예제 #1
0
파일: index.php 프로젝트: rhertzog/lcs
 */
$dialogBox = new DialogBox();
if ($is_allowedToEdit && !empty($cmd)) {
    $description = new CourseDescription();
    if (!empty($descId)) {
        $description->load($descId);
    }
    if ($cmd == 'exEdit') {
        if (isset($_REQUEST['descTitle'])) {
            $description->setTitle($_REQUEST['descTitle']);
        }
        if (isset($_REQUEST['descContent'])) {
            $description->setContent($_REQUEST['descContent']);
        }
        if (isset($_REQUEST['descCategory'])) {
            $description->setCategory($_REQUEST['descCategory']);
        }
        if ($description->validate()) {
            // Update description
            if ($description->save()) {
                if ($descId) {
                    $eventNotifier->notifyCourseEvent('course_description_modified', claro_get_current_course_id(), claro_get_current_tool_id(), $descId, claro_get_current_group_id(), '0');
                    $dialogBox->success(get_lang('Description updated'));
                } else {
                    $eventNotifier->notifyCourseEvent('course_description_added', claro_get_current_course_id(), claro_get_current_tool_id(), $descId, claro_get_current_group_id(), '0');
                    $dialogBox->success(get_lang('Description added'));
                }
            } else {
                $dialogBox->error(get_lang('Unable to update'));
            }
        } else {