Drupal 7 module development

34
Adam Kalsey [email protected] @akalsey www.Tropo.com @tropo

description

 

Transcript of Drupal 7 module development

Page 1: Drupal 7 module development

Adam [email protected]@akalsey

www.Tropo.com@tropo

Page 2: Drupal 7 module development

Who Am I?

Page 3: Drupal 7 module development

Activity Stream

Page 4: Drupal 7 module development

Phone Poll

Vote in polls with SMS or voice

http://www.flickr.com/photos/sanberdoo/510894918/

http://www.flickr.com/photos/comedynose/4584215861/

Page 5: Drupal 7 module development

Luxe

Login User eXperience Enahcements

Page 6: Drupal 7 module development

Passkey

Login integration with external systems

Page 7: Drupal 7 module development
Page 8: Drupal 7 module development

The Basics

http://www.flickr.com/photos/lrosa/2182577107

Page 9: Drupal 7 module development

tropo.info

name  =  Tropodescription  =  Voice  and  SMS  Awesomenesscore  =  7.x

dependencies[]  =  views  (>2.1)

Mostly the same

Page 10: Drupal 7 module development

/** * Remove block_callback field from {menu_router}. */function system_update_7064() { db_drop_field('menu_router', 'block_callback');}

Documentation that appears in update.php

Update comments

Page 11: Drupal 7 module development

Everything’s an Object

Page 12: Drupal 7 module development

Everything’s an Object

Nodes

Page 13: Drupal 7 module development

Everything’s an Object

Nodes

Users

Page 14: Drupal 7 module development

Everything’s an Object

Nodes

Users

Comments

Page 15: Drupal 7 module development

Everything’s an Object

Nodes

Users

Comments

Files

Page 16: Drupal 7 module development

Everything’s an Object

Nodes

Users

Comments

Files

Taxonomy Terms

Page 17: Drupal 7 module development

Everything has a hook

http://www.flickr.com/photos/versageek

Page 18: Drupal 7 module development

hook_nodeapi($op)

Page 19: Drupal 7 module development

hook_node_load

Page 20: Drupal 7 module development

hook_node_load

hook_user_load

hook_file_load

hook_comment_load

hook_taxonomy_term_load

hook_blah_load

Page 21: Drupal 7 module development

hook_user($op)

Page 22: Drupal 7 module development

hook_user($op)

hook_user_presavehook_user_inserthook_user_loadhook_user_operation

No moreUniversal Business Adaptors

Page 23: Drupal 7 module development

Fields

http://www.flickr.com/photos/mikecattell

Page 24: Drupal 7 module development

<?php  $node->body = array(    'und' => array(      array(        'value'  => 'body here',        'summary' => 'teaser here',        'format' => '1',        'safe_value' => 'sanitized body',        'safe_summary' => 'sanitized teaser',      )    ),  );?>

Page 25: Drupal 7 module development
Page 26: Drupal 7 module development

<?php// Drupal 6db_query("INSERT INTO {mytable} (intvar, stringvar, floatvar) VALUES (%d, '%s', %f)", 5, 'hello world', 3.14);$id = db_last_insert_id();

// Drupal 7$id = db_insert('mytable')  ->fields(array(    'intvar' => 5,    'stringvar' => 'hello world',    'floatvar' => 3.14,  ))  ->execute();?>

Page 27: Drupal 7 module development

Form API

http://www.flickr.com/photos/teegardin

Page 28: Drupal 7 module development

<?php  //Drupal 6  $form[$theme->name]['screenshot'] = array('#value' => $screenshot);

  //Drupal 7  $form[$theme->name]['screenshot'] = array('#markup' => $screenshot);?>

Page 29: Drupal 7 module development

my_function($argument, array $options);

Function signatures

Page 30: Drupal 7 module development

Lots of little function name changes

Set static variables with drupal_static()

Email assumes everything’s html

Block deltas can be arbitrary strings

New API for search tab creation

Page 31: Drupal 7 module development

Lots of little function name changes

Set static variables with drupal_static()

Email assumes everything’s html

Block deltas can be arbitrary strings

New API for search tab creation

http://drupal.org/node/224333

Page 32: Drupal 7 module development

Text

Coder Upgrade module

Automate the grunt work

Page 33: Drupal 7 module development
Page 34: Drupal 7 module development

Adam [email protected]@akalsey

www.Tropo.com@tropo