/** * prepare display */ /** * Display */ $out = ''; /** * Information edit for create or edit a category */ switch ($view) { case DISP_ANALYSE: $out .= claro_html_tool_title(array('mainTitle' => 'ANALYSE RESULT', 'subTitle' => 'Tree Structure ')) . claro_html_msg_list($analyseTreeResultMsg, 1) . $dgDataAnalyseResult->render() . ($errorCounter ? claro_html_button($_SERVER['PHP_SELF'] . '?cmd=repairTree', 'Repair', 'Run repair task on the tree ? ') : '') . claro_html_tool_title('Course ownance') . $dgCourseOwnanceCheck->render(); break; case DISP_REPAIR_RESULT: $out .= claro_html_tool_title(array('mainTitle' => 'REPAIR RESULT', 'subTitle' => 'Tree Structure ')) . claro_html_msg_list($repairResultMsg, 1) . claro_html_button($_SERVER['PHP_SELF'] . '?cmd=', 'Analyse'); break; default: $out .= '<div>' . __LINE__ . ': $view = <pre>' . var_export($view, 1) . '</PRE></div>'; } $claroline->display->body->appendContent($out); echo $claroline->display->render(); /** * Return course list which have an unexisting category as parent * * @author Christophe Gesché <*****@*****.**> * @since 1.8 * * @return array('Course code'=>string, 'Unknow faculty'=>string) */ function checkCourseOwnance()
$out .= '<br />' . "\n" . get_lang('An email has been sent to help you remember your username and password.'); } $out .= '</p>' . "\n"; if (claro_is_allowed_to_create_course()) { $out .= '<p>' . get_lang('You can now create your course') . '</p>' . "\n"; } else { $out .= '<p>' . get_lang('You can now select, in the list, the courses you want to access') . '</p>' . "\n"; } $out .= '<form action="../../index.php?cidReset=1" >' . '<input type="submit" name="next" value="' . get_lang('Next') . '" />' . "\n" . '</form>' . "\n"; } elseif (DISP_REGISTRATION_AGREEMENT == $display) { if (trim($agreementText) != '') { $out .= '<div class="info">' . $agreementText . '</div>'; } $out .= '<br />' . '<form action="' . $_SERVER['PHP_SELF'] . '" >' . '<input type="hidden" name="cmd" value="agree" />' . "\n" . '<input type="submit" name="next" value="' . get_lang('Ok') . '" /> ' . "\n" . claro_html_button(get_conf('urlAppend') . '/index.php', get_lang('Cancel')) . '</form>' . "\n"; } elseif (DISP_REGISTRATION_NOT_ALLOWED == $display) { $out .= claro_html_msg_list(array(array('info' => get_lang('Subscription not allowed')))); $out .= '<br />' . '<form action="' . get_conf('rootWeb', '/') . '" >' . '<input type="submit" name="next" value="' . get_lang('Ok') . '" />' . "\n" . '</form>' . "\n"; } elseif (DISP_REGISTRATION_FORM == $display) { // If registration failed display error message if (count($messageList) > 0) { $dialogBox = new DialogBox(); $dialogBox->error(implode('<br />', $messageList)); $out .= $dialogBox->render(); } if (trim($subscriptionText) != '') { $out .= '<div class="info subscribe">' . $subscriptionText . '</div>'; } $out .= user_html_form(); } $claroline->display->body->appendContent($out); echo $claroline->display->render();
$coursesToCheck = false; } if ($disp_form) { $course_list = fetchtCourseList(); if (is_array($course_list)) { $coursesToCheck_list['** ' . get_lang('All') . ' ** !!! ' . get_lang('high resources')] = ' all '; foreach ($course_list as $courseSel) { $coursesToCheck_list[$courseSel['officialCode']] = $courseSel['sysCode']; } } } $msg['info'][] = get_lang('Course Repository') . ' : ' . get_path('coursesRepositorySys'); $msg['info'][] = get_lang('Mysql Repository') . ' : ' . (get_conf('mysqlRepositorySys', false) ? get_conf('mysqlRepositorySys') : '!!! ' . get_lang('Missing')); //OUTPUT $out = ''; $out .= claro_html_tool_title($nameTools) . claro_html_msg_list($msg); if ($disp_form) { $out .= '<ul>'; if ($disp_claro) { $out .= '<li>' . 'Claroline : ' . sprintf('%01.2f', disk_usage(get_path('clarolineRepositorySys'), '', 'm')) . ' ' . $byteUnits[2] . '</li>'; } if ($disp_allcrs) { $diskUsage = sprintf('%01.2f', disk_usage(get_path('coursesRepositorySys'), get_path('mysqlRepositorySys'), 'm')) . ' ' . $byteUnits[2]; $out .= '<li>' . get_lang('Courses : %disk_usage (perhaps with other directories)', array('%disk_usage' => $diskUsage)) . '</li>'; } $out .= '</ul> <hr /> <form method="post" action="' . $_SERVER['PHP_SELF'] . '"> <input type="checkbox" id="disp_claro" name="disp_claro" value="true" /> <label for="disp_claro"> ' . get_lang('size of claroline scripts') . ' </label> <br />
/** * PREPARE DISPLAY */ ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb')); $contactUidList = claro_get_uid_of_platform_contact(); $requestUidList = claro_get_uid_of_request_admin(); $notifiedUidList = claro_get_uid_of_system_notification_recipient(); foreach ($platformAdminUidList as $k => $platformAdminUid) { $userData = user_get_properties($platformAdminUid); $userDataGrid[$k]['id'] = $userData['user_id']; $userDataGrid[$k]['name'] = $userData['lastname']; $userDataGrid[$k]['firstname'] = $userData['firstname']; $userDataGrid[$k]['email'] = $userData['email']; $userDataGrid[$k]['authSource'] = $userData['authSource']; //$userDataGrid[$k]['contact_switch'] = '<input name="contactList[]" type="checkbox" value="' . $platformAdminUid . '" ' . ((bool) in_array($platformAdminUid,$contactUidList) ? 'checked="checked" />' : '>'); $userDataGrid[$k]['request_switch'] = '<input name="requestList[]" type="checkbox" value="' . $platformAdminUid . '" ' . ((bool) in_array($platformAdminUid, $requestUidList) ? 'checked="checked" /> ' : '> '); $userDataGrid[$k]['notification_switch'] = '<input name="notifiedList[]" type="checkbox" value="' . $platformAdminUid . '" ' . ((bool) in_array($platformAdminUid, $notifiedUidList) ? 'checked="checked" /> ' : '> '); } $adminDataGrid = new claro_datagrid($userDataGrid); $adminDataGrid->set_idLineType('none'); $adminDataGrid->set_colHead('name'); $adminDataGrid->set_colTitleList(array('user id' => get_lang('User id'), 'name' => get_lang('Last name'), 'firstname' => get_lang('First name'), 'email' => get_lang('Email'), 'authSource' => get_lang('Authentication source'), 'request_switch' => get_lang('Request'), 'notification_switch' => get_lang('Notify'))); $adminDataGrid->set_colAttributeList(array('request_switch' => array('align' => 'left'), 'notification_switch' => array('align' => 'left'), 'authSource' => array('align' => 'center'))); /** * DISPLAY */ $out = ''; // Display tool title $out .= claro_html_tool_title($nameTools) . claro_html_msg_list($messageList) . '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . "\n" . '<input type="hidden" name="cmd" value="setRecipient" />' . "\n" . $adminDataGrid->render() . '<input type="submit" value="' . get_lang('Ok') . '" /> ' . "\n" . claro_html_button($_SERVER['PHP_SELF'], get_lang('Cancel')) . "\n" . '</form>' . "\n"; $claroline->display->body->appendContent($out); echo $claroline->display->render();
claro_sql_query($sql); $msgList['info'][] = get_lang("%moduleName has been added as module", array('%moduleName' => $exercise['title'])) . '<br />' . "\n"; } else { // check if this is this LP that used this exercise as a module $sql = "SELECT COUNT(*)\n FROM `" . $TABLELEARNPATHMODULE . "` AS LPM,\n `" . $TABLEMODULE . "` AS M,\n `" . $TABLEASSET . "` AS A\n WHERE M.`module_id` = LPM.`module_id`\n AND M.`startAsset_id` = A.`asset_id`\n AND A.`path` = " . (int) $exercise['id'] . "\n AND LPM.`learnPath_id` = " . (int) $_SESSION['path_id']; $num = claro_sql_query_get_single_value($sql); if ($num == 0) { // determine the default order of this Learning path $sql = "SELECT MAX(`rank`)\n FROM `" . $TABLELEARNPATHMODULE . "`"; $orderMax = claro_sql_query_get_single_value($sql); $order = $orderMax + 1; // finally : insert in learning path $sql = "INSERT INTO `" . $TABLELEARNPATHMODULE . "`\n (`learnPath_id`, `module_id`, `specificComment`, `rank`, `lock`)\n VALUES (" . (int) $_SESSION['path_id'] . ", " . (int) $existingModule['module_id'] . ",'" . claro_sql_escape(get_block('blockDefaultModuleAddedComment')) . "', " . $order . ", 'OPEN')"; $query = claro_sql_query($sql); $msgList['info'][] = get_lang("%moduleName has been added as module", array('%moduleName' => $exercise['title'])) . '<br />' . "\n"; } else { $msgList['info'][] = get_lang("%moduleName is already used as a module in this learning path", array('%moduleName' => $exercise['title'])) . '<br />' . "\n"; } } } } //end while //STEP ONE : display form to add an exercise $out .= claro_html_msg_list($msgList); $out .= display_my_exercises($dialogBox); //STEP TWO : display learning path content $out .= claro_html_tool_title(get_lang('Learning path content')); // display list of modules used by this learning path $out .= display_path_content(); $claroline->display->body->appendContent($out); echo $claroline->display->render();
} if ($displayMode != "viewContentList") { claro_set_display_mode_available(false); } $skypeName = get_user_property($userIdViewed, 'skype'); if ($skypeName) { $skypeStatus = '<a href="skype:' . $skypeName . '?call">' . "\n" . '<img src="http://mystatus.skype.com/smallclassic/' . $skypeName . '" style="border: none;" width="100" height="15" alt="" />' . "\n" . '</a>'; } else { $skypeStatus = '<em>' . get_lang('None') . '</em>'; } ////////////////////////////// // OUTPUT ////////////////////////////// $out = ''; $out .= claro_html_tool_title($nameTools) . '<p>' . "\n" . '<small>' . "\n" . '<a href="' . claro_htmlspecialchars(Url::Contextualize(get_module_entry_url('CLUSR'))) . '">' . '<< ' . get_lang('Back to user list') . '</a>' . "\n" . '</small>' . "\n" . '</p>' . "\n" . claro_html_msg_list($messageList); $userData = user_get_properties($userIdViewed); $picturePath = user_get_picture_path($userData); if ($picturePath && file_exists($picturePath)) { $pictureUrl = user_get_picture_url($userData); } else { $pictureUrl = get_icon_url('nopicture'); } $out .= '<div id="rightSidebar"><img src="' . $pictureUrl . '" alt="' . get_lang('avatar') . '" /></div>'; if ($displayMode == "viewDefEdit") { /* CATEGORIES DEFINITIONS : EDIT */ $out .= '<form method="post" action="' . claro_htmlspecialchars($_SERVER['PHP_SELF'] . '?uInfo=' . $userIdViewed) . '">' . "\n" . claro_form_relay_context() . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . "\n" . '<input type="hidden" name="id" value="' . $catToEdit['id'] . '" />' . "\n" . '<table>' . "\n" . '<tr>' . "\n" . '<td>' . "\n" . '<label for="title" >' . get_lang('Heading') . '</label> :' . "\n" . '</td>' . "\n" . '<td>' . "\n" . '<input type="text" name="title" id="title" size="80" maxlength="80" value ="' . claro_htmlspecialchars($catToEdit['title']) . '" />' . "\n" . '</td>' . "\n" . '</tr>' . "\n" . '<tr>' . "\n" . '<td>' . "\n" . '<label for="comment" >' . get_lang('Comment') . '</label> :' . "\n" . '</td>' . "\n" . '<td>' . "\n" . '<textarea name="comment" id="comment" cols="60" rows="3" >' . $catToEdit['comment'] . '</textarea>' . "\n" . '</td>' . "\n" . '</tr>' . "\n" . '<tr>' . "\n" . '<td nowrap="nowrap">' . "\n" . '<label for="nbline" >' . get_lang('Line Number') . '</label> :' . "\n" . '' . "\n" . '</td>' . "\n" . '<td>' . "\n" . '<select name="nbline" id="nbline">' . "\n"; if ($catToEdit['nbline'] && $catToEdit['nbline'] != 1) { $out .= '<option value="' . $catToEdit['nbline'] . '" selected>' . $catToEdit['nbline'] . ' ' . get_lang('line(s)') . '</option>' . "\n" . '<option>---</option>' . "\n"; } sort($descSizeToPrupose);
} $subtitle = get_lang('Preview : %textZone', array('%textZone' => $textZoneList[$fileId]['desc'])); $display = DISP_VIEW_FILE; } } } // DISPLAY $nameTools = get_lang('Edit text zones'); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb')); $noQUERY_STRING = true; $out = ''; //display titles $titles = array('mainTitle' => $nameTools); if (isset($subtitle)) { $titles['subTitle'] = $subtitle; } $out .= claro_html_tool_title($titles) . claro_html_msg_list($controlMsg, 1); if ($display == DISP_EDIT_FILE) { $out .= '<h4>' . basename($textZoneList[$fileId]['filename']) . '</h4>' . '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . "\n" . '<input type="hidden" name="file" value="' . claro_htmlspecialchars($fileId) . '" />' . "\n" . '<input type="hidden" name="cmd" value="exEdit" />' . "\n" . claro_html_textarea_editor('textContent', $textContent) . '<p>' . "\n" . '<input type="submit" class="claroButton" value="' . get_lang('Ok') . '" /> ' . claro_html_button($_SERVER['PHP_SELF'], get_lang('Cancel')) . '</p>' . "\n" . '</form>' . "\n"; } elseif ($display == DISP_VIEW_FILE) { $out .= '<br />' . '<h4>' . basename($textZoneList[$fileId]['filename']) . '</h4>' . $textContent . '<br />'; } if ($display == DISP_FILE_LIST || $display == DISP_EDIT_FILE || $display == DISP_VIEW_FILE) { $out .= '<p>' . get_lang('Here you can modify the content of the text zones displayed on the platform home page.') . '<br />' . get_lang('See below the files you can edit from this tool.') . '</p>' . "\n" . '<table cellspacing="2" cellpadding="2" border="0" class="claroTable emphaseLine">' . "\n" . '<thead>' . '<tr>' . "\n" . '<th>' . get_lang('Description') . '</th>' . "\n" . '<th>' . get_lang('Edit') . '</th>' . "\n" . '<th>' . get_lang('Preview') . '</th>' . "\n" . '</tr>' . "\n" . '</thead>' . "\n"; foreach ($textZoneList as $idFile => $textZone) { $out .= '<tr>' . "\n" . '<td >' . (array_key_exists('desc', $textZone) ? $textZone['desc'] : '') . '</td>' . "\n" . '<td align="center">' . "\n" . '<a href="' . $_SERVER['PHP_SELF'] . '?cmd=rqEdit&file=' . $idFile . '">' . '<img src="' . get_icon_url('edit') . '" alt="' . get_lang('Edit') . '" />' . "\n" . '</a>' . "\n" . '</td>' . "\n" . '<td align="center">' . "\n" . '<a href="' . $_SERVER['PHP_SELF'] . '?cmd=exView&file=' . $idFile . '">' . '<img src="' . get_icon_url('preview') . '" alt="' . get_lang('Preview') . '" />' . "\n" . '</a>' . "\n" . '</td>' . "\n" . '</tr>' . "\n"; } $out .= '</table>' . "\n" . '<br />' . "\n"; } $claroline->display->body->appendContent($out); echo $claroline->display->render();
/** * Get (and not display !) the debug banner html code * @return string */ function claro_disp_debug_banner() { require_once dirname(__FILE__) . '/backlog.class.php'; $html = ''; $claroMsgList = getClaroMessageList(); if (is_array($claroMsgList) && count($claroMsgList) > 0) { $claroMsgCount = 0; $html .= '<div class="debugBar">' . "\n" . get_lang('Debug') . "\n"; $html .= get_lang('Messages') . ' : '; foreach ($claroMsgList as $bloc => $msgList) { $html .= Backlog_Reporter::report($bloc . ' : ' . count($msgList), claro_html_msg_list($msgList), '+', true); $claroMsgCount += count($msgList); $html .= ' | '; } $html .= get_lang('%nb message(s)', array('%nb' => $claroMsgCount)); $html .= '<div class="spacer"></div>' . "\n\n" . '</div>' . "\n" . '<!-- end of debugBanner -->' . "\n\n"; } return $html; }