You are here

function panels_allowed_layouts::sync_with_available in Panels 6.3

Same name and namespace in other branches
  1. 5.2 includes/common.inc \panels_allowed_layouts::sync_with_available()
  2. 6.2 includes/common.inc \panels_allowed_layouts::sync_with_available()
  3. 7.3 includes/common.inc \panels_allowed_layouts::sync_with_available()

Checks for newly-added layouts and deleted layouts. If any are found, updates panels_allowed_layouts::allowed_layout_settings; new additions are made according to panels_allowed_layouts::allow_new, while deletions are unset().

Note that any changes made by this function are not saved in any permanent location.

1 call to panels_allowed_layouts::sync_with_available()
panels_allowed_layouts::set_allowed in includes/common.inc
Manage panels_common_set_allowed_layouts(), the FAPI code for selecting allowed layouts.

File

includes/common.inc, line 169
Functions used by more than one panels client module.

Class

panels_allowed_layouts
Class definition for the allowed layouts governing structure.

Code

function sync_with_available() {
  $layouts = $this
    ->list_layouts();
  foreach (array_diff($layouts, array_keys($this->allowed_layout_settings)) as $new_layout) {
    $this->allowed_layout_settings[$new_layout] = $this->allow_new ? 1 : 0;
  }
  foreach (array_diff(array_keys($this->allowed_layout_settings), $layouts) as $deleted_layout) {
    unset($this->allowed_layout_settings[$deleted_layout]);
  }
}