• Save
Drupalcamp Nantes - Adapter Drupal
Upcoming SlideShare
Loading in...5
×
 

Drupalcamp Nantes - Adapter Drupal

on

  • 946 views

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

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

Statistics

Views

Total Views
946
Views on SlideShare
850
Embed Views
96

Actions

Likes
0
Downloads
11
Comments
0

2 Embeds 96

http://drupalcamp.fr 78
http://nantes2011.drupalcamp.fr 18

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Drupalcamp Nantes - Adapter Drupal Presentation Transcript

  • 1. Adapter Drupal Florian Lorétan
  • 2. Adapter Drupal
  • 3. Adapter Drupal• Pourquoi?
  • 4. Adapter Drupal• Pourquoi?• La méthode
  • 5. Adapter Drupal• Pourquoi?• La méthode• Exemples
  • 6. Adapter Drupal• Pourquoi?• La méthode• Exemples• Conseils
  • 7. Adapter Drupal Pourquoi?
  • 8. Glue Code
  • 9. mymodule.infoname = "My Module"description = "Example custom module"core = 7.xmymodule.module<?php
  • 10. La méthode
  • 11. La méthode• Quoi et pourquoi?
  • 12. La méthode• Quoi et pourquoi?• Quel composant?
  • 13. La méthode• Quoi et pourquoi?• Quel composant?• Quelles données
  • 14. La méthode• Quoi et pourquoi?• Quel composant?• Quelles données• Comment?
  • 15. Un exemple
  • 16. form
  • 17. api.drupal.org
  • 18. hook_form_alter(&$form, &$form_state, $form_id)
  • 19. function mymodule_form_alter(&$form, &$form_state, $form_id) { dpm(‘youpiiiii!’);}
  • 20. Module “Devel” : http://drupal.org/project/develfunction mymodule_form_alter(&$form, &$form_state, $form_id) { dpm(‘youpiiiii!’);}
  • 21. function mymodule_form_alter(&$form, &$form_state, $form_id) { dpm($form_id);}
  • 22. function mymodule_form_alter(&$form, &$form_state, $form_id) { if ($form_id == article_node_form) { dpm($form); }}
  • 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. quelques exemples
  • 25. function mymodule_menu_alter(&$items) { $items[user/register][type] = MENU_CALLBACK; $items[user/password][type] = MENU_CALLBACK;}
  • 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. Attention!• Sécurité• Commentaires• Dépendances• Références• Contribuez!