Esempio n. 1
0
 public function render()
 {
     if ($this->hidden) {
         return '<!-- footer hidden -->' . "\n";
     }
     $currentCourse = claro_get_current_course_data();
     if (claro_is_in_a_course()) {
         $courseManagerOutput = '<div id="courseManager">' . get_lang('Manager(s) for %course_code', array('%course_code' => $currentCourse['officialCode'])) . ' : ';
         $currentCourseTitular = empty($currentCourse['titular']) ? get_lang('Course manager') : $currentCourse['titular'];
         if (empty($currentCourse['email'])) {
             $courseManagerOutput .= '<a href="' . get_module_url('CLUSR') . '/user.php">' . $currentCourseTitular . '</a>';
         } else {
             $courseManagerOutput .= '<a href="mailto:' . $currentCourse['email'] . '?body=' . $currentCourse['officialCode'] . '&amp;subject=[' . rawurlencode(get_conf('siteName')) . ']' . '">' . $currentCourseTitular . '</a>';
         }
         $courseManagerOutput .= '</div>';
         $this->assign('courseManager', $courseManagerOutput);
     } else {
         $this->assign('courseManager', '');
     }
     $platformManagerOutput = '<div id="platformManager">' . get_lang('Administrator for %site_name', array('%site_name' => get_conf('siteName'))) . ' : ' . '<a href="mailto:' . get_conf('administrator_email') . '?subject=[' . rawurlencode(get_conf('siteName')) . ']' . '">' . get_conf('administrator_name') . '</a>';
     if (get_conf('administrator_phone') != '') {
         $platformManagerOutput .= '<br />' . "\n" . get_lang('Phone : %phone_number', array('%phone_number' => get_conf('administrator_phone')));
     }
     $platformManagerOutput .= '</div>';
     $this->assign('platformManager', $platformManagerOutput);
     $poweredByOutput = '<span class="poweredBy">' . get_lang('Powered by') . ' <a href="http://www.claroline.net" target="_blank">Claroline</a> ' . '&copy; 2001 - 2013' . '</span>';
     $this->assign('poweredBy', $poweredByOutput);
     return parent::render();
 }
Esempio n. 2
0
    public function renderContent()
    {
        $output = '';
        $course = claro_get_current_course_data();
        $course['db'] = $course['dbName'];
        $toolId = get_tool_id_from_module_label('CLANN');
        if (is_module_installed_in_course('CLANN', claro_get_current_course_id()) && is_tool_activated_in_course($toolId, claro_get_current_course_id()) && claro_is_tool_visible($toolId, claro_get_current_course_id())) {
            $announcementList = announcement_get_course_item_list_portlet($course);
            // Manage announcement's datas
            if ($announcementList) {
                $output .= '<dl id="portletAnnouncements">' . "\n";
                $i = 0;
                foreach ($announcementList as $announcementItem) {
                    // Generate announcement URL
                    $announcementItem['url'] = get_path('url') . '/claroline/announcements/announcements.php?cidReq=' . $course['sysCode'];
                    // Generate announcement title and content
                    $announcementItem['title'] = trim(strip_tags($announcementItem['title']));
                    if ($announcementItem['title'] == '') {
                        $announcementItem['title'] = substr($announcementItem['title'], 0, 60) . (strlen($announcementItem['title']) > 60 ? ' (...)' : '');
                    }
                    $announcementItem['content'] = trim(strip_tags($announcementItem['content']));
                    if ($announcementItem['content'] == '') {
                        $announcementItem['content'] = substr($announcementItem['content'], 0, 60) . (strlen($announcementItem['content']) > 60 ? ' (...)' : '');
                    }
                    // Don't display hidden and expired elements
                    $isVisible = (bool) ($announcementItem['visibility'] == 'SHOW') ? 1 : 0;
                    $isOffDeadline = (bool) (isset($announcementItem['visibleFrom']) && strtotime($announcementItem['visibleFrom']) > time() || isset($announcementItem['visibleUntil']) && time() >= strtotime($announcementItem['visibleUntil'])) ? 1 : 0;
                    // Prepare the render
                    $displayChar = 250;
                    if (strlen($announcementItem['content']) > $displayChar) {
                        $content = substr($announcementItem['content'], 0, $displayChar) . '... <a href="' . claro_htmlspecialchars(Url::Contextualize($announcementItem['url'])) . '">' . '<b>' . get_lang('Read more &raquo;') . '</b></a>';
                    } else {
                        $content = $announcementItem['content'];
                    }
                    if ($isVisible && !$isOffDeadline) {
                        $output .= '<dt>' . "\n" . '<h2> ' . '<a href="' . $announcementItem['url'] . '#item' . $announcementItem['id'] . '">' . (!empty($announcementItem['title']) ? $announcementItem['title'] : get_lang('No title')) . '</a></h2>' . "\n" . '</dt>' . "\n" . '<dd' . ($i == count($announcementList) - 1 ? ' class="last"' : '') . '>' . "\n" . $content . "\n" . (claro_is_allowed_to_edit() ? '<div class="manageTools"><a
                                        href="' . claro_htmlspecialchars(Url::Contextualize(get_module_url('CLANN') . '/announcements.php?cmd=rqEdit&id=' . $announcementItem['id'])) . '"
                                        title="' . get_lang('Edit this item') . '">
                                        <img src="' . get_icon_url('edit') . '" alt="' . get_lang('Edit') . '" />
                                    </a>

                                    <a
                                        href="' . claro_htmlspecialchars(Url::Contextualize(get_module_url('CLANN') . '/announcements.php?cmd=exDelete&id=' . $announcementItem['id'])) . '"
                                        title="' . get_lang('Delete this item') . '">
                                        <img src="' . get_icon_url('delete') . '" alt="' . get_lang('Delete') . '" />
                                    </a></div>' : '') . '</dd>' . "\n";
                    }
                    $i++;
                }
                $output .= '</dl>';
            } else {
                $output .= "\n" . '<dl>' . "\n" . '<dt></dt>' . "\n" . '<dd class="last">' . ' ' . get_lang('No announcement') . "\n" . '</dd>' . "\n" . '</dl>' . "\n\n";
            }
        }
        return $output;
    }
Esempio n. 3
0
 public function render()
 {
     $out = '';
     if (!claro_is_user_authenticated()) {
         if (get_conf('claro_displayLocalAuthForm', true) == true) {
             $out .= $this->renderLoginLink();
         }
     } elseif (!claro_is_platform_admin() && (claro_is_in_a_course() && !claro_is_course_member()) && claro_get_current_course_data('registrationAllowed')) {
         if (claro_is_current_user_enrolment_pending()) {
             $out .= '<img src="' . get_icon_url('warning') . '" alt="off" /> ' . '<b>' . get_lang('Enrolment pending') . '</b>';
         } else {
             $out .= $this->renderRegistrationLink();
         }
     } elseif (claro_is_display_mode_available()) {
         $out .= $this->renderViewModeSwitch();
     }
     return $out;
 }
Esempio n. 4
0
/*
if(isset ($_GET['path_id']) && $_GET['path_id'] != '')
    $_SESSION['path_id'] = $_GET['path_id'];

if(isset ($_GET['viewModule_id']) && $_GET['viewModule_id'] != '')
    $_SESSION['module_id'] = $_GET['viewModule_id'];
*/
$nameTools = get_lang('Learning path');
if (!isset($titlePage)) {
    $titlePage = '';
}
if (!empty($nameTools)) {
    $titlePage .= $nameTools . ' - ';
}
if (claro_get_current_course_data('officialCode') != '') {
    $titlePage .= claro_get_current_course_data('officialCode') . ' - ';
}
$titlePage .= get_conf('siteName');
// set charset as claro_header should do but we cannot include it here
header('Content-Type: text/html; charset=' . get_locale('charset'));
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
   "http://www.w3.org/TR/html4/frameset.dtd">
<html>

    <head>
        <title><?php 
echo $titlePage;
?>
</title>
    </head>
Esempio n. 5
0
 /**
  * Render the HTML page header
  * @return  string
  */
 public function render()
 {
     $this->_globalVarsCompat();
     $this->addInlineJavascript(JavascriptLanguage::getInstance()->buildJavascript());
     $titlePage = '';
     if (empty($this->_toolName) && !empty($this->_nameTools)) {
         $titlePage .= $this->_nameTools . ' - ';
     } elseif (!empty($this->_toolName)) {
         $titlePage .= $this->_toolName . ' - ';
     }
     if (claro_is_in_a_course() && claro_get_current_course_data('officialCode') != '') {
         $titlePage .= claro_get_current_course_data('officialCode') . ' - ';
     }
     $titlePage .= get_conf('siteName');
     $this->assign('pageTitle', $titlePage);
     if (true === get_conf('warnSessionLost', true) && claro_get_current_user_id()) {
         $this->assign('warnSessionLost', "function claro_session_loss_countdown(sessionLifeTime){\n    var chrono = setTimeout('claro_warn_of_session_loss()', sessionLifeTime * 1000);\n}\n\nfunction claro_warn_of_session_loss() {\n    alert('" . clean_str_for_javascript(get_lang('WARNING ! You have just lost your session on the server.') . "\n" . get_lang('Copy any text you are currently writing and paste it outside the browser')) . "');\n}\n");
     } else {
         $this->assign('warnSessionLost', '');
     }
     $htmlXtraHeaders = '';
     if (!empty($this->_htmlXtraHeaders)) {
         $htmlXtraHeaders .= implode("\n", $this->_htmlXtraHeaders);
     }
     $this->assign('htmlScriptDefinedHeaders', $htmlXtraHeaders);
     return parent::render() . "\n";
 }
Esempio n. 6
0
/*
 * Init some other vars
 */
// Command list
$cmdList = array();
$cmdList[] = array('img' => 'delete', 'name' => get_lang('Delete all course statistics'), 'url' => claro_htmlspecialchars(Url::Contextualize('delete_course_stats.php')));
/*
 * Output
 */
CssLoader::getInstance()->load('tracking', 'screen');
JavascriptLoader::getInstance()->load('tracking');
// initialize output
$claroline->setDisplayType(Claroline::PAGE);
$nameTools = get_lang('Statistics');
$html = '';
$html .= claro_html_tool_title(array('mainTitle' => $nameTools, 'subTitle' => get_lang('Statistics of course : %courseCode', array('%courseCode' => claro_get_current_course_data('officialCode')))), null, $cmdList);
/*
 * Prepare rendering :
 * Load and loop through available tracking renderers
 * Order of renderers blocks is arranged using "first found, first display" in the registry
 * Modify the registry to change the load order if required
 */
// get all renderers by using registry
$trackingRendererRegistry = TrackingRendererRegistry::getInstance(claro_get_current_course_id());
// here we need course tracking renderers
$courseTrackingRendererList = $trackingRendererRegistry->getCourseRendererList();
foreach ($courseTrackingRendererList as $ctr) {
    $renderer = new $ctr(claro_get_current_course_id());
    $html .= $renderer->render();
}
/*
Esempio n. 7
0
$tlabelReq = 'CLWRK';
require '../inc/claro_init_global.inc.php';
if (!claro_is_in_a_course() || !claro_is_course_allowed()) {
    claro_disp_auth_form(true);
}
require_once './lib/assignment.class.php';
require_once get_path('incRepositorySys') . '/lib/pager.lib.php';
require_once get_path('incRepositorySys') . '/lib/fileUpload.lib.php';
require_once get_path('incRepositorySys') . '/lib/fileDisplay.lib.php';
// need format_url function
require_once get_path('incRepositorySys') . '/lib/fileManage.lib.php';
// need claro_delete_file
$tbl_cdb_names = claro_sql_get_course_tbl();
$tbl_wrk_assignment = $tbl_cdb_names['wrk_assignment'];
$tbl_wrk_submission = $tbl_cdb_names['wrk_submission'];
$currentCoursePath = claro_get_current_course_data('path');
// 'step' of pager
$assignmentsPerPage = get_conf('assignmentsPerPage', 20);
// use viewMode
claro_set_display_mode_available(TRUE);
/*============================================================================
                     BASIC VARIABLES DEFINITION
  =============================================================================*/
$currentCourseRepositorySys = get_path('coursesRepositorySys') . $currentCoursePath . '/';
$currentCourseRepositoryWeb = get_path('coursesRepositoryWeb') . $currentCoursePath . '/';
$fileAllowedSize = get_conf('max_file_size_per_works');
//file size in bytes
// use with strip_tags function when strip_tags is used to check if a text is empty
// but a 'text' with only an image don't have to be considered as empty
$allowedTags = '<img>';
// initialise dialog box to an empty string, all dialog will be concat to it
Esempio n. 8
0
}
if (!claro_is_platform_admin()) {
    $courseStatus = claro_get_current_course_data('status');
    if ($courseStatus == 'trash' || $courseStatus == 'disable') {
        Claroline::getDisplay()->body->hideCourseTitleAndTools();
        claro_die(get_lang('This course is not available anymore, please contact the platform administrator.'));
    }
}
// post kernel access check
if (claro_is_in_a_course()) {
    if (!(basename(php_self()) == 'courses.php' && isset($_REQUEST['cmd']) && $_REQUEST['cmd'] == 'exReg')) {
        if (!claro_is_course_allowed()) {
            if (!claro_is_user_authenticated()) {
                claro_disp_auth_form();
            } else {
                if (claro_get_current_course_data('access') == 'private' && !claro_is_course_member()) {
                    claro_die(get_lang("You have to be enroled to this course to access its contents") . '<br /><a href="' . claro_htmlspecialchars(get_path('clarolineRepositoryWeb') . 'auth/courses.php?cmd=exReg&course=' . claro_get_current_course_id()) . '">' . claro_html_icon('enroll') . ' ' . '<b>' . get_lang('Enrolment') . '</b>' . '</a>');
                } else {
                    claro_die(get_lang("Not allowed!"));
                }
            }
        }
    }
}
// group_space.php?registration=1&selfReg=1
if (claro_is_in_a_group()) {
    if (!(basename(php_self()) == 'group_space.php' && isset($_REQUEST['registration']) && $_REQUEST['registration'] == '1')) {
        if (!claro_is_group_allowed()) {
            if (!claro_is_user_authenticated()) {
                claro_disp_auth_form();
            } else {
Esempio n. 9
0
 /**
  * @param   string $template name of the template
  */
 public function __construct($template)
 {
     $template = secure_file_path($template);
     $customTemplatePath = get_path('rootSys') . '/platform/templates/' . $template;
     $defaultTemplatePath = get_path('includePath') . '/templates/' . $template;
     if (file_exists($customTemplatePath)) {
         parent::__construct($customTemplatePath);
     } elseif (file_exists($defaultTemplatePath)) {
         parent::__construct($defaultTemplatePath);
     } else {
         throw new Exception("Template not found {$template} " . "at custom location {$customTemplatePath} " . "or default location {$defaultTemplatePath} !");
     }
     if (claro_is_in_a_course()) {
         $this->course = claro_get_current_course_data();
         require_once dirname(__FILE__) . '/../claroCourse.class.php';
         $this->courseObject = new ClaroCourse();
         $this->courseObject->load(claro_get_current_course_id());
         // Fetch related courses
         $this->relatedCourses = $this->courseObject->getRelatedCourses();
         // $this->relatedUserCourses = $this->courseObject->getRelatedUserCourses(claro_get_current_user_id());
         if (claro_is_in_a_group()) {
             $this->group = claro_get_current_group_data();
         }
     }
     if (claro_is_user_authenticated()) {
         $this->user = claro_get_current_user_data();
     }
 }
Esempio n. 10
0
$out = '';
// tables names
$tbl_cdb_names = claro_sql_get_course_tbl();
$tbl_lp_learnPath = $tbl_cdb_names['lp_learnPath'];
$tbl_lp_rel_learnPath_module = $tbl_cdb_names['lp_rel_learnPath_module'];
$tbl_lp_user_module_progress = $tbl_cdb_names['lp_user_module_progress'];
$tbl_lp_module = $tbl_cdb_names['lp_module'];
$tbl_lp_asset = $tbl_cdb_names['lp_asset'];
$TABLELEARNPATH = $tbl_lp_learnPath;
$TABLELEARNPATHMODULE = $tbl_lp_rel_learnPath_module;
$TABLEUSERMODULEPROGRESS = $tbl_lp_user_module_progress;
$TABLEMODULE = $tbl_lp_module;
$TABLEASSET = $tbl_lp_asset;
$dbTable = $tbl_cdb_names['document'];
// document browser vars
$TABLEDOCUMENT = claro_get_current_course_data('dbNameGlu') . 'document';
$courseDir = claro_get_course_path() . '/document';
$moduleDir = claro_get_course_path() . '/modules';
$baseWorkDir = get_path('coursesRepositorySys') . $courseDir;
$moduleWorkDir = get_path('coursesRepositorySys') . $moduleDir;
//lib of this tool
require_once get_path('incRepositorySys') . "/lib/learnPath.lib.inc.php";
require_once get_path('incRepositorySys') . "/lib/fileDisplay.lib.php";
require_once get_path('incRepositorySys') . "/lib/fileManage.lib.php";
// $_SESSION
if (!isset($_SESSION['path_id'])) {
    claro_redirect(Url::Contextualize("./learningPath.php"));
}
/*======================================
       CLAROLINE MAIN
 ======================================*/
Esempio n. 11
0
/**
 * Load configuration file for a module
 * @param   $module module label (default null for current module)
 */
function load_module_config($moduleLabel = null)
{
    if (!$moduleLabel) {
        $moduleLabel = get_current_module_label();
    }
    // load main config file
    $mainConfigFile = claro_get_conf_repository() . $moduleLabel . '.conf.php';
    if (file_exists($mainConfigFile)) {
        include $mainConfigFile;
    }
    // check if config overwritten in course and load config file
    if (claro_is_in_a_course()) {
        $courseConfigFile = get_conf('coursesRepositorySys') . claro_get_current_course_data('path') . '/conf/' . $moduleLabel . '.conf.php';
        if (file_exists($courseConfigFile)) {
            include $courseConfigFile;
        }
    }
}
Esempio n. 12
0
 }
 $submission->setAssignmentId($assignmentId);
 $submission->setUserId($posterId);
 $submission->setTitle($wrkForm['wrkTitle']);
 $submission->setAuthor($wrkForm['wrkAuthors']);
 $submission->setVisibility($assignment->getDefaultSubmissionVisibility());
 $submission->setSubmittedText($wrkForm['wrkTxt']);
 $submission->setSubmittedFilename($wrkForm['filename']);
 if ($assignment->getAssignmentType() == 'GROUP' && isset($wrkForm['wrkGroup'])) {
     $submission->setGroupId($wrkForm['wrkGroup']);
 }
 $submission->save();
 $dialogBox->success(get_lang('Work added'));
 // notify eventmanager that a new submission has been posted
 $eventNotifier->notifyCourseEvent("work_submission_posted", claro_get_current_course_id(), claro_get_current_tool_id(), $assignmentId, '0', '0');
 if (get_conf('mail_notification') && (claro_get_current_course_data('notify_submissions') || get_conf('automatic_mail_notification', false))) {
     // get teacher(s) mail
     $sql = "SELECT `U`.`user_id`\n                        FROM `" . $tbl_rel_cours_user . "` AS `CU`,`" . $tbl_user . "` AS `U`\n                        WHERE `CU`.`user_id` = `U`.`user_id`\n                        AND `CU`.`code_cours` = '" . claro_get_current_course_id() . "'\n                        AND `CU`.`isCourseManager` = 1";
     $userIdList = claro_sql_query_fetch_all_rows($sql);
     if (is_array($userIdList) && !empty($userIdList)) {
         require_once dirname(__FILE__) . '/../messaging/lib/message/platformmessagetosend.lib.php';
         require_once dirname(__FILE__) . '/../messaging/lib/recipient/userlistrecipient.lib.php';
         // subject
         $subject = $_user['firstName'] . ' ' . $_user['lastName'] . ' : ' . get_lang('New submission posted in assignment tool.');
         if ($assignment->getAssignmentType() == 'GROUP' && isset($_REQUEST['wrkGroup'])) {
             $authId = $wrkForm['wrkGroup'];
         } else {
             $authId = $_REQUEST['authId'];
         }
         $url = Url::Contextualize(get_path('rootWeb') . 'claroline/work/user_work.php?authId=' . $authId . '&assigId=' . $assignmentId);
         // email content
Esempio n. 13
0
 private function autoPrepend()
 {
     if (empty($this->currentNode) && array_key_exists('nameTools', $GLOBALS)) {
         $name = $GLOBALS['nameTools'];
         if (array_key_exists('noPHP_SELF', $GLOBALS) && $GLOBALS['noPHP_SELF']) {
             $url = null;
         } elseif (array_key_exists('noQUERY_STRING', $GLOBALS) && $GLOBALS['noQUERY_STRING']) {
             $url = $_SERVER['PHP_SELF'];
         } else {
             if (!array_key_exists('noQUERY_STRING', $_SERVER)) {
                 $url = $_SERVER['PHP_SELF'];
             } else {
                 $url = $_SERVER['PHP_SELF'] . '?' . claro_htmlspecialchars(strip_tags($_SERVER['QUERY_STRING']));
             }
         }
         $url = claro_htmlspecialchars(Url::Contextualize($url));
         $this->setCurrentNode(new BreadCrumbsNode($name, $url));
     }
     if (claro_is_in_a_group()) {
         $this->prependNode(new BreadCrumbsNode(claro_get_current_group_data('name'), claro_htmlspecialchars(get_module_url('CLGRP') . '/group_space.php?cidReq=' . claro_htmlspecialchars(claro_get_current_course_id()) . '&gidReq=' . (int) claro_get_current_group_id())));
         $this->prependNode(new BreadCrumbsNode(get_lang('Groups'), claro_htmlspecialchars(get_module_url('CLGRP') . '/index.php?cidReq=' . claro_htmlspecialchars(claro_get_current_course_id()))));
     }
     if (claro_is_in_a_course()) {
         $this->prependNode(new BreadCrumbsNode(claro_get_current_course_data('officialCode'), claro_htmlspecialchars(get_path('clarolineRepositoryWeb') . 'course/index.php?cid=' . claro_get_current_course_id())));
     }
     $this->prependNode(new BreadCrumbsNode(get_conf('siteName'), claro_htmlspecialchars(get_path('url') . '/index.php'), get_icon_url('home')));
 }
Esempio n. 14
0
                         break;
                     default:
                         $dialogBox->error(get_lang('Error!! you cannot unregister a course manager'));
                 }
             }
         }
     }
 }
 // end if cmd == unregister
 // Export users list
 if ($cmd == 'export' && $can_export_user_list) {
     require_once dirname(__FILE__) . '/lib/export.lib.php';
     // contruction of XML flow
     $csv = export_user_list(claro_get_current_course_id());
     if (!empty($csv)) {
         $courseData = claro_get_current_course_data();
         claro_send_stream($csv, $courseData['officialCode'] . '_userlist.csv');
         exit;
     }
 }
 // Validate a user (if this option is enable for the course)
 if ($cmd == 'validation' && $req['user_id']) {
     $courseUserPrivileges = new CourseUserPrivileges(claro_get_current_course_id(), $req['user_id']);
     $courseUserPrivileges->load();
     $courseObject = new Claro_Course(claro_get_current_course_id());
     $courseObject->load();
     $validation = new UserCourseEnrolmentValidation($courseObject, $courseUserPrivileges);
     $validationChange = isset($_REQUEST['validation']) ? $_REQUEST['validation'] : null;
     if ($validation->isModifiable()) {
         if ('grant' == $validationChange && $validation->isPending()) {
             if ($validation->grant()) {
Esempio n. 15
0
                 $dialogBox->error($failure);
             } else {
                 $dialogBox->error(get_lang('Impossible to add the announcement'));
             }
             $emailOption = 0;
         }
     } else {
         $dialogBox->error(get_lang('The "visible from" date can\'t exceed the "visible until" date'));
         $emailOption = 0;
     }
 }
 // end elseif cmd == exCreate
 // Email sending (optionnal)
 if (1 == $emailOption) {
     $courseSender = claro_get_current_user_data('firstName') . ' ' . claro_get_current_user_data('lastName');
     $courseOfficialCode = claro_get_current_course_data('officialCode');
     $subject = '';
     if (!empty($title)) {
         $subject .= $title;
     } else {
         $subject .= get_lang('Message from your lecturer');
     }
     $msgContent = $content;
     // Enclosed resource
     $body = $msgContent . "\n" . "\n" . ResourceLinker::renderLinkList($currentLocator, true);
     require_once dirname(__FILE__) . '/../messaging/lib/message/messagetosend.lib.php';
     require_once dirname(__FILE__) . '/../messaging/lib/recipient/courserecipient.lib.php';
     $courseRecipient = new CourseRecipient(claro_get_current_course_id());
     $message = new MessageToSend(claro_get_current_user_id(), $subject, $body);
     $message->setCourse(claro_get_current_course_id());
     $message->setTools('CLANN');
Esempio n. 16
0
if (!$is_allowedToEdit) {
    claro_die(get_lang('Not allowed'));
}
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Learning path'), Url::Contextualize(get_module_url('CLLNP') . '/learningPathAdmin.php'));
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Learning path list'), Url::Contextualize(get_module_url('CLLNP') . '/learningPathList.php'));
$nameTools = get_lang('Add a module of this course');
// Command list
$cmdList = array();
$cmdList[] = array('img' => 'back', 'name' => get_lang('Back to learning path administration'), 'url' => claro_htmlspecialchars(Url::Contextualize('learningPathAdmin.php')));
$out = '';
// tables names
$TABLELEARNPATH = claro_get_current_course_data('dbNameGlu') . "lp_learnPath";
$TABLEMODULE = claro_get_current_course_data('dbNameGlu') . "lp_module";
$TABLELEARNPATHMODULE = claro_get_current_course_data('dbNameGlu') . "lp_rel_learnPath_module";
$TABLEASSET = claro_get_current_course_data('dbNameGlu') . "lp_asset";
$TABLEUSERMODULEPROGRESS = claro_get_current_course_data('dbNameGlu') . "lp_user_module_progress";
//lib of this tool
require_once get_path('incRepositorySys') . "/lib/learnPath.lib.inc.php";
//lib of document tool
require_once get_path('incRepositorySys') . "/lib/fileDisplay.lib.php";
// $_SESSION
if (!isset($_SESSION['path_id'])) {
    die("<center> Not allowed ! (path_id not set :@ )</center>");
}
/*======================================
       CLAROLINE MAIN
 ======================================*/
// FUNCTION NEEDED TO BUILD THE QUERY TO SELECT THE MODULES THAT MUST BE AVAILABLE
// 1)  We select first the modules that must not be displayed because
// as they are already in this learning path
function buildRequestModules()
Esempio n. 17
0
/**
 * Return the breadcrumb to display in the header
 *
 * @global string  $nameTools
 * @global array   $interbredcrump
 * @global boolean $noPHP_SELF
 * @global boolean $noQUERY_STRING
 *
 * @return string html content
 */
function claro_html_breadcrumb()
{
    // dirty global to keep value (waiting a refactoring)
    global $nameTools, $interbredcrump, $noPHP_SELF, $noQUERY_STRING;
    /******************************************************************************
       BREADCRUMB LINE
       ******************************************************************************/
    $htmlBC = '';
    if (claro_is_in_a_course() || isset($nameTools) || isset($interbredcrump) && is_array($interbredcrump)) {
        $htmlBC .= '<div id="breadcrumbLine">' . "\n\n" . '<hr />' . "\n";
        $breadcrumbUrlList = array();
        $breadcrumbNameList = array();
        $breadcrumbUrlList[] = get_path('url') . '/index.php';
        $breadcrumbNameList[] = get_conf('siteName');
        if (claro_is_in_a_course()) {
            $breadcrumbUrlList[] = get_path('clarolineRepositoryWeb') . 'course/index.php?cid=' . claro_htmlspecialchars(claro_get_current_course_id());
            $breadcrumbNameList[] = claro_get_current_course_data('officialCode');
        }
        if (claro_is_in_a_group()) {
            $breadcrumbUrlList[] = get_module_url('CLGRP') . '/index.php?cidReq=' . claro_htmlspecialchars(claro_get_current_course_id());
            $breadcrumbNameList[] = get_lang('Groups');
            $breadcrumbUrlList[] = get_module_url('CLGRP') . '/group_space.php?cidReq=' . claro_htmlspecialchars(claro_get_current_course_id()) . '&gidReq=' . (int) claro_get_current_group_id();
            $breadcrumbNameList[] = claro_get_current_group_data('name');
        }
        if (isset($interbredcrump) && is_array($interbredcrump)) {
            while (list(, $bredcrumpStep) = each($interbredcrump)) {
                $breadcrumbUrlList[] = $bredcrumpStep['url'];
                $breadcrumbNameList[] = $bredcrumpStep['name'];
            }
        }
        if (isset($nameTools)) {
            $breadcrumbNameList[] = $nameTools;
            if (isset($noPHP_SELF) && $noPHP_SELF) {
                $breadcrumbUrlList[] = null;
            } elseif (isset($noQUERY_STRING) && $noQUERY_STRING) {
                $breadcrumbUrlList[] = $_SERVER['PHP_SELF'];
            } else {
                // set Query string to empty if not exists
                if (!isset($_SERVER['QUERY_STRING'])) {
                    $_SERVER['QUERY_STRING'] = '';
                }
                $breadcrumbUrlList[] = $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'];
            }
        }
        $htmlBC .= claro_html_breadcrumbtrail($breadcrumbNameList, $breadcrumbUrlList, ' &gt; ', get_icon_url('home'));
        if (!claro_is_user_authenticated()) {
            $htmlBC .= "\n" . '<div id="toolViewOption" style="padding-right:10px">' . '<a href="' . get_path('clarolineRepositoryWeb') . 'auth/login.php' . '?sourceUrl=' . urlencode(base64_encode((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])) . '" target="_top">' . get_lang('Login') . '</a>' . '</div>' . "\n";
        } elseif (claro_is_in_a_course() && !claro_is_course_member() && claro_get_current_course_data('registrationAllowed') && !claro_is_platform_admin()) {
            $htmlBC .= '<div id="toolViewOption">' . '<a href="' . get_path('clarolineRepositoryWeb') . 'auth/courses.php?cmd=exReg&course=' . claro_get_current_course_id() . '">' . '<img src="' . get_icon_url('enroll') . '" alt="" /> ' . '<b>' . get_lang('Enrolment') . '</b>' . '</a>' . '</div>' . "\n";
        } elseif (claro_is_display_mode_available()) {
            $htmlBC .= "\n" . '<div id="toolViewOption">' . "\n";
            if (isset($_REQUEST['View mode'])) {
                $htmlBC .= claro_html_tool_view_option($_REQUEST['View mode']);
            } else {
                $htmlBC .= claro_html_tool_view_option();
            }
            if (claro_is_platform_admin() && !claro_is_course_member()) {
                $htmlBC .= ' | <a href="' . get_path('clarolineRepositoryWeb') . 'auth/courses.php?cmd=exReg&course=' . claro_get_current_course_id() . '">';
                $htmlBC .= '<img src="' . get_icon_url('enroll') . '" alt="" /> ';
                $htmlBC .= '<b>' . get_lang('Enrolment') . '</b>';
                $htmlBC .= '</a>';
            }
            $htmlBC .= "\n" . '</div>' . "\n";
        }
        $htmlBC .= '<div class="spacer"></div>' . "\n" . '<hr />' . "\n" . '</div>' . "\n";
    } else {
        // $htmlBC .= '<div style="height:1em"></div>';
    }
    return $htmlBC;
}
Esempio n. 18
0
 /**
  * Prepare the campus banner
  */
 private function _prepareCampusBanner()
 {
     $campus = array();
     $campus['siteName'] = get_conf('siteLogo') != '' ? '<img src="' . get_conf('siteLogo') . '" alt="' . get_conf('siteName') . '"  />' : get_conf('siteName');
     $institutionNameOutput = '';
     $bannerInstitutionName = get_conf('institutionLogo') != '' ? '<img src="' . get_conf('institutionLogo') . '" alt="' . get_conf('institution_name') . '" />' : get_conf('institution_name');
     if (!empty($bannerInstitutionName)) {
         if (get_conf('institution_url') != '') {
             $institutionNameOutput .= '<a href="' . get_conf('institution_url') . '" target="_top">' . $bannerInstitutionName . '</a>';
         } else {
             $institutionNameOutput .= $bannerInstitutionName;
         }
     }
     /* --- External Link Section --- */
     if (claro_get_current_course_data('extLinkName') != '') {
         $institutionNameOutput .= get_conf('institution_url') != '' ? ' / ' : ' ';
         if (claro_get_current_course_data('extLinkUrl') != '') {
             $institutionNameOutput .= '<a href="' . claro_get_current_course_data('extLinkUrl') . '" target="_top">' . claro_get_current_course_data('extLinkName') . '</a>';
         } else {
             $institutionNameOutput .= claro_get_current_course_data('extLinkName');
         }
     }
     $campus['institution'] = $institutionNameOutput;
     $this->assign('campus', $campus);
 }
Esempio n. 19
0
<?php

// $Id: rqmkhtml.php 14314 2012-11-07 09:09:19Z zefredz $
require '../inc/claro_init_global.inc.php';
require_once get_path('incRepositorySys') . '/lib/fileManage.lib.php';
$_course = claro_get_current_course_data();
function is_parent_path($parentPath, $childPath)
{
    // convert the path for operating system harmonize
    $parentPath = realpath($parentPath);
    $childPath = realpath($parentPath . $childPath);
    if ($childPath !== false) {
        // verify if the file exists and if the file is under parent path
        return preg_match('|^' . preg_quote($parentPath) . '|', $childPath);
    } else {
        return false;
    }
}
if (claro_is_in_a_group() && claro_is_group_allowed()) {
    $_group = claro_get_current_group_data();
    $courseDir = claro_get_course_path() . '/group/' . claro_get_current_group_data('directory');
    ClaroBreadCrumbs::getInstance()->prepend(get_lang('Documents and Links'), 'document.php');
    ClaroBreadCrumbs::getInstance()->prepend(get_lang('Groups'), '../group/group.php');
} else {
    $courseDir = claro_get_course_path() . '/document';
    ClaroBreadCrumbs::getInstance()->prepend(get_lang('Documents and Links'), 'document.php');
}
$noPHP_SELF = true;
$baseWorkDir = get_path('coursesRepositorySys') . $courseDir;
if (!empty($_REQUEST['cmd'])) {
    $cmd = $_REQUEST['cmd'];
Esempio n. 20
0
             claro_mkdir($questionObj->questionDirSys, CLARO_FILE_PERMISSIONS);
         }
         if ($fp = @fopen($questionObj->questionDirSys . "/question_" . $quRank . ".xml", 'w')) {
             fwrite($fp, $xml);
             fclose($fp);
         } else {
             // interrupt process
         }
         // list of dirs to add in archive
         $filePathList[] = $questionObj->questionDirSys;
     }
     if (!empty($filePathList)) {
         require_once get_path('incRepositorySys') . '/lib/thirdparty/pclzip/pclzip.lib.php';
         // build and send the zip
         // TODO use $courseDir ?
         if (sendZip($exercise->title, $filePathList, get_conf('coursesRepositorySys') . claro_get_current_course_data('path') . '/exercise/')) {
             exit;
         } else {
             $dialogBox->error(get_lang("Unable to create zip file"));
         }
     }
 }
 //-- export pdf
 if ($cmd == 'printPreview' && $exId) {
     require_once './lib/question.class.php';
     $exercise = new Exercise();
     $exercise->load($exId);
     if ($exercise->getShuffle() && isset($_REQUEST['shuffle']) && $_REQUEST['shuffle'] == 1) {
         $questionList = $exercise->getRandomQuestionList();
     } else {
         $questionList = $exercise->getQuestionList();