View file radio/Tpl/mainMenu.tpl.html

File size: 2.64Kb
<?php
	$request = Request::create();

	$index = 0;
	$links[$index]['href'] = 'playlist.php';
	$links[$index]['files'] = array('add_tracks','playlist_zakaz','playlist_view','playlist_proverki','playlist','playlist_edit', 'edit_song');
    $links[$index]['image'] = 'images/navi_05.jpg';
    $links[$index]['activeImage'] = 'images/navi_white_05.jpg';
    $index++;

	$links[$index]['href'] = 'setting.php';
    $links[$index]['files'] = array('setting','setting_system','setting_dir');
    $links[$index]['image'] = 'images/navi_07.jpg';
    $links[$index]['activeImage'] = 'images/navi_white_07.jpg';
    $index++;

	$links[$index]['href'] = 'meneger.php';
    $links[$index]['files'] = array('meneger','meneger_upload','meneger_zapros');
    $links[$index]['image'] = 'images/navi_09.jpg';
    $links[$index]['activeImage'] = 'images/navi_white_09.jpg';
    $index++;

	$links[$index]['href'] = 'statistic.php';
    $links[$index]['files'] = array('statistic', 'statistic_client');
    $links[$index]['image'] = 'images/navi_11.jpg';
    $links[$index]['activeImage'] = 'images/navi_white_11.jpg';
    $index++;

	$links[$index]['href'] = 'dj.php';
    $links[$index]['files'] = array('dj');
    $links[$index]['image'] = 'images/navi_17.jpg';
    $links[$index]['activeImage'] = 'images/navi_white_17.jpg';
    $index++;

	$links[$index]['href'] = 'status.php';
    $links[$index]['files'] = array('status');
    $links[$index]['image'] = 'images/navi_13.jpg';
    $links[$index]['activeImage'] = 'images/navi_white_13.jpg';



	foreach ($links as $index=>$link) {
		$white = false;
  		foreach ($link['files'] as $file) {
			if ($request->getServerVar('SCRIPT_NAME') == "/radio/$file.php") {
				$white = true;
			}
		}
		if ($white) {
?>
			<a href="<?=$link['href']?>"><img border="0" src="<?=$link['activeImage']?>" width="100" height="84"></a>
<?php
		} else {
?>
			<a href="<?=$link['href']?>"><img border="0" src="<?=$link['image']?>" width="100" height="84"></a>
<?php
		}
		printMenuDelimiter($links, $index);
	}
?>
<?php
	function printMenuDelimiter($links, $index) {

  		$white =  false;
  		 foreach ($links[$index]['files'] as $file) {
			if ($_SERVER['SCRIPT_NAME'] == "/radio/$file.php") {
				$white = true;
			}
		}
		if (!empty($links[$index+1]['files']))
        foreach ($links[$index+1]['files'] as $file) {
			if ($_SERVER['SCRIPT_NAME'] == "/radio/$file.php") {
				$white = true;
			}
		}
        if ($white) {
?>
			<img border="0" src="images/navi_white_06.jpg" width="1" height="84">
<?php
		} else {
?>
			<img border="0" src="images/navi_06.jpg" width="1" height="84">
<?php
        }
	}
?>