[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

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

   1  <?php
   2  // $Id: yui_editor.install,v 1.1.2.1.2.2 2008/11/21 22:54:27 jeffcd Exp $
   3  
   4  /**
   5   * @file
   6   * Install file for the YUI Editor module.
   7   */
   8  
   9  require_once(drupal_get_path('module', 'yui_editor') .'/yui_editor.admin.inc');
  10  
  11  /**
  12   * Implementation of hook_install().
  13   */
  14  function yui_editor_install() {
  15    yui_editor_update_6200();
  16  }
  17  
  18  /**
  19   * Move settings from previous install to new profile variable.
  20   */
  21  function yui_editor_update_6200() {
  22    $profiles = variable_get('yui_editor_profiles', array());
  23    if (sizeof($profiles) == 0) {
  24      // Need to include the module file first
  25      include_once dirname(__FILE__).'/yui_editor.module';
  26  
  27      // Get a default profile
  28      $profile = yui_editor_profile_default();
  29  
  30      // Add in settings from previous install
  31      $profile['include'] = variable_get('yui_editor_include', '');
  32      $profile['ids'] = variable_get('yui_editor_ids', '');
  33      $profile['title'] = variable_get('yui_editor_title', '');
  34      $profile['titlebar'] = variable_get('yui_editor_titlebar', 0);
  35      $profile['height'] = variable_get('yui_editor_height', '250px');
  36      $profile['width'] = variable_get('yui_editor_width', '100%');
  37      $profile['markup'] = variable_get('yui_editor_markup', 'xhtml');
  38      $profile['resize'] = variable_get('yui_editor_resize', 0);
  39      $profile['plaintext'] = variable_get('yui_editor_plaintext', 0);
  40      $profile['coder'] = variable_get('yui_editor_coder', 0);
  41      $profile['collapse'] = variable_get('yui_editor_collapse', 0);
  42      $profile['draggable'] = variable_get('yui_editor_draggable', 0);
  43      $profile['dom'] = variable_get('yui_editor_dom', 1);
  44      $profile['ptags'] = variable_get('yui_editor_ptags', 0);
  45      $profile['img_upload'] = variable_get('yui_editor_img_upload', 0);
  46      $profile['flickr'] = variable_get('yui_editor_flickr', 0);
  47      $profile['flickr_api_key'] = variable_get('yui_editor_flickr_api_key', '');
  48      $profile['button_type'] = variable_get('yui_editor_button_type', 'simple');
  49      $profile['button_profile'] = variable_get('yui_editor_profile', 'yui_editor_toolbar_default.js');
  50  
  51      $profiles[10][time()] = $profile;
  52      variable_set('yui_editor_profiles', $profiles);
  53    }
  54    return array(array('success' => TRUE, 'query' => check_plain('Imported your YUI Editor settings to 2.x')));
  55  }


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