コード例 #1
0
 /**
  * Delete
  *
  * @access protected
  * @param
  * @return
  */
 protected function delete()
 {
     global $ilCtrl;
     if (!$_POST['category_id']) {
         ilUtil::sendFailure($this->lng->txt('select_one'), true);
         $this->manage();
     }
     /*
     		$this->readPermissions();
     		if(!$this->isEditable())
     		{
     			ilUtil::sendFailure($this->lng->txt('permission_denied'));
     			$this->edit();
     			return false;
     		}
     */
     include_once './Services/Calendar/classes/class.ilCalendarCategory.php';
     foreach ($_POST['category_id'] as $cat_id) {
         $category = new ilCalendarCategory((int) $cat_id);
         $category->delete();
     }
     ilUtil::sendSuccess($this->lng->txt('cal_cal_deleted'), true);
     $ilCtrl->redirect($this, 'manage');
 }
コード例 #2
0
 /**
  * delete category
  *
  * @access public
  * @param
  * @return
  * @static
  */
 public static function deleteCategory($a_obj_id)
 {
     global $ilLog;
     include_once './Services/Calendar/classes/class.ilCalendarCategories.php';
     if (!($cat_id = ilCalendarCategories::_lookupCategoryIdByObjId($a_obj_id))) {
         $ilLog->write(__METHOD__ . ': Cannot find calendar category for obj_id ' . $a_obj_id);
         return false;
     }
     $category = new ilCalendarCategory($cat_id);
     $category->delete();
 }