Outline Working together Working with Nodes Working with Blocks Working with Taxonomy The Form API jQuery Summary
Working together q=user/131 $op = view
Working together q=user/131/ edit $op = view
Working together function user_view($uid = 0) { … foreach (module_list() as $module) { if ($data = module_invoke($module, 'user', 'view', '', $account)) { foreach ($data as $category => $items){ foreach ($items as $key => $item){ $item['class'] = "$module-". $item['class']; $fields[$category][$key] = $item; } … }
Working together Function XXXXX_user($op, &$edit, &$user, $category=NULL) { …. }
Working together function profile_user($op, &$edit, &$user, $category = NULL) { switch ($op) { … case 'view': return profile_view_profile($user); … }
Working together $op After_update Delete Form Insert Login Logout Load Register Submit Update Validate View
Working together function tracker_menu($may_cache) { …… else { if (arg(0) == 'user' && is_numeric(arg(1))) { $items[] = array('path' => 'user/'. arg(1).'/track', …); } …… }
Outline Working together Working with Nodes Working with Blocks Working with Taxonomy The Form API jQuery Summary
Working with Nodes
Not Everything is a Node Users Blocks Comments
Working with Nodes MyNode MyNode_install (.install) MyNode_node_info (.module) MyNode_menu(url mapping) MyNode_perm (permission) MyNode_access (access control) MyNode_form (input form) MyNode_validate MyNode_insert (insert to DB) MyNode_update (update to DB) MyNode_delete (delete from DB) MyNode_load MyNode_view
Working with Nodes Node Object NodeChange logMyNodeCommentsTaxonomy
Outline Working together Working with Nodes Working with Blocks Working with Taxonomy The Form API jQuery Summary
Working with Blocks 左欄左欄 頁首 內容 頁尾
Working with Blocks
Outline Working together Working with Nodes Working with Blocks Working with Taxonomy The Form API jQuery Summary
Working with Taxonomy Taxonomy is classification of things Terms ~ tags. Assigning terms ~ tagging Synonyms
Working with Taxonomy
Outline Working together Working with Nodes Working with Blocks Working with Taxonomy The Form API jQuery Summary
The Form API Fieldset Textfield
The Form API $form[‘name’] = array( ‘#title’ => t(‘Your Name’), ‘#type’ => ‘fieldset’, ‘#description’ => t(‘Please enter your name.’) ); Fieldset
The Form API $form[‘name’][‘user_name’] = array( ‘#title’ => t(‘Your Name’), ‘#type’ => ‘textfield’, ‘#description’ => t(‘Please enter your name.’) ); Textfield
Outline Working together Working with Nodes Working with Blocks Working with Taxonomy The Form API jQuery Summary
jQuery Write PHP in place of JavaScript
jQuery JavaScript window.onload = function{ /*your code*/ } PHP with jQuery $(document).ready( function{ /*your code*/ } ); Drupal with jQuery drupal_add_js(‘$(document).ready( function{ /*your code*/ } );’, ‘inline’);
jQuery jQuery (Drupal 5.0+) jQuery Xajax (PHP library) Xajax Prototype (JavaScript) Prototype Yahoo UI (YUI) (JavaScript) Yahoo UI (YUI)
Outline Working together Working with Nodes Working with Blocks Working with Taxonomy The Form API jQuery Summary
Simple framework Develop fast Work together Work flow? Dependence sequence?