2007 Fsoss Drupal Under The Hood

100 %
0 %
Information about 2007 Fsoss Drupal Under The Hood

Published on November 4, 2007

Author: walkah

Source: slideshare.net

Description

Brief look at Drupal's internal features - given at http://fsoss.senecac.on.ca/2007/

Drupal: Under the Hood

What is Drupal? 1. Content Management System 2. Content Management Framework 3. Community

Content Management System

file uploads revisions menus security user profiles blocks performance modules search engine-friendly urls user manage- ment administration panels localization error reporting rss taxonomy blogging comments forums multi-site installations event logging community authoring ajax search free tagging feed aggregation contact form help system roles and per- missions statistics tracking polls

1200+ Contributed Modules

Community

Doubles in size each release source: http://acko.net/blog/drupal-org-explosion-and-trends source: http://buytaert.net/drupal-site-statistics

Statistics • 840+ code contributors • 160+ local user groups • 430+ attendees at Drupalcon Barcelona • 200,000+ users on drupal.org • 3 million+ lines of code (core+contrib) • 52 SoC mentors for 20 students • 100,000+ downloads/month

Content Management Framework

xml-rpc file api jquery database abstraction layer form api file api session management node system url routing theme system string handling filter system content versioning installation profiles access control trans- latable output user system caching date/time handling unicode support mail handling image manipulation installation system hook system menu system module system user authentication themable output

What’s under the hood?

Core • Lightweight framework Drupal Core • Library of common Content User Forms API Management Management functions Install Theming • Localization Allows Drupal to Profiles Layer bootstrap and serve a request Library of Common Functions • What you get when you download Drupal

Modules Drupal Core Content User Forms API • Management Management How Drupal is extended Install Theming Localization • Profiles Layer Lean and mean and versatile • Library of Common Functions Inversion of control design pattern Modules • Actions/ Content Drupal exposes hooks Ecommerce Workflows Creation Kit for modules Organic Views Groups Custom Module

INSTALL.txt index.php themes install.php update.php modules sites xmlrpc.php includes

drupal_bootstrap() • DRUPAL_BOOTSTRAP_CONFIGURATION • DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE • DRUPAL_BOOTSTRAP_DATABASE • DRUPAL_BOOTSTRAP_ACCESS • DRUPAL_BOOTSTRAP_SESSION • DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE • DRUPAL_BOOTSTRAP_PATH • DRUPAL_BOOTSTRAP_FULL

menu system

Yes Is site Return offline? MENU_SITE_OFFLINE No Get menu array Is callback No Parse $path from Trim last '/' from defined for $_GET['q'] $path $path? No Does callback Return function exist? MENU_NOT_FOUND User allowed No Return to access this MENU_ACCESS_DENIED item? Marshall parameters from URL and item's Call callback callback arguments

Hooks

Hooks are PHP functions with Drupal-specific names

How Drupal Finds Hooks /** * Determine whether a module implements a hook. * * @param $module * The name of the module (without the .module extension). * @param $hook * The name of the hook (e.g. quot;helpquot; or quot;menuquot;). */ function module_hook($module, $hook) { return function_exists($module .'_'. $hook); }

Naming Hooks Module Hook Function name pants user pants_user() pants menu pants_menu() pants perm pants_perm()

Hook Overview hook_user() comment_user() locale_user() node_user() mymodule_user() comment.module locale.module node.module mymodule.module

FormAPI

FormAPI • Form elements are PHP arrays so you can programmatically manipulate any form • Chain validator and submitter routines • Theme overrides - down to the element! • Built-in security

Form Example $form['user_name'] = array( '#title' => t('Your Name'), '#type' => 'textfield', '#description' => t('Please enter your name.'), ); $form['submit'] = array( '#type' => 'submit', '#value' => t('Submit') );

Security • Verifies that $_POST values have corresponding $form elements • Form rendering sanitized for potential XSS • $form[‘token’] used to prevent CSRF

hook_form_alter

drupal_execute()

Theme System

Theme System

PHPTemplate Files • page.tpl.php • node.tpl.php • block.tpl.php • comment.tpl.php • box.tpl.php

theme('breadcrumb') theme-name_breadcrumb() theme-engine_breadcrumb() theme_breadcrumb() The first function found gets called.

theme('page') garland_page() phptemplate_page() theme_page() The first function found gets called.

Creating New Template Files template.php function mytheme_breadcrumb($breadcrumb) { if (!empty($breadcrumb)) { return '<span class=quot;breadcrumbquot;>'. implode(' * ', $breadcrumb) .'</span>'; } } new template.php function mytheme_breadcrumb($breadcrumb) { if (!empty($breadcrumb)) { $variables = array('breadcrumb' => implode(' * ', $breadcrumb)); return _phptemplate_callback('breadcrumb', $variables); } } breadcrumb.tpl.php <span class=quot;breadcrumbquot;><?php print $breadcrumb ?></span>

ultimate control

http://greenpeace.co.uk/

http://theonion.com/

http://musicbox.sonybmg.com/

http://43folders.com/

http://lifetimetv.com/

http://flex.org/showcase

http://help.yahoo.com/

http://ubuntu.com/

Thanks... Questions? James Walker http://walkah.net/ Lullabot james@lullabot.com

Add a comment

Comments

Richard Panik Jersey | 14/10/16
Along with magento business it is possible to confidently proceed with the knowledge that whichever payment computer programs you could have, magento rather experience it expecting people. You may process many merchants from the extraordinario administration control panel and device collection. [url=http://www.chiblackhawks-jerseys.com/66-richard-panik-jersey]Richard Panik Jersey[/url]

Related presentations

Related pages

Chapter 3 ~ Under The Hood | Drupal.org

... The quiz node relationship. A Quiz is a Drupal node, ... Chapter 3 ~ Under The Hood. ... 2009. Created on December 10, 2007. Edited by VM, ...
Read more

Free Software and Open Source Symposium 2007 | walkah

Free Software and Open Source Symposium 2007 ... do with Drupal in a few hours. Drupal under the hood is my ... overview of Drupal's internal ...
Read more

FSOSS 2007 Agenda

9:00am - 4:00pm Oct. 25-26, 2007, Toronto . 8:15-9:00am: ... FSOSS: gathering - Cafeteria ... Drupal under the hood James Walker
Read more

Under the Hood of a Salesforce.com Business Application ...

Speak Security: Under the Hood of the OpenDNS Security Research Labs with Dhia and Dima 2007 Fsoss Drupal Under The Hood Looking Under the Hood ...
Read more

Mobile blogging | Drupal.org

The result is getting wonderful and the site is so heavily customized that no one would recognize that it's Drupal under the hood. ... 2007 at 9:35pm.
Read more

Eli Neiburger: Implementing Drupal in the case of aadl.org ...

Eli Neiburger: Implementing Drupal in the case of ... This will be a rare chance to look under the hood of a regionally high profile ... 2007 at 1:55pm.
Read more

2007 328I - HOOD | Used BMW Parts Online | Bishop's Auto

2007 BMW 328i HOOD . SKU: 457114 . Year: 2007; Make: BMW ... Shipping is not refundable under any circumstances. ... Website powered by ISG Drupal Commerce ...
Read more