<?php
!function_exists('adminmsg') && exit('Forbidden');

require GetLang('left');
$headdb = array();
$guides = $titles = $dfcate = $gd_diy = '';
if (If_manager) {
	$nav_left['config']['settings']['option']['settings']['all'] = array(getLangInfo('other','admin_settingsall'),$admin_file.'?adminjob=settings&admintype=all');
	$nav_left = array_merge(array('initiator' => array('initiator' => array('name' => $nav_manager['name'],'option' => $nav_manager['option']))),$nav_left);
}
unset($nav_manager);

$diyoptions = $db_diy ? explode(',',$db_diy) : array('setforum','setuser','level','postcache','article');

foreach ($nav_left as $cate => $left) {
	$output1 = '';
	foreach ($left as $title => $value) {
		$output2 = '';
		foreach ($value['option'] as $key => $option) {
			if (!isset($option[0]) || is_array($option[0])) {
				foreach ($option as $k => $v) {
					if (is_array($rightset[$key]) && (int)$rightset[$key][$k]==1) {
						$output2 .= ",'$k' : ['$v[0]','$v[1]']";
						in_array($key.'_'.$k,$diyoptions) && $gd_diy .= ",'$k' : ['$v[0]','$v[1]']";
					}
				}
			} elseif ((int)$rightset[$key]==1) {
				$output2 .= ",'$key' : ['$option[0]','$option[1]']";
				in_array($key,$diyoptions) && $gd_diy .= ",'$key' : ['$option[0]','$option[1]']";
			}
		}
		if (!$output2) continue;
		$output2 = substr($output2,1);
		$output1.= ",'$title' : {{$output2}}";
		$titles .= ",'$title' : '$value[name]'";
	}
	if (!$output1) continue;
	$output1 = substr($output1,1);
	$guides .= ",\r\n\t'$cate' : {{$output1}}";
	$headdb[$cate] = $nav_head[$cate];
	!$dfcate && $dfcate = $cate;
}
if ($gd_diy) {
	$dfcate = 'common';
	$gd_diy = substr($gd_diy,1);
	$guides .= ",\r\n\t'common' : {'diy' : {{$gd_diy}}}";
	$titles .= ",'diy' : '".getLangInfo('other','admin_diy')."'";
}
$guides = substr($guides,1)."\n";
$titles = substr($titles,1);
include PrintEot('index');exit;
?>