Ejemplo n.º 1
0
        #cpp#endif
        if ((!isset($currentUser->coreAccess['personal_messages']) || $currentUser->coreAccess['personal_messages'] != 'hidden') && EfrontUser::isOptionVisible('messages')) {
            $myCoursesOptions[] = array('text' => _MESSAGES, 'image' => "32x32/mail.png", 'href' => basename($_SERVER['PHP_SELF']) . "?ctg=messages");
        }
        if (EfrontUser::isOptionVisible('statistics')) {
            $myCoursesOptions[] = array('text' => _STATISTICS, 'image' => "32x32/reports.png", 'href' => basename($_SERVER['PHP_SELF']) . "?ctg=statistics");
        }
        if (EfrontUser::isOptionVisible('forum')) {
            $myCoursesOptions[] = array('text' => _FORUM, 'image' => "32x32/forum.png", 'href' => basename($_SERVER['PHP_SELF']) . "?ctg=forum");
        }
        if (EfrontUser::isOptionVisible('calendar')) {
            $myCoursesOptions[] = array('text' => _CALENDAR, 'image' => "32x32/calendar.png", 'href' => basename($_SERVER['PHP_SELF']) . "?ctg=calendar");
        }
        if (EfrontUser::isOptionVisible('professor_courses') && ($_SESSION['s_type'] == 'professor' || $currentUser->user['user_type'] == 'professor')) {
            if ($currentUser->coreAccess['professor_courses'] != 'hidden') {
                $myCoursesOptions[] = array('text' => _COURSES, 'image' => "32x32/courses.png", 'href' => "professor.php?ctg=courses");
                $myCoursesOptions[] = array('text' => _LESSONS, 'image' => "32x32/lessons.png", 'href' => "professor.php?ctg=professor_lessons");
            }
        }
        foreach ($loadedModules as $module) {
            if ($linkInfo = $module->getToolsLinkInfo()) {
                $myCoursesOptions[] = array('text' => $linkInfo['title'], 'image' => eF_getRelativeModuleImagePath($linkInfo['image']), 'href' => $linkInfo['link']);
            }
        }
        $smarty->assign("T_LAYOUT_CLASS", $currentTheme->options['toolbar_position'] == "left" ? "hideRight" : "hideLeft");
        //Whether to show the sidemenu on the left or on the right
        $smarty->assign("T_COURSES_LIST_OPTIONS", $myCoursesOptions);
    }
} catch (Exception $e) {
    handleNormalFlowExceptions($e);
}
Ejemplo n.º 2
0
     $newMenu->insertMenuOption($moduleMenu, $toolsMenuId);
 }
 // MODULES MENU
 $other_menus = array();
 foreach ($modules as $key => $module) {
     $sidebarLinks = $module->getSidebarLinkInfo();
     isset($sidebarLinks["other"]) ? $sidebarLinks = $sidebarLinks["other"] : ($sidebarLinks = array());
     isset($sidebarLinks["menuTitle"]) ? $menuTitle = $sidebarLinks["menuTitle"] : ($menuTitle = '');
     // Get the title set for this other menu
     // If this menu does not exist create it
     if ($menuTitle && !isset($other_menus["'" . $menuTitle . "'"])) {
         $other_menus["'" . $menuTitle . "'"] = array();
     }
     if (isset($sidebarLinks["links"])) {
         foreach ($sidebarLinks["links"] as $mod_link) {
             $other_menus["'" . $menuTitle . "'"][] = array("id" => $module->className . ($mod_link['id'] ? "_" . $mod_link['id'] : ""), "image" => eF_getRelativeModuleImagePath($mod_link['image']), "link" => $mod_link['link'], "title" => $mod_link['title'], "moduleLink" => "1", "eFrontExtensions" => $mod_link['eFrontExtensions'], "target" => isset($mod_link['target']) ? $mod_link['target'] : "mainframe");
         }
     }
 }
 // If more than 8 new menus exist, then all will be put under the same menu called MODULES
 if (sizeof($other_menus) > 8) {
     $massModulesMenuId = $newMenu->createMenu(array("title" => _MODULES));
     foreach ($other_menus as $other_module_menu) {
         $newMenu->insertMenuOption($other_module_menu, $massModulesMenu);
     }
 } else {
     // Otherwise a new menu will be put for each of them
     foreach ($other_menus as $title => $other_module_menu) {
         $newMenu->insertMenuOption($other_module_menu, false, substr($title, 1, strlen($title) - 2));
     }
 }
Ejemplo n.º 3
0
/**
* Function to return an array with all links
* that have been defined for all modules ($modules) for the current user
* type for the menu defined by parameter ($menu_category)
*
*<br>Example:
* $modules = $user -> getModules();
* $sysMenus = eF_getModuleMenu($modules, "system");
*
* @param $modules the module list,
*        $menu_category: one of "system" | "lessons" | "users" | "organization" | "tools" | "current_lesson" | "links" (for "other" menus)
* @return the array of the links found for this menu
* @version 1.0
*
**/
function eF_getModuleMenu($modules, $menu_category)
{
    $links = array();
    foreach ($modules as $module) {
        if ($menu_category != "current_lesson" || $menu_category == "current_lesson" && $GLOBALS['currentLesson']->options[$module->className]) {
            $sidebarLinks = $module->getSidebarLinkInfo();
            isset($sidebarLinks[$menu_category]) ? $sidebarLinks = $sidebarLinks[$menu_category] : ($sidebarLinks = array());
            foreach ($sidebarLinks as $mod_link) {
                // The "moduleLink" in the following array denotes special treatment
                $links[] = array("id" => $module->className . ($mod_link['id'] ? "_" . $mod_link['id'] : ""), "image" => eF_getRelativeModuleImagePath($mod_link['image']), "link" => $mod_link['link'], "title" => $mod_link['title'], "moduleLink" => "1", "eFrontExtensions" => $mod_link['eFrontExtensions'], "class" => "menuOption");
            }
        }
    }
    return $links;
}
Ejemplo n.º 4
0
 ///Create control panel sidelinks and innertable
 $innertable_modules = array();
 foreach ($loadedModules as $module) {
     if ($_admin_ || isset($currentLesson->options[$module->className]) && $currentLesson->options[$module->className] == 1) {
         unset($InnertableHTML);
         if ($_admin_) {
             $centerLinkInfo = $module->getCenterLinkInfo();
             $InnertableHTML = $module->getControlPanelModule();
             $InnertableHTML ? $module_smarty_file = $module->getControlPanelSmartyTpl() : ($module_smarty_file = false);
         } else {
             $centerLinkInfo = $module->getLessonCenterLinkInfo();
             $InnertableHTML = $module->getLessonModule();
             $InnertableHTML ? $module_smarty_file = $module->getLessonSmartyTpl() : ($module_smarty_file = false);
         }
         if ($centerLinkInfo) {
             $controlPanelOption = array('text' => $centerLinkInfo['title'], 'image' => eF_getRelativeModuleImagePath($centerLinkInfo['image']), 'href' => $centerLinkInfo['link']);
             if ($_SESSION['s_lesson_user_type'] != 'student') {
                 $controlPanelOption['group'] = 1;
             }
             $controlPanelOptions[] = $controlPanelOption;
         }
         // If the module has a lesson innertable
         if ($InnertableHTML) {
             // Get module html - two ways: pure HTML or PHP+smarty
             // If no smarty file is defined then false will be returned
             if ($module_smarty_file) {
                 // Execute the php code -> The code has already been executed by above (**HERE**)
                 // Let smarty know to include the module smarty file
                 $innertable_modules[$module->className] = array('smarty_file' => $module_smarty_file);
             } else {
                 // Present the pure HTML cod
Ejemplo n.º 5
0
         } else {
             if ($isSupervisor) {
                 $options[] = array('text' => _USERSTATISTICS, 'image' => "32x32/user.png", 'href' => $_SERVER['PHP_SELF'] . "?ctg=statistics&option=user");
                 $options[] = array('text' => _COURSESTATISTICS, 'image' => "32x32/courses.png", 'href' => $_SERVER['PHP_SELF'] . "?ctg=statistics&option=course");
                 $options[] = array('text' => _CERTIFICATESTATISTICS, 'image' => "32x32/certificate.png", 'href' => $_SERVER['PHP_SELF'] . "?ctg=statistics&option=certificate");
                 if (!isset($currentUser->coreAccess['organization']) || $currentUser->coreAccess['organization'] != 'hidden') {
                     $options[] = array('text' => _BRANCHSTATISTICS, 'image' => "32x32/branch.png", 'href' => $_SERVER['PHP_SELF'] . "?ctg=statistics&option=branches");
                     $options[] = array('text' => _SKILLSSTATISTICS, 'image' => "32x32/skills.png", 'href' => $_SERVER['PHP_SELF'] . "?ctg=statistics&option=skill");
                 }
                 $options[] = array('group' => 1, 'text' => _ADVANCEDUSERREPORTS, 'image' => "32x32/users.png", 'href' => $_SERVER['PHP_SELF'] . "?ctg=statistics&option=advanced_user_reports");
             }
         }
     }
     foreach ($loadedModules as $module) {
         if ($linkInfo = $module->getReportsLinkInfo()) {
             $options[] = array('group' => 1, 'text' => $linkInfo['title'], 'image' => eF_getRelativeModuleImagePath($linkInfo['image']), 'href' => $linkInfo['link']);
         }
     }
     $smarty->assign("T_STATISTICS_OPTIONS", $options);
 } else {
     if ($_GET['option'] == 'user') {
         require_once "statistics/users_stats.php";
     } else {
         if ($_GET['option'] == 'lesson') {
             require_once "statistics/lessons_stats.php";
         } else {
             if ($_GET['option'] == 'course') {
                 require_once "statistics/courses_stats.php";
             } else {
                 if ($_GET['option'] == 'test') {
                     require_once "statistics/tests_stats.php";