https://www.icyphoenix.com/viewtopic.php?f=28&t=7615&p=51492#p51492
-----------------------------------
Mighty Gorgon
Fri 11 Feb, 2011 15:51

Re: [MOD] Tab Menu For Icy
-----------------------------------
I don't know what you wanted to achieve... anyway I have created a PHP function which you can check how it works into the latest dev version of Icy Phoenix for the CMS:

[code syntax=php]
	/*
	* Generate tabs
	*/
	function generate_tabs($mode)
	{
		global $db, $cache, $config, $userdata, $lang, $template;

		$tabs_array = array();

		$tabs_array[] = array('TITLE' => $lang['CMS_TITLE'], 'MODE' => false, 'LINK' => append_sid(IP_ROOT_PATH . $this->root), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_home.png', 'TIP' => $lang['CMS_TIP_TITLE'], 'AUTH' => AUTH_REG);
		$tabs_array[] = array('TITLE' => $lang['CMS_CUSTOM_PAGES'], 'MODE' => 'layouts', 'LINK' => append_sid(IP_ROOT_PATH . $this->root . '?mode=layouts'), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_custom_pages.png', 'TIP' => $lang['CMS_TIP_CUSTOM_PAGES'], 'AUTH' => AUTH_REG);
		$tabs_array[] = array('TITLE' => $lang['CMS_STANDARD_PAGES'], 'MODE' => 'layouts_special', 'LINK' => append_sid(IP_ROOT_PATH . $this->root . '?mode=layouts_special'), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_standard_pages.png', 'TIP' => $lang['CMS_TIP_STANDARD_PAGES'], 'AUTH' => AUTH_REG);
		$tabs_array[] = array('TITLE' => $lang['CMS_BLOCK_SETTINGS'], 'MODE' => 'block_settings', 'LINK' => append_sid(IP_ROOT_PATH . $this->root . '?mode=block_settings'), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_blocks.png', 'TIP' => $lang['CMS_TIP_BLOCK_SETTINGS'], 'AUTH' => AUTH_REG);
		$tabs_array[] = array('TITLE' => $lang['CMS_GLOBAL_BLOCKS'], 'MODE' => 'blocks', 'LINK' => append_sid(IP_ROOT_PATH . $this->root . '?mode=blocks&l_id=0&action=editglobal'), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_blocks_global.png', 'TIP' => $lang['CMS_TIP_GLOBAL_BLOCKS'], 'AUTH' => AUTH_REG);
		$tabs_array[] = array('TITLE' => $lang['CMS_CONFIG'], 'MODE' => 'config', 'LINK' => append_sid(IP_ROOT_PATH . $this->root . '?mode=config'), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_settings.png', 'TIP' => $lang['CMS_TIP_CONFIG'], 'AUTH' => AUTH_REG);
		$tabs_array[] = array('TITLE' => $lang['CMS_MENU_PAGE'], 'MODE' => 'menu', 'LINK' => append_sid(IP_ROOT_PATH . 'cms_menu.' . PHP_EXT), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_menu.png', 'TIP' => $lang['CMS_TIP_MENU'], 'AUTH' => AUTH_REG);
		$tabs_array[] = array('TITLE' => $lang['CMS_ADS'], 'MODE' => 'ads', 'LINK' => append_sid(IP_ROOT_PATH . 'cms_ads.' . PHP_EXT), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_ads.png', 'TIP' => $lang['CMS_TIP_ADS'], 'AUTH' => AUTH_REG);

		$tabs_counter = 0;
		$current_nav = false;
		foreach ($tabs_array as $tab_data)
		{
			$selected = false;
			if(check_auth_level($tab_data['AUTH']))
			{
				if ($mode == $tab_data['MODE'])
				{
					$selected = true;
				}

				$template->assign_block_vars('tabs', array(
					'TAB_ID' => $tabs_counter,
					'TAB_TITLE' => $tab_data['TITLE'],
					'TAB_LINK' => $tab_data['LINK'],
					'TAB_ICON' => $tab_data['ICON'],
					'TAB_TIP' => (empty($tab_data['TIP']) ? $tab_data['TITLE'] : $tab_data['TIP']),
					'S_SELECTED' => $selected,
					)
				);
				$tabs_counter++;
			}
		}

		$template->assign_vars(array(
			'N_TABS' => $tabs_counter,
			)
		);

		return true;
	}
[/code]

File is here:
https://github.com/MightyGorgon/icy_phoenix/blob/master/includes/class_cms_admin.php

This function depend on the MODE var, but you can easily replace that with script name.


