/[drupal]/contributions/modules/img_assist/img_assist.install
ViewVC logotype

Contents of /contributions/modules/img_assist/img_assist.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.8 - (show annotations) (download) (as text)
Mon Nov 3 23:12:58 2008 UTC (12 months, 3 weeks ago) by sun
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +2 -2 lines
File MIME type: text/x-php
#322731 by sun: Fixed improper use of t() in module install file.
1 <?php
2 // $Id: img_assist.install,v 1.7 2008/07/18 22:58:09 sun Exp $
3
4
5 /**
6 * Implementation of hook_schema().
7 */
8 function img_assist_schema() {
9 $schema['img_assist_map'] = array(
10 'description' => t('Stores references of image files to content.'),
11 'fields' => array(
12 'nid' => array(
13 'description' => t('The {node}.nid of the content referencing the image file.'),
14 'type' => 'int',
15 'unsigned' => TRUE,
16 'not null' => TRUE,
17 'default' => 0,
18 ),
19 'iid' => array(
20 'description' => t('The {image}.nid of the image file referenced by the content.'),
21 'type' => 'int',
22 'unsigned' => TRUE,
23 'not null' => TRUE,
24 'default' => 0,
25 ),
26 ),
27 'primary key' => array('nid', 'iid'),
28 );
29 return $schema;
30 }
31
32 /**
33 * Implementation of hook_install().
34 */
35 function img_assist_install() {
36 drupal_install_schema('img_assist');
37 }
38
39 /**
40 * Implementation of hook_uninstall().
41 */
42 function img_assist_uninstall() {
43 drupal_uninstall_schema('img_assist');
44
45 variable_del('img_assist_page_styling');
46 variable_del('img_assist_link');
47 variable_del('img_assist_all');
48 variable_del('img_assist_pages');
49 variable_del('img_assist_link');
50 variable_del('img_assist_preview_count');
51 variable_del('img_assist_max_size');
52 variable_del('img_assist_popup_label');
53 variable_del('img_assist_default_label');
54 variable_del('img_assist_create_derivatives');
55 variable_del('img_assist_default_link_behavior');
56 variable_del('img_assist_default_link_url');
57 variable_del('img_assist_default_insert_mode');
58 variable_del('img_assist_load_title');
59 variable_del('img_assist_load_description');
60 variable_del('img_assist_vocabs');
61 variable_del('img_assist_default_alignment');
62 variable_del('img_assist_all');
63 }
64
65 /**
66 * Remove obsolete img_assist_preview_count variable.
67 * Disable Image assist if Views is not installed/enabled.
68 */
69 function img_assist_update_6200() {
70 $ret = array();
71 variable_del('img_assist_preview_count');
72 if (!module_exists('views')) {
73 db_query("UPDATE {system} SET status = %d WHERE type = '%s' AND name = '%s'", 0, 'module', 'img_assist');
74 drupal_set_message('Image assist has been disabled, because it requires <a href="http://drupal.org/project/views">Views</a> module to be installed.', 'error');
75 }
76 return $ret;
77 }
78

  ViewVC Help
Powered by ViewVC 1.1.2