Only in node_style_old: node_style.inc Only in node_style: node_style.inc.old diff -urp node_style_old/node_style.info node_style/node_style.info --- node_style_old/node_style.info 2009-04-15 18:06:18.000000000 -0500 +++ node_style/node_style.info 2009-04-15 18:08:29.000000000 -0500 @@ -1,8 +1,10 @@ ; $Id: node_style.info,v 1.1 2007/01/16 01:17:29 karthik Exp $ name = Node style description = Allows for node specific customisations. -version = "$Name: DRUPAL-5--2-1 $" + ; Information added by drupal.org packaging script on 2007-04-07 -version = "5.x-2.1" +version = "6.x-1.x-dev" project = "node_style" + +core = 6.x diff -urp node_style_old/node_style.install node_style/node_style.install --- node_style_old/node_style.install 2009-04-15 18:06:18.000000000 -0500 +++ node_style/node_style.install 2009-04-15 18:08:52.000000000 -0500 @@ -2,102 +2,76 @@ // $Id: node_style.install,v 1.8.2.1 2007/04/07 08:45:52 karthik Exp $ /** - * Implementation of hook_install(). + * @file + * Install for the node_style module */ -function node_style_install() { - $ret = array(); - - switch ($GLOBALS['db_type']) { - case 'mysqli': - case 'mysql': - db_query("CREATE TABLE {node_style_schemes} ( - sid int(11) unsigned NOT NULL auto_increment, - name varchar(64) NOT NULL default '', - variables text NOT NULL, - PRIMARY KEY (sid)) - COMMENT='Node style module: style scheme settings' - /*!40100 default CHARACTER SET utf8 */" - ); - db_query("CREATE TABLE {node_style_maps} ( - nid int(11) unsigned NOT NULL default 0, - sid int(11) unsigned NOT NULL default 0, - PRIMARY KEY (nid)) - COMMENT='Node style module: nid to scheme map' - /*!40100 default CHARACTER SET utf8 */" - ); - break; - case 'pgsql': - db_query("CREATE TABLE {node_style_schemes} ( - sid serial, - name varchar(64) NOT NULL default '', - variables text NOT NULL, - PRIMARY KEY (sid))" - ); - db_query("CREATE TABLE {node_style_maps} ( - nid integer NOT NULL default 0, - sid integer NOT NULL default 0, - PRIMARY KEY (nid))" - ); - } + +/** + * Implementation of hook_schema(). + */ +function node_style_schema() { + $schema['node_style_schemes'] = array( + 'description' => t('Node style module: style scheme settings'), + 'fields' => array( + 'sid' => array( + 'description' => t('TODO'), + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + 'name' => array( + 'description' => t('TODO'), + 'type' => 'varchar', + 'length' => 64, + 'not null' => TRUE, + 'default' => '', + ), + 'variables' => array( + 'description' => t('TODO'), + 'type' => 'text', + 'not null' => TRUE, + ), + ), + 'primary key' => array('sid'), + ); + + $schema['node_style_maps'] = array( + 'description' => t('Node style module: nid to scheme map'), + 'fields' => array( + 'nid' => array( + 'description' => t('TODO'), + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + 'sid' => array( + 'description' => t('TODO'), + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + ), + ), + 'primary key' => array('nid'), + ); - return $ret; + return $schema; } -function node_style_update_2() { - $ret = array(); - - switch ($GLOBALS['db_type']) { - case 'mysqli': - case 'mysql': - $ret[] = update_sql("CREATE TABLE {node_style_schemes} ( - sid int(11) unsigned NOT NULL auto_increment, - name varchar(64) NOT NULL default '', - variables text NOT NULL, - PRIMARY KEY (sid)) - COMMENT='Node style module: style scheme settings' - /*!40100 default CHARACTER SET utf8 */" - ); - $ret[] = update_sql("CREATE TABLE {node_style_maps} ( - nid int(11) unsigned NOT NULL default 0, - sid int(11) unsigned NOT NULL default 0, - PRIMARY KEY (nid)) - COMMENT='Node style module: nid to scheme map' - /*!40100 default CHARACTER SET utf8 */" - ); - break; - case 'pgsql': - $ret[] = update_sql("CREATE TABLE {node_style_schemes} ( - sid serial, - name varchar(64) NOT NULL default '', - variables text NOT NULL, - PRIMARY KEY (sid))" - ); - $ret[] = update_sql("CREATE TABLE {node_style_maps} ( - nid integer NOT NULL default 0, - sid integer NOT NULL default 0, - PRIMARY KEY (nid))" - ); - break; - } - - $result = db_query("SELECT * FROM {node_style}"); - $sid = 1; - while ($style = db_fetch_array($result)) { - $name = 'Scheme '. $sid; - $ret[] = update_sql("INSERT INTO {node_style_schemes} (sid, name, variables) VALUES ($sid, '$name', '". $style['variables'] ."')"); - $ret[] = update_sql("INSERT INTO {node_style_maps} (nid, sid) VALUES (". $style['nid'] .", $sid)"); - $sid++; - } - - $ret[] = update_sql("DROP TABLE {node_style}"); - - return $ret; +/** + * Implementation of hook_install(). + */ +function node_style_install() { + drupal_install_schema('node_style'); } /** * Implementation of hook_uninstall(). */ function node_style_uninstall() { - db_query('DROP TABLE {node_style_maps}, {node_style_schemes}'); + // Remove tables. + drupal_uninstall_schema('node_style'); + variable_del('node_style_mode'); } diff -urp node_style_old/node_style.module node_style/node_style.module --- node_style_old/node_style.module 2009-04-15 18:06:18.000000000 -0500 +++ node_style/node_style.module 2009-04-15 18:09:07.000000000 -0500 @@ -12,11 +12,18 @@ * Make module usable with more than just nodes. */ +/* TODO Implement the hook_theme registry. Combine all theme registry entries + into one hook_theme function in each corresponding module file. +function node_style_theme() { + return array( + ); +} */ + /** * Implementation of hook_help(). */ -function node_style_help($section) { - switch ($section) { +function node_style_help($path, $arg) { + switch ($path) { case 'admin/help#node_style': return t('This module allows for node specific style customisations. Its primary uses include: