/** * Install database for the given module in the given course * @param string moduleLabel * @param string courseId * @return boolean * @author Frederic Minne <*****@*****.**> */ function install_module_in_course($moduleLabel, $courseId) { install_module_database_in_course($moduleLabel, $courseId); install_module_script_in_course($moduleLabel, $courseId); }
*/ /*================================================================= Initialize =================================================================*/ $tlabelReq = 'CLFRM'; require '../inc/claro_init_global.inc.php'; if (!claro_is_in_a_course() || !claro_is_course_allowed()) { claro_disp_auth_form(true); } claro_set_display_mode_available(true); /** * * Try to create table (update script error for forum notifications)* * */ install_module_database_in_course('CLFRM', claro_get_current_course_id()); /*----------------------------------------------------------------- Library -----------------------------------------------------------------*/ include_once get_path('incRepositorySys') . '/lib/forum.lib.php'; // variables $allowed = TRUE; $error = FALSE; $dialogBox = new DialogBox(); $pagetype = 'newtopic'; /*================================================================= Main Section =================================================================*/ if (isset($_REQUEST['forum'])) { $forum_id = (int) $_REQUEST['forum']; } else {
} if ($tlabelReq !== 'CLWRK' && $tlabelReq !== 'CLGRP' && !claro_is_module_allowed() && !(isset($_SESSION['inPathMode']) && $_SESSION['inPathMode'] && ($tlabelReq == 'CLQWZ' || $tlabelReq == 'CLDOC'))) { if (!claro_is_user_authenticated()) { claro_disp_auth_form(true); } else { claro_die(get_lang('Not allowed')); } } if ($tlabelReq !== 'CLGRP' && $tlabelReq !== 'CLWRK' && claro_is_in_a_group() && (!claro_is_group_allowed() || !claro_is_allowed_to_edit() && !is_tool_activated_in_groups($_cid, $tlabelReq))) { claro_die(get_lang('Not allowed')); } /*---------------------------------------------------------------------- Install module ----------------------------------------------------------------------*/ if (claro_is_in_a_course() && !is_module_installed_in_course($tlabelReq, claro_get_current_course_id())) { install_module_database_in_course($tlabelReq, claro_get_current_course_id()); } } /*---------------------------------------------------------------------- Context from URL ----------------------------------------------------------------------*/ // if page is called from another tool ... (from LP for an example) if (isset($_REQUEST['calledFrom'])) { $calledFrom = $_REQUEST['calledFrom']; } else { $calledFrom = false; } // if page is embedded hide banner and footer if (isset($_REQUEST['embedded']) && $_REQUEST['embedded'] == 'true') { // old school method $GLOBALS['hide_banner'] = true;