4 require_once
'Modules/TestQuestionPool/classes/class.ilUnitConfigurationGUI.php';
18 return 'showLocalUnitCategories';
27 return 'showLocalUnitCategories';
29 return 'showGlobalUnitCategories';
38 if (!isset(
$_GET[self::REQUEST_PARAM_SUB_CONTEXT_ID]) ||
$_GET[self::REQUEST_PARAM_SUB_CONTEXT_ID] == $this->
repository->getConsumerId()) {
70 $ilHelp = $DIC[
'ilHelp'];
72 $this->ctrl->saveParameter($this, self::REQUEST_PARAM_SUB_CONTEXT_ID);
74 $ilHelp->setScreenIdComponent(
'qpl');
75 parent::executeCommand();
87 $ilTabs = $DIC[
'ilTabs'];
89 $this->ctrl->setParameter($this, self::REQUEST_PARAM_SUB_CONTEXT_ID, $this->
repository->getConsumerId());
90 $ilTabs->addSubTab(
'view_unit_ctx_local', $this->lng->txt(
'un_local_units'), $this->ctrl->getLinkTarget($this,
'showLocalUnitCategories'));
91 $this->ctrl->setParameter($this, self::REQUEST_PARAM_SUB_CONTEXT_ID, 0);
92 $ilTabs->addSubTab(
'view_unit_ctx_global', $this->lng->txt(
'un_global_units'), $this->ctrl->getLinkTarget($this,
'showGlobalUnitCategories'));
93 $this->ctrl->setParameter($this, self::REQUEST_PARAM_SUB_CONTEXT_ID,
'');
96 $ilTabs->activateSubTab(
'view_unit_ctx_local');
98 $ilTabs->activateSubTab(
'view_unit_ctx_global');
105 protected function showLocalUnitCategories()
111 $ilToolbar = $DIC[
'ilToolbar'];
113 $ilToolbar->addButton($this->lng->txt(
'un_add_category'), $this->ctrl->getLinkTarget($this,
'showUnitCategoryCreationForm'));
116 $categories = array_filter(
119 return $category->getQuestionFi() == $repo->getConsumerId() ? true :
false;
123 foreach ($categories as $category) {
128 'category_id' => $category->getId(),
129 'category' => $category->getDisplayString()
141 require_once
'Modules/TestQuestionPool/classes/tables/class.ilLocalUnitCategoryTableGUI.php';
143 $table->setData($categories);
145 $this->tpl->setContent(
$table->getHTML());
153 if (!isset(
$_GET[
'category_id'])) {
154 $this->showGlobalUnitCategories();
157 $_POST[
'category_ids'] = array(
$_GET[
'category_id']);
167 if (!isset(
$_POST[
'category_ids']) || !is_array(
$_POST[
'category_ids'])) {
168 $this->showGlobalUnitCategories();
186 if (!isset(
$_POST[
'category_ids']) || !is_array(
$_POST[
'category_ids'])) {
187 $this->showGlobalUnitCategories();
192 foreach (
$_POST[
'category_ids'] as $category_id) {
194 $category = $this->
repository->getUnitCategoryById((
int) $category_id);
200 $new_cat_id = $this->
repository->copyCategory($category->getId(), $this->
repository->getConsumerId());
203 $this->
repository->copyUnitsByCategories($category->getId(), $new_cat_id, $this->
repository->getConsumerId());
208 ilUtil::sendSuccess($this->lng->txt(
'saved_successfully'),
true);
211 $this->ctrl->setParameter($this,
'question_fi', 0);
212 $this->ctrl->redirect($this,
'showLocalUnitCategories');
const REQUEST_PARAM_SUB_CONTEXT_ID
showUnitCategories(array $categories)
confirmImportGlobalCategory()
if(!array_key_exists('StateId', $_REQUEST)) $id
Class ilUnitConfigurationGUI .
confirmImportGlobalCategories()
getUnitCategoryOverviewCommand()
Class ilLocalUnitConfigurationGUI.
if(empty($password)) $table
Class ilLocalUnitCategoryTableGUI.