You are here

protected function spaces_controller_context::load_original_values in Spaces 6.3

Same name and namespace in other branches
  1. 7.3 plugins/spaces_controller_context.inc \spaces_controller_context::load_original_values()
  2. 7 plugins/spaces_controller_context.inc \spaces_controller_context::load_original_values()

Override of load_original_values().

Note that $id here is *NOT* $context->name, but rather a derived plugin id allowing overrides to be set on a granular, per-plugin level. The format of $id is "{$context->name}:{$plugin_type}:{$plugin}", e.g. "blog:reaction:block".

Overrides spaces_controller::load_original_values

File

plugins/spaces_controller_context.inc, line 69

Class

spaces_controller_context
Context controller.

Code

protected function load_original_values($id = NULL) {
  if (empty($this->loaded_all['original'])) {
    if (!isset($id)) {
      $contexts = context_load();
      foreach ($contexts as $name => $context) {
        array_merge($this->values['original'], $this
          ->plugin_values($context));
      }
      $this->loaded_all['original'] = TRUE;
    }
    else {
      if (!isset($this->loaded['original'][$id])) {
        if ($context = $this
          ->load_from_override($id)) {
          $plugins = $this
            ->plugin_values($context);
          foreach ($plugins as $plugin_id => $plugin_values) {
            $this->values['original'][$plugin_id] = $plugin_values;
            $this->loaded['original'][$plugin_id] = TRUE;
          }
        }
      }
    }
  }
}