function views_ui_cache_set

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

drupal/core/modules/views/views_ui/views_ui.module, line 373
Provide structure for the administrative interface to Views.

Code

function views_ui_cache_set(ViewUI $view) {
  if (isset($view->locked) && is_object($view->locked) && $view->locked->owner != $GLOBALS['user']->uid) {
    drupal_set_message(t('Changes cannot be made to a locked view.'), 'error');
    return;
  }
  $view->changed = TRUE;

  // let any future object know that this view has changed.
  $executable = $view
    ->get('executable');
  if (isset($executable->current_display)) {

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

  // Unset handlers; we don't want to write these into the cache
  unset($executable->display_handler);
  unset($executable->default_display);
  $executable->query = NULL;
  $executable->displayHandlers = array();
  drupal_container()
    ->get('user.tempstore')
    ->get('views')
    ->set($view
    ->get('name'), $view);
}