views_ui_cache_set

6 views_ui.module views_ui_cache_set(&$view)
7 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.

26 calls to views_ui_cache_set()

File

./views_ui.module, line 285
views_ui.module 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;
  }
  views_include('cache');
  $view->changed = TRUE; // let any future object know that this view has changed.

  // Unset handlers; we don't want to write these into the cache
  unset($view->display_handler);
  unset($view->current_display);
  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);
  }
  views_object_cache_set('view', $view->name, $view);
}
Login or register to post comments