function views_ui_cache_set

3.x views_ui.module views_ui_cache_set(&$view)
2.x views_ui.module views_ui_cache_set(&$view)

Specialized cache function to add a flag to our view, include an appropriate include, and cache more easily.

32 calls to views_ui_cache_set()
views_ui::clone_page in plugins/export_ui/views_ui.class.php
views_ui_add_form_store_edit_submit in includes/admin.inc
Process the add view form, 'continue'.
views_ui_add_item_form_submit in includes/admin.inc
Submit handler for adding new item(s) to a view.
views_ui_config_item_extra_form_submit in includes/admin.inc
Submit handler for configing new item(s) to a view.
views_ui_config_item_form in includes/admin.inc
Form to config_item items in the views UI.

... See full list

File

./views_ui.module, line 326
Provide structure for the administrative interface to Views.

Code

function views_ui_cache_set(&$view) {
  if (!empty($view->locked)) {
    drupal_set_message(t('Changes cannot be made to a locked view.'), 'error');
    return;
  }
  ctools_include('object-cache');
  $view->changed = TRUE; // let any future object know that this view has changed.

  if (isset($view->current_display)) {
    // Add the knowledge of the changed display, too.
    $view->changed_display[$view->current_display] = TRUE;
    unset($view->current_display);
  }

  // Unset handlers; we don't want to write these into the cache
  unset($view->display_handler);
  unset($view->default_display);
  $view->query = NULL;
  foreach (array_keys($view->display) as $id) {
    unset($view->display[$id]->handler);
    unset($view->display[$id]->default_display);
  }
  ctools_object_cache_set('view', $view->name, $view);
}