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

Contents of /contributions/modules/maxlength/maxlength.install

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


Revision 1.8 - (show annotations) (download) (as text)
Sun Sep 28 13:07:38 2008 UTC (13 months, 4 weeks ago) by acm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +5 -25 lines
File MIME type: text/x-php
reverting to pre 2.0 code, undoing the mistake of committing to HEAD instead of 5--2
1 <?php
2 // $Id: maxlength.install,v 1.6 2008/09/27 18:39:51 mariuss Exp $
3 /**
4 * @file
5 * Install file for the maxlenght module
6 */
7
8 require_once 'maxlength.inc';
9
10 // hook_update_N
11 function maxlength_update_1() {
12 foreach (node_get_types() as $type => $name) {
13 $code_old = 'maxlength_node_type_'. $type;
14 $code_new = MAXLENGTH_NODE_TYPE . $type;
15
16 $max_title = variable_get($code_old .'_maxlength_title', '');
17 $max_body = variable_get($code_old .'_maxlength_body', '');
18
19 variable_set($code_new .'_t', $max_title);
20 variable_set($code_new .'_b', $max_body);
21
22 variable_del($code_old .'_maxlength_title');
23 variable_del($code_old .'_maxlength_body');
24
25 // old variables, not used anymore
26 variable_del($code_old .'_limit');
27 variable_del($code_old .'_maxlength');
28 }
29
30 return array();
31 }
32
33 // hook_unistall
34 function maxlength_uninstall() {
35 foreach (node_get_types() as $type => $name) {
36 $code = MAXLENGTH_NODE_TYPE . $type;
37
38 variable_del($code .'_t');
39 variable_del($code .'_b');
40 }
41 }

  ViewVC Help
Powered by ViewVC 1.1.2