'signwriter table', 'fields' => array( 'id' => array( 'description' => 'the primary identifier of the schema', 'type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, ), 'name' => array( 'description' => 'the name of the schema', 'type' => 'varchar', 'length' => 128, ), 'pattern' => array( 'description' => 'the signwriter pattern', 'type' => 'varchar', 'length' => 128, ), 'allowed_nonasciichars' => array( 'description' => 'allowed unicode characters for text', 'type' => 'varchar', 'length' => 255, ), 'imagetype' => array( 'description' => 'the type of the image', 'type' => 'varchar', 'length' => 8, 'not null' => TRUE, 'default' => 'gif', ), 'width' => array( 'description' => 'width of the image', 'type' => 'int', ), 'height' => array( 'description' => 'height of the image', 'type' => 'int', ), 'maxwidth' => array( 'description' => 'maximum width of the image', 'type' => 'int', ), 'textalign' => array( 'description' => 'alignment of text within the image', 'type' => 'varchar', 'length' => 32, ), 'multiline' => array( 'description' => 'is multiline functionality enabled', 'type' => 'int', 'not null' => TRUE, 'default' => 1, ), 'disable_span' => array( 'description' => 'Whether or not to disable the hidden span.', 'type' => 'int', 'unsigned' => TRUE, 'default' => 0, ), 'threestate' => array( 'description' => 'add hover and active images', 'type' => 'int', 'not null' => TRUE, 'default' => 0, ), 'transparent' => array( 'description' => 'transparent image', 'type' => 'int', 'not null' => TRUE, 'default' => 1, ), 'use_title_text' => array( 'description' => 'Whether or not to display title text for images.', 'type' => 'int', 'unsigned' => TRUE, 'default' => 0, ), ), 'indexes' => array( 'name' => array('name'), ), 'primary key' => array('id'), ); signwriter_imgstate_schema($schema); signwriter_imgstate_schema($schema, "hov_"); signwriter_imgstate_schema($schema, "act_"); $schema['signwriter_menu'] = array( 'description' => 'signwriter menu profile table', 'fields' => array( 'id' => array( 'description' => 'the primary identifier of the profile', 'type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, ), 'name' => array( 'description' => 'the name of the profile', 'type' => 'varchar', 'length' => 128, ), 'data' => array( 'description' => 'The value of the variable.', 'type' => 'text', 'not null' => TRUE, 'size' => 'big', ), ), 'indexes' => array( 'name' => array('name'), ), 'primary key' => array('id'), ); return $schema; } /** * Provides additional signwriter fields for different menu states */ function signwriter_imgstate_schema(&$schema, $state = "") { $schema['signwriter']['fields'] += array( "${state}fontfile" => array( 'description' => 'the name of the font, without ttf', 'type' => 'varchar', 'length' => 128, ), "${state}fontsize" => array( 'description' => 'the size of the font', 'type' => 'int', 'unsigned' => TRUE, 'default' => 20, ), "${state}background" => array( 'description' => 'background color', 'type' => 'varchar', 'length' => 6, 'default' => 'ffffff', ), "${state}foreground" => array( 'description' => 'foreground color', 'type' => 'varchar', 'length' => 6, 'default' => '000000', ), "${state}bgimage" => array( 'description' => 'background image', 'type' => 'varchar', 'length' => 128, ), "${state}xoffset" => array( 'description' => 'x offset of the text within the image', 'type' => 'int', ), "${state}yoffset" => array( 'description' => 'y offset of the text within the image', 'type' => 'int', ), "${state}drop_shadow" => array( 'description' => 'are drop shadows on or off', 'type' => 'int', 'not null' => TRUE, 'default' => 0, ), "${state}shadow_color" => array( 'description' => 'are drop shadows on or off', 'type' => 'varchar', 'length' => 6, 'default' => 'd2d2d2', ), "${state}shadow_xoffset" => array( 'description' => 'x offset of shadow from actual text', 'type' => 'int', 'default' => 5, ), "${state}shadow_yoffset" => array( 'description' => 'y offset of shadow from actual text', 'type' => 'int', ), "${state}border" => array( 'description' => 'are borders on or off', 'type' => 'int', 'not null' => TRUE, 'default' => 0, ), "${state}border_color" => array( 'description' => 'border color', 'type' => 'varchar', 'length' => 6, 'default' => 'e2e2e2', ), "${state}border_radius" => array( 'description' => 'radius of border', 'type' => 'int', 'default' => 1, ), ); } /** * Provides update for additional signwriter fields for different menu states */ function _signwriter_update_imgstate(&$ret, $state) { db_add_field('signwriter', "${state}fontfile", array('description' => 'the name of the font, without ttf', 'type' => 'varchar', 'length' => 128)); db_add_field('signwriter', "${state}fontsize", array('description' => 'the size of the font', 'type' => 'int', 'unsigned' => TRUE, 'default' => 20)); db_add_field('signwriter', "${state}background", array('description' => 'background color', 'type' => 'varchar', 'length' => 6, 'default' => 'ffffff')); db_add_field('signwriter', "${state}foreground", array('description' => 'foreground color', 'type' => 'varchar', 'length' => 6, 'default' => '000000')); db_add_field('signwriter', "${state}bgimage", array('description' => 'background image', 'type' => 'varchar', 'length' => 128)); db_add_field('signwriter', "${state}xoffset", array('description' => 'x offset of the text within the image', 'type' => 'int')); db_add_field('signwriter', "${state}yoffset", array('description' => 'y offset of the text within the image', 'type' => 'int')); db_add_field('signwriter', "${state}drop_shadow", array('description' => 'are drop shadows on or off', 'type' => 'int', 'not null' => TRUE, 'default' => 0)); db_add_field('signwriter', "${state}shadow_color", array('description' => 'are drop shadows on or off', 'type' => 'varchar', 'length' => 6, 'default' => 'd2d2d2')); db_add_field('signwriter', "${state}shadow_xoffset", array('description' => 'x offset of shadow from actual text', 'type' => 'int', 'default' => 5)); db_add_field('signwriter', "${state}shadow_yoffset", array('description' => 'y offset of shadow from actual text', 'type' => 'int')); db_add_field('signwriter', "${state}border", array('description' => 'are borders on or off', 'type' => 'int', 'not null' => TRUE, 'default' => 0)); db_add_field('signwriter', "${state}border_color", array('description' => 'border color', 'type' => 'varchar', 'length' => 6, 'default' => 'e2e2e2')); db_add_field('signwriter', "${state}border_radius", array('description' => 'radius of border', 'type' => 'int', 'default' => 1)); } /** * @todo Please document this function. * @see http://drupal.org/node/1354 */ function signwriter_update_6000() { $ret = array(); variable_del('cachedir'); variable_del('fontpath'); // TODO update_sql has been removed. Use the database API for any schema or data changes. $ret[] = array() /* update_sql("ALTER TABLE {signwriter} CHANGE fontsize fontsize int unsigned default '20'") */; // TODO update_sql has been removed. Use the database API for any schema or data changes. $ret[] = array() /* update_sql("ALTER TABLE {signwriter} CHANGE background background varchar(6) default 'ffffff'") */; // TODO update_sql has been removed. Use the database API for any schema or data changes. $ret[] = array() /* update_sql("ALTER TABLE {signwriter} CHANGE foreground foreground varchar(6) default '000000'") */; // TODO update_sql has been removed. Use the database API for any schema or data changes. $ret[] = array() /* update_sql("ALTER TABLE {signwriter} CHANGE shadow_color shadow_color varchar(6) default 'd2d2d2'") */; // TODO update_sql has been removed. Use the database API for any schema or data changes. $ret[] = array() /* update_sql("ALTER TABLE {signwriter} ADD allowed_nonasciichars varchar(255) AFTER fontsize") */; cache_clear_all(); menu_rebuild(); drupal_set_message(t('The signwriter module now has an option to clean up the generated image files regularily (off by default). Files generated by previous versions have to be removed manually from the old signwriter cache directory, the new one is located within the files directory.')); // hook_update_N() no longer returns a $ret array. Instead, return // nothing or a translated string indicating the update ran successfully. // See http://drupal.org/node/224333#update_sql. return t('TODO Add a descriptive string here to show in the UI.') /* $ret */; } /** * @todo Please document this function. * @see http://drupal.org/node/1354 */ function signwriter_update_6200() { $ret = array(); // Need to check this column as it exists in new D5 versions but not old ones if (!db_field_exists('signwriter', 'disable_span')) { db_add_field('signwriter', 'disable_span', array('description' => 'Whether or not to disable the hidden span.', 'type' => 'int', 'unsigned' => TRUE, 'default' => 0)); } db_add_field('signwriter', 'threestate', array('description' => 'add hover and active images', 'type' => 'int', 'not null' => TRUE, 'default' => 0)); db_add_field('signwriter', 'use_title_text', array('description' => 'Whether or not to display title text for images.', 'type' => 'int', 'unsigned' => TRUE, 'default' => 0)); db_add_field('signwriter', 'border_radius', array('description' => 'radius of border', 'type' => 'int', 'default' => 1)); db_add_field('signwriter', 'border_color', array('description' => 'border color', 'type' => 'varchar', 'length' => 6, 'default' => 'e2e2e2')); db_add_field('signwriter', 'border', array('description' => 'are borders on or off', 'type' => 'int', 'not null' => TRUE, 'default' => 0)); _signwriter_update_imgstate($ret, "hov_"); _signwriter_update_imgstate($ret, "act_"); $schema['signwriter_menu'] = array( 'description' => 'signwriter menu profile table', 'fields' => array( 'id' => array( 'description' => 'the primary identifier of the profile', 'type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, ), 'name' => array( 'description' => 'the name of the profile', 'type' => 'varchar', 'length' => 128, ), 'data' => array( 'description' => 'The value of the variable.', 'type' => 'text', 'not null' => TRUE, 'size' => 'big', ), ), 'indexes' => array( 'name' => array('name'), ), 'primary key' => array('id'), ); db_create_table('signwriter_menu', $schema['signwriter_menu']); // hook_update_N() no longer returns a $ret array. Instead, return // nothing or a translated string indicating the update ran successfully. // See http://drupal.org/node/224333#update_sql. return t('TODO Add a descriptive string here to show in the UI.') /* $ret */; }