function views_ui_cache_set

Same name in other branches
  1. 7.x-3.x views_ui.module \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()
views_ui_add_display_form_submit in includes/admin.inc
Submit handler to add a display to a view.
views_ui_add_form_submit in includes/admin.inc
Process the add view form
views_ui_add_item_form_submit in includes/admin.inc
Submit handler for adding new item(s) to a view.
views_ui_change_style_form_submit in includes/admin.inc
Submit handler for configing new item(s) to a view.
views_ui_clone_display_form_submit in includes/admin.inc
Submit handler to add a clone to a display from a view.

... See full list

File

./views_ui.module, line 285

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