Index: branches/5.0.x/core/kernel/db/db_tag_processor.php =================================================================== diff -u -r12162 -r12246 --- branches/5.0.x/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 12162) +++ branches/5.0.x/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 12246) @@ -1,6 +1,6 @@ Application->RecallVar('module')); - if (!$force_module) $force_module = 'core'; - } - else { - $force_module = mb_strtolower($force_module); - } - - if ($force_module == 'core') { - $module_folder = 'core'; - } - else { - $module_folder = trim( $this->Application->findModule('Name', $force_module, 'Path'), '/'); - } - } - else { - $module_folder = $this->Application->getUnitOption($this->Prefix, 'ModuleFolder'); - } - return '../../'.$module_folder.'/admin_templates/'; - } - - /** * Returns object used in tag processor * * @access public Index: branches/5.0.x/core/units/sections/sections_config.php =================================================================== diff -u -r12230 -r12246 --- branches/5.0.x/core/units/sections/sections_config.php (.../sections_config.php) (revision 12230) +++ branches/5.0.x/core/units/sections/sections_config.php (.../sections_config.php) (revision 12246) @@ -1,6 +1,6 @@ 'core-sections', 'EventHandlerClass' => Array ('class' => 'SiteConfigEventHandler', 'file' => 'site_config_eh.php', 'build_event' => 'OnBuild'), - 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'), + 'TagProcessorClass' => Array ('class' => 'SiteConfigTagProcessor', 'file' => 'site_config_tp.php', 'build_event' => 'OnBuild'), 'Hooks' => Array ( Array ( Index: branches/5.0.x/core/admin_templates/themes/extra_toolbar.tpl =================================================================== diff -u -r12117 -r12246 --- branches/5.0.x/core/admin_templates/themes/extra_toolbar.tpl (.../extra_toolbar.tpl) (revision 12117) +++ branches/5.0.x/core/admin_templates/themes/extra_toolbar.tpl (.../extra_toolbar.tpl) (revision 12246) @@ -15,10 +15,7 @@ - - - - +
\ No newline at end of file Index: branches/5.0.x/core/kernel/processors/tag_processor.php =================================================================== diff -u -r12117 -r12246 --- branches/5.0.x/core/kernel/processors/tag_processor.php (.../tag_processor.php) (revision 12117) +++ branches/5.0.x/core/kernel/processors/tag_processor.php (.../tag_processor.php) (revision 12246) @@ -1,6 +1,6 @@ Application->RecallVar('module')); + if (!$force_module) $force_module = 'core'; + } + else { + $force_module = mb_strtolower($force_module); + } + + if ($force_module == 'core') { + $module_folder = 'core'; + } + else { + $module_folder = trim( $this->Application->findModule('Name', $force_module, 'Path'), '/'); + } + } + else { + $module_folder = $this->Application->getUnitOption($this->Prefix, 'ModuleFolder'); + } + return '../../'.$module_folder.'/admin_templates/'; + } } /*class ProcessorsPool { Index: branches/5.0.x/core/units/sections/site_config_tp.php =================================================================== diff -u --- branches/5.0.x/core/units/sections/site_config_tp.php (revision 0) +++ branches/5.0.x/core/units/sections/site_config_tp.php (revision 12246) @@ -0,0 +1,47 @@ + Array ('image' => 'show_structure', 'title' => 'Browse Mode'), + 4 => Array ('image' => 'content_mode', 'title' => 'Content Mode'), + 2 => Array ('image' => 'show_all', 'title' => 'Layout Mode'), + 3 => Array ('image' => 'show_all', 'title' => 'Design Mode'), + ); + + $base_path = FULL_PATH . dirname( $this->Application->UnitConfigReader->getPrefixFile('custom-sections') ) . '/../site_configs'; + + if (file_exists($base_path . DIRECTORY_SEPARATOR . 'settings.php')) { + include_once $base_path . DIRECTORY_SEPARATOR . 'settings.php'; // will get $visible_editing_modes + + foreach ($editing_modes as $editing_mode => $data) { + if (!in_array($editing_mode, $visible_editing_modes)) { + unset($editing_modes[$editing_mode]); + } + } + + if (count($editing_modes) == 1) { + // don't show buttons, when there only one left + return ''; + } + } + + $ret = ''; + $i = 1; + $count = count($editing_modes); + $block_params = Array ('name' => $params['render_as']); + + foreach ($editing_modes as $editing_mode => $data) { + $block_params = array_merge($block_params, $data); + $block_params['editing_mode'] = $editing_mode; + $block_params['is_last'] = $i == $count; + + $ret .= $this->Application->ParseBlock($block_params); + $i++; + } + + return $ret; + } + } \ No newline at end of file