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; } }