4 require_once
'Modules/TestQuestionPool/classes/class.ilUnitConfigurationGUI.php';
18 return 'showLocalUnitCategories';
28 return 'showLocalUnitCategories';
32 return 'showGlobalUnitCategories';
41 if(!isset(
$_GET[self::REQUEST_PARAM_SUB_CONTEXT_ID]) ||
$_GET[self::REQUEST_PARAM_SUB_CONTEXT_ID] == $this->repository->getConsumerId())
56 $id = $this->repository->getConsumerId();
80 $this->ctrl->saveParameter($this, self::REQUEST_PARAM_SUB_CONTEXT_ID);
82 $ilHelp->setScreenIdComponent(
'qpl');
83 parent::executeCommand();
96 $this->ctrl->setParameter($this, self::REQUEST_PARAM_SUB_CONTEXT_ID, $this->repository->getConsumerId());
97 $ilTabs->addSubTab(
'view_unit_ctx_local', $this->lng->txt(
'un_local_units'), $this->ctrl->getLinkTarget($this,
'showLocalUnitCategories'));
98 $this->ctrl->setParameter($this, self::REQUEST_PARAM_SUB_CONTEXT_ID, 0);
99 $ilTabs->addSubTab(
'view_unit_ctx_global', $this->lng->txt(
'un_global_units'), $this->ctrl->getLinkTarget($this,
'showGlobalUnitCategories'));
100 $this->ctrl->setParameter($this, self::REQUEST_PARAM_SUB_CONTEXT_ID,
'');
104 $ilTabs->activateSubTab(
'view_unit_ctx_local');
108 $ilTabs->activateSubTab(
'view_unit_ctx_global');
115 protected function showLocalUnitCategories()
122 $ilToolbar->addButton($this->lng->txt(
'un_add_category'), $this->ctrl->getLinkTarget($this,
'showUnitCategoryCreationForm'));
125 $categories = array_filter(
126 $this->repository->getAllUnitCategories(),
128 return $category->getQuestionFi() == $repo->getConsumerId() ? true :
false;
132 foreach($categories as $category)
138 'category_id' => $category->getId(),
139 'category' => $category->getDisplayString()
151 require_once
'Modules/TestQuestionPool/classes/tables/class.ilLocalUnitCategoryTableGUI.php';
153 $table->setData($categories);
155 $this->tpl->setContent($table->getHTML());
163 if(!isset(
$_GET[
'category_id']))
165 $this->showGlobalUnitCategories();
178 if(!isset(
$_POST[
'category_ids']) || !is_array(
$_POST[
'category_ids']))
180 $this->showGlobalUnitCategories();
199 if(!isset(
$_POST[
'category_ids']) || !is_array(
$_POST[
'category_ids']))
201 $this->showGlobalUnitCategories();
206 foreach(
$_POST[
'category_ids'] as $category_id)
210 $category = $this->repository->getUnitCategoryById((
int)$category_id);
218 $new_cat_id = $this->repository->copyCategory($category->getId(), $this->repository->getConsumerId());
221 $this->repository->copyUnitsByCategories($category->getId(), $new_cat_id, $this->repository->getConsumerId());
230 $this->ctrl->setParameter($this,
'question_fi', 0);
231 $this->ctrl->redirect($this,
'showLocalUnitCategories');
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Base class for ILIAS Exception handling.
const REQUEST_PARAM_SUB_CONTEXT_ID
showUnitCategories(array $categories)
confirmImportGlobalCategory()
Class ilUnitConfigurationGUI .
confirmImportGlobalCategories()
getUnitCategoryOverviewCommand()
Create styles array
The data for the language used.
Class ilLocalUnitConfigurationGUI.
Class ilLocalUnitCategoryTableGUI.