private function loadModuleManager($cidReq = null)
 {
     $toolList = claro_get_main_course_tool_list();
     foreach ($toolList as $tool) {
         if (!is_null($tool['label'])) {
             $file = get_module_path($tool['label']) . '/connector/trackingManager.cnr.php';
             if (file_exists($file)) {
                 require_once $file;
                 if (claro_debug_mode()) {
                     pushClaroMessage('Tracking : ' . $tool['label'] . ' tracking managers loaded', 'debug');
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
    // here because it's a right and not a state
} else {
    $_profileId = !empty($_SESSION['_profileId']) ? $_SESSION['_profileId'] : false;
    $is_courseMember = !empty($_SESSION['is_courseMember']) ? $_SESSION['is_courseMember'] : false;
    $is_courseAdmin = !empty($_SESSION['is_courseAdmin']) ? $_SESSION['is_courseAdmin'] : false;
    $is_courseAllowed = !empty($_SESSION['is_courseAllowed']) ? $_SESSION['is_courseAllowed'] : false;
    $is_courseTutor = !empty($_SESSION['is_courseTutor']) ? $_SESSION['is_courseTutor'] : false;
    // not used !?!
    $_courseUser = !empty($_SESSION['_courseUser']) ? $_SESSION['_courseUser'] : null;
}
// Installed module in course if available in platform and not in course
if ($_cid && is_array($_course) && isset($_course['dbNameGlu']) && !empty($_course['dbNameGlu']) && trim($_course['dbNameGlu'])) {
    // 0. load course configuration to avoid creating uneeded examples
    require claro_get_conf_repository() . 'course_main.conf.php';
    // 1. get tool list from main db
    $mainCourseToolList = claro_get_main_course_tool_list();
    // 2. get list af already installed tools from course
    $tbl_mdb_names = claro_sql_get_main_tbl();
    $tbl_tool = $tbl_mdb_names['tool'];
    $sql = " SELECT pct.id                    AS toolId       ,\n                  pct.claro_label           AS label\n\n            FROM `" . $_course['dbNameGlu'] . "tool_list` AS ctl\n            INNER JOIN `" . $tbl_tool . "` AS pct\n            ON `ctl`.`tool_id` = `pct`.`id`\n            WHERE ctl.installed = 'true'";
    $courseToolList = claro_sql_query_fetch_all_rows($sql);
    $tmp = array();
    foreach ($courseToolList as $thisCourseTool) {
        $tmp[$thisCourseTool['label']] = $thisCourseTool['toolId'];
    }
    // 3. compare the two lists and register and install/activate missing tool if necessary
    $listOfToolsToAdd = array();
    foreach ($mainCourseToolList as $thisToolId => $thisMainCourseTool) {
        if (!array_key_exists($thisMainCourseTool['label'], $tmp)) {
            $listOfToolsToAdd[$thisMainCourseTool['label']] = $thisToolId;
        }
 /**
  * Search in all activated modules
  *
  * @param string $cidReq
  */
 private function loadModuleRenderer()
 {
     if (!is_null($this->courseId)) {
         $profileId = claro_get_current_user_profile_id_in_course($this->courseId);
         $toolList = claro_get_course_tool_list($this->courseId, $profileId);
     } else {
         $toolList = claro_get_main_course_tool_list();
     }
     foreach ($toolList as $tool) {
         if (!is_null($tool['label'])) {
             $file = get_module_path($tool['label']) . '/connector/tracking.cnr.php';
             if (file_exists($file)) {
                 require_once $file;
                 if (claro_debug_mode()) {
                     pushClaroMessage('Tracking : ' . $tool['label'] . ' tracking renderers loaded', 'debug');
                 }
             }
         }
     }
 }
Exemplo n.º 4
0
                $out .= '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exVisible&amp;tool_id=' . $linkId . '&amp;section=' . claro_htmlspecialchars($currentSection))) . '" >' . '<img src="' . get_icon_url('invisible') . '" alt="' . get_lang('Invisible') . '" />' . '</a>';
            }
            $out .= '</td>' . "\n";
            $out .= '<td align="center">' . '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=rqEdit&amp;externalToolId=' . $linkId . '&amp;section=' . claro_htmlspecialchars($currentSection))) . '">' . '<img src="' . get_icon_url('edit') . '" alt="' . get_lang('Modify') . '" />' . '</a></td>' . "\n";
            $out .= '<td align="center">' . '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exDelete&amp;externalToolId=' . $linkId . '&amp;section=' . claro_htmlspecialchars($currentSection))) . '"' . ' onclick="return confirmation(\'' . clean_str_for_javascript($link['name']) . '\');">' . '<img src="' . get_icon_url('delete') . '" alt="' . get_lang('Delete') . '" />' . '</a></td>' . "\n";
            $out .= '</tr>' . "\n";
        }
    } else {
        $out .= '<tr><td colspan="4">' . get_lang('Empty') . '</td></tr>' . "\n";
    }
    $out .= '</tbody>' . "\n" . '</table>' . "\n\n" . '</blockquote>' . "\n";
} elseif ($currentSection == 'toolList') {
    $out .= '<p>' . get_lang('Add or remove tools from your course') . '</p>' . "\n";
    $activeCourseToolList = module_get_course_tool_list(claro_get_current_course_id(), true, true);
    $inactiveCourseToolList = module_get_course_tool_list(claro_get_current_course_id(), true, false);
    $platformCourseToolList = claro_get_main_course_tool_list(true);
    $completeInactiveToolList = array();
    foreach ($inactiveCourseToolList as $inactiveCourseTool) {
        $completeInactiveToolList[] = array('id' => $inactiveCourseTool['id'], 'tool_id' => $inactiveCourseTool['tool_id'], 'label' => $inactiveCourseTool['label'], 'icon' => get_module_url($inactiveCourseTool['label']) . '/' . $inactiveCourseTool['icon'], 'access_manager' => $inactiveCourseTool['access_manager']);
    }
    foreach ($platformCourseToolList as $toolId => $platformCourseTool) {
        $found = false;
        foreach ($activeCourseToolList as $activeCourse) {
            if ($activeCourse['label'] == $platformCourseTool['label']) {
                $found = true;
                break;
            }
        }
        $alreadyThere = false;
        foreach ($inactiveCourseToolList as $inactiveCourseTool) {
            if ($inactiveCourseTool['label'] == $platformCourseTool['label']) {