Пример #1
0
    } else {
        return false;
    }
}
if (isset($_REQUEST['cmd'])) {
    $cmd = $_REQUEST['cmd'];
} else {
    $cmd = '';
}
/*=====================================================================
  Display Section
 =====================================================================*/
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb'));
$noQUERY_STRING = true;
if ($display == DISP_REGISTRATION_FORM) {
    $dialogBox->info('Cette opération synchronise les comptes utilistateurs Claroline avec le LDAP du LCS');
}
$out = '';
// Display title
$out .= claro_html_tool_title(array('mainTitle' => $nameTools)) . $dialogBox->render();
if ($display == DISP_REGISTRATION_SUCCEED) {
    //$out .= claro_html_list($newUserMenu);
} else {
    //  if registration failed display error message
    $out .= '<style>
  .message {background-color: #E6E6E6;
    color: #339933;font-size: 0.9 em;}
  </style>';
    $out .= 'La synchronisation : <br />
    <ul>
    <li> ajoute les &#233;l&#232;ves pr&#233;sents dans le ldap mais absents de la plateforme et les affecte &#224; leur classe : <span id="cr0" class="message"></span></li>
Пример #2
0
                $dialogBox->error(get_lang('This introduction\'s visibility can\'t be modified'));
            }
        }
    }
}
// Display
$cmdList = array();
if (claro_is_allowed_to_edit()) {
    $cmdList[] = array('img' => 'headline_new', 'name' => get_lang('New headline'), 'url' => claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=rqAdd')));
}
$cmdList[] = array('img' => 'coursehome', 'name' => get_lang('Back to course homepage'), 'url' => claro_htmlspecialchars(Url::Contextualize(get_path('rootWeb') . 'claroline/course/index.php?cid=' . claro_get_current_course_id())));
$toolIntroIterator = new ToolIntroductionIterator(claro_get_current_course_id());
$toolIntroductionList = '';
if (count($toolIntroIterator) > 0) {
    foreach ($toolIntroIterator as $toolIntro) {
        $toolIntroductionList .= $toolIntro->render();
    }
} else {
    // If there's no item, display the form to add one
    $toolIntro = new ToolIntro();
    $dialogBox->info(get_lang('There\'s no headline for this course right now.  Use the form below to add a new one.'));
    $toolIntroForm = empty($toolIntroForm) ? $toolIntro->renderForm() : $toolIntroForm;
}
Claroline::getDisplay()->body->appendContent(claro_html_tool_title(get_lang('Headlines'), null, $cmdList));
Claroline::getDisplay()->body->appendContent($dialogBox->render());
$output = '';
$output .= $toolIntroForm . $toolIntroductionList;
// Append output
Claroline::getDisplay()->body->appendContent($output);
// Render output
echo $claroline->display->render();
Пример #3
0
    $dialogBox = new DialogBox();
    $dialogBoxMsg = get_lang('All messages older than %date% have been deleted', array('%date%' => $date)) . '<br /><br />' . '<a href="admin.php">' . get_lang('Back') . '</a>';
    $dialogBox->success($dialogBoxMsg);
    $content .= '<br />' . $dialogBox->render();
}
// --------------- end older than
// ------------ platform message
if ($displayRemovePlatformMessageConfirmation) {
    $dialogBox = new DialogBox();
    $dialogBox->setBoxType('question');
    $dialogBox->question(get_lang('Are you sure to delete all platform messages?'));
    $dialogBox->warning(get_lang('There is no way to restore deleted messages.'));
    $dialogBox->info('<br /><br /><a href="' . $_SERVER['PHP_SELF'] . '?cmd=exPlatformMessage">' . get_lang('Yes') . '</a> | <a href="admin.php">' . get_lang('No') . '</a>');
    $content .= '<br />' . $dialogBox->render();
}
if ($displayRemovePlatformMessageValidated) {
    $dialogBoxMsg = get_lang('All platform messages have been deleted') . '<br /><br />' . '<a href="admin.php">' . get_lang('Back') . '</a>';
    $dialogBox = new DialogBox();
    $dialogBox->info($dialogBoxMsg);
    $content .= '<br />' . $dialogBox->render();
}
// ------------- end platform message
// ------------------- render ----------------------------
$claroline->display->banner->breadcrumbs->append(get_lang('Administration'), get_path('rootAdminWeb'));
$claroline->display->banner->breadcrumbs->append(get_lang('Internal messaging'), 'admin.php');
$claroline->display->banner->breadcrumbs->append(get_lang('Delete'), 'admin_delete.php?cmd=' . addslashes($_REQUEST['cmd']));
$title['mainTitle'] = get_lang('Internal messaging') . ' - ' . get_lang('Delete');
$title['subTitle'] = $subTitle;
$claroline->display->body->appendContent(claro_html_tool_title($title));
$claroline->display->body->appendContent($content);
echo $claroline->display->render();
Пример #4
0
                    $message->setCourse($_POST['courseRecipient']);
                } elseif ($_REQUEST['typeRecipient'] == 'all') {
                    $recipient = new AllUsersRecipient();
                    // breadcrump
                    $claroline->display->banner->breadcrumbs->append(get_lang('Administration'), get_path('rootAdminWeb'));
                } elseif ($_REQUEST['typeRecipient'] == 'group') {
                    $recipient = new GroupRecipient($_POST['groupRecipient'], $_POST['courseRecipient']);
                    $message->setCourse($_POST['courseRecipient']);
                    $message->setGroup($_POST['groupRecipient']);
                } else {
                    claro_die(get_lang('unknow recipient type'));
                }
                $recipient->sendMessage($message);
                $informationString = get_lang('Message sent') . '<br /><br />' . '<a href="messagebox.php?box=inbox">' . get_lang('Back to inbox') . '</a>';
                $dialogbox = new DialogBox();
                $dialogbox->info($informationString);
                if ($failure = claro_failure::get_last_failure()) {
                    $dialogbox->warning($failure);
                }
                $content .= $dialogbox->render();
            }
        }
    }
}
// ------------ Prepare display --------------------
if ($addForm) {
    $message = claro_html_sanitize_all($message);
    $content .= "<br/>";
    $content .= '<form method="post" action="sendmessage.php?cmd=exSendMessage' . claro_url_relay_context('&amp;') . '">' . "\n" . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . "\n" . claro_form_relay_context() . "\n" . '<input type="hidden" name="cmd" value="exSendMessage" />' . "\n" . '<input type="hidden" name="typeRecipient" value="' . $typeRecipient . '" />' . "\n" . '<input type="hidden" name="userRecipient" value="' . $userRecipient . '" />' . "\n" . '<input type="hidden" name="courseRecipient" value="' . $courseRecipient . '" />' . "\n" . '<input type="hidden" name="groupRecipient" value="' . $groupRecipient . '" />' . "\n" . '<input type="hidden" name="responseTo" value="' . $responseTo . '" />' . "\n" . '<label for="message_subject">' . get_lang('Subject') . ' : </label><br/><input type="text" id="message_subject" name="subject" value="' . claro_htmlspecialchars($subject) . '" maxlength="255" size="40" /><br/>' . "\n" . '<label for="message">' . get_lang('Message') . ' : </label><br/>' . claro_html_textarea_editor('message', $message) . '<br/><br/>' . "\n" . '<input type="submit" value="' . get_lang('Send') . '" name="send" />' . "\n" . '</form>' . "\n\n";
}
$claroline->display->body->appendContent(claro_html_tool_title(get_lang('Compose a message')));
Пример #5
0
                // TODO  display in a popup "To Print" with  content to give to user.
            }
        }
    } else {
        // User validate form return error messages
        if (is_array($messageList) && !empty($messageList)) {
            foreach ($messageList as $message) {
                $dialogBox->error($message);
            }
        }
        $error = true;
    }
}
/*=====================================================================
  Display Section
 =====================================================================*/
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb'));
$noQUERY_STRING = true;
if ($display == DISP_REGISTRATION_FORM) {
    $dialogBox->info(get_lang('New users will receive an e-mail with their username and password'));
}
$out = '';
// Display title
$out .= claro_html_tool_title(array('mainTitle' => $nameTools)) . $dialogBox->render();
if ($display == DISP_REGISTRATION_SUCCEED) {
    $out .= claro_html_list($newUserMenu);
} else {
    $out .= user_html_form();
}
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
Пример #6
0
            }
            $csvExporter = new CsvExporter(';', '"');
            $fileName = get_lang('files_stats') . '_' . claro_date('d-m-Y') . '.csv';
            $stream = $csvExporter->export($csvTab);
            claro_send_stream($stream, $fileName, 'text/csv');
        }
    } else {
        $dialogBox->warning(get_lang('Statistics in progress, please don\'t refresh until further instructions ! ') . '<br />' . get_lang('Course actually treated : ') . $course['title'] . '<br />' . get_lang(' Number of course treated : ') . count($stats));
        $claroline->display->body->appendContent($dialogBox->render());
        echo $claroline->display->render();
    }
} else {
    $dialogBox = new DialogBox();
    $dialogBox->warning(get_lang('Caution: building files\' statistics is a pretty heavy work.  It might take a while and a lot of resources, depending of the size of your campus.'));
    if (!empty($extensions)) {
        $dialogBox->info(get_lang('You\'ve chosen to isolate the following extensions: %types.  If you wish to modify these extensions, check the advanced platform settings', array('%types' => implode(', ', $extensions))));
    } else {
        $dialogBox->info(get_lang('You don\'t have chosen any extension to isolate.  If you wish to isolate extensions in your statistics, check the advanced platform settings'));
    }
    $template = new CoreTemplate('admin_files_stats.tpl.php');
    $template->assign('dialogBox', $dialogBox);
    $template->assign('extensions', $extensions);
    $template->assign('formAction', $_SERVER['PHP_SELF']);
    $template->assign('cancelUrl', get_path('rootAdminWeb'));
    $claroline->display->body->appendContent($template->render());
    echo $claroline->display->render();
}
/**
 * Convert a size (Bytes) to KiB/MiB/GiB/TiB
 * @param int $size
 * @return string
Пример #7
0
if (claro_is_allowed_to_edit() && $topicId) {
    $out .= '<div style="float: right;">' . "\n" . '<img src=' . get_icon_url('html') . '" alt="" /> <a href="' . claro_htmlspecialchars(Url::Contextualize('export.php?type=HTML&topic=' . $topicId)) . '" target="_blank">' . get_lang('Export to HTML') . '</a>' . "\n" . '<img src="' . get_icon_url('mime/pdf') . '" alt="" /> <a href="' . claro_htmlspecialchars(Url::Contextualize('export.php?type=PDF&topic=' . $topicId)) . '" target="_blank">' . get_lang('Export to PDF') . '</a>' . "\n" . '</div>';
}
if ($topicSettingList) {
    $out .= disp_forum_breadcrumb($pagetype, $forumSettingList['forum_id'], $forumSettingList['forum_name'], $topicSettingList['topic_id'], $topicSettingList['topic_title']);
} else {
    $out .= disp_forum_breadcrumb($pagetype, $forumSettingList['forum_id'], $forumSettingList['forum_name']);
}
if ('show' != $cmd) {
    if ('default' == $anonymityStatus) {
        $info = '<tr valign="top">' . "\n" . '<td>&nbsp;</td>' . '<td><strong>' . get_lang('Contributions to this forum are anonymous by default!<br/>') . get_lang('If you want to sign your post all the same, uncheck the checkbox above the "OK" button') . '</strong></td>' . '</tr>' . '<tr style="height:1px;"><td colspan="2">&nbsp;</td></tr>';
    } elseif ('allowed' == $anonymityStatus) {
        $info = '<tr valign="top">' . "\n" . '<td>&nbsp;</td>' . '<td><strong>' . get_lang('This forum allows anonymous contributions!<br/>') . get_lang('If you do not want to sign your post, check the checkbox above the "OK" button') . '</strong></td>' . '</tr>' . '<tr style="height:1px;"><td colspan="2">&nbsp;</td></tr>';
    }
    if (!empty($info)) {
        $dialogBox->info($info);
    }
}
$out .= $dialogBox->render();
//display edit form if any
if (isset($form)) {
    $formBox = new DialogBox();
    $formBox->form($form->render());
    $out .= $formBox->render() . '<hr />';
}
//display topic review if any
if ($topicSettingList) {
    // get post and use pager
    if (!$viewall) {
        $postLister = new postLister($topicId, $start, get_conf('posts_per_page'));
    } else {
Пример #8
0
        if (empty($subject)) {
            $subject .= get_lang('Message from your lecturer');
        }
        // content
        $body = $_REQUEST['content'];
        $message = new MessageToSend(claro_get_current_user_id(), $subject, $body);
        $message->setCourse(claro_get_current_course_id());
        $recipient = new UserListRecipient();
        $recipient->addUserIdList($userIdList);
        $recipient->sendMessage($message);
        $dialogBox = new DialogBox();
        $dialogBox->success(get_lang('Message sent'));
        if ($failure = claro_failure::get_last_failure()) {
            $dialogBox->warning($failure);
        }
        $dialogBox->info('<a href="' . $_SERVER['PHP_SELF'] . '">&lt;&lt;&nbsp;' . get_lang('Back') . '</a>');
        $content .= $dialogBox->render();
    }
    // end cmd exSendMessage
} else {
    /*
     * Get user    list of    this course
     */
    $singleUserList = claro_get_course_user_list(claro_get_current_course_id());
    $userList = array();
    if (is_array($singleUserList) && !empty($singleUserList)) {
        foreach ($singleUserList as $singleUser) {
            $userList[] = $singleUser;
        }
    }
    /*
Пример #9
0
            user_set_course_properties($userId, $courseCode, $properties);
        }
    } else {
        switch ($courseRegistration->getStatus()) {
            case Claro_CourseUserRegistration::STATUS_KEYVALIDATION_FAILED:
                $displayMode = DISPLAY_REGISTRATION_KEY_FORM;
                $dialogBox->error($courseRegistration->getErrorMessage());
                break;
            case Claro_CourseUserRegistration::STATUS_SYSTEM_ERROR:
                $displayMode = DISPLAY_MESSAGE_SCREEN;
                $dialogBox->error($courseRegistration->getErrorMessage());
                break;
            case Claro_CourseUserRegistration::STATUS_REGISTRATION_NOTAVAILABLE:
                $displayMode = DISPLAY_REGISTRATION_DISABLED_FORM;
                $dialogBox->error($courseRegistration->getErrorMessage());
                $dialogBox->info(get_lang('Please contact the course manager : %email', array('%email' => '<a href="mailto:' . $courseObj->email . '?body=' . $courseObj->officialCode . '&amp;subject=[' . rawurlencode(get_conf('siteName')) . ']' . '">' . claro_htmlspecialchars($courseObj->titular) . '</a>')));
                break;
            default:
                $displayMode = DISPLAY_MESSAGE_SCREEN;
                $dialogBox->warning($courseRegistration->getErrorMessage());
                break;
        }
    }
}
// end if ($cmd == 'exReg')
/*----------------------------------------------------------------------------
User course list to unregister
----------------------------------------------------------------------------*/
if ($cmd == 'rqUnreg') {
    $courseListView = CourseTreeNodeViewFactory::getUserCourseTreeView($userId);
    $unenrollUrl = Url::buildUrl($_SERVER['PHP_SELF'] . '?cmd=exUnreg', $urlParamList, null);
Пример #10
0
 }
 // Unregister user from course
 // (notice : it does not delete user from claroline main DB)
 if ('allStudent' == $req['user_id']) {
     // TODO : add a function to unenroll all users from a course
     $course = new Claro_Course(claro_get_current_course_id());
     $course->load();
     $claroCourseRegistration = new Claro_BatchCourseRegistration($course);
     $claroCourseRegistration->removeAllUsers($req['keepClasses']);
     $result = $claroCourseRegistration->getResult();
     if (!$result->hasError() || !$result->checkStatus(Claro_BatchRegistrationResult::STATUS_ERROR_DELETE_FAIL)) {
         $unregisterdUserCount = count($result->getDeletedUserList());
         if ($unregisterdUserCount) {
             Console::log("{$req['user_id']} ({$unregisterdUserCount}) removed by user " . claro_get_current_user_id(), 'COURSE_UNSUBSCRIBE');
         }
         $dialogBox->info(get_lang('%number student(s) unregistered from this course', array('%number' => $unregisterdUserCount)));
     } else {
         Console::error("Error while deleting all users from course " . claro_get_current_course_id() . " : " . var_export($result->getErrorLog(), true));
         $dialogBox->error(get_lang('An error occured') . ' : <ul><li>' . implode('</li><li>', $result->getErrorLog()) . '</li></ul>');
     }
 } elseif (0 < (int) $req['user_id']) {
     if ($forceUnenrolment) {
         $course = new Claro_Course(claro_get_current_course_id());
         $course->load();
         $userCourseRegistration = new Claro_CourseUserRegistration(AuthProfileManager::getUserAuthProfile($req['user_id']), $course);
         if (claro_is_platform_admin()) {
             $userCourseRegistration->forceUnregistrationOfManager();
         }
         if (!$userCourseRegistration->forceRemoveUser(false, array())) {
             $dialogBox->error(get_lang('The user cannot be removed from the course'));
         } else {
Пример #11
0
 //  Display results
 /*if( $exercise->getShuffle() && $exercise->getUseSameShuffle() && isset( $_SESSION['lastRandomQuestionList'] ) )
   {
       $out .= '<div style="font-weight: bold;">' . "\n"
       .   '<a href="exercise.php?exId=' . $exercise->getId() .'&cmd=exSaveQwz'.( $inLP ? '&calledFrom=CLLP&embedded=true' : '' ).'">' . get_lang('Save this questions list') . '</a>'
       .   '</div>'
       ;
   }*/
 if ($recordResults) {
     $dialogBoxResults = new DialogBox();
     $outDialogbox = '';
     if ($exercise->getTimeLimit() > 0) {
         $outDialogbox .= get_lang('Your time is %time', array('%time' => claro_html_duration($timeToCompleteExe))) . '<br />' . "\n";
     }
     $outDialogbox .= '<strong>' . get_lang('Your total score is %score', array('%score' => $totalResult . "/" . $totalGrade)) . '</strong>';
     $dialogBoxResults->info($outDialogbox);
     $out .= $dialogBoxResults->render();
 } else {
     $contentDialogBox = '';
     if ($exercise->getTimeLimit() > 0) {
         $contentDialogBox .= get_lang('Your time is %time', array('%time' => claro_html_duration($timeToCompleteExe))) . '<br />' . "\n";
     }
     $contentDialogBox .= get_lang('Time is over, results not submitted.');
     $dialogBox->error($contentDialogBox);
     $dialogBox->info('<a href="' . claro_htmlspecialchars(Url::Contextualize('./exercise.php')) . '">&lt;&lt; ' . get_lang('Back') . '</a>');
 }
 //-- question(s)
 if (!empty($questionList)) {
     $out .= "\n" . '<table width="100%" border="0" cellpadding="1" cellspacing="0" class="claroTable">' . "\n\n";
     // foreach question
     $questionIterator = 1;
Пример #12
0
    } else {
        return false;
    }
}
if (isset($_REQUEST['cmd'])) {
    $cmd = $_REQUEST['cmd'];
} else {
    $cmd = '';
}
/*=====================================================================
  Display Section
 =====================================================================*/
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb'));
$noQUERY_STRING = true;
if ($display == DISP_REGISTRATION_FORM) {
    $dialogBox->info('Cette initialisation ne doit &ecirc;tre faite qu\'en d&eacute;but d\'ann&eacute;e');
}
$out = '';
// Display title
$out .= claro_html_tool_title(array('mainTitle' => $nameTools)) . $dialogBox->render();
if ($display == DISP_REGISTRATION_SUCCEED) {
    //$out .= claro_html_list($newUserMenu);
} else {
    //  if registration failed display error message
    $out .= '<style>
  .message {background-color: #E6E6E6;
    color: #339933;font-size: 0.9 em;}
  </style>';
    $out .= 'L\'initialisation : <br />
    <ul>
    <li> supprime les classes existantes : <span id="cr0" class="message"></span></li>
Пример #13
0
             $doChange = false;
         }
     }
 } else {
     $dialogBox->error(get_lang('There is no category available !'));
     $doChange = false;
 }
 // Edit a category (don't move the category)
 $_REQUEST['nameCat'] = trim($_REQUEST['nameCat']);
 $_REQUEST['codeCat'] = trim($_REQUEST['codeCat']);
 if (!empty($_REQUEST['nameCat']) && !empty($_REQUEST['codeCat'])) {
     if (!isset($_REQUEST['fatherCat']) && $doChange) {
         $canHaveCoursesChild = $_REQUEST['canHaveCoursesChild'] == 1 ? 'TRUE' : 'FALSE';
         // If nothing is different
         if ($facultyEdit['name'] != $_REQUEST['nameCat'] && $facultyEdit['code'] != $_REQUEST['codeCat'] && $facultyEdit['canHaveCoursesChild'] != $canHaveCoursesChild) {
             $dialogBox->info(get_lang('No change applied.'));
         } else {
             // If the category can't have course child, look if they haven't already
             if ($canHaveCoursesChild == 'FALSE') {
                 $sql_SearchCourses = " SELECT count(cours_id) num" . " FROM `" . $tbl_course . "`" . " WHERE faculte = '" . claro_sql_escape($facultyEdit['code']) . "'";
                 $array = claro_sql_query_fetch_all($sql_SearchCourses);
                 if ($array[0]['num'] > 0) {
                     $dialogBox->error(get_lang('This category include some courses, you must delete or move them before'));
                     $canHaveCoursesChild = "TRUE";
                 } else {
                     $sql_ChangeInfoFaculty = " UPDATE `" . $tbl_course_node . "`\n                                                      SET name='" . claro_sql_escape($_REQUEST['nameCat']) . "',\n                                                          code='" . claro_sql_escape($_REQUEST['codeCat']) . "',\n                                                          canHaveCoursesChild='" . $canHaveCoursesChild . "'\n                                                      WHERE id='" . (int) $_REQUEST['id'] . "'";
                     claro_sql_query($sql_ChangeInfoFaculty);
                     $dialogBox->success(get_lang('Changes have been saved'));
                 }
             } else {
                 $sql_ChangeInfoFaculty = "SELECT id\n                                                FROM `" . $tbl_course_node . "`\n                                                WHERE code = '" . claro_sql_escape($_REQUEST["codeCat"]) . "'\n                                                AND id != '" . (int) $_REQUEST["id"] . "'";
Пример #14
0
if ($is_allowedToEdit) {
    /*--------------------------------------------------------------------
      MODIFY An ASSIGNMENT FEEDBACK
      --------------------------------------------------------------------*/
    /*-----------------------------------
      STEP 2 : check & query
      -------------------------------------*/
    // edit an assignment / form has been sent
    if ($cmd == 'exEditFeedback') {
        $assignment->setAutoFeedbackText($autoFeedbackText);
        $assignment->setAutoFeedbackFilename($autoFeedbackFilename);
        $assignment->setAutoFeedbackSubmitMethod($autoFeedbackSubmitMethod);
        // form data have been handled before this point if the form was sent
        if ($formCorrectlySent && $assignment->save()) {
            $dialogBox->success(get_lang('Feedback edited'));
            $dialogBox->info('<a href="' . claro_htmlspecialchars(Url::Contextualize('./work_list.php?assigId=' . $assignmentId)) . '">' . get_lang('Continue') . '</a>');
            $displayFeedbackForm = false;
            //report event to eventmanager "feedback_posted"
            $eventNotifier->notifyCourseEvent("work_feedback_posted", claro_get_current_course_id(), claro_get_current_tool_id(), $assignmentId, '0', '0');
        } else {
            $cmd = 'rqEditFeedback';
        }
    }
    /*-----------------------------------
      STEP 1 : display form
      -------------------------------------*/
    // edit assignment / display the form
    if ($cmd == 'rqEditFeedback') {
        require_once get_path('incRepositorySys') . '/lib/form.lib.php';
        // check if it was already sent
        if (!$isFeedbackSubmitted) {
Пример #15
0
 */
$sortUrlList = $myPager->get_sort_url_list($_SERVER['PHP_SELF']);
$courseDataGrid = new claro_datagrid($courseDataList);
$courseDataGrid->set_colTitleList(array('officialCode' => '<a href="' . $sortUrlList['officialCode'] . '">' . get_lang('Course code') . '</a>', 'intitule' => '<a href="' . $sortUrlList['intitule'] . '">' . get_lang('Course title') . '</a>', 'qty_cm' => get_lang('Course members'), 'cmdSetting' => get_lang('Course settings'), 'cmdDelete' => get_lang('Delete')));
$courseDataGrid->set_colAttributeList(array('qty_cm' => array('align' => 'right'), 'cmdSetting' => array('align' => 'center'), 'cmdDelete' => array('align' => 'center')));
$courseDataGrid->set_idLineType('none');
$courseDataGrid->set_colHead('officialCode');
$courseDataGrid->set_noRowMessage(get_lang('There is no course matching such criteria') . '<br />' . '<a href="advanced_course_search.php' . $addtoAdvanced . '">' . get_lang('Search again (advanced)') . '</a>');
// Command list
$cmdList = array();
$cmdList[] = array('img' => 'courseadd', 'name' => get_lang('Create course'), 'url' => '../course/create.php?adminContext=1');
// Display
$out = '';
$out .= claro_html_tool_title($nameTools, null, $cmdList);
if (!empty($isSearched)) {
    $dialogBox->info('<b>' . get_lang('Search on') . '</b> : <small>' . $isSearched . '</small>');
}
$out .= $dialogBox->render();
// DISPLAY : Search/filter panel
$out .= '<table width="100%">' . "\n\n" . '<tr>' . "\n" . '<td align="right"  valign="top">' . "\n\n" . '<form action="' . $_SERVER['PHP_SELF'] . '">' . "\n" . '<label for="search">' . get_lang('Make new search') . ' : </label>' . "\n" . '<input type="text" value="' . claro_htmlspecialchars($search) . '" name="search" id="search" />' . "\n" . '<input type="submit" value=" ' . get_lang('Ok') . ' " />' . "\n" . '<input type="hidden" name="newsearch" value="yes" />' . "\n" . '[<a class="claroCmd" href="advanced_course_search.php' . $addtoAdvanced . '">' . get_lang('Advanced') . '</a>]' . "\n" . '</form>' . "\n\n" . '</td>' . "\n" . '</tr>' . "\n\n" . '</table>' . "\n\n";
// DISPLAY : List of datas
$out .= $myPager->disp_pager_tool_bar($_SERVER['PHP_SELF']) . $courseDataGrid->render() . $myPager->disp_pager_tool_bar($_SERVER['PHP_SELF']);
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
/**
 * Prepares the sql request to select courses in database.
 *
 * @return string $sql
 */
function prepare_get_filtred_course_list()
{
Пример #16
0
        $manager = new $ctr(claro_get_current_course_id());
        $manager->deleteAll();
    }
    $dialogBox->success(get_lang('Course statistics are now empty'));
    Console::log("In course " . claro_get_current_course_id() . " : all tracking events deleted by user " . claro_get_current_user_id(), 'COURSE_RESET_ALL_TRACKING');
    $display = DISP_FLUSH_RESULT;
}
/*
 * Prepare output
 */
$nameTools = get_lang('Delete all course statistics');
/*
 * Output
 */
$html = '';
$html .= claro_html_tool_title($nameTools);
if (DISP_FLUSH_RESULT == $display) {
    // display confirm msg and back link
    $dialogBox->info('<small>' . '<a href="courseReport.php">' . '&lt;&lt;&nbsp;' . get_lang('Back') . '</a>' . '</small>' . "\n");
} elseif (DISP_FORM == $display) {
    $dialogBox->warning(get_lang('Delete is definitive.  There is no way to get your data back after delete.'));
    $dialogBox->form('<form action="' . $_SERVER['PHP_SELF'] . '">' . "\n" . claro_form_relay_context() . '<input type="hidden" name="cmd" value="exDelete" />' . "\n" . '<input type="radio" name="scope" id="scope_all" value="ALL" />' . "\n" . '<label for="scope_all">' . get_lang('All') . '</label>' . "\n" . '<br />' . "\n" . '<input type="radio" name="scope" id="scope_before" value="BEFORE" checked="checked" />' . "\n" . '<label for="scope_before" >' . get_lang('Before') . '</label> ' . "\n" . claro_html_date_form('beforeDate[day]', 'beforeDate[month]', 'beforeDate[year]', time(), 'short') . '<br /><br />' . "\n" . '<input type="submit" name="action" value="' . get_lang('Ok') . '" />&nbsp; ' . claro_html_button('courseReport.php', get_lang('Cancel')) . '</form>' . "\n");
}
// end else if $delete
$html .= $dialogBox->render();
/*
 * Output rendering
 */
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Statistics'), 'courseReport.php');
$claroline->display->body->setContent($html);
echo $claroline->display->render();
Пример #17
0
            if (claro_mail_user($userList[0]['uid'], $emailBody, $emailSubject)) {
                $dialogBox->success(get_lang('Your password has been emailed to') . ' : ' . $emailTo);
            } else {
                $dialogBox->error(get_lang('The system is unable to send you an e-mail.') . '<br />' . get_lang('Please contact') . ' : ' . '<a href="mailto:' . get_conf('administrator_email') . '?BODY=' . $emailTo . '">' . get_lang('Platform administrator') . '</a>');
            }
        }
    } else {
        $dialogBox->error(get_lang('There is no user account with this email address.'));
    }
    if ($extAuthPasswordCount > 0) {
        if ($extAuthPasswordCount == count($userList)) {
            $dialogBox->warning(get_lang('Your password(s) is (are) recorded in an external authentication system outside the platform.'));
        } else {
            $dialogBox->warning(get_lang('Passwords of some of your user account(s) are recorded an in external authentication system outside the platform.'));
        }
        $dialogBox->info(get_lang('For more information take contact with the platform administrator.'));
    }
}
////////////////////////////////////////////////////
// display section
$out = '';
// display title
$out .= claro_html_tool_title($nameTools);
// display message box
if (!$passwordFound) {
    $dialogBox->title(get_lang('Enter your email so we can send you your password.'));
    $dialogBox->form('<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . '<input type="hidden" name="searchPassword" value="1" />' . '<label for="Femail">' . get_lang('Email') . ' : </label>' . '<br />' . '<input type="text" name="Femail" id="Femail" size="50" maxlength="100" value="' . claro_htmlspecialchars($emailTo) . '" />' . '<br /><br />' . '<input type="submit" name="retrieve" value="' . get_lang('Ok') . '" />&nbsp; ' . claro_html_button(get_conf('urlAppend') . '/index.php', get_lang('Cancel')) . '</form>');
}
$out .= $dialogBox->render();
// display form
$claroline->display->body->appendContent($out);
Пример #18
0
                $dialogBox->error($course->backlog->output());
                $display = DISP_COURSE_CREATION_FAILED;
            }
        } else {
            $dialogBox->error($course->backlog->output());
            $display = DISP_COURSE_CREATION_FAILED;
        }
    }
    if ($cmd == 'rqProgress') {
        $course->handleForm();
        if ($course->validate()) {
            // Trig a waiting screen as course creation may take a while...
            $progressUrl = $course->buildProgressUrl();
            $htmlHeadXtra[] = '<meta http-equiv="REFRESH" content="0; URL=' . $progressUrl . '">';
            // Display "progression" page
            $dialogBox->info(get_lang('Creating course (it may take a while) ...') . '<br />' . "\n" . '<p align="center">' . '<img src="' . get_icon_url('processing') . '" alt="" />' . '</p>' . "\n" . '<p>' . get_lang('If after while no message appears confirming the course creation, please click <a href="%url">here</a>', array('%url' => $progressUrl)) . '</p>');
            $display = DISP_COURSE_CREATION_PROGRESS;
        } else {
            $dialogBox->error($course->backlog->output());
            $display = DISP_COURSE_CREATION_FAILED;
        }
    }
}
// Set navigation url
if ($adminContext && claro_is_platform_admin()) {
    ClaroBreadCrumbs::getInstance()->prepend(get_lang('Create course'), get_path('clarolineRepositoryWeb') . 'course/create.php?adminContext=1');
    ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb'));
    $backUrl = get_path('rootAdminWeb');
} else {
    if ($course->courseId) {
        $backUrl = get_path('url') . '/claroline/course/index.php?cid=' . $course->courseId;
Пример #19
0
  * attributes of the form, rather than simply put in a post
  * hidden input. That way, this parameter is concatenated with
  * the URL, and it guarantees than it will be received by the
  * server. The reason of this trick, is because, sometimes,
  * when file upload fails, no form data are received at all by
  * the server. For example when the size of the sent file is so
  * huge that its reception exceeds the max execution time
  * allowed for the script. When no 'cmd' argument are sent it is
  * impossible to manage this error gracefully. That's why,
  * exceptionally, we pass 'cmd' in the 'action' attribute of
  * the form.
  */
 $dialogBox->title(get_lang('Upload file'));
 $agreementText = claro_text_zone::get_content('textzone_upload_file_disclaimer');
 if (!empty($agreementText)) {
     $dialogBox->info($agreementText);
 }
 $form = '<form action="' . claro_htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post" enctype="multipart/form-data">' . '<fieldset>' . claro_form_relay_context() . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . "\n" . '<input type="hidden" name="cmd" value="exUpload" />' . "\n" . '<input type="hidden" name="cwd" value="' . claro_htmlspecialchars($cwd) . '" />' . "\n" . '<dl>' . '<dt><label for="userFile">' . get_lang('File') . '&nbsp;<span class="required">*</span></label>' . '</dt>' . "\n" . '<dd>' . '<input type="file" id="userFile" name="userFile" />' . "\n" . '<p class="notice">' . get_lang("Max file size") . ' : ' . format_file_size($maxUploadSize) . '</p>' . "\n" . '</dd>' . '<dt>' . get_lang("Disk space available") . '</dt>' . '<dd>' . claro_html_progress_bar($spaceAlreadyOccupied / $maxFilledSpace * 100, 1) . ' <span class="notice">' . format_file_size($remainingDiskSpace) . '</span>' . '</dd>' . "\n";
 if ($is_allowedToUnzip) {
     // uncompress
     $form .= '<dt>' . "\n" . '<label for="uncompress"><img src="' . get_icon_url('mime/package-x-generic') . '" alt="" /> ' . get_lang('uncompress zipped (.zip) file on the server') . '</label>' . "\n" . '</dt>' . '<dd>' . '<input type="checkbox" id="uncompress" name="uncompress" value="1" />' . '</dd>' . "\n";
 }
 if ($courseContext) {
     if (!isset($oldComment)) {
         $oldComment = "";
     }
     // comment
     $form .= '<dt>' . "\n" . '<label for="comment">' . get_lang('Comment') . '</label>' . '</dt>' . "\n" . '<dd>' . '<textarea rows=2 cols=50 id="comment" name="comment">' . claro_htmlspecialchars($oldComment) . '</textarea>' . "\n" . '</dd>' . "\n";
 }
 $form .= '</dl>' . '</fieldset>' . '<p><span class="required">*</span>&nbsp;' . get_lang('Denotes required fields') . '</p>' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" />&nbsp; ' . claro_html_button(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exChDir&file=' . base64_encode($cwd))), get_lang('Cancel')) . '</form>';
 $dialogBox->form($form);
Пример #20
0
             $wikiPage->loadPage($title);
         } else {
             $wikiPage->loadPageVersion($versionId);
         }
         if ('' == $content) {
             $content = $wikiPage->getContent();
         }
         if ('__CONTENT__EMPTY__' == $content) {
             $content = '';
         }
         $title = $wikiPage->getTitle();
         $_SESSION['wikiLastVersion'] = $wikiPage->getLastVersionId();
     } else {
         if ($content == '') {
             $message = get_lang("This page is empty, use the editor to add content.");
             $dialogBox->info($message);
         }
     }
     break;
     // view page
 // view page
 case 'show':
     unset($_SESSION['wikiLastVersion']);
     if ($wikiStore->pageExists($wikiId, $title)) {
         if ($versionId == 0) {
             $wikiPage->loadPage($title);
         } else {
             $wikiPage->loadPageVersion($versionId);
         }
         $content = $wikiPage->getContent();
         $title = $wikiPage->getTitle();
Пример #21
0
        // Display user tracking link
        $profileText = claro_text_zone::get_content('textzone_edit_profile_form');
        if (get_conf('is_trackingEnabled')) {
            // Display user tracking link
            $cmdList[] = array('img' => 'statistics', 'name' => get_lang('View my statistics'), 'url' => claro_htmlspecialchars(Url::Contextualize(get_conf('urlAppend') . '/claroline/tracking/userReport.php?userId=' . claro_get_current_user_id())));
        }
        // Display request course creator status
        if (!claro_is_allowed_to_create_course() && get_conf('can_request_course_creator_status')) {
            $cmdList[] = array('name' => get_lang('Request course creation status'), 'url' => claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=reqCCstatus')));
        }
        // Display user revoquation
        if (get_conf('can_request_revoquation')) {
            $cmdList[] = array('img' => 'delete', 'name' => get_lang('Delete my account'), 'url' => claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=reqRevoquation')));
        }
        if (claro_is_platform_admin()) {
            $dialogBox->info(get_lang('As a platform administrator, you can edit any field you want, even if this field isn\'t editable for other users.<br />You can check the list of editable fields in your platform\'s configuration.'));
        }
        break;
}
// Display
$out = '';
$out .= claro_html_tool_title($nameTools, null, $cmdList) . $dialogBox->render();
switch ($display) {
    case DISP_PROFILE_FORM:
        // Display form profile
        if (trim($profileText) != '') {
            $out .= '<div class="info profileEdit">' . $profileText . '</div>';
        }
        $out .= user_html_form($userId);
        break;
    case DISP_MOREINFO_FORM:
Пример #22
0
     require_once './export/exercise_import.inc.php';
     require_once './lib/question.class.php';
     require_once './export/qti2/qti2_classes.php';
     require_once get_path('incRepositorySys') . '/lib/backlog.class.php';
     if (!isset($_FILES['uploadedExercise']['name'])) {
         $dialogBox->error(get_lang('Error : no file uploaded'));
     } else {
         $backlog = new Backlog();
         $importedExId = import_exercise($_FILES['uploadedExercise']['name'], $backlog);
         if ($importedExId) {
             $dialogBox->success('<strong>' . get_lang('Import done') . '</strong>');
         } else {
             $dialogBox->error('<strong>' . get_lang('Import failed') . '</strong>');
             $cmd = 'rqImport';
         }
         $dialogBox->info($backlog->output());
     }
 }
 if ($cmd == 'rqImport') {
     require_once get_path('incRepositorySys') . '/lib/fileDisplay.lib.php';
     require_once get_path('incRepositorySys') . '/lib/fileUpload.lib.php';
     $dialogBox->form("\n" . '<strong>' . get_lang('Import exercise') . '</strong><br />' . "\n" . get_lang('Imported exercises must be an ims-qti zip file.') . '<br />' . "\n" . '<form enctype="multipart/form-data" action="./exercise.php" method="post">' . "\n" . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '">' . "\n" . '<input name="cmd" type="hidden" value="exImport" />' . "\n" . claro_form_relay_context() . "\n" . '<input name="uploadedExercise" type="file" /><br />' . "\n" . '<small>' . get_lang('Max file size') . ' : ' . format_file_size(get_max_upload_size($maxFilledSpace, $courseDir)) . '</small>' . "\n" . '<p>' . "\n" . '<input value="' . get_lang('Import exercise') . '" type="submit" /> ' . "\n" . claro_html_button(Url::Contextualize('./exercise.php'), get_lang('Cancel')) . '</p>' . "\n" . '</form>');
 }
 //-- export
 if ($cmd == 'rqExport' && $exId) {
     $exercise = new Exercise();
     if (!$exercise->load($exId)) {
         $dialogBox->error(get_lang('Unable to load the exercise'));
     } else {
         $dialogBoxContent = "\n" . '<strong>' . get_lang('Export exercise') . '</strong><br />' . "\n" . get_lang('Select the type for your export :') . '<br />' . "\n" . '<ul>' . "\n";
         if (get_conf('enableExerciseExportQTI')) {