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()
ViewAddFormController::continueAndEdit in drupal/core/modules/views/views_ui/lib/Drupal/views_ui/ViewAddFormController.php
Form submission handler for the 'continue' action.
ViewEditFormController::submitDisplayAdd in drupal/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
Submit handler to add a display to a view.
ViewEditFormController::submitDisplayDelete in drupal/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
Submit handler to delete a display from a view.
ViewEditFormController::submitDisplayDisable in drupal/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
Submit handler to disable display.
ViewEditFormController::submitDisplayDuplicate in drupal/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
Submit handler to duplicate a display for a view.

... See full list

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);
}