Beruflich Dokumente
Kultur Dokumente
FOLI-AWLI
(mawusee.foli@azri.biz)
S am M . K . F OL I -A W L I
Plan
I- Drupal 7 Architecture
IV- References
2/23 S am M . K . F OL I -A W L I
Drupal 5.7 vs Drupal 7.0Beta / Architecture
The main architecture (contents are nodes, use of hooks) is still the same (1).
(1) Consult Pro Drupal Developement, John K. VanDyk and Matt Westgate 2007 for the technology stack,
3/23 S am M . K . F OL I -A W L I
Drupal 5.7 vs Drupal 7.0Beta / Architecture
[Some changes]
. More Core optional modules like actions, triggers
. Required modules are no more displayed (node, block),
. Sqlite is supported
. Drag and drop more used (block, menus,etc.) (UI changes)
4/23 S am M . K . F OL I -A W L I
Drupal 5.7 vs Drupal 7.0Beta / Architecture
. Performance improvements: the registry now keeps a record of all modules that
implement a given hook, and caches registry lookup
5/23 S am M . K . F OL I -A W L I
Drupal 5.7 vs Drupal 7.0Beta / Work with Drupal 7
[Themes]
,stylesheets,scripts,php)
. drupal_add_css and drupal_add_js overrides modules or core css and js files when the new
7/23 S am M . K . F OL I -A W L I
Drupal 5.7 vs Drupal 7.0Beta / Work with Drupal 7
[Modules]
.info file (name, description, dependencies[ ], files, version, package)
.hook _perm
.hook_install/hook_uninstall (drupal_install_schema/drupal_uninstall_schema)
.hook_help
.hook_menu (new Menu type MENU_ACCESS_DENIED,MENU_FOUND)
8/23 S am M . K . F OL I -A W L I
Drupal 5.7 vs Drupal 7.0Beta / Work with Drupal 7
[Javascript / CSS]
9/23 S am M . K . F OL I -A W L I
Drupal 5.7 vs Drupal 7.0Beta / Work with Drupal 7
[Coding standard]
# Avoid creating code that already exists : use the API documentation
[Some doubts...]
1. Override in Drupal ...
- module weights
- hooks
- callbacks
4. Code registry ?
- 2 tables registry (function, type, suffix,weight,module,filename) and registry_files )
- cache_registry
11/23 S am M . K . F OL I -A W L I
Drupal 5.7 vs Drupal 7.0Beta / Work with Drupal 7
[Some doubts – Ajax sample code]
// Implementation of hook_menu().
function myModule_menu() {
);
return $items;
}
function mymodule_get_photos_ajax($nid) {
$photo = mymodule_get_photo($nid);
12/23 S am M . K . F OL I -A W L I
Drupal 5.7 vs Drupal 7.0Beta / Work with Drupal 7
Drupal.behaviors.myModule = function() {
$('a.photo_button:not(.mymodule-processed)', context).addClass('mymodule-processed')
.bind('click', function(){
});
$('div.field-type-image div.field-item').html(result['image']);
13/23 S am M . K . F OL I -A W L I
Drupal 5.7 vs Drupal 7.0Beta / Upgrade
- Evaluate the upgrade cost (are contributed modules used compatible with new version,
14/23 S am M . K . F OL I -A W L I
Drupal 5.7 vs Drupal 7.0Beta / Upgrade
15/23 S am M . K . F OL I -A W L I
Drupal 5.7 vs Drupal 7.0Beta / Upgrade
Step 1
- Install drupal7
- Modifying the Css file (the files default folder is now in sites/default/files) to display background images and
styles
16/23 S am M . K . F OL I -A W L I
Drupal 5.7 vs Drupal 7.0Beta / Upgrade
Step 2
- Putting back it's blocks (proceed link by link) Full Html filter for the block content)
17/23 S am M . K . F OL I -A W L I
Drupal 5.7 vs Drupal 7.0Beta / Upgrade
Step 3
18/23 S am M . K . F OL I -A W L I
Drupal 5.7 vs Drupal 7.0Beta / Upgrade
function whitejazz_block($block) {
$template_path = drupal_get_path('theme', 'whitejazz')."/";
if (module_exists('blocktheme')) {
$custom_theme = blocktheme_get_theme($block);
$custom_theme = (is_array($custom_theme) && (count($custom_theme) >0)) ?
$custom_theme[0] : $custom_theme;
}
//If no custom_theme is found the default "block.tpl.php" file will be used
$custom_theme = ($custom_theme) ? $custom_theme : "block";
return theme_render_template($template_path.$custom_theme.".tpl.php",array('block' =>
$block));
}
19/23 S am M . K . F OL I -A W L I
Drupal 5.7 vs Drupal 7.0Beta / Upgrade
20/23 S am M . K . F OL I -A W L I
Drupal 5.7 vs Drupal 7.0Beta / Questions
[References]
Pro Drupal Developement, John K. VanDyk and Matt Westgate 2007 for the technology stack,
21/23 S am M . K . F OL I -A W L I
Drupal 5.7 vs Drupal 7.0Beta / Questions
Questions ?
Questions ?
Questions ?
Questions ?
Questions ?
T hank s :-)
22/23 S am M . K . F OL I -A W L I
Drupal 5.7 vs Drupal 7.0Beta
[Credits]
23/23 S am M . K . F OL I -A W L I