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

Contents of /contributions/modules/imagecrop/imagecrop.install

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


Revision 1.1 - (show annotations) (download) (as text)
Mon Mar 24 16:29:28 2008 UTC (20 months ago) by swentel
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-5, DRUPAL-6--1
File MIME type: text/x-php
Initial import of imagecrop. This module provides an extra imagecache action called javascript_crop and hooks into modules or fields to manipulate images with a javascript toolbox
1 <?php
2
3 /**
4 * Implementation of hook_install().
5 * @todo postgresql support
6 * @todo add unique key on fid & presetid?
7 */
8 function imagecrop_install() {
9 switch ($GLOBALS['db_type']) {
10 case 'mysql':
11 case 'mysqli':
12 $ret1 = db_query("CREATE TABLE {imagecrop} (
13 fid INT UNSIGNED NOT NULL DEFAULT 0,
14 presetid INT UNSIGNED NOT NULL DEFAULT 0,
15 xoffset INT UNSIGNED NOT NULL DEFAULT 0,
16 yoffset INT UNSIGNED NOT NULL DEFAULT 0,
17 width INT UNSIGNED NOT NULL DEFAULT 0,
18 height INT UNSIGNED NOT NULL DEFAULT 0)
19 /*!40100 DEFAULT CHARACTER SET utf8 */
20 ");
21 break;
22 case'pgsql':
23
24 break;
25 }
26 if ($ret1) {
27 drupal_set_message(t('Imagecrop module installed succesfully.'));
28 } else {
29 drupal_set_message(t('Imagecrop module installation was unsuccessfull. Necessary database tables should be created by hand.', 'error'));
30 }
31 return $ret1;
32 }
33
34 /**
35 * Implementation of hook_uninstall()
36 */
37 function imagecrop_uninstall() {
38 db_query("DROP TABLE {imagecrop}");
39 db_query("DELETE FROM {system} where name = 'imagecrop'");
40 variable_del('imagecrop_modules');
41 variable_del('imagecrop_fields');
42 }

  ViewVC Help
Powered by ViewVC 1.1.2