class spaces_controller_variable in Spaces 7
Same name and namespace in other branches
- 6.3 plugins/spaces_controller_variable.inc \spaces_controller_variable
- 7.3 plugins/spaces_controller_variable.inc \spaces_controller_variable
Variable controller.
Hierarchy
- class \spaces_controller
- class \spaces_controller_variable
Expanded class hierarchy of spaces_controller_variable
3 string references to 'spaces_controller_variable'
- spaces_customtext_spaces_plugins in spaces_customtext/
spaces_customtext.module - Implements hook_spaces_plugins().
- spaces_spaces_plugins in ./
spaces.module - Implements hook_spaces_plugins().
- spaces_spaces_registry in ./
spaces.module - Implements hook_spaces_registry().
File
- plugins/
spaces_controller_variable.inc, line 6
View source
class spaces_controller_variable extends spaces_controller {
/**
* Override of init_overrides().
*/
function init_overrides() {
// Load original variables. Only do this once, and it may not be reset.
$this
->load_original_values();
// Load the preset values.
$this
->reset_values('preset');
$this
->load_preset_values();
// Load space variables.
$this
->reset_values('space');
$this
->load_space_values();
// Alter global variable conf as we don't have any other way of
// influencing the result of variable_get().
global $conf;
$conf = $this
->get();
// If we have overridden 'site_frontpage', we need to do some extra
// work to reinit the drupal path.
// TODO: Is purl_language_strip still needed?
//if ($this->get('site_frontpage') !== $this->get('site_frontpage', 'original') && function_exists('purl_language_strip')) {
// $_GET['q'] = purl_language_strip($_REQUEST['q']);
// drupal_path_initialize();
//}
}
/**
* Override of load_preset_values(). We cannot rely on variable_get() --
* we must first check our space override values.
*/
protected function load_preset_values($id = NULL) {
if (empty($this->loaded_all['preset'])) {
$preset_name = $this
->get("spaces_preset_{$this->space_type}", 'space') ? $this
->get("spaces_preset_{$this->space_type}", 'space') : variable_get("spaces_preset_{$this->space_type}", NULL);
if ($preset_name && ($preset = spaces_preset_load($preset_name))) {
if (isset($preset->value[$this->controller])) {
$this->values['preset'] = $preset->value[$this->controller];
}
}
$this->loaded_all['preset'] = TRUE;
}
}
/**
* Override of load_original_values().
*/
protected function load_original_values($id = NULL) {
global $conf;
if (empty($this->values['original'])) {
$this->values['original'] = $conf;
$this->loaded_all['original'] = TRUE;
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
spaces_controller:: |
property | |||
spaces_controller:: |
protected | property | ||
spaces_controller:: |
protected | property | ||
spaces_controller:: |
property | |||
spaces_controller:: |
property | |||
spaces_controller:: |
property | |||
spaces_controller:: |
function | Delete a controller object override for this space. | ||
spaces_controller:: |
function | Get a value for this controller. | ||
spaces_controller:: |
protected | function | Protected method that ensures a space-level override for the provided object has been loaded. | 1 |
spaces_controller:: |
protected | function | Wrapper around load_[environment]_values. | |
spaces_controller:: |
protected | function | Clear out loaded values. | |
spaces_controller:: |
function | Set override values for a given controller object in this space. | ||
spaces_controller:: |
function | Provide a readable display of an object override for administration. | ||
spaces_controller:: |
function | |||
spaces_controller_variable:: |
function |
Override of init_overrides(). Overrides spaces_controller:: |
1 | |
spaces_controller_variable:: |
protected | function |
Override of load_original_values(). Overrides spaces_controller:: |
|
spaces_controller_variable:: |
protected | function |
Override of load_preset_values(). We cannot rely on variable_get() --
we must first check our space override values. Overrides spaces_controller:: |