Esempio n. 1
0
     print_r($row);
     echo '</span><br /></div></pre>';
 }
 $jr_admin_row = jr_admin_get_user_info($user_id);
 $module_list = jr_admin_get_module_list();
 $user_module_list = explode(EXPLODE_SEPARATOR_CHAR, $jr_admin_row['user_jr_admin']);
 if ($debug) {
     //Dump out the get and post vars if in debug mode
     echo '<pre><div class="gensmall"><span class="text_blue">DEBUG - Modules -</span><br /><span class="text_blue">';
     print_r($module_list);
     echo '</span><br />';
     echo '<span class="text_red">DEBUG - User Modules -</span><br /><span class="text_red">';
     print_r($user_module_list);
     echo '</span><br /></div></pre>';
 }
 jr_admin_include_all_lang_files();
 $i = 0;
 foreach ($module_list as $cat => $info_array) {
     $cat_started = false;
     foreach ($info_array as $module_name => $file_array) {
         if ($file_array['junior_admin'] == true) {
             if ($cat_started == false) {
                 $template->assign_block_vars('catrow', array('CAT' => isset($lang[$cat]) ? $lang[$cat] : preg_replace("/_/", ' ', $cat), 'NUM' => $i));
                 $cat_started = true;
             }
             $file_hash = $file_array['file_hash'];
             $checked = in_array($file_hash, $user_module_list) ? 'checked="checked"' : '';
             $template->assign_block_vars('catrow.modulerow', array('ROW' => $i % 2 ? 'row1' : 'row2', 'NAME' => isset($lang[$module_name]) ? $lang[$module_name] : preg_replace("/_/", ' ', $module_name), 'FILENAME' => $file_array['filename'], 'FILE_HASH' => $file_hash, 'CHECKED' => $checked));
         }
     }
     $i++;
Esempio n. 2
0
function jr_admin_make_left_pane()
{
    global $template, $lang, $module, $user, $theme;
    jr_admin_include_all_lang_files();
    include_once IP_ROOT_PATH . ADM . '/acp_icons.' . PHP_EXT;
    // We need this for regular expressions... to avoid errors!!!
    $phpEx = PHP_EXT;
    @ksort($module);
    //Loop through and set up all the nice form names, etc
    //+MOD: DHTML Menu for ACP
    $menu_cat_id = 0;
    //-MOD: DHTML Menu for ACP
    foreach ($module as $cat => $module_array) {
        $cat_icon = '<img src="' . (isset($acp_icon[$cat]) ? $acp_icon[$cat] : $acp_icon['default']) . '" alt="' . $cat_name . '" style="vertical-align: middle;" />&nbsp;';
        $cat_name = isset($lang[$cat]) ? $lang[$cat] : preg_replace("/_/", ' ', $cat);
        $template->assign_block_vars('catrow', array('MENU_CAT_ID' => $menu_cat_id, 'MENU_CAT_ROWS' => sizeof($action_array), 'MENU_CAT_ICON' => $cat_icon, 'ADMIN_CATEGORY' => $cat_name));
        //die($cat);
        @ksort($module_array);
        $i = 0;
        foreach ($module_array as $module_name => $data_array) {
            //Compile our module url with lots of options
            $module_url = $data_array['filename'];
            $module_url .= preg_match("/^.*\\.{$phpEx}\\?/", $module_url) ? '&amp;' : '?';
            $module_url .= 'sid=' . $user->data['session_id'] . '&amp;module=' . $data_array['file_hash'];
            $template->assign_block_vars('catrow.modulerow', array('ROW_CLASS' => ++$i % 2 ? $theme['td_class1'] : $theme['td_class2'], 'ROW_COUNT' => $i, 'ADMIN_MODULE' => isset($lang[$module_name]) ? $lang[$module_name] : preg_replace("/_/", ' ', $module_name), 'U_ADMIN_MODULE' => $module_url));
        }
        //+MOD: DHTML Menu for ACP
        $menu_cat_id++;
        //-MOD: DHTML Menu for ACP
    }
}