View source
<?php
function img_assist_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query('CREATE TABLE {img_assist_map} (
nid INT(10) UNSIGNED NOT NULL ,
iid INT(10) UNSIGNED NOT NULL ,
PRIMARY KEY (nid, iid)
) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;');
break;
case 'pgsql':
db_query('create table {img_assist_map} (
nid integer not null,
iid integer not null,
primary key (nid, iid)
);');
break;
}
}
function img_assist_uninstall() {
db_query('DROP TABLE {img_assist_map}');
variable_del('img_assist_page_styling');
variable_del('img_assist_link');
variable_del('img_assist_all');
variable_del('img_assist_pages');
variable_del('img_assist_link');
variable_del('img_assist_preview_count');
variable_del('img_assist_max_size');
variable_del('img_assist_popup_label');
variable_del('img_assist_default_label');
variable_del('img_assist_create_derivatives');
variable_del('img_assist_default_link_behavior');
variable_del('img_assist_default_link_url');
variable_del('img_assist_default_insert_mode');
variable_del('img_assist_load_title');
variable_del('img_assist_load_description');
variable_del('img_assist_vocabs');
variable_del('img_assist_default_alignment');
variable_del('img_assist_all');
}
function img_assist_update_1() {
return _system_update_utf8(array(
'img_assist_map',
));
}
function img_assist_update_2() {
$ret = array();
$type = variable_get('img_assist_textareas_type', 2);
if ($type < 2) {
variable_set('img_assist_textareas_type', $type ? 0 : 1);
}
return $ret;
}