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

Contents of /contributions/modules/livesearch/livesearch.install

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


Revision 1.2 - (show annotations) (download) (as text)
Mon Aug 11 06:24:05 2008 UTC (15 months, 2 weeks ago) by kourge
Branch: MAIN
CVS Tags: DRUPAL-5--1-2, HEAD
Changes since 1.1: +2 -1 lines
File MIME type: text/x-php
Fixed update.php error
1 <?php
2 // $Id: livesearch.install,v 1.1 2008/01/20 19:49:54 kourge Exp $
3
4 function livesearch_update_1() {
5 $variables = array(
6 'search_results_location',
7 'target_search_box',
8 'compact_search_box',
9 'delay_duration',
10 'custom_search_result_element_id',
11 'hide_snippets',
12 'show_item_info',
13 'scroll_to_search_result'
14 );
15 $variables = array_fill_keys($variables, NULL);
16 foreach ($variables as $variable => $value) {
17 $variables[$variable] = variable_get($variable, NULL);
18 variable_del($variable);
19 if ($variables[$variable] !== NULL) {
20 variable_set('livesearch_'. $variable, $variables[$variable]);
21 }
22 }
23 drupal_set_message('Live Search variables have been cleaned.');
24 return array();
25 }
26
27 function livesearch_uninstall() {
28 $variables = array(
29 'search_results_location',
30 'target_search_box',
31 'compact_search_box',
32 'delay_duration',
33 'custom_search_result_element_id',
34 'hide_snippets',
35 'show_item_info',
36 'scroll_to_search_result'
37 );
38 foreach ($variables as $variable) {
39 variable_del($variable);
40 variable_del('livesearch_'. $variable);
41 }
42 drupal_set_message('Live Search variables have been deleted.');
43 }

  ViewVC Help
Powered by ViewVC 1.1.2