public function actionAdd()
 {
     $category = CBaseManager::getWorkPlanContentCategory(CRequest::getInt("id"));
     $object = new CWorkPlanContentSection();
     $object->category_id = $category->getId();
     $object->sectionIndex = $category->sections->getCount() + 1;
     $this->setData("object", $object);
     /**
      * Генерация меню
      */
     $this->addActionsMenuItem(array("title" => "Назад", "link" => "workplancontentcategories.php?action=edit&id=" . $object->category_id, "icon" => "actions/edit-undo.png"));
     /**
      * Отображение представления
      */
     $this->renderView("_corriculum/_workplan/contentSections/add.tpl");
 }
 public function actionGetObject($id)
 {
     return CBaseManager::getWorkPlanContentCategory($id);
 }
 public function actionDelete()
 {
     $object = CBaseManager::getWorkPlanContentCategory(CRequest::getInt("id"));
     $plan = $object->plan;
     $object->remove();
     $order = 1;
     foreach ($plan->categories as $category) {
         $category->order = $order++;
         $category->save();
     }
     $this->redirect("workplans.php?action=edit&id=" . $plan->getId());
 }