예제 #1
0
파일: index.php 프로젝트: 0hyeah/yurivn
         if (empty($navgroup['permissions']) or can_administer($navgroup['permissions'])) {
             $group_displayorder = intval($navgroup['displayorder']);
             $group_key = fetch_nav_text($navgroup);
             if (!isset($navigation["{$group_displayorder}"]["{$group_key}"])) {
                 $navigation["{$group_displayorder}"]["{$group_key}"] = array('options' => array());
             }
             $local_options =& $navigation["{$group_displayorder}"]["{$group_key}"]['options'];
             if (!is_array($navgroup['navoption'][0])) {
                 $navgroup['navoption'] = array($navgroup['navoption']);
             }
             foreach ($navgroup['navoption'] as $navoption) {
                 if (!empty($navoption['debug']) and $vbulletin->debug != 1 or !empty($navoption['permissions']) and !can_administer($navoption['permissions'])) {
                     continue;
                 }
                 $navoption['link'] = str_replace(array('{$vbulletin->config[Misc][modcpdir]}', '{$vbulletin->config[Misc][admincpdir]}'), array($vbulletin->config['Misc']['modcpdir'], $vbulletin->config['Misc']['admincpdir']), $navoption['link']);
                 $navoption['text'] = fetch_nav_text($navoption);
                 $local_options[intval($navoption['displayorder'])]["{$navoption['text']}"] = $navoption;
             }
             if (!isset($navigation["{$group_displayorder}"]["{$group_key}"]['group']) or $xml['master']) {
                 unset($navgroup['navoption']);
                 $navgroup['nav_file'] = $nav_file;
                 $navgroup['text'] = $group_key;
                 $navigation["{$group_displayorder}"]["{$group_key}"]['group'] = $navgroup;
             }
         }
     }
     $xmlobj = null;
     unset($xml);
 }
 ($hook = vBulletinHook::fetch_hook('admin_index_navigation')) ? eval($hook) : false;
 // sort groups by display order
예제 #2
0
function fetch_xml_data()
{
    $navigation = array();
    $navfiles = vB_Api_Product::loadProductXmlList('cpnav', true);
    if (empty($navfiles['vbulletin'])) {
        echo construct_phrase($vbphrase['could_not_open_x'], DIR . '/includes/xml/cpnav_vbulletin.xml');
        exit;
    }
    foreach ($navfiles as $nav_file => $file) {
        $xmlobj = new vB_XML_Parser(false, $file);
        $xml =& $xmlobj->parse();
        if (!is_array($xml['navgroup'][0])) {
            $xml['navgroup'] = array($xml['navgroup']);
        }
        foreach ($xml['navgroup'] as $navgroup) {
            if (!is_array($navgroup['navoption'][0])) {
                $navgroup['navoption'] = array($navgroup['navoption']);
            }
            foreach ($navgroup['navoption'] as $navoption) {
                $navoption['link'] = str_replace(array('{$vbulletin->config[Misc][modcpdir]}', '{$vbulletin->config[Misc][admincpdir]}'), array($vb5_config['Misc']['modcpdir'], 'admincp'), $navoption['link']);
                $navoption['text'] = fetch_nav_text($navoption);
                if ($navoption['phrase'] and (!isset($navigation[$navoption['phrase']]) or $xml['master'])) {
                    $navigation[$navoption['phrase']] = array('text' => $navoption['text'], 'link' => $navoption['link']);
                }
            }
        }
        $xmlobj = null;
        unset($xml);
    }
    return $navigation;
}