spaces_controller_variable.inc in Spaces 6.3
File
plugins/spaces_controller_variable.inc
View source
<?php
class spaces_controller_variable extends spaces_controller {
function init_overrides() {
$this
->load_original_values();
$this
->reset_values('preset');
$this
->load_preset_values();
$this
->reset_values('space');
$this
->load_space_values();
global $conf;
$conf = $this
->get();
if ($this
->get('site_frontpage') !== $this
->get('site_frontpage', 'original') && function_exists('purl_language_strip')) {
$_GET['q'] = purl_language_strip($_REQUEST['q']);
drupal_init_path();
}
}
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;
}
}
protected function load_original_values($id = NULL) {
global $conf;
if (empty($this->values['original'])) {
$this->values['original'] = $conf;
$this->loaded_all['original'] = TRUE;
}
}
}