[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/views_slideshow_imageflow/ -> views_slideshow_imageflow.install (source)

   1  <?php
   2  
   3  /**
   4   * @file
   5   * This is Views Slideshow: ImageFlow's installation file.
   6   */
   7  
   8  /**
   9   * Implementation of hook_install().
  10   */
  11  function views_slideshow_imageflow_install() {
  12    return array();
  13  }
  14  
  15  /**
  16   * Implementation of hook_uninstall().
  17   */
  18  function views_slideshow_imageflow_uninstall() {
  19    foreach (views_slideshow_imageflow_variable_default() as $variable => $value) {
  20      views_slideshow_imageflow_variable_del($variable);
  21    }
  22    return array(array('success' => TRUE, 'query' => "Deleted all variables in the Views Slideshow: ImageFlow namespace."));
  23  }
  24  
  25  /**
  26   * Convert variables to new namespace.
  27   */
  28  function views_slideshow_imageflow_update_6001() {
  29    // Rebuild our menu and themes.
  30    drupal_rebuild_theme_registry();
  31    menu_rebuild();
  32  
  33    // Convert variables to the Views Slideshow: ImageFlow variable namespace.
  34    $ret = array();
  35    $flag = FALSE;
  36  
  37    $variables = array(
  38      'views_slideshow_imageflow_plugin' => 'plugin_path',
  39    );
  40  
  41    foreach ($variables as $old_variable => $new_variable) {
  42      $new_value = views_slideshow_imageflow_variable_get($new_variable);
  43      $old_value = variable_get($old_variable, $new_value);
  44  
  45      // Set the variable to the value of the old version, assuming it hasn't
  46      // already been overridden, and the old version is not the current default.
  47      if (($new_value == views_slideshow_imageflow_variable_default($new_variable)) && ($new_value != $value)) {
  48        views_slideshow_imageflow_variable_set($new_variable, $value);
  49      }
  50      variable_del($old_variable);
  51      $flag = TRUE;
  52    }
  53  
  54    if ($flag) {
  55      $ret[] = array('success' => TRUE, 'query' => "Converted old variables to the Views Slideshow: ImageFlow variable namespace.");
  56    }
  57  
  58    return $ret;
  59  }


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7