Exemplo n.º 1
0
       REQUEST DESCRIPTION ITEM EDITION
   -------------------------------------------------------------------------*/
 if ($cmd == 'rqEdit') {
     claro_set_display_mode_available(false);
     // Manage the tips
     $tips['isTitleEditable'] = isset($tipList[$category]['isEditable']) ? $tipList[$category]['isEditable'] : true;
     $tips['presetTitle'] = !empty($tipList[$category]['title']) ? claro_htmlspecialchars($tipList[$category]['title']) : '';
     $tips['question'] = !empty($tipList[$category]['question']) ? $tipList[$category]['question'] : '';
     $tips['information'] = !empty($tipList[$category]['information']) ? $tipList[$category]['information'] : '';
     $displayForm = true;
 }
 /*-------------------------------------------------------------------------
       DELETE DESCRIPTION ITEM
   -------------------------------------------------------------------------*/
 if ($cmd == 'exDelete') {
     if ($description->delete()) {
         $eventNotifier->notifyCourseEvent('course_description_deleted', claro_get_current_course_id(), claro_get_current_tool_id(), $descId, claro_get_current_group_id(), '0');
         $dialogBox->success(get_lang("Description deleted."));
     } else {
         $dialogBox->error(get_lang("Unable to delete"));
     }
 }
 /*-------------------------------------------------------------------------
       EDIT  VISIBILITY DESCRIPTION ITEM
   -------------------------------------------------------------------------*/
 if ($cmd == 'mkVis') {
     $description->setVisibility('VISIBLE');
     if ($description->save()) {
         $eventNotifier->notifyCourseEvent('course_description_visible', claro_get_current_course_id(), claro_get_current_tool_id(), $descId, claro_get_current_group_id(), '0');
     }
 }
 /**
  * It's used for destroy a course description,
  * render to listing view
  * @param int $id description type
  */
 public function destroy($id)
 {
     $course_description = new CourseDescription();
     $session_id = api_get_session_id();
     $course_description->set_session_id($session_id);
     if (!empty($id)) {
         $course_description->set_id($id);
         $course_description->delete();
         Display::addFlash(Display::return_message(get_lang('CourseDescriptionDeleted')));
     }
     $this->listing(false);
 }
 /**
  * It's used for destroy a course description,
  * render to listing view
  * @param int description type
  */
 public function destroy($id)
 {
     $course_description = new CourseDescription();
     $session_id = api_get_session_id();
     $course_description->set_session_id($session_id);
     if (!empty($id)) {
         $course_description->set_id($id);
         $affected_rows = $course_description->delete();
     }
     if ($affected_rows) {
         $message['destroy'] = true;
     }
     $this->listing(false, $message);
 }