22 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
29 $lng->loadLanguageModule(
"cntr");
30 $lng->loadLanguageModule(
"obj");
48 $this->ctrl->returnToParent($this);
73 $ilHelp->setScreenIdComponent(
"root");
75 $this->ctrl->setParameter($this,
"ref_id", $this->ref_id);
77 if (
$rbacsystem->checkAccess(
'read', $this->ref_id)) {
78 $this->tabs_gui->addTab(
81 $this->ctrl->getLinkTarget($this,
"")
85 if (
$rbacsystem->checkAccess(
'write', $this->ref_id)) {
86 $force_active = (
$_GET[
"cmd"] ==
"edit")
89 $this->tabs_gui->addTarget(
91 $this->ctrl->getLinkTarget($this,
"edit"),
107 $next_class = $this->ctrl->getNextClass($this);
108 $cmd = $this->ctrl->getCmd();
111 switch ($next_class) {
113 $ru = new \ilRepUtilGUI($this);
114 $this->ctrl->setReturn($this,
'trash');
115 $this->ctrl->forwardCommand($ru);
119 case 'ilcontainerlinklistgui':
120 include_once(
"Services/Container/classes/class.ilContainerLinkListGUI.php");
122 $ret = &$this->ctrl->forwardCommand($link_list_gui);
126 case "ilcontainerpagegui":
130 $this->tpl->setContent(
$ret);
134 case 'ilpermissiongui':
136 $this->tabs_gui->activateTab(
'perm_settings');
138 $ret = $this->ctrl->forwardCommand($perm_gui);
144 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
145 $this->tpl->setVariable(
146 "LOCATION_CONTENT_STYLESHEET",
152 case 'ilobjectcopygui':
154 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
156 $cp->setType(
'root');
157 $this->ctrl->forwardCommand($cp);
160 case "ilobjstylesheetgui":
164 case "ilcommonactiondispatchergui":
165 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
167 $this->ctrl->forwardCommand($gui);
170 case 'ilobjecttranslationgui':
175 include_once(
"./Services/Object/classes/class.ilObjectTranslationGUI.php");
177 $this->ctrl->forwardCommand($transgui);
181 if ($cmd ==
"infoScreen") {
187 $this->ctrl->redirectToURL(
"login.php?client_id=" .
CLIENT_ID .
"&cmd=force_login");
191 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
192 $this->tpl->setVariable(
193 "LOCATION_CONTENT_STYLESHEET",
216 include_once
"Services/Object/classes/class.ilObjectListGUI.php";
217 ilObjectListGUI::prepareJSLinks(
219 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"ilnotegui"),
"",
"",
true,
false),
220 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"iltagginggui"),
"",
"",
true,
false)
223 $ilTabs->activateTab(
"view_content");
224 $ret = parent::renderObject();
237 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui") {
238 parent::viewObject();
255 parent::setTitleAndDescription();
256 $this->tpl->setDescription(
"");
258 if ($this->object->getTitle() ==
"ILIAS") {
259 $this->tpl->setTitle(
$lng->txt(
"repository"));
261 if ($this->object->getDescription() !=
"") {
262 $this->tpl->setDescription($this->object->getDescription());
270 $this->tabs_gui->addSubTab(
272 $this->lng->txt(
"settings"),
273 $this->ctrl->getLinkTarget($this,
"edit")
280 $this->tabs_gui->addSubTab(
282 $this->lng->txt(
"obj_multilinguality"),
283 $this->ctrl->getLinkTargetByClass(
"ilobjecttranslationgui",
"")
287 $this->tabs_gui->activateTab(
"settings");
288 $this->tabs_gui->activateSubTab($active_tab);
296 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
298 $form->setFormAction($this->ctrl->getFormAction($this));
299 $form->setTitle($this->lng->txt(
'obj_presentation'));
309 ilcontainer::SORT_MANUAL
314 $this->showCustomIconsEditing(1, $form,
false);
316 $form = $obj_service->commonSettings()->legacyForm($form, $this->
object)->addTitleIconVisibility();
323 $form->addCommandButton(
"update", $this->lng->txt(
"save"));
324 $form->addCommandButton(
"addTranslation", $this->lng->txt(
"add_translation"));
346 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilias->error_obj->MESSAGE);
349 if ($form->checkInput()) {
358 $customIconFactory =
$DIC[
'object.customicons.factory'];
359 $customIcon = $customIconFactory->getByObjId($this->object->getId(), $this->object->getType());
362 $fileData = (array) $form->getInput(
'cont_icon');
363 $item = $form->getItemByPostVar(
'cont_icon');
365 if ($item->getDeletionFlag()) {
366 $customIcon->remove();
369 if ($fileData[
'tmp_name']) {
370 $customIcon->saveFromHttpRequest();
376 $obj_service->commonSettings()->legacyForm($form, $this->
object)->saveTitleIconVisibility();
385 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
390 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
391 $this->ctrl->redirect($this,
"edit");
396 $form->setValuesByPost();
397 $this->tpl->setContent($form->getHTML());
409 $this->ctrl->redirectByClass(
"ilobjecttranslationgui",
"");
411 $this->lng->loadLanguageModule($this->object->getType());
414 include_once(
"./Services/Object/classes/class.ilObjectTranslationTableGUI.php");
421 if ($a_get_post_values) {
423 foreach (
$_POST[
"title"] as $k => $v) {
424 $vals[] = array(
"title" => $v,
425 "desc" =>
$_POST[
"desc"][$k],
426 "lang" =>
$_POST[
"lang"][$k],
427 "default" => (
$_POST[
"default"] == $k));
429 $table->setData($vals);
431 $data = $this->
object->getTranslations();
432 foreach (
$data[
"Fobject"] as $k => $v) {
433 $data[
"Fobject"][$k][
"default"] = ($k ==
$data[
"default_language"]);
435 $table->setData(
$data[
"Fobject"]);
437 $tpl->setContent($table->getHTML());
446 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"), $this->ilias->error_obj->MESSAGE);
450 if (!isset(
$_POST[
"default"]) && count(
$_POST[
"lang"]) > 0) {
456 if (array_key_exists(
"",
$_POST[
"lang"])) {
462 if (count(array_unique(
$_POST[
"lang"])) < count(
$_POST[
"lang"])) {
468 $this->
object->removeTranslations();
470 if (
sizeof(
$_POST[
"title"])) {
471 foreach (
$_POST[
"title"] as $k => $v) {
473 $is_default = (
$_POST[
"default"] == $k);
477 $this->
object->update();
480 $this->
object->addTranslation(
489 $this->
object->setTitle(
"ILIAS");
490 $this->
object->setDescription(
"");
491 $this->
object->update();
494 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
495 $this->ctrl->redirect($this,
"editTranslations");
503 if (
sizeof(
$_POST[
"title"])) {
504 $k = max(array_keys(
$_POST[
"title"])) + 1;
518 foreach (
$_POST[
"title"] as $k => $v) {
519 if (
$_POST[
"check"][$k]) {
520 unset(
$_POST[
"title"][$k]);
521 unset(
$_POST[
"desc"][$k]);
522 unset(
$_POST[
"lang"][$k]);
523 if (
$_POST[
"default"] == $k) {
529 if ($del_default &&
sizeof(
$_POST[
"title"])) {
530 $_POST[
"default"] = array_shift(array_keys(
$_POST[
"title"]));
538 public static function _goto($a_target)
An exception for terminatinating execution or to throw for unit testing.
static _catchupWriteEvents($obj_id, $usr_id, $timestamp=null)
Catches up with all write events which occured before the specified timestamp.
static _recordWriteEvent($obj_id, $usr_id, $action, $parent_obj_id=null)
Records a write event.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
& forwardToPageObject()
forward command to page object
initSortingForm(ilPropertyFormGUI $form, array $a_sorting_settings)
Append sorting settings to property form.
prepareOutput($a_show_subobjects=true)
prepare output
saveListPresentation(ilPropertyFormGUI $form)
Save list presentation setting.
forwardToStyleSheet()
Forward to style object.
initListPresentationForm(ilPropertyFormGUI $form)
Add list presentation settings to form.
saveSortingSettings(ilPropertyFormGUI $form)
Save sorting settings.
Class ilContainerLinkListGUI.
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
static _importCategories($a_ref_id, $withrol_tmp)
import categories (static, also called by RootFolderGUI)
static _importCategoriesForm($a_ref_id, &$a_tpl)
display form for category import (static, also called by RootFolderGUI)
Class ilObjRootFolderGUI.
importCategoriesFormObject()
import categories form
importCategoriesWithRolObject()
import categories
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
Constructor @access public.
saveTranslationsObject()
Save title and translations.
static _goto($a_target)
goto target group
getTabs()
common tabs for all container objects (should be called at the end of child getTabs() method
getEditFormValues()
Get values for edit form.
initEditForm()
Init object edit form.
executeCommand()
execute command note: this method is overwritten in all container objects
viewObject()
View root folder.
importCancelledObject()
import cancelled
deleteTranslationsObject()
Remove translation.
setTitleAndDescription()
called by prepare output
setEditTabs($active_tab="settings_misc")
addTranslationObject()
Add a translation.
importCategoriesObject()
import categories
renderObject()
Render root folder.
editTranslationsObject($a_get_post_values=false)
Edit title and translations.
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
GUI class for the workflow of copying objects.
Base exception class for object service.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
getObjectService()
Get object service.
updateObject()
updates object entry in object_data
GUI class for object translation handling.
TableGUI class for title/description translations.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
redirection script todo: (a better solution should control the processing via a xml file)