29 protected \ILIAS\Style\Content\GUIService
$cs_gui;
38 bool $a_prevent_get_id =
false,
43 $this->tpl =
$DIC[
"tpl"];
44 $this->
ctrl = $DIC->ctrl();
45 $this->
tabs = $DIC->tabs();
46 $this->
access = $DIC->access();
47 $this->
lng = $DIC->language();
49 if (in_array($this->
ctrl->getCmd(), [
"createMediaPoolPage",
"saveMediaPoolPage",
"cancelSaveNewMediaPoolPage"])) {
55 $cs =
$DIC->contentStyle()
59 $this->cs_gui =
$DIC->contentStyle()->gui();
62 $this->mep_request =
$DIC->mediaPool()
77 $p = $this->getPageObject();
83 $this->pool_gui = $pool_gui;
88 $this->getMediaPoolPage()->setPool($this->pool);
90 $this->activateMetaDataEditor(
94 $this->getMediaPoolPage(),
100 bool $a_no_title =
false
105 if (!$this->getRawPageContent()) {
106 $this->cs_gui->addCss($tpl, $this->requested_ref_id);
109 $this->setTemplateOutput(
false);
114 return parent::showPage();
117 public function getTabs(
string $a_activate =
""): void
119 $this->setMediaPoolPageTabs();
124 $this->setRawPageContent(
true);
125 $this->setLinkXml(
"");
126 return $this->showPage(
true);
138 $form = $this->initMediaPoolPageForm(
"create");
139 $tpl->setContent($form->getHTML());
140 $this->
tabs->clearTargets();
146 $form = $this->initMediaPoolPageForm(
"edit");
147 $this->getMediaPoolPageValues($form);
148 $tpl->setContent($form->getHTML());
155 $ilCtrl = $this->ctrl;
157 $form = $this->initMediaPoolPageForm(
"create");
158 if ($form->checkInput()) {
161 $item->setTitle($form->getInput(
"title"));
162 $item->setType(
"pg");
165 if ($item->getId() > 0) {
167 $tree = $this->pool->getTree();
168 $parent = $this->mep_request->getItemId() > 0
169 ? $this->mep_request->getItemId()
170 : $tree->getRootId();
171 $this->pool->insertInTree($item->getId(), $parent);
175 $page->setId($item->getId());
176 $page->setParentId($this->pool->getId());
178 $page->createMetaData($this->pool->getId());
180 $ilCtrl->setParameterByClass(
"ilmediapoolpagegui",
"mepitem_id", $item->getId());
181 $ilCtrl->redirectByClass(
"ilmediapoolpagegui",
"edit");
183 $ilCtrl->returnToParent($this);
186 $form->setValuesByPost();
187 $tpl->setContent($form->getHtml());
193 $ilCtrl = $this->ctrl;
196 $form = $this->initMediaPoolPageForm(
"edit");
197 if ($form->checkInput()) {
199 $item->setTitle($form->getInput(
"title"));
201 $this->getMediaPoolPage()->updateMetaData();
202 $tpl->setOnScreenMessage(
"success",
$lng->txt(
"msg_obj_modified"),
true);
203 $ilCtrl->redirect($this,
"editMediaPoolPage");
206 $form->setValuesByPost();
207 $tpl->setContent($form->getHtml());
213 $ilCtrl = $this->ctrl;
219 $ti->setMaxLength(128);
220 $ti->setRequired(
true);
224 if ($a_mode ===
"create") {
225 $form->addCommandButton(
"saveMediaPoolPage",
$lng->txt(
"save"));
226 $form->addCommandButton(
"cancelSaveNewMediaPoolPage",
$lng->txt(
"cancel"));
227 $form->setTitle(
$lng->txt(
"mep_new_content_snippet"));
229 $form->addCommandButton(
"updateMediaPoolPage",
$lng->txt(
"save"));
230 $form->setTitle(
$lng->txt(
"mep_edit_content_snippet"));
233 $form->setFormAction($ilCtrl->getFormAction($this));
241 $ctrl->returnToParent($this);
255 $ilTabs = $this->tabs;
256 $ilCtrl = $this->ctrl;
259 if ($this->use_meta_data) {
261 $this->meta_data_rep_obj,
262 $this->meta_data_type,
263 $this->meta_data_sub_obj_id
265 $mdtab = $mdgui->getTab();
267 $this->tabs_gui->addTarget(
271 "ilobjectmetadatagui"
278 $ilCtrl->getLinkTarget($this,
"showMediaPoolPageUsages"),
279 array(
"showMediaPoolPageUsages",
"showAllMediaPoolPageUsages"),
284 $ilCtrl->getLinkTarget($this,
"editMediaPoolPage"),
288 $ilCtrl->setParameter($this,
"mepitem_id", $this->pool->getPoolTree()->getParentId($this->mep_request->getItemId()));
289 $ilTabs->setBackTarget(
$lng->txt(
"mep_folder"), $ilCtrl->getLinkTargetByClass(
290 ilObjMediaPoolGUI::class,
293 $ilCtrl->setParameter($this,
"mepitem_id", $this->mep_request->getItemId());
298 $this->showMediaPoolPageUsages(
true);
307 $ilTabs = $this->tabs;
308 $ilCtrl = $this->ctrl;
312 $ilTabs->clearTargets();
316 $lng->txt(
"cont_current_usages"),
317 $ilCtrl->getLinkTarget($this,
"showMediaPoolPageUsages")
322 $lng->txt(
"cont_all_usages"),
323 $ilCtrl->getLinkTarget($this,
"showAllMediaPoolPageUsages")
327 $ilTabs->activateSubTab(
"all_usages");
328 $cmd =
"showAllMediaPoolPageUsages";
330 $ilTabs->activateSubTab(
"current_usages");
331 $cmd =
"showMediaPoolPageUsages";
338 $tpl->setContent($table->getHTML());
343 $this->
ctrl->returnToParent($this);
351 $this->meta_data_rep_obj,
352 $this->meta_data_type,
353 $this->meta_data_sub_obj_id
355 $mdtab = $mdgui->getTab();
357 $tabs[] = $this->
ui->factory()->link()->standard(
358 $this->
lng->txt(
'meta_data'),
364 $this->
ui->factory()->link()->standard(
365 $this->
lng->txt(
'cont_usage'),
366 $this->ctrl->getLinkTargetByClass([
368 ],
'showMediaPoolPageUsages')
371 $this->
ui->factory()->link()->standard(
372 $this->
lng->txt(
'settings'),
373 $this->ctrl->getLinkTargetByClass([
375 ],
'editMediaPoolPage')
Class ilMediaPoolPage GUI class.
__construct(int $a_id=0, int $a_old_nr=0, bool $a_prevent_get_id=false, string $a_lang="")
ilObjMediaPoolGUI $pool_gui
getTabs(string $a_activate="")
setMediaPoolPage(ilMediaPoolPage $a_media_pool_page)
showMediaPoolPageUsages(bool $a_all=false)
List usages of the contnet snippet.
MediaPool StandardGUIRequest $mep_request
cancelSaveNewMediaPoolPage()
showPage(bool $a_no_title=false)
setTemplate(ilGlobalTemplateInterface $tpl)
getMediaPoolPageValues(ilPropertyFormGUI $form)
ILIAS Style Content GUIService $cs_gui
initMediaPoolPageForm(string $a_mode="edit")
getAdditionalPageActions()
Get additional page actions.
showAllMediaPoolPageUsages()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setStyleId(int $a_styleid)
setPageObject(ilPageObject $a_pg_obj)
setEditPreview(bool $a_editpreview)
Set Display first Edit tab, then Preview tab, instead of Page and Edit.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text property in a property form.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc