You are here

visual_select_file.install in Visual select file 7

File

visual_select_file.install
View source
<?php

/**
 * Implements hook_install().
 */
function visual_select_file_install() {
  variable_set('visual_select_file_public_is_public', 1);
}

/**
 * Implements hook_uninstall().
 */
function visual_select_file_uninstall() {
  variable_del('visual_select_file_submit_button_selector');
  variable_del('visual_select_file_remove_absolute');
  variable_del('visual_select_file_default_style');
}

/**
 * Notify user about changes in the admin/selection/popup View.
 */
function visual_select_file_update_1() {
  $views = views_get_all_views();
  $warning = array();
  foreach ($views as $view) {
    if (_visual_select_file_view_has_tag($view)) {

      // Overridden default view OR other view.
      $other = $view->name != 'visual_select_file';
      $overridden = $view->type == t('Overridden');
      if ($overridden || $other) {
        $warning[] = $view->name;
      }
    }
  }
  if ($warning) {
    $t = get_t();
    drupal_set_message($t('The following Views must be checked, because Visual Select File has changed: @views', array(
      '@views' => implode(', ', $warning),
    )), 'warning');
  }
}

/**
 * The Visual Select File admin View has changed, so IF you have created a custom View, you'll have to fix it using the new "File as image" field.
 */
function visual_select_file_update_2() {
  $t = get_t();
  return $t("The Visual Select File admin View has changed, so IF you have created a custom View, you'll have to fix it using the new &quot;File as image&quot; field.");
}

/**
 * Enable vsf_wysiwyg.
 */
function visual_select_file_update_3() {
  module_enable(array(
    'vsf_wysiwyg',
  ));
}

Functions

Namesort descending Description
visual_select_file_install Implements hook_install().
visual_select_file_uninstall Implements hook_uninstall().
visual_select_file_update_1 Notify user about changes in the admin/selection/popup View.
visual_select_file_update_2 The Visual Select File admin View has changed, so IF you have created a custom View, you'll have to fix it using the new "File as image" field.
visual_select_file_update_3 Enable vsf_wysiwyg.