Drupalcamp Nantes - Adapter Drupal

1,044 views

Published on

Présentation de Florian Lorétan (http://twitter.com/#!/floretan)

Published in: Technology, Art & Photos
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,044
On SlideShare
0
From Embeds
0
Number of Embeds
100
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Drupalcamp Nantes - Adapter Drupal

  1. 1. Adapter Drupal Florian Lorétan
  2. 2. Adapter Drupal
  3. 3. Adapter Drupal• Pourquoi?
  4. 4. Adapter Drupal• Pourquoi?• La méthode
  5. 5. Adapter Drupal• Pourquoi?• La méthode• Exemples
  6. 6. Adapter Drupal• Pourquoi?• La méthode• Exemples• Conseils
  7. 7. Adapter Drupal Pourquoi?
  8. 8. Glue Code
  9. 9. mymodule.infoname = "My Module"description = "Example custom module"core = 7.xmymodule.module<?php
  10. 10. La méthode
  11. 11. La méthode• Quoi et pourquoi?
  12. 12. La méthode• Quoi et pourquoi?• Quel composant?
  13. 13. La méthode• Quoi et pourquoi?• Quel composant?• Quelles données
  14. 14. La méthode• Quoi et pourquoi?• Quel composant?• Quelles données• Comment?
  15. 15. Un exemple
  16. 16. form
  17. 17. api.drupal.org
  18. 18. hook_form_alter(&$form, &$form_state, $form_id)
  19. 19. function mymodule_form_alter(&$form, &$form_state, $form_id) { dpm(‘youpiiiii!’);}
  20. 20. Module “Devel” : http://drupal.org/project/develfunction mymodule_form_alter(&$form, &$form_state, $form_id) { dpm(‘youpiiiii!’);}
  21. 21. function mymodule_form_alter(&$form, &$form_state, $form_id) { dpm($form_id);}
  22. 22. function mymodule_form_alter(&$form, &$form_state, $form_id) { if ($form_id == article_node_form) { dpm($form); }}
  23. 23. function mymodule_form_alter(&$form, &$form_state, $form_id) { if ($form_id == article_node_form) { $form[actions][submit][#value] = t(Publish this article); }}
  24. 24. quelques exemples
  25. 25. function mymodule_menu_alter(&$items) { $items[user/register][type] = MENU_CALLBACK; $items[user/password][type] = MENU_CALLBACK;}
  26. 26. function mymodule_views_post_execute($view) { if ($view->name == some_view) { drupal_set_message(t(There are @count results matching your criteria., array(@count => $view->total_rows))); }}
  27. 27. Attention!• Sécurité• Commentaires• Dépendances• Références• Contribuez!

×