$sqlSelectType = " CT.`id` AS courseToolId, " . "\n" . " CT.`icon` AS icon," . "\n" . " CT.`script_url` AS script_url," . "\n" . " CT.`def_rank` AS rank," . "\n" . " CT.`def_access` AS visibility," . "\n"; $sqlJoinType = " LEFT JOIN `" . $tbl_course_tool . "` AS CT " . "\n" . " ON CT.`claro_label`= M.label " . "\n"; $orderType = "ORDER BY `def_rank` \n"; break; default: $sqlSelectType = ""; $sqlJoinType = ""; $orderType = ""; } $sql = "\n SELECT M.`id` AS `id`,\n M.`label` AS `label`,\n M.`name` AS `name`,\n M.`activation` AS `activation`,\n " . $sqlSelectType . "\n M.`type` AS `type`\n FROM `" . $tbl_module . "` AS M\n " . $sqlJoinType . "\n WHERE M.`type` = '" . claro_sql_escape($typeReq) . "'\n GROUP BY `id`\n " . $orderType . "\n "; //pager creation $myPager = new claro_sql_pager($sql, $offset, $modulePerPage); $moduleList = $myPager->get_result_list(); //find docks in which the modules do appear. $module_dock = array(); $dockList = get_dock_list($typeReq); // will be usefull to display correctly the dock names foreach ($moduleList as $module) { $module_dock[$module['id']] = array(); $module_dock[$module['id']] = get_module_dock_list($module['id']); if (!file_exists(get_module_path($module['label']))) { $dialogBox->warning(get_lang('<b>Warning : </b>') . get_lang('There is a module installed in DB : <b><i>%module_name</i></b> for which there is no folder on the server.', array('%module_name' => $module['label']))); } } //do a check of modules to see if there is anyhting to install $modules_found = check_module_repositories(); foreach ($modules_found['folder'] as $module_folder) { $urlTryInstall = $_SERVER['PHP_SELF'] . '?cmd=exLocalInstall&moduleDir=' . rawurlencode($module_folder); $urlDelete = $_SERVER['PHP_SELF'] . '?cmd=exLocalRemove&moduleDir=' . rawurlencode($module_folder); $dialogBox->warning(get_lang('There is a folder called <b><i>%module_name</i></b> for which there is no module installed.', array('%module_name' => $module_folder)) . '<ul>' . "\n" . '<li>' . "\n" . '<a href="' . $urlTryInstall . '">' . get_lang('Install this module') . '</a>' . '</li>' . "\n" . '<li>' . "\n" . '<a href="' . $urlDelete . '">' . get_lang('Remove this module') . '</a>' . '</li>' . "\n" . '</ul>' . "\n"); }
if (!claro_is_user_authenticated()) { claro_disp_auth_form(); } if (!claro_is_platform_admin()) { claro_die(get_lang('Not allowed')); } //DECLARE NEEDED LIBRARIES require_once get_path('incRepositorySys') . '/lib/pager.lib.php'; require_once get_path('incRepositorySys') . '/lib/module/manage.lib.php'; //SQL table name $tbl_name = claro_sql_get_main_tbl(); $tbl_module = $tbl_name['module']; $tbl_dock = $tbl_name['dock']; $dialogBox = new DialogBox(); if (isset($_REQUEST['dock'])) { $dockList = get_dock_list('applet'); $dock = $_REQUEST['dock']; $dockName = isset($dockList[$dock]) ? $dockList[$dock] : $dock; $nameTools = get_lang('Dock') . ' : ' . $dockName; } else { $dock = null; $dialogBox->error(get_lang('No dock selected')); $nameTools = get_lang('Dock'); } ClaroBreadCrumbs::getInstance()->prepend(get_lang('Module list'), get_path('rootAdminWeb') . 'module/module_list.php'); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb')); //CONFIG and DEVMOD vars : $modulePerPage = get_conf('moduleDockPerPage', 10); //---------------------------------- // EXECUTE COMMAND //----------------------------------
require_once get_path('incRepositorySys') . '/lib/admin.lib.inc.php'; $undeactivable_tool_array = get_not_deactivable_tool_list(); $htmlHeadXtra[] = "<script type=\"text/javascript\">\nfunction confirmMakeVisible ()\n{\n if (confirm(\" " . clean_str_for_javascript(get_lang("Are you sure you want to make this module visible in all courses ?")) . "\"))\n {return true;}\n else\n {return false;}\n}\nfunction confirmMakeInVisible ()\n{\n if (confirm(\" " . clean_str_for_javascript(get_lang("Are you sure you want to make this module invisible in all courses ?")) . "\"))\n {return true;}\n else\n {return false;}\n}\n</script>"; //---------------------------------- // GET REQUEST VARIABLES //---------------------------------- $cmd = isset($_REQUEST['cmd']) ? $_REQUEST['cmd'] : null; $item = isset($_REQUEST['item']) ? $_REQUEST['item'] : 'GLOBAL'; $section_selected = isset($_REQUEST['section']) ? $_REQUEST['section'] : null; $moduleId = isset($_REQUEST['module_id']) ? (int) $_REQUEST['module_id'] : null; $module = get_module_info($moduleId); if (!$module) { claro_die("ERROR: INVALID MODULE ID!!!"); } language::load_module_translation($module['label']); $dockList = get_dock_list($module['type']); $nameTools = get_lang('Module settings'); $noPHP_SELF = true; // FIXME : BAD use of get_lang !!!!! ClaroBreadCrumbs::getInstance()->prepend(get_lang($module['module_name'])); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Module list'), get_path('rootAdminWeb') . 'module/module_list.php?typeReq=' . $module['type']); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb')); ClaroBreadCrumbs::getInstance()->setCurrent($nameTools); $dialogBox = new dialogBox(); //---------------------------------- // EXECUTE COMMAND //---------------------------------- switch ($cmd) { case 'activplatformadmin': if (allow_module_activation_by_course_manager($module['label'], false)) { $dialogBox->success(get_lang('Only PLATFORM_ADMIN can activate this module'));