Ejemplo n.º 1
0
    $category = $_REQUEST['category'];
} else {
    $category = -1;
}
/*
 * init other vars
 */
$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');