ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilContainerGUI Class Reference

Class ilContainerGUI. More...

+ Inheritance diagram for ilContainerGUI:
+ Collaboration diagram for ilContainerGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public. More...
 
 executeCommand ()
 execute command note: this method is overwritten in all container objects More...
 
 forwardToStyleSheet ()
 Forward to style object. More...
 
forwardToPageObject ()
 forward command to page object More...
 
 addPageTabs ()
 Add page tabs. More...
 
 getContainerPageHTML ()
 Get container page HTML. More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 showTreeFlatIcon ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 showPossibleSubObjects ()
 show possible sub objects selection list More...
 
 getContentGUI ()
 Get content gui object. More...
 
 renderObject ()
 render the object More...
 
 renderBlockAsynchObject ()
 render the object More...
 
 setContentSubTabs ()
 Set content sub tabs. More...
 
 showAdministrationPanel ()
 show administration panel More...
 
 __showTimingsButton (&$tpl)
 
 showPermanentLink ()
 show permanent link More...
 
 switchToStdEditorObject ()
 Switch to standard page editor. More...
 
 switchToOldEditorObject ()
 Switch to old page editor. More...
 
 useNewEditorObject ()
 Use new editor (-> delete xhtml content page) More...
 
 editPageFrameObject ()
 show page editor frameset More...
 
 editPageContentObject ()
 edit page content (for repository root node and categories) More...
 
 savePageContentObject ()
 
 cancelPageContentObject ()
 
 showLinkListObject ()
 
 clearAdminCommandsDetermination ()
 cleaer administration commands determination More...
 
newBlockTemplate ()
 determin admin commands More...
 
 addHeaderRow (&$a_tpl, $a_type, $a_show_image=true)
 adds a header row to a block template More...
 
 addMessageRow (&$a_tpl, $a_message, $a_type)
 add message row More...
 
 resetRowType ()
 
 setPageEditorTabs ()
 Add page editor tabs. More...
 
 addStandardContainerSubTabs ($a_include_view=true)
 Add standar container subtabs for view, manage, oderdering and text/media editor link. More...
 
 getTabs ()
 common tabs for all container objects (should be called at the end of child getTabs() method More...
 
 enableAdministrationPanelObject ()
 enable administration panel More...
 
 disableAdministrationPanelObject ()
 enable administration panel More...
 
 editOrderObject ()
 Edit order. More...
 
 isActiveOrdering ()
 Check if ordering is enabled. More...
 
 isActiveItemOrdering ()
 Check if item ordering is enabled. More...
 
 enableMultiDownloadObject ()
 
 isMultiDownloadEnabled ()
 
 cutObject ()
 cut object(s) out from a container and write the information to clipboard More...
 
 copyObject ()
 Copy object(s) out from a container and write the information to clipboard It is not possible to copy multiple objects at once. More...
 
 downloadObject ()
 
 getBucketTitle ()
 get proper label to add in the background task popover More...
 
 linkObject ()
 create an new reference of an object in tree it's like a hard link of unix More...
 
 clearObject ()
 clear clipboard and go back to last object More...
 
 performPasteIntoMultipleObjectsObject ()
 
 initAndDisplayLinkIntoMultipleObjectsObject ()
 
 showPasteTreeObject ()
 Show paste tree. More...
 
 cancelMoveLinkObject ()
 Cancel move|link empty clipboard and return to parent. More...
 
 keepObjectsInClipboardObject ()
 Keep objects in the clipboard. More...
 
 initAndDisplayCopyIntoMultipleObjectsObject ()
 
 initAndDisplayMoveIntoObjectObject ()
 
 pasteObject ()
 paste object from clipboard to current place Depending on the chosen command the object(s) are linked, copied or moved More...
 
 clipboardObject ()
 show clipboard More...
 
 isActiveAdministrationPanel ()
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 allowBlocksMoving ()
 Standard is to allow blocks moving. More...
 
 allowBlocksConfigure ()
 Standard is to allow blocks configuration. More...
 
 cloneWizardPageTreeObject ()
 public More...
 
 cloneWizardPageListObject ()
 public More...
 
 cloneWizardPageObject ($a_tree_view=true)
 Show clone wizard page for container objects. More...
 
 cloneAllObject ()
 Clone all object Overwritten method for copying container objects. More...
 
 saveSortingObject ()
 Save Sorting. More...
 
 cloneNodes ($srcRef, $dstRef, &$mapping, $newName=null)
 Recursively clones all nodes of the RBAC tree. More...
 
 modifyItemGUI ($a_item_list_gui, $a_item_data, $a_show_path)
 Modify list gui for presentation in container. More...
 
 editStylePropertiesObject ()
 Edit style properties. More...
 
 initStylePropertiesForm ()
 Init style properties form. More...
 
 createStyleObject ()
 Create Style. More...
 
 editStyleObject ()
 Edit Style. More...
 
 deleteStyleObject ()
 Delete Style. More...
 
 saveStyleSettingsObject ()
 Save style settings. More...
 
 getAsynchItemListObject ()
 Get item list command drop down asynchronously. More...
 
 redrawListItemObject ()
 Redraw a list item (ajax) More...
 
 trashObject ()
 Show trash content of object. More...
 
 trashApplyFilterObject ()
 trash table apply filter More...
 
 trashResetFilterObject ()
 trash table reset filter More...
 
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method More...
 
 undeleteObject ()
 Get objects back from trash. More...
 
 confirmRemoveFromSystemObject ()
 confirmation screen remove from system More...
 
 setSideColumnReturn ()
 Set return point for side column actions. More...
 
 getAdminTabs ()
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ilDesktopItemHandling
 addToDeskObject ()
 Add desktop item public. More...
 
 removeFromDeskObject ()
 Remove from desktop public. More...
 

Static Public Member Functions

static _buildPath ($a_ref_id, $a_course_ref_id)
 build path More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Data Fields

 $bl_cnt = 1
 
 $multi_download_enabled = false
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 getEditFormValues ()
 Get values for edit form. More...
 
 afterUpdate ()
 
 showPasswordInstructionObject ($a_init=true)
 Show webdav password instruction. More...
 
 initFormPasswordInstruction ()
 Init password form. More...
 
 savePasswordObject ()
 Save password. More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add file manager link. More...
 
 fileManagerLaunchObject ()
 Launch jnlp. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initSortingForm (ilPropertyFormGUI $form, array $a_sorting_settings)
 Append sorting settings to property form. More...
 
 initListPresentationForm (ilPropertyFormGUI $form)
 Add list presentation settings to form. More...
 
 saveListPresentation (ilPropertyFormGUI $form)
 Save list presentation setting. More...
 
 initSortingDirectionForm (ilContainerSortingSettings $sorting_settings, $element, $a_prefix)
 Add sorting direction. More...
 
 initManualSortingOptionForm (ilContainerSortingSettings $settings, $element, $a_prefix, $a_sorting_settings)
 Add manual sorting options. More...
 
 saveSortingSettings (ilPropertyFormGUI $form)
 Save sorting settings. More...
 
 trashHandleFilter (bool $action_apply, bool $action_reset)
 
 restoreToNewLocationObject (\ilPropertyFormGUI $form=null)
 
 getTreeSelectorGUI ($cmd)
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $rbacsystem
 
 $tabs
 
 $settings
 
 $user
 
 $db
 
 $access
 
 $error
 
 $obj_definition
 
 $rbacadmin
 
 $rbacreview
 
 $log
 
 $obj_data_cache
 
 $toolbar
 
 $plugin_admin
 
 $global_screen
 
 $app_event_handler
 
 $ui
 
 $container_filter_service
 
 $container_user_filter = null
 
 $ui_filter
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 

Detailed Description

Class ilContainerGUI.

This is a base GUI class for all container objects in ILIAS: root folder, course, group, category, folder

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Stefan Hecken stefa.nosp@m.n.he.nosp@m.cken@.nosp@m.conc.nosp@m.epts-.nosp@m.and-.nosp@m.train.nosp@m.ing..nosp@m.de
Version
$Id$

Definition at line 21 of file class.ilContainerGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilContainerGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference = true,
  $a_prepare_output = true 
)

Constructor public.

Definition at line 129 of file class.ilContainerGUI.php.

References $DIC, ilObjectGUI\$lng, $rbacsystem, ILIAS\GlobalScreen\Provider\__construct(), settings(), ui(), and user().

130  {
131  global $DIC;
132 
133  $this->lng = $DIC->language();
134  $this->tpl = $DIC["tpl"];
135  $this->ctrl = $DIC->ctrl();
136  $this->tabs = $DIC->tabs();
137  $this->settings = $DIC->settings();
138  $this->user = $DIC->user();
139  $this->db = $DIC->database();
140  $this->access = $DIC->access();
141  $this->tree = $DIC->repositoryTree();
142  $this->error = $DIC["ilErr"];
143  $this->obj_definition = $DIC["objDefinition"];
144  $this->rbacadmin = $DIC->rbac()->admin();
145  $this->rbacreview = $DIC->rbac()->review();
146  $this->log = $DIC["ilLog"];
147  $this->obj_data_cache = $DIC["ilObjDataCache"];
148  $this->toolbar = $DIC->toolbar();
149  $this->plugin_admin = $DIC["ilPluginAdmin"];
150  $this->app_event_handler = $DIC["ilAppEventHandler"];
151  $this->ui = $DIC->ui();
152  $this->global_screen = $DIC->globalScreen();
153  $rbacsystem = $DIC->rbac()->system();
154  $lng = $DIC->language();
155 
156  $this->rbacsystem = $rbacsystem;
157 
158  $lng->loadLanguageModule("cntr");
159  $lng->loadLanguageModule('cont');
160 
161  // prepare output things should generally be made in executeCommand
162  // method (maybe dependent on current class/command
163  parent::__construct($a_data, $a_id, $a_call_by_reference, false);
164 
165  $this->container_filter_service = new ilContainerFilterService();
166  $this->initFilter();
167  }
settings()
Definition: settings.php:2
user()
Definition: user.php:4
ui()
Definition: ui.php:5
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
Container filter service factory.
+ Here is the call graph for this function:

Member Function Documentation

◆ __showTimingsButton()

ilContainerGUI::__showTimingsButton ( $tpl)

Definition at line 830 of file class.ilContainerGUI.php.

References ilObjectGUI\$tpl, and ilObjectGUI\$tree.

831  {
832  $tree = $this->tree;
833 
834  if (!$tree->checkForParentType($this->object->getRefId(), 'crs')) {
835  return false;
836  }
837  $tpl->setCurrentBlock("custom_button");
838  $tpl->setVariable("ADMIN_MODE_LINK", $this->ctrl->getLinkTargetByClass('ilcoursecontentgui', 'editTimings'));
839  $tpl->setVariable("TXT_ADMIN_MODE", $this->lng->txt('timings_edit'));
840  $tpl->parseCurrentBlock();
841  return true;
842  }

◆ _buildPath()

static ilContainerGUI::_buildPath (   $a_ref_id,
  $a_course_ref_id 
)
static

build path

Definition at line 2812 of file class.ilContainerGUI.php.

References ilObjectGUI\$data, $DIC, and ilObjectGUI\$tree.

2813  {
2814  global $DIC;
2815 
2816  $tree = $DIC->repositoryTree();
2817 
2818  $path_arr = $tree->getPathFull($a_ref_id, $a_course_ref_id);
2819  $counter = 0;
2820  foreach ($path_arr as $data) {
2821  if ($counter++) {
2822  $path .= " > ";
2823  }
2824  $path .= $data['title'];
2825  }
2826 
2827  return $path;
2828  }
$DIC
Definition: xapitoken.php:46

◆ addHeaderRow()

ilContainerGUI::addHeaderRow ( $a_tpl,
  $a_type,
  $a_show_image = true 
)

adds a header row to a block template

Parameters
object$a_tplblock template
string$a_typeobject type private

Definition at line 1154 of file class.ilContainerGUI.php.

References $a_type, $DIC, $ilSetting, $settings, ilContainerSortingSettings\_lookupSortMode(), ilUtil\getImagePath(), isActiveAdministrationPanel(), and ilContainer\SORT_MANUAL.

1155  {
1156  $icon = ilUtil::getImagePath("icon_" . $a_type . ".svg");
1157  $title = $this->lng->txt("objs_" . $a_type);
1158 
1159  if ($a_show_image) {
1160  $a_tpl->setCurrentBlock("container_header_row_image");
1161  $a_tpl->setVariable("HEADER_IMG", $icon);
1162  $a_tpl->setVariable("HEADER_ALT", $title);
1163  } else {
1164  $a_tpl->setCurrentBlock("container_header_row");
1165  }
1166 
1167  $a_tpl->setVariable("BLOCK_HEADER_CONTENT", $title);
1168  $a_tpl->parseCurrentBlock();
1169  //$a_tpl->touchBlock("container_row");
1170  }
$a_type
Definition: workflow.php:92
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:

◆ addMessageRow()

ilContainerGUI::addMessageRow ( $a_tpl,
  $a_message,
  $a_type 
)

add message row

Definition at line 1244 of file class.ilContainerGUI.php.

References $a_type, and $type.

1245  {
1246  $this->cur_row_type = ($this->cur_row_type == "row_type_1")
1247  ? "row_type_2"
1248  : "row_type_1";
1249 
1250  $a_tpl->touchBlock($this->cur_row_type);
1251 
1252  $type = $this->lng->txt("obj_" . $a_type);
1253  $a_message = str_replace("[type]", $type, $a_message);
1254 
1255  $a_tpl->setVariable("ROW_NBSP", " ");
1256 
1257  $a_tpl->setCurrentBlock("container_standard_row");
1258  $a_tpl->setVariable(
1259  "BLOCK_ROW_CONTENT",
1260  $a_message
1261  );
1262  $a_tpl->parseCurrentBlock();
1263  $a_tpl->touchBlock("container_row");
1264  }
$type
$a_type
Definition: workflow.php:92

◆ addPageTabs()

ilContainerGUI::addPageTabs ( )

Add page tabs.

Definition at line 401 of file class.ilContainerGUI.php.

References ilObjectGUI\$ctrl, $ilCtrl, and $tabs.

402  {
403  $ilTabs = $this->tabs;
405 
406  $ilTabs->addTarget(
407  "obj_sty",
408  $ilCtrl->getLinkTarget($this, 'editStyleProperties'),
409  "editStyleProperties"
410  );
411  }
global $ilCtrl
Definition: ilias.php:18

◆ addStandardContainerSubTabs()

ilContainerGUI::addStandardContainerSubTabs (   $a_include_view = true)

Add standar container subtabs for view, manage, oderdering and text/media editor link.

Definition at line 1303 of file class.ilContainerGUI.php.

References $_SESSION, $access, ilObjectGUI\$ctrl, $ilCtrl, $ilSetting, $ilUser, ilObjectGUI\$lng, $settings, $tabs, $user, ilFrameTargetInfo\_getFrame(), and isActiveAdministrationPanel().

Referenced by ilObjOrgUnitGUI\setContentSubTabs(), setContentSubTabs(), and ilObjCourseGUI\setContentSubTabs().

1304  {
1305  $ilTabs = $this->tabs;
1306  $ilAccess = $this->access;
1307  $lng = $this->lng;
1308  $ilCtrl = $this->ctrl;
1309  $ilUser = $this->user;
1311 
1312  if (!is_object($this->object)) {
1313  return;
1314  }
1315 
1316  if ($a_include_view && $this->rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
1317  if (!$this->isActiveAdministrationPanel()) {
1318  $ilTabs->addSubTab("view_content", $lng->txt("view"), $ilCtrl->getLinkTarget($this, "view"));
1319  } else {
1320  $ilTabs->addSubTab("view_content", $lng->txt("view"), $ilCtrl->getLinkTarget($this, "disableAdministrationPanel"));
1321  }
1322  }
1323 
1324  if ($ilUser->getId() != ANONYMOUS_USER_ID &&
1325  (
1326  $this->adminCommands ||
1327  (is_object($this->object) &&
1328  ($this->rbacsystem->checkAccess("write", $this->object->getRefId())))
1329  ||
1330  (is_object($this->object) &&
1331  ($this->object->getHiddenFilesFound())) ||
1332  $_SESSION["clipboard"]
1333  )
1334  ) {
1335  if ($this->isActiveAdministrationPanel()) {
1336  $ilTabs->addSubTab("manage", $lng->txt("cntr_manage"), $ilCtrl->getLinkTarget($this, ""));
1337  } else {
1338  $ilTabs->addSubTab("manage", $lng->txt("cntr_manage"), $ilCtrl->getLinkTarget($this, "enableAdministrationPanel"));
1339  }
1340  }
1341  if ($ilUser->getId() != ANONYMOUS_USER_ID &&
1342  is_object($this->object) &&
1343  $this->rbacsystem->checkAccess("write", $this->object->getRefId()) /* &&
1344  $this->object->getOrderType() == ilContainer::SORT_MANUAL */ // always on because of custom block order
1345  ) {
1346  $ilTabs->addSubTab("ordering", $lng->txt("cntr_ordering"), $ilCtrl->getLinkTarget($this, "editOrder"));
1347  }
1348  if ($ilUser->getId() != ANONYMOUS_USER_ID &&
1349  is_object($this->object) &&
1350  $this->rbacsystem->checkAccess("write", $this->object->getRefId())
1351  ) {
1352  if ($ilSetting->get("enable_cat_page_edit")) {
1353  $ilTabs->addSubTab(
1354  "page_editor",
1355  $lng->txt("cntr_text_media_editor"),
1356  $ilCtrl->getLinkTarget($this, "editPageFrame"),
1357  ilFrameTargetInfo::_getFrame("MainContent")
1358  );
1359  }
1360  }
1361  }
$_SESSION["AccountId"]
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
static _getFrame($a_class, $a_type='')
Get content frame name.
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterUpdate()

ilContainerGUI::afterUpdate ( )
protected

Definition at line 224 of file class.ilContainerGUI.php.

References ilObjectGUI\getDidacticTemplateVar(), and ilDidacticTemplateObjSettings\lookupTemplateId().

Referenced by ilObjCourseGUI\updateObject(), and ilObjCategoryGUI\updateObject().

225  {
226  // check if template is changed
227  include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
228  $current_tpl_id = (int) ilDidacticTemplateObjSettings::lookupTemplateId(
229  $this->object->getRefId()
230  );
231  $new_tpl_id = (int) $this->getDidacticTemplateVar('dtpl');
232 
233  if ($new_tpl_id != $current_tpl_id) {
234  $_REQUEST['tplid'] = $new_tpl_id;
235 
236  // redirect to didactic template confirmation
237  include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateGUI.php';
238  $this->ctrl->setReturn($this, 'edit');
239  $this->ctrl->setCmdClass('ildidactictemplategui');
240  $this->ctrl->setCmd('confirmTemplateSwitch');
241  $dtpl_gui = new ilDidacticTemplateGUI($this);
242  return $this->ctrl->forwardCommand($dtpl_gui);
243  }
244  parent::afterUpdate();
245  }
static lookupTemplateId($a_ref_id)
Lookup template id ilDB $ilDB.
GUI class for didactic template settings inside repository objects.
getDidacticTemplateVar($a_type)
Get didactic template setting from creation screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ allowBlocksConfigure()

ilContainerGUI::allowBlocksConfigure ( )

Standard is to allow blocks configuration.

Definition at line 2526 of file class.ilContainerGUI.php.

2527  {
2528  return true;
2529  }

◆ allowBlocksMoving()

ilContainerGUI::allowBlocksMoving ( )

Standard is to allow blocks moving.

Definition at line 2518 of file class.ilContainerGUI.php.

2519  {
2520  return true;
2521  }

◆ cancelMoveLinkObject()

ilContainerGUI::cancelMoveLinkObject ( )

Cancel move|link empty clipboard and return to parent.

Definition at line 2115 of file class.ilContainerGUI.php.

References $_SESSION, ilObjectGUI\$ctrl, and $ilCtrl.

2116  {
2117  $ilCtrl = $this->ctrl;
2118 
2119  unset($_SESSION['clipboard']);
2120  $ilCtrl->returnToParent($this);
2121  }
$_SESSION["AccountId"]
global $ilCtrl
Definition: ilias.php:18

◆ cancelPageContentObject()

ilContainerGUI::cancelPageContentObject ( )

Definition at line 1050 of file class.ilContainerGUI.php.

1051  {
1052  $this->ctrl->redirect($this, "");
1053  }

◆ clearAdminCommandsDetermination()

ilContainerGUI::clearAdminCommandsDetermination ( )

cleaer administration commands determination

Definition at line 1103 of file class.ilContainerGUI.php.

1104  {
1105  $this->adminCommands = false;
1106  }

◆ clearObject()

ilContainerGUI::clearObject ( )

clear clipboard and go back to last object

public

Definition at line 1731 of file class.ilContainerGUI.php.

References $_POST, and $_SESSION.

Referenced by pasteObject(), and performPasteIntoMultipleObjectsObject().

1732  {
1733  unset($_SESSION["clipboard"]);
1734  unset($_SESSION["il_rep_clipboard"]);
1735 
1736  //var_dump($this->getReturnLocation("clear",$this->ctrl->getLinkTarget($this)),get_class($this));
1737 
1738  // only redirect if clipboard was cleared
1739  if (isset($_POST["cmd"]["clear"])) {
1740  ilUtil::sendSuccess($this->lng->txt("msg_clear_clipboard"), true);
1741  // fixed mantis 0018474: Clear Clipboard redirects to Subtab View, instead of Subtab "Edit Multiple"
1742  $this->ctrl->redirect($this, 'render');
1743  }
1744  }
$_SESSION["AccountId"]
$_POST["username"]
+ Here is the caller graph for this function:

◆ clipboardObject()

ilContainerGUI::clipboardObject ( )

show clipboard

Definition at line 2420 of file class.ilContainerGUI.php.

References $_SESSION, ilObjectGUI\$ctrl, ilObjectGUI\$data, $error, $ilCtrl, ilObjectGUI\$ilErr, $ilLog, ilObjectGUI\$lng, $log, $message, ilObjectGUI\$ref_id, $tab, $tabs, $toolbar, ilObjectGUI\$tpl, and ilObjectFactory\getInstanceByRefId().

2421  {
2422  $ilErr = $this->error;
2423  $ilLog = $this->log;
2424  $ilTabs = $this->tabs;
2425  $tpl = $this->tpl;
2426  $ilToolbar = $this->toolbar;
2427  $ilCtrl = $this->ctrl;
2428  $lng = $this->lng;
2429 
2430  $ilTabs->activateTab("clipboard");
2431 
2432  // function should not be called if clipboard is empty
2433  if (empty($_SESSION['clipboard']) or !is_array($_SESSION['clipboard'])) {
2434  $message = sprintf('%s::clipboardObject(): Illegal access. Clipboard variable is empty!', get_class($this));
2435  $ilLog->write($message, $ilLog->FATAL);
2436  $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->WARNING);
2437  }
2438 
2439  $data = array();
2440  foreach ($_SESSION["clipboard"]["ref_ids"] as $ref_id) {
2441  if (!$tmp_obj = ilObjectFactory::getInstanceByRefId($ref_id, false)) {
2442  continue;
2443  }
2444 
2445  $data[] = array(
2446  "type" => $tmp_obj->getType(),
2447  "type_txt" => $this->lng->txt("obj_" . $tmp_obj->getType()),
2448  "title" => $tmp_obj->getTitle(),
2449  "cmd" => ($_SESSION["clipboard"]["cmd"] == "cut") ? $this->lng->txt("move") :$this->lng->txt($_SESSION["clipboard"]["cmd"]),
2450  "ref_id" => $ref_id,
2451  "obj_id" => $tmp_obj->getId()
2452  );
2453 
2454  unset($tmp_obj);
2455  }
2456 
2457  include_once("./Services/Object/classes/class.ilObjClipboardTableGUI.php");
2458  $tab = new ilObjClipboardTableGUI($this, "clipboard");
2459  $tab->setData($data);
2460  $tpl->setContent($tab->getHTML());
2461 
2462  if (count($data) > 0) {
2463  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
2464  $ilToolbar->addFormButton(
2465  $lng->txt("insert_object_here"),
2466  "paste"
2467  );
2468  $ilToolbar->addFormButton(
2469  $lng->txt("clear_clipboard"),
2470  "clear"
2471  );
2472  }
2473 
2474  return true;
2475  }
$_SESSION["AccountId"]
global $ilCtrl
Definition: ilias.php:18
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
$message
Definition: xapiexit.php:14
+ Here is the call graph for this function:

◆ cloneAllObject()

ilContainerGUI::cloneAllObject ( )

Clone all object Overwritten method for copying container objects.

public

Definition at line 2671 of file class.ilContainerGUI.php.

References $_COOKIE, $_GET, $_POST, $access, ilObjectGUI\$ctrl, $error, $ilCtrl, ilObjectGUI\$ilErr, $ilLog, $ilUser, $log, $rbacsystem, ilObjectGUI\$ref_id, $result, ilObjectGUI\$tree, $user, ilCopyWizardOptions\_isFinished(), ilObjectGUI\createObject(), ilObjectFactory\getInstanceByRefId(), ilUtil\sendFailure(), and ilUtil\sendInfo().

2672  {
2673  $ilLog = $this->log;
2674  $ilCtrl = $this->ctrl;
2675 
2676  include_once('./Services/Link/classes/class.ilLink.php');
2677  include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
2678 
2679  $ilAccess = $this->access;
2680  $ilErr = $this->error;
2682  $tree = $this->tree;
2683  $ilUser = $this->user;
2684 
2685  $new_type = $_REQUEST['new_type'];
2686  $ref_id = (int) $_GET['ref_id'];
2687  $clone_source = (int) $_REQUEST['clone_source'];
2688 
2689  if (!$rbacsystem->checkAccess('create', $ref_id, $new_type)) {
2690  $ilErr->raiseError($this->lng->txt('permission_denied'));
2691  }
2692  if (!$clone_source) {
2693  ilUtil::sendFailure($this->lng->txt('select_one'));
2694  $this->createObject();
2695  return false;
2696  }
2697  if (!$ilAccess->checkAccess('write', '', $clone_source, $new_type)) {
2698  $ilErr->raiseError($this->lng->txt('permission_denied'));
2699  }
2700 
2701  $options = $_POST['cp_options'] ? $_POST['cp_options'] : array();
2702  $orig = ilObjectFactory::getInstanceByRefId($clone_source);
2703  $result = $orig->cloneAllObject($_COOKIE[session_name()], $_COOKIE['ilClientId'], $new_type, $ref_id, $clone_source, $options);
2704 
2705  include_once './Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
2706  if (ilCopyWizardOptions::_isFinished($result['copy_id'])) {
2707  ilUtil::sendSuccess($this->lng->txt("object_duplicated"), true);
2708  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $result['ref_id']);
2709  $ilCtrl->redirectByClass("ilrepositorygui", "");
2710  } else {
2711  ilUtil::sendInfo($this->lng->txt("object_copy_in_progress"), true);
2712  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $ref_id);
2713  $ilCtrl->redirectByClass("ilrepositorygui", "");
2714  }
2715  }
$result
$_GET["client_id"]
createObject()
create new object form
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _isFinished($a_copy_id)
check if copy is finished
$ilUser
Definition: imgupload.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
$_COOKIE[session_name()]
Definition: xapitoken.php:39
$_POST["username"]
+ Here is the call graph for this function:

◆ cloneNodes()

ilContainerGUI::cloneNodes (   $srcRef,
  $dstRef,
$mapping,
  $newName = null 
)

Recursively clones all nodes of the RBAC tree.

private

Parameters
integerref_id of source object
integerref_id of destination object
arraymapping new_ref_id => old_ref_id
stringthe new name of the copy (optional).
Returns
The ref_id pointing to the cloned object.

Definition at line 2749 of file class.ilContainerGUI.php.

References ilObjectGUI\$tree, and ilObjectFactory\getInstanceByRefId().

Referenced by performPasteIntoMultipleObjectsObject().

2750  {
2751  $tree = $this->tree;
2752 
2753  // clone the source node
2754  $srcObj = ilObjectFactory::getInstanceByRefId($srcRef);
2755  error_log(__METHOD__ . ' cloning srcRef=' . $srcRef . ' dstRef=' . $dstRef . '...');
2756  $newRef = $srcObj->cloneObject($dstRef)->getRefId();
2757  error_log(__METHOD__ . ' ...cloning... newRef=' . $newRef . '...');
2758 
2759  // We must immediately apply a new name to the object, to
2760  // prevent confusion of WebDAV clients about having two objects with identical
2761  // name in the repository.
2762  if (!is_null($newName)) {
2763  $newObj = ilObjectFactory::getInstanceByRefId($newRef);
2764  $newObj->setTitle($newName);
2765  $newObj->update();
2766  unset($newObj);
2767  }
2768  unset($srcObj);
2769  $mapping[$newRef] = $srcRef;
2770 
2771  // clone all children of the source node
2772  $children = $tree->getChilds($srcRef);
2773  foreach ($tree->getChilds($srcRef) as $child) {
2774  // Don't clone role folders, because it does not make sense to clone local roles
2775  // FIXME - Maybe it does make sense (?)
2776  if ($child["type"] != 'rolf') {
2777  $this->cloneNodes($child["ref_id"], $newRef, $mapping);
2778  } else {
2779  if (count($rolf = $tree->getChildsByType($newRef, "rolf"))) {
2780  $mapping[$rolf[0]["ref_id"]] = $child["ref_id"];
2781  }
2782  }
2783  }
2784  error_log(__METHOD__ . ' ...cloned srcRef=' . $srcRef . ' dstRef=' . $dstRef . ' newRef=' . $newRef);
2785  return $newRef;
2786  }
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
cloneNodes($srcRef, $dstRef, &$mapping, $newName=null)
Recursively clones all nodes of the RBAC tree.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneWizardPageListObject()

ilContainerGUI::cloneWizardPageListObject ( )

public

Parameters

Definition at line 2550 of file class.ilContainerGUI.php.

References cloneWizardPageObject().

2551  {
2552  $this->cloneWizardPageObject(false);
2553  }
cloneWizardPageObject($a_tree_view=true)
Show clone wizard page for container objects.
+ Here is the call graph for this function:

◆ cloneWizardPageObject()

ilContainerGUI::cloneWizardPageObject (   $a_tree_view = true)

Show clone wizard page for container objects.

public

Definition at line 2561 of file class.ilContainerGUI.php.

References $_SESSION, $i, $obj_data_cache, ilObjectGUI\$tree, $type, ilCopyWizardPageFactory\_getInstanceByType(), ilObjectGUI\createObject(), ilUtil\getImagePath(), and ilUtil\sendFailure().

Referenced by cloneWizardPageListObject(), and cloneWizardPageTreeObject().

2562  {
2563  include_once('Services/CopyWizard/classes/class.ilCopyWizardPageFactory.php');
2564 
2565  $ilObjDataCache = $this->obj_data_cache;
2566  $tree = $this->tree;
2567 
2568  if (!$_REQUEST['clone_source']) {
2569  ilUtil::sendFailure($this->lng->txt('select_one'));
2570  if (isset($_SESSION['wizard_search_title'])) {
2571  $this->searchCloneSourceObject();
2572  } else {
2573  $this->createObject();
2574  }
2575  return false;
2576  }
2577  $source_id = $_REQUEST['clone_source'];
2578  $new_type = $_REQUEST['new_type'];
2579  $this->ctrl->setParameter($this, 'clone_source', (int) $_REQUEST['clone_source']);
2580  $this->ctrl->setParameter($this, 'new_type', $new_type);
2581 
2582 
2583  // Generell JavaScript
2584  $this->tpl->addJavaScript('./Services/CopyWizard/js/ilContainer.js');
2585  $this->tpl->setVariable('BODY_ATTRIBUTES', 'onload="ilDisableChilds(\'cmd\');"');
2586 
2587 
2588  $this->tpl->addBlockFile(
2589  'ADM_CONTENT',
2590  'adm_content',
2591  'tpl.container_wizard_page.html',
2592  "Services/Container"
2593  );
2594  $this->tpl->setVariable('FORMACTION', $this->ctrl->getFormAction($this));
2595  $this->tpl->setVariable('TYPE_IMG', ilUtil::getImagePath('icon_' . $new_type . '.svg'));
2596  $this->tpl->setVariable('ALT_IMG', $this->lng->txt('obj_' . $new_type));
2597  $this->tpl->setVariable('TXT_DUPLICATE', $this->lng->txt($new_type . '_wizard_page'));
2598  $this->tpl->setVariable('INFO_DUPLICATE', $this->lng->txt($new_type . '_copy_threads_info'));
2599  $this->tpl->setVariable('BTN_COPY', $this->lng->txt('obj_' . $new_type . '_duplicate'));
2600  $this->tpl->setVariable('BTN_BACK', $this->lng->txt('btn_back'));
2601  if (isset($_SESSION['wizard_search_title'])) {
2602  $this->tpl->setVariable('CMD_BACK', 'searchCloneSource');
2603  } else {
2604  $this->tpl->setVariable('CMD_BACK', 'create');
2605  }
2606 
2607  $this->tpl->setVariable('BTN_TREE', $this->lng->txt('treeview'));
2608  $this->tpl->setVariable('BTN_LIST', $this->lng->txt('flatview'));
2609 
2610  // Fill item rows
2611  // tree view
2612  if ($a_tree_view) {
2613  $first = true;
2614  $has_items = false;
2615  foreach ($subnodes = $tree->getSubtree($source_node = $tree->getNodeData($source_id), true) as $node) {
2616  if ($first == true) {
2617  $first = false;
2618  continue;
2619  }
2620 
2621  if ($node['type'] == 'rolf') {
2622  continue;
2623  }
2624 
2625  $has_items = true;
2626 
2627  for ($i = $source_node['depth'];$i < $node['depth']; $i++) {
2628  $this->tpl->touchBlock('padding');
2629  $this->tpl->touchBlock('end_padding');
2630  }
2631  // fill options
2632  $copy_wizard_page = ilCopyWizardPageFactory::_getInstanceByType($source_id, $node['type']);
2633  $copy_wizard_page->fillTreeSelection($node['ref_id'], $node['type'], $node['depth']);
2634 
2635  $this->tpl->setCurrentBlock('tree_row');
2636  $this->tpl->setVariable('TREE_IMG', ilUtil::getImagePath('icon_' . $node['type'] . '.svg'));
2637  $this->tpl->setVariable('TREE_ALT_IMG', $this->lng->txt('obj_' . $node['type']));
2638  $this->tpl->setVariable('TREE_TITLE', $node['title']);
2639  $this->tpl->parseCurrentBlock();
2640  }
2641  if (!$has_items) {
2642  $this->tpl->setCurrentBlock('no_content');
2643  $this->tpl->setVariable('TXT_NO_CONTENT', $this->lng->txt('container_no_items'));
2644  $this->tpl->parseCurrentBlock();
2645  } else {
2646  $this->tpl->setCurrentBlock('tree_footer');
2647  $this->tpl->setVariable('TXT_COPY_ALL', $this->lng->txt('copy_all'));
2648  $this->tpl->setVariable('TXT_LINK_ALL', $this->lng->txt('link_all'));
2649  $this->tpl->setVariable('TXT_OMIT_ALL', $this->lng->txt('omit_all'));
2650  $this->tpl->parseCurrentBlock();
2651  }
2652  } else {
2653  foreach ($tree->getSubTreeTypes($source_id, array('rolf','crs')) as $type) {
2654  $copy_wizard_page = ilCopyWizardPageFactory::_getInstanceByType($source_id, $type);
2655  if (strlen($html = $copy_wizard_page->getWizardPageBlockHTML())) {
2656  $this->tpl->setCurrentBlock('obj_row');
2657  $this->tpl->setVariable('ITEM_BLOCK', $html);
2658  $this->tpl->parseCurrentBlock();
2659  }
2660  }
2661  }
2662  }
static _getInstanceByType($a_source_id, $a_item_type)
Get instance by type.
$_SESSION["AccountId"]
$type
createObject()
create new object form
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$i
Definition: metadata.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneWizardPageTreeObject()

ilContainerGUI::cloneWizardPageTreeObject ( )

public

Parameters

Definition at line 2538 of file class.ilContainerGUI.php.

References cloneWizardPageObject().

2539  {
2540  $this->cloneWizardPageObject(true);
2541  }
cloneWizardPageObject($a_tree_view=true)
Show clone wizard page for container objects.
+ Here is the call graph for this function:

◆ confirmRemoveFromSystemObject()

ilContainerGUI::confirmRemoveFromSystemObject ( )

confirmation screen remove from system

Definition at line 3633 of file class.ilContainerGUI.php.

References $_POST, ilObjectGUI\$lng, and ilUtil\sendFailure().

3634  {
3635  $lng = $this->lng;
3636  include_once("./Services/Repository/classes/class.ilRepUtilGUI.php");
3637 
3638  if (!isset($_POST["trash_id"])) {
3639  ilUtil::sendFailure($lng->txt("no_checkbox"), true);
3640  $this->ctrl->redirect($this, "trash");
3641  }
3642 
3643  $ru = new ilRepUtilGUI($this);
3644  $ru->confirmRemoveFromSystemObject($_POST["trash_id"]);
3645  }
Repository GUI Utilities.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ copyObject()

ilContainerGUI::copyObject ( )

Copy object(s) out from a container and write the information to clipboard It is not possible to copy multiple objects at once.

public

Definition at line 1539 of file class.ilContainerGUI.php.

References $_GET, $_POST, $_SESSION, ilObjectGUI\$ctrl, $error, $ilCtrl, ilObjectGUI\$ilErr, $obj_definition, ilObjectGUI\$objDefinition, $rbacsystem, ilObjectGUI\$ref_id, ilObject\_lookupObjId(), ilObject\_lookupTitle(), initAndDisplayCopyIntoMultipleObjectsObject(), and ilUtil\sendInfo().

1540  {
1542  $ilCtrl = $this->ctrl;
1544  $ilErr = $this->error;
1545 
1546  $no_copy = [];
1547 
1548  if ($_GET["item_ref_id"] != "") {
1549  $_POST["id"] = array($_GET["item_ref_id"]);
1550  }
1551 
1552  if (!isset($_POST["id"])) {
1553  $ilErr->raiseError($this->lng->txt("no_checkbox"), $ilErr->MESSAGE);
1554  }
1555 
1556  // FOR ALL OBJECTS THAT SHOULD BE COPIED
1557  $containers = 0;
1558  foreach ($_POST["id"] as $ref_id) {
1559  // GET COMPLETE NODE_DATA OF ALL SUBTREE NODES
1560  $node_data = $this->tree->getNodeData($ref_id);
1561 
1562  // count containers
1563  if ($objDefinition->isContainer($node_data["type"])) {
1564  $containers++;
1565  }
1566 
1567  $subtree_nodes = $this->tree->getSubTree($node_data);
1568 
1569  $all_node_data[] = $node_data;
1570  $all_subtree_nodes[] = $subtree_nodes;
1571 
1572  // CHECK COPY PERMISSION OF ALL OBJECTS IN ACTUAL SUBTREE
1573  foreach ($subtree_nodes as $node) {
1574  if ($node['type'] == 'rolf') {
1575  continue;
1576  }
1577 
1578  if (!$rbacsystem->checkAccess('visible,read,copy', $node["ref_id"])) {
1579  $no_copy[] = $node["ref_id"];
1580  }
1581  }
1582  }
1583 
1584  if ($containers > 0 && count($_POST["id"]) > 1) {
1585  $ilErr->raiseError($this->lng->txt("cntr_container_only_on_their_own"), $ilErr->MESSAGE);
1586  }
1587 
1588  // IF THERE IS ANY OBJECT WITH NO PERMISSION TO 'delete'
1589  if (is_array($no_copy) && count($no_copy)) {
1590  $titles = array();
1591  foreach ((array) $no_copy as $copy_id) {
1592  $titles[] = ilObject::_lookupTitle(ilObject::_lookupObjId($copy_id));
1593  }
1594  $ilErr->raiseError(
1595  $this->lng->txt("msg_no_perm_copy") . " " . implode(',', $titles),
1596  $ilErr->MESSAGE
1597  );
1598  }
1599 
1600  // if we have a single container, set it as source id and redirect to ilObjectCopyGUI
1601  if (count($_POST["id"]) == 1) {
1602  $ilCtrl->setParameterByClass("ilobjectcopygui", "source_id", $_POST["id"][0]);
1603  $ilCtrl->redirectByClass("ilobjectcopygui", "initTargetSelection");
1604  } else {
1605  $ilCtrl->setParameterByClass("ilobjectcopygui", "source_ids", implode("_", $_POST["id"]));
1606  $ilCtrl->redirectByClass("ilobjectcopygui", "initTargetSelection");
1607  }
1608 
1609  $_SESSION["clipboard"]["parent"] = $_GET["ref_id"];
1610  $_SESSION["clipboard"]["cmd"] = $ilCtrl->getCmd();
1611  $_SESSION["clipboard"]["ref_ids"] = $_POST["id"];
1612 
1613  ilUtil::sendInfo($this->lng->txt("msg_copy_clipboard"), true);
1614 
1616  } // END COPY
$_SESSION["AccountId"]
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _lookupObjId($a_id)
$_POST["username"]
+ Here is the call graph for this function:

◆ createStyleObject()

ilContainerGUI::createStyleObject ( )

Create Style.

Definition at line 2966 of file class.ilContainerGUI.php.

References ilObjectGUI\$ctrl, and $ilCtrl.

2967  {
2968  $ilCtrl = $this->ctrl;
2969 
2970  $ilCtrl->redirectByClass("ilobjstylesheetgui", "create");
2971  }
global $ilCtrl
Definition: ilias.php:18

◆ cutObject()

ilContainerGUI::cutObject ( )

cut object(s) out from a container and write the information to clipboard

public

Definition at line 1476 of file class.ilContainerGUI.php.

References $_GET, $_POST, $_SESSION, ilObjectGUI\$ctrl, $error, $ilCtrl, ilObjectGUI\$ilErr, $rbacsystem, ilObjectGUI\$ref_id, ilObject\_lookupObjId(), ilObject\_lookupTitle(), initAndDisplayMoveIntoObjectObject(), and ilUtil\sendInfo().

Referenced by ilObjLearningSequenceGUI\executeCommand().

1477  {
1479  $ilCtrl = $this->ctrl;
1480  $ilErr = $this->error;
1481 
1482  if ($_GET["item_ref_id"] != "") {
1483  $_POST["id"] = array($_GET["item_ref_id"]);
1484  }
1485 
1486  $no_cut = [];
1487 
1488  if (!isset($_POST["id"])) {
1489  $ilErr->raiseError($this->lng->txt("no_checkbox"), $ilErr->MESSAGE);
1490  }
1491 
1492  // FOR ALL OBJECTS THAT SHOULD BE COPIED
1493  foreach ($_POST["id"] as $ref_id) {
1494  // GET COMPLETE NODE_DATA OF ALL SUBTREE NODES
1495  $node_data = $this->tree->getNodeData($ref_id);
1496  $subtree_nodes = $this->tree->getSubTree($node_data);
1497 
1498  $all_node_data[] = $node_data;
1499  $all_subtree_nodes[] = $subtree_nodes;
1500 
1501  // CHECK DELETE PERMISSION OF ALL OBJECTS IN ACTUAL SUBTREE
1502  foreach ($subtree_nodes as $node) {
1503  if ($node['type'] == 'rolf') {
1504  continue;
1505  }
1506 
1507  if (!$rbacsystem->checkAccess('delete', $node["ref_id"])) {
1508  $no_cut[] = $node["ref_id"];
1509  }
1510  }
1511  }
1512  // IF THERE IS ANY OBJECT WITH NO PERMISSION TO 'delete'
1513  if (count($no_cut)) {
1514  $titles = array();
1515  foreach ((array) $no_cut as $cut_id) {
1516  $titles[] = ilObject::_lookupTitle(ilObject::_lookupObjId($cut_id));
1517  }
1518  $ilErr->raiseError(
1519  $this->lng->txt("msg_no_perm_cut") . " " . implode(',', (array) $titles),
1520  $ilErr->MESSAGE
1521  );
1522  }
1523  $_SESSION["clipboard"]["parent"] = $_GET["ref_id"];
1524  $_SESSION["clipboard"]["cmd"] = $ilCtrl->getCmd();
1525  $_SESSION["clipboard"]["ref_ids"] = $_POST["id"];
1526 
1527  ilUtil::sendInfo($this->lng->txt("msg_cut_clipboard"), true);
1528 
1529  return $this->initAndDisplayMoveIntoObjectObject();
1530  } // END CUT
$_SESSION["AccountId"]
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _lookupObjId($a_id)
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteStyleObject()

ilContainerGUI::deleteStyleObject ( )

Delete Style.

Definition at line 2986 of file class.ilContainerGUI.php.

References ilObjectGUI\$ctrl, and $ilCtrl.

2987  {
2988  $ilCtrl = $this->ctrl;
2989 
2990  $ilCtrl->redirectByClass("ilobjstylesheetgui", "delete");
2991  }
global $ilCtrl
Definition: ilias.php:18

◆ disableAdministrationPanelObject()

ilContainerGUI::disableAdministrationPanelObject ( )

enable administration panel

Definition at line 1414 of file class.ilContainerGUI.php.

References $_SESSION.

1415  {
1416  $_SESSION["il_cont_admin_panel"] = false;
1417  $this->ctrl->redirect($this, "render");
1418  }
$_SESSION["AccountId"]

◆ downloadObject()

ilContainerGUI::downloadObject ( )

Definition at line 1618 of file class.ilContainerGUI.php.

References $_GET, $_POST, $error, $GLOBALS, ilObjectGUI\$ilErr, ilObjectGUI\$object, getBucketTitle(), ilObjectFactory\getInstanceByRefId(), and user().

1619  {
1620  $ilErr = $this->error;
1621  // This variable determines whether the task has been initiated by a folder's action drop-down to prevent a folder
1622  // duplicate inside the zip.
1623  $initiated_by_folder_action = false;
1624 
1625  if ($_GET["item_ref_id"] != "") {
1626  $_POST["id"] = array($_GET["item_ref_id"]);
1627  }
1628 
1629  if (!isset($_POST["id"])) {
1631  $object_type = $object->getType();
1632  if ($object_type == "fold") {
1633  $_POST["id"] = array($_GET['ref_id']);
1634  $initiated_by_folder_action = true;
1635  } else {
1636  $ilErr->raiseError($this->lng->txt("no_checkbox"), $ilErr->MESSAGE);
1637  }
1638  }
1639 
1640  include_once './Services/Container/classes/BackgroundTasks/class.ilDownloadContainerFilesBackgroundTask.php';
1641  $download_job = new ilDownloadContainerFilesBackgroundTask($GLOBALS['DIC']->user()->getId(), $_POST["id"], $initiated_by_folder_action);
1642 
1643  $download_job->setBucketTitle($this->getBucketTitle());
1644  if ($download_job->run()) {
1645  ilUtil::sendSuccess($this->lng->txt('msg_bt_download_started'), true);
1646  }
1647  $GLOBALS['DIC']->ctrl()->redirect($this);
1648  }
getBucketTitle()
get proper label to add in the background task popover
$_GET["client_id"]
user()
Definition: user.php:4
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
$_POST["username"]
+ Here is the call graph for this function:

◆ editOrderObject()

ilContainerGUI::editOrderObject ( )

Edit order.

Definition at line 1423 of file class.ilContainerGUI.php.

References $_SESSION, $tabs, and renderObject().

1424  {
1425  $ilTabs = $this->tabs;
1426 
1427  $this->edit_order = true;
1428  $_SESSION["il_cont_admin_panel"] = false;
1429  $this->renderObject();
1430 
1431  $ilTabs->activateSubTab("ordering");
1432  }
$_SESSION["AccountId"]
renderObject()
render the object
+ Here is the call graph for this function:

◆ editPageContentObject()

ilContainerGUI::editPageContentObject ( )

edit page content (for repository root node and categories)

public

Definition at line 938 of file class.ilContainerGUI.php.

References $_GET, ilObjectGUI\$ctrl, $error, $ilCtrl, ilObjectGUI\$ilErr, ilObjectGUI\$lng, ilObjectGUI\$obj_id, $rbacsystem, ilObjectGUI\$tpl, ilRTE\_getRTEClassname(), ilContainer\_lookupContainerSetting(), ilObject\_lookupObjectId(), ilObject\_lookupType(), ilUtil\getImagePath(), and ilUtil\prepareFormOutput().

939  {
941  $tpl = $this->tpl;
942  $lng = $this->lng;
945 
946  if (!$rbacsystem->checkAccess("write", $this->ref_id)) {
947  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
948  }
949 
951  $this->object->getId(),
952  "xhtml_page"
953  );
954  if ($xpage_id > 0) {
955  include_once("Services/XHTMLPage/classes/class.ilXHTMLPage.php");
956  $xpage = new ilXHTMLPage($xpage_id);
957  $content = $xpage->getContent();
958  }
959 
960  // get template
961  $tpl->addBlockFile(
962  "ADM_CONTENT",
963  "adm_content",
964  "tpl.container_edit_page_content.html",
965  "Services/Container"
966  );
967  $tpl->setVariable("VAL_CONTENT", ilUtil::prepareFormOutput($content));
968  $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
969  $tpl->setVariable(
970  "TXT_EDIT_PAGE_CONTENT",
971  $this->lng->txt("edit_page_content")
972  );
973  $tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
974  $tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
975  $tpl->setVariable("TXT_MIGRATION_INFO", $lng->txt("cntr_old_editor_warning"));
976  $tpl->setVariable("TXT_MIGRATION_OPEN_STD_EDITOR", $lng->txt("cntr_old_editor_open_standard_editor"));
977  $tpl->setVariable("IMG_WARNING", ilUtil::getImagePath("icon_alert.svg"));
978  $tpl->setVariable("HREF_OPEN_STD_EDITOR", $ilCtrl->getLinkTarget($this, "switchToStdEditor"));
979  $tpl->setVariable("ALT_WARNING", $lng->txt("warning"));
980 
981  include_once("./Services/Form/classes/class.ilFormPropertyGUI.php");
982  include_once("./Services/Form/classes/class.ilTextAreaInputGUI.php");
983  //$ta = new ilTextAreaInputGUI();
984  //$tags = $ta->getRteTagSet("extended_table_img");
985 
986  // add rte support
987  include_once "./Services/RTE/classes/class.ilRTE.php";
988  $rtestring = ilRTE::_getRTEClassname();
989  include_once "./Services/RTE/classes/class.$rtestring.php";
990  $rte = new $rtestring();
991  //$rte->addPlugin("latex");
992  include_once "./Services/Object/classes/class.ilObject.php";
994  $obj_type = ilObject::_lookupType($_GET["ref_id"], true);
995  $rte->addRTESupport($obj_id, $obj_type);
996  //$rte->setStyleSelect(true);
997  //$rte->addCustomRTESupport($obj_id, $obj_type, $tags);
998  }
static _getRTEClassname()
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
$_GET["client_id"]
static _lookupObjectId($a_ref_id)
lookup object id
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupType($a_id, $a_reference=false)
lookup object type
XHTML Page class.
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
+ Here is the call graph for this function:

◆ editPageFrameObject()

ilContainerGUI::editPageFrameObject ( )

show page editor frameset

Definition at line 919 of file class.ilContainerGUI.php.

References $_SESSION, and ilContainer\_lookupContainerSetting().

920  {
921  // old tiny stuff
923  $this->object->getId(),
924  "xhtml_page"
925  );
926  if ($xpage_id > 0 && $_SESSION["il_cntr_editor"] != "std") {
927  $this->ctrl->redirect($this, "editPageContent");
928  } else {
929  $this->ctrl->redirectByClass(array("ilcontainerpagegui"), "edit");
930  }
931  }
$_SESSION["AccountId"]
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
+ Here is the call graph for this function:

◆ editStyleObject()

ilContainerGUI::editStyleObject ( )

Edit Style.

Definition at line 2976 of file class.ilContainerGUI.php.

References ilObjectGUI\$ctrl, and $ilCtrl.

2977  {
2978  $ilCtrl = $this->ctrl;
2979 
2980  $ilCtrl->redirectByClass("ilobjstylesheetgui", "edit");
2981  }
global $ilCtrl
Definition: ilias.php:18

◆ editStylePropertiesObject()

ilContainerGUI::editStylePropertiesObject ( )

Edit style properties.

Definition at line 2837 of file class.ilContainerGUI.php.

References $tabs, ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), and initStylePropertiesForm().

2838  {
2839  $ilTabs = $this->tabs;
2840  $tpl = $this->tpl;
2841 
2842  $this->checkPermission("write");
2843 
2844  $this->initStylePropertiesForm();
2845  $tpl->setContent($this->form->getHTML());
2846 
2847  $ilTabs->activateTab("obj_sty");
2848  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
initStylePropertiesForm()
Init style properties form.
+ Here is the call graph for this function:

◆ enableAdministrationPanelObject()

ilContainerGUI::enableAdministrationPanelObject ( )

enable administration panel

Definition at line 1405 of file class.ilContainerGUI.php.

References $_SESSION.

1406  {
1407  $_SESSION["il_cont_admin_panel"] = true;
1408  $this->ctrl->redirect($this, "render");
1409  }
$_SESSION["AccountId"]

◆ enableMultiDownloadObject()

ilContainerGUI::enableMultiDownloadObject ( )

Definition at line 1459 of file class.ilContainerGUI.php.

References renderObject().

1460  {
1461  $this->multi_download_enabled = true;
1462  $this->renderObject();
1463  }
renderObject()
render the object
+ Here is the call graph for this function:

◆ executeCommand()

ilContainerGUI::executeCommand ( )

execute command note: this method is overwritten in all container objects

Definition at line 173 of file class.ilContainerGUI.php.

References $_GET, $ret, ilObjectGUI\$tpl, forwardToPageObject(), forwardToStyleSheet(), and prepareOutput().

174  {
175  $tpl = $this->tpl;
176 
177  $next_class = $this->ctrl->getNextClass();
178  $cmd = $this->ctrl->getCmd("render");
179 
180 
181  switch ($next_class) {
182  // page editing
183  case "ilcontainerpagegui":
184  if ($_GET["redirectSource"] != "ilinternallinkgui") {
185  $ret = $this->forwardToPageObject();
186  $tpl->setContent($ret);
187  } else {
188  return "";
189  }
190  break;
191 
192  case "ilobjstylesheetgui":
193  $this->forwardToStyleSheet();
194  break;
195 
196  default:
197  $this->prepareOutput();
198  $cmd .= "Object";
199  $this->$cmd();
200  break;
201  }
202  return true;
203  }
$_GET["client_id"]
prepareOutput($a_show_subobjects=true)
prepare output
forwardToStyleSheet()
Forward to style object.
& forwardToPageObject()
forward command to page object
$ret
Definition: parser.php:6
+ Here is the call graph for this function:

◆ fileManagerLaunchObject()

ilContainerGUI::fileManagerLaunchObject ( )
protected

Launch jnlp.

Definition at line 3206 of file class.ilContainerGUI.php.

References $_COOKIE, $ilUser, ilObjectGUI\$tpl, $user, exit, ilFMSettings\getInstance(), and ILIAS_HTTP_PATH.

3207  {
3208  $ilUser = $this->user;
3209 
3210  $tpl = new ilTemplate('tpl.fm_launch_ws.html', false, false, 'Services/WebServices/FileManager');
3211  $tpl->setVariable('JNLP_URL', ILIAS_HTTP_PATH . '/Services/WebServices/FileManager/lib/dist/FileManager.jnlp');
3212  $tpl->setVariable('SESSION_ID', $_COOKIE[session_name()] . '::' . CLIENT_ID);
3213  $tpl->setVariable('UID', $ilUser->getId());
3214  $tpl->setVariable('REF_ID', $this->object->getRefId());
3215  $tpl->setVariable('WSDL_URI', ILIAS_HTTP_PATH . '/webservice/soap/server.php?wsdl');
3216  $tpl->setVariable('LOCAL_FRAME', ilFMSettings::getInstance()->isLocalFSEnabled() ? 1 : 0);
3217  $tpl->setVariable('REST_URI', ILIAS_HTTP_PATH . '/Services/WebServices/Rest/server.php');
3218  $tpl->setVariable('FILE_LOCKS', 0);
3219  $tpl->setVariable('UPLOAD_FILESIZE', ilFMSettings::getInstance()->getMaxFileSize());
3220 
3221  include_once("./Modules/SystemFolder/classes/class.ilObjSystemFolder.php");
3222  $header_top_title = ilObjSystemFolder::_getHeaderTitle();
3223  $tpl->setVariable('HEADER_TITLE', $header_top_title ? $header_top_title : '');
3224  echo $tpl->get();
3225  exit;
3226  }
exit
Definition: login.php:29
$ilUser
Definition: imgupload.php:18
static getInstance()
Get singleton instance.
$_COOKIE[session_name()]
Definition: xapitoken.php:39
+ Here is the call graph for this function:

◆ forwardToPageObject()

& ilContainerGUI::forwardToPageObject ( )

forward command to page object

Definition at line 286 of file class.ilContainerGUI.php.

References $_GET, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, $ret, $tabs, ilPageObject\_exists(), ilContainer\_lookupContainerSetting(), ilObjectGUI\checkPermission(), exit, ilObjStyleSheet\getContentStylePath(), ilObjStyleSheet\getEffectiveContentStyleId(), ilUtil\getImagePath(), and ilObjStyleSheet\getSyntaxStylePath().

Referenced by ilObjGroupGUI\executeCommand(), ilObjCategoryGUI\executeCommand(), ilObjFolderGUI\executeCommand(), ilObjRootFolderGUI\executeCommand(), executeCommand(), and ilObjCourseGUI\executeCommand().

287  {
288  $lng = $this->lng;
289  $ilTabs = $this->tabs;
291 
292  $cmd = $ilCtrl->getCmd();
293 
294  if (in_array($cmd, array("displayMediaFullscreen", "downloadFile", "displayMedia"))) {
295  $this->checkPermission("read");
296  } else {
297  $this->checkPermission("write");
298  }
299 
300  $ilTabs->clearTargets();
301 
302  if ($_GET["redirectSource"] == "ilinternallinkgui") {
303  exit;
304  }
305 
307  $this->object->getId(),
308  "xhtml_page"
309  );
310  if ($xpage_id > 0) {
311  $ilTabs->setBackTarget(
312  $lng->txt("cntr_back_to_old_editor"),
313  $ilCtrl->getLinkTarget($this, "switchToOldEditor"),
314  "_top"
315  );
316  } else {
317  $ilTabs->setBackTarget($lng->txt("back"), "./goto.php?target=" . $this->object->getType() . "_" .
318  $this->object->getRefId(), "_top");
319  }
320 
321  // page object
322  include_once("./Services/Container/classes/class.ilContainerPage.php");
323  include_once("./Services/Container/classes/class.ilContainerPageGUI.php");
324 
325  $lng->loadLanguageModule("content");
326 
327  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
328  $this->tpl->addCss(ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
329  // $this->tpl->setCurrentBlock("SyntaxStyle");
330  $this->tpl->addCss(ilObjStyleSheet::getSyntaxStylePath());
331  // $this->tpl->parseCurrentBlock();
332 
334  "cont",
335  $this->object->getId()
336  )) {
337  // doesn't exist -> create new one
338  $new_page_object = new ilContainerPage();
339  $new_page_object->setParentId($this->object->getId());
340  $new_page_object->setId($this->object->getId());
341  $new_page_object->createFromXML();
342  }
343 
344  // get page object
345  $this->ctrl->setReturnByClass("ilcontainerpagegui", "edit");
346  $page_gui = new ilContainerPageGUI($this->object->getId());
347  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
348  $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
349  $this->object->getStyleSheetId(),
350  $this->object->getType()
351  ));
352 
353  $page_gui->setTemplateTargetVar("ADM_CONTENT");
354  $page_gui->setFileDownloadLink("");
355  //$page_gui->setLinkParams($this->ctrl->getUrlParameterString()); // todo
356  $page_gui->setPresentationTitle("");
357  $page_gui->setTemplateOutput(false);
358 
359  // old editor information text
361  $this->object->getId(),
362  "xhtml_page"
363  );
364  if ($xpage_id > 0) {
365  $wtpl = new ilTemplate(
366  "tpl.cntr_old_editor_message.html",
367  true,
368  true,
369  "Services/Container"
370  );
371  $wtpl->setVariable("ALT_WARNING", $lng->txt("warning"));
372  $wtpl->setVariable(
373  "IMG_WARNING",
374  ilUtil::getImagePath("icon_alert.svg")
375  );
376  $wtpl->setVariable("TXT_MIGRATION_INFO", $lng->txt("cntr_switch_to_new_editor_message"));
377  $wtpl->setVariable("TXT_MIGRATION_INFO", $lng->txt("cntr_switch_to_new_editor_message"));
378  $wtpl->setVariable(
379  "HREF_SWITCH_TO_NEW_EDITOR",
380  $ilCtrl->getLinkTarget($this, "useNewEditor")
381  );
382  $wtpl->setVariable(
383  "TXT_MIGRATION_SWITCH",
384  $lng->txt("cntr_switch_to_new_editor_cmd")
385  );
386  $page_gui->setPrependingHtml($wtpl->get());
387  }
388 
389  // style tab
390  $page_gui->setTabHook($this, "addPageTabs");
391 
392  $ret = $this->ctrl->forwardCommand($page_gui);
393 
394  //$ret =& $page_gui->executeCommand();
395  return $ret;
396  }
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
exit
Definition: login.php:29
Container page GUI class.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
Container page object.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static getSyntaxStylePath()
get syntax style path
$ret
Definition: parser.php:6
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ forwardToStyleSheet()

ilContainerGUI::forwardToStyleSheet ( )

Forward to style object.

Definition at line 251 of file class.ilContainerGUI.php.

References $_GET, ilObjectGUI\$ctrl, $ilCtrl, $ret, $tabs, and ilObjectGUI\omitLocator().

Referenced by ilObjGroupGUI\executeCommand(), ilObjCategoryGUI\executeCommand(), ilObjFolderGUI\executeCommand(), ilObjRootFolderGUI\executeCommand(), executeCommand(), and ilObjCourseGUI\executeCommand().

252  {
254  $ilTabs = $this->tabs;
255 
256  $ilTabs->clearTargets();
257 
258  $cmd = $ilCtrl->getCmd();
259  include_once("./Services/Style/Content/classes/class.ilObjStyleSheetGUI.php");
260  $this->ctrl->setReturn($this, "editStyleProperties");
261  $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
262  $style_gui->omitLocator();
263  if ($cmd == "create" || $_GET["new_type"] == "sty") {
264  $style_gui->setCreationMode(true);
265  }
266 
267  if ($cmd == "confirmedDelete") {
268  $this->object->setStyleSheetId(0);
269  $this->object->update();
270  }
271 
272  $ret = $this->ctrl->forwardCommand($style_gui);
273 
274  if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
275  $style_id = $ret;
276  $this->object->setStyleSheetId($style_id);
277  $this->object->update();
278  $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
279  }
280  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
omitLocator($a_omit=true)
Class ilObjStyleSheetGUI.
$ret
Definition: parser.php:6
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAdminTabs()

ilContainerGUI::getAdminTabs ( )

Definition at line 3761 of file class.ilContainerGUI.php.

References ilObjectGUI\$tree, and ilObjectGUI\checkPermissionBool().

3762  {
3763  $tree = $this->tree;
3764 
3765  if ($this->checkPermissionBool("visible,read")) {
3766  $this->tabs_gui->addTab(
3767  'view',
3768  $this->lng->txt('view'),
3769  $this->ctrl->getLinkTarget($this, 'view')
3770  );
3771  }
3772 
3773  // Always show container trash
3774  $this->tabs_gui->addTab(
3775  'trash',
3776  $this->lng->txt('trash'),
3777  $this->ctrl->getLinkTarget($this, 'trash')
3778  );
3779 
3780  if ($this->checkPermissionBool("edit_permission")) {
3781  $this->tabs_gui->addTab(
3782  'perm_settings',
3783  $this->lng->txt('perm_settings'),
3784  $this->ctrl->getLinkTargetByClass(
3785  [
3786  get_class($this),
3787  'ilpermissiongui'
3788  ],
3789  'perm'
3790  )
3791  );
3792  }
3793  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:

◆ getAsynchItemListObject()

ilContainerGUI::getAsynchItemListObject ( )

Get item list command drop down asynchronously.

Definition at line 3014 of file class.ilContainerGUI.php.

References $_GET, ilObjectGUI\$ctrl, ilObjectGUI\$data, $ilCtrl, ilObjectGUI\$obj_id, $plugin_admin, ilObjectGUI\$ref_id, XapiProxy\$resp, $type, ilObjectListGUIFactory\_getListGUIByType(), ilObject\_lookupObjId(), ilObject\_lookupType(), exit, ilPluginAdmin\getPluginObject(), IL_COMP_SERVICE, ilUIHookPluginGUI\KEEP, and modifyItemGUI().

3015  {
3016  $ilCtrl = $this->ctrl;
3017 
3018  $ref_id = $_GET["cmdrefid"];
3021 
3022  // this should be done via container-object->getSubItem in the future
3023  $data = array("child" => $ref_id, "ref_id" => $ref_id, "obj_id" => $obj_id,
3024  "type" => $type);
3025  include_once 'Services/Object/classes/class.ilObjectListGUIFactory.php';
3027  $item_list_gui->setContainerObject($this);
3028 
3029  $item_list_gui->enableComments(true);
3030  $item_list_gui->enableNotes(true);
3031  $item_list_gui->enableTags(true);
3032 
3033  $this->modifyItemGUI($item_list_gui, $data, false);
3034  $html = $item_list_gui->getListItemHTML(
3035  $ref_id,
3036  $obj_id,
3037  "",
3038  "",
3039  true,
3040  true
3041  );
3042 
3043  // include plugin slot for async item list
3044  $ilPluginAdmin = $this->plugin_admin;
3045  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
3046  foreach ($pl_names as $pl) {
3047  $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
3048  $gui_class = $ui_plugin->getUIClassInstance();
3049  $resp = $gui_class->getHTML("Services/Container", "async_item_list", array("html" => $html));
3050  if ($resp["mode"] != ilUIHookPluginGUI::KEEP) {
3051  $html = $gui_class->modifyHTML($html, $resp);
3052  }
3053  }
3054 
3055  echo $html;
3056  exit;
3057  }
exit
Definition: login.php:29
$type
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static _lookupObjId($a_id)
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
modifyItemGUI($a_item_list_gui, $a_item_data, $a_show_path)
Modify list gui for presentation in container.
static _lookupType($a_id, $a_reference=false)
lookup object type
static _getListGUIByType($a_type, $a_context=ilObjectListGUI::CONTEXT_REPOSITORY)
const IL_COMP_SERVICE
+ Here is the call graph for this function:

◆ getBucketTitle()

ilContainerGUI::getBucketTitle ( )

get proper label to add in the background task popover

Returns
string

Definition at line 1654 of file class.ilContainerGUI.php.

Referenced by downloadObject().

1655  {
1656  return $bucket_title = ilUtil::getAsciiFilename($this->object->getTitle());
1657  }
+ Here is the caller graph for this function:

◆ getContainerPageHTML()

ilContainerGUI::getContainerPageHTML ( )

Get container page HTML.

Definition at line 416 of file class.ilContainerGUI.php.

References $ilSetting, $ilUser, $lang, $ret, $settings, $user, ilPageUtil\_existsAndNotEmpty(), ilContainer\_lookupContainerSetting(), ilObjStyleSheet\getContentStylePath(), ilObjStyleSheet\getEffectiveContentStyleId(), ilObjectTranslation\getInstance(), and ilObjStyleSheet\getSyntaxStylePath().

417  {
420 
421  if (!$ilSetting->get("enable_cat_page_edit") || $this->object->filteredSubtree()) {
422  return;
423  }
424 
425  // old page editor content
427  $this->object->getId(),
428  "xhtml_page"
429  );
430  if ($xpage_id > 0) {
431  include_once("Services/XHTMLPage/classes/class.ilXHTMLPage.php");
432  $xpage = new ilXHTMLPage($xpage_id);
433  return $xpage->getContent();
434  }
435 
436 
437  // page object
438 
439 
440  // if page does not exist, return nothing
441  include_once("./Services/COPage/classes/class.ilPageUtil.php");
443  "cont",
444  $this->object->getId()
445  )) {
446  return "";
447  }
448  include_once("./Services/Container/classes/class.ilContainerPage.php");
449  include_once("./Services/Container/classes/class.ilContainerPageGUI.php");
450 
451  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
452  $this->tpl->setVariable(
453  "LOCATION_CONTENT_STYLESHEET",
454  ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId())
455  );
456  $this->tpl->setCurrentBlock("SyntaxStyle");
457  $this->tpl->setVariable(
458  "LOCATION_SYNTAX_STYLESHEET",
460  );
461  $this->tpl->parseCurrentBlock();
462 
463  // get page object
464  include_once("./Services/Object/classes/class.ilObjectTranslation.php");
465  $ot = ilObjectTranslation::getInstance($this->object->getId());
466  $lang = $ot->getEffectiveContentLang($ilUser->getCurrentLanguage(), "cont");
467  $page_gui = new ilContainerPageGUI($this->object->getId(), 0, $lang);
468  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
469  $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
470  $this->object->getStyleSheetId(),
471  $this->object->getType()
472  ));
473 
474  $page_gui->setPresentationTitle("");
475  $page_gui->setTemplateOutput(false);
476  $page_gui->setHeader("");
477  $ret = $page_gui->showPage();
478 
479  //$ret = "<div style='background-color: white; padding:5px; margin-bottom: 30px;'>".$ret."</div>";
480 
481  //$ret =& $page_gui->executeCommand();
482  return $ret;
483  }
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
Container page GUI class.
static _existsAndNotEmpty($a_parent_type, $a_id, $a_lang="-")
checks whether page exists and is not empty (may return true on some empty pages) ...
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
$ilUser
Definition: imgupload.php:18
static getSyntaxStylePath()
get syntax style path
XHTML Page class.
$lang
Definition: xapiexit.php:8
global $ilSetting
Definition: privfeed.php:17
static getInstance($a_obj_id)
Get instance.
$ret
Definition: parser.php:6
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
+ Here is the call graph for this function:

◆ getContentGUI()

ilContainerGUI::getContentGUI ( )

Get content gui object.

Parameters

Definition at line 562 of file class.ilContainerGUI.php.

References ilCourseConstants\IL_CRS_VIEW_TIMING, ilContainer\VIEW_BY_TYPE, ilContainer\VIEW_OBJECTIVE, ilContainer\VIEW_SESSIONS, and ilContainer\VIEW_SIMPLE.

Referenced by redrawListItemObject(), renderBlockAsynchObject(), and renderObject().

563  {
564  $view_mode = $this->object->getViewMode();
565  if ($this->object->filteredSubtree()) {
566  $view_mode = ilContainer::VIEW_SIMPLE;
567  }
568  switch ($view_mode) {
569  // all items in one block
571  include_once("./Services/Container/classes/class.ilContainerSimpleContentGUI.php");
572  $container_view = new ilContainerSimpleContentGUI($this);
573  break;
574 
576  include_once('./Services/Container/classes/class.ilContainerObjectiveGUI.php');
577  $container_view = new ilContainerObjectiveGUI($this);
578  break;
579 
580  // all items in one block
582  case ilCourseConstants::IL_CRS_VIEW_TIMING: // not nice this workaround
583  include_once("./Services/Container/classes/class.ilContainerSessionsContentGUI.php");
584  $container_view = new ilContainerSessionsContentGUI($this);
585  break;
586 
587  // all items in one block
589  default:
590  include_once("./Services/Container/classes/class.ilContainerByTypeContentGUI.php");
591  $container_view = new ilContainerByTypeContentGUI($this, $this->container_user_filter);
592  break;
593  }
594  return $container_view;
595  }
Shows all items grouped by type.
GUI class for course objective view.
+ Here is the caller graph for this function:

◆ getEditFormValues()

ilContainerGUI::getEditFormValues ( )
protected

Get values for edit form.

Returns
array

Definition at line 210 of file class.ilContainerGUI.php.

References ilDidacticTemplateObjSettings\lookupTemplateId().

Referenced by ilObjFolderGUI\editObject().

211  {
212  $values = parent::getEditFormValues();
213 
214  include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
215  $values['didactic_type'] =
216  'dtpl_' . ilDidacticTemplateObjSettings::lookupTemplateId($this->object->getRefId());
217 
218  return $values;
219  }
static lookupTemplateId($a_ref_id)
Lookup template id ilDB $ilDB.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTabs()

ilContainerGUI::getTabs ( )

common tabs for all container objects (should be called at the end of child getTabs() method

Definition at line 1368 of file class.ilContainerGUI.php.

References $_GET, $_SESSION, ilObjectGUI\$ctrl, $ilCtrl, and $rbacsystem.

1369  {
1371  $ilCtrl = $this->ctrl;
1372 
1373  // edit permissions
1374  if ($rbacsystem->checkAccess('edit_permission', $this->ref_id)) {
1375  $this->tabs_gui->addTarget(
1376  "perm_settings",
1377  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
1378  array("perm","info","owner"),
1379  'ilpermissiongui'
1380  );
1381  if ($ilCtrl->getNextClass() == "ilpermissiongui") {
1382  $this->tabs_gui->activateTab("perm_settings");
1383  }
1384  }
1385 
1386  // show clipboard
1387  if (strtolower($_GET["baseClass"]) == "ilrepositorygui" && !empty($_SESSION["clipboard"])) {
1388  $this->tabs_gui->addTarget(
1389  "clipboard",
1390  $this->ctrl->getLinkTarget($this, "clipboard"),
1391  "clipboard",
1392  get_class($this)
1393  );
1394  }
1395  }
$_SESSION["AccountId"]
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18

◆ getTreeSelectorGUI()

ilContainerGUI::getTreeSelectorGUI (   $cmd)
protected
Parameters
$cmdstring
Returns
ilTreeExplorerGUI

Definition at line 3651 of file class.ilContainerGUI.php.

References $_SESSION, $type, and ilObject\_lookupType().

Referenced by showPasteTreeObject().

3652  {
3653  include_once("./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php");
3654  $exp = new ilRepositorySelectorExplorerGUI($this, "showPasteTree");
3655  // TODO: The study programme 'prg' is not included here, as the
3656  // ilRepositorySelectorExplorerGUI only handles static rules for
3657  // parent-child-relations and not the dynamic relationsships
3658  // required for the SP (see #16909).
3659  $exp->setTypeWhiteList(array("root", "cat", "grp", "crs", "fold"));
3660 
3661  // Not all types are allowed in the LearningSequence
3662  // Extend whitelist, if all selected types are possible subojects of LSO
3663  if (in_array($_SESSION["clipboard"]["cmd"], ["link", "cut"])) {
3664  $lso_types = array_keys($this->obj_definition->getSubObjects('lso'));
3665  $refs = $_SESSION["clipboard"]["ref_ids"];
3666  $allow_lso = true;
3667  foreach ($refs as $item_ref_id) {
3668  $type = ilObject::_lookupType($item_ref_id, true);
3669  if (!in_array($type, $lso_types)) {
3670  $allow_lso = false;
3671  }
3672  }
3673  if ($allow_lso) {
3674  $whitelist = $exp->getTypeWhiteList();
3675  $whitelist[] = 'lso';
3676  $exp->setTypeWhiteList($whitelist);
3677  }
3678  }
3679 
3680  if ($cmd == "link") {
3681  $exp->setSelectMode("nodes", true);
3682  return $exp;
3683  } else {
3684  $exp->setSelectMode("nodes[]", false);
3685  return $exp;
3686  }
3687  }
$_SESSION["AccountId"]
Explorer for selecting repository items.
$type
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initAndDisplayCopyIntoMultipleObjectsObject()

ilContainerGUI::initAndDisplayCopyIntoMultipleObjectsObject ( )

Definition at line 2135 of file class.ilContainerGUI.php.

References $_GET, $_SESSION, ilObjectGUI\$tree, and showPasteTreeObject().

Referenced by copyObject().

2136  {
2137  $tree = $this->tree;
2138 
2139  // empty session on init
2140  $_SESSION['paste_copy_repexpand'] = array();
2141 
2142  // copy opend nodes from repository explorer
2143  $_SESSION['paste_copy_repexpand'] = is_array($_SESSION['repexpand']) ? $_SESSION['repexpand'] : array();
2144 
2145  // open current position
2146  $path = $tree->getPathId((int) $_GET['ref_id']);
2147  foreach ((array) $path as $node_id) {
2148  if (!in_array($node_id, $_SESSION['paste_copy_repexpand'])) {
2149  $_SESSION['paste_copy_repexpand'][] = $node_id;
2150  }
2151  }
2152 
2153  return $this->showPasteTreeObject();
2154  }
$_SESSION["AccountId"]
$_GET["client_id"]
showPasteTreeObject()
Show paste tree.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initAndDisplayLinkIntoMultipleObjectsObject()

ilContainerGUI::initAndDisplayLinkIntoMultipleObjectsObject ( )

Definition at line 2033 of file class.ilContainerGUI.php.

References $_GET, $_SESSION, ilObjectGUI\$tree, and showPasteTreeObject().

Referenced by linkObject().

2034  {
2035  $tree = $this->tree;
2036 
2037  // empty session on init
2038  $_SESSION['paste_linked_repexpand'] = array();
2039 
2040  // copy opend nodes from repository explorer
2041  $_SESSION['paste_linked_repexpand'] = is_array($_SESSION['repexpand']) ? $_SESSION['repexpand'] : array();
2042 
2043  // open current position
2044  $path = $tree->getPathId((int) $_GET['ref_id']);
2045  foreach ((array) $path as $node_id) {
2046  if (!in_array($node_id, $_SESSION['paste_linked_repexpand'])) {
2047  $_SESSION['paste_linked_repexpand'][] = $node_id;
2048  }
2049  }
2050 
2051  return $this->showPasteTreeObject();
2052  }
$_SESSION["AccountId"]
$_GET["client_id"]
showPasteTreeObject()
Show paste tree.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initAndDisplayMoveIntoObjectObject()

ilContainerGUI::initAndDisplayMoveIntoObjectObject ( )

Definition at line 2157 of file class.ilContainerGUI.php.

References $_GET, $_SESSION, ilObjectGUI\$tree, and showPasteTreeObject().

Referenced by cutObject().

2158  {
2159  $tree = $this->tree;
2160 
2161  // empty session on init
2162  $_SESSION['paste_cut_repexpand'] = array();
2163 
2164  // copy opend nodes from repository explorer
2165  $_SESSION['paste_cut_repexpand'] = is_array($_SESSION['repexpand']) ? $_SESSION['repexpand'] : array();
2166 
2167  // open current position
2168  $path = $tree->getPathId((int) $_GET['ref_id']);
2169  foreach ((array) $path as $node_id) {
2170  if (!in_array($node_id, $_SESSION['paste_cut_repexpand'])) {
2171  $_SESSION['paste_cut_repexpand'][] = $node_id;
2172  }
2173  }
2174 
2175  return $this->showPasteTreeObject();
2176  }
$_SESSION["AccountId"]
$_GET["client_id"]
showPasteTreeObject()
Show paste tree.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initEditForm()

ilContainerGUI::initEditForm ( )
protected

Init object edit form.

Returns
ilPropertyFormGUI

Definition at line 3234 of file class.ilContainerGUI.php.

References ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, ilMDLanguageItem\_getLanguages(), ilPropertyFormGUI\addItem(), ilObjectGUI\getCreationMode(), ilObjectGUI\initEditCustomForm(), ilTextAreaInputGUI\setRows(), and ilObject\TITLE_LENGTH.

3235  {
3236  $lng = $this->lng;
3237  $ilCtrl = $this->ctrl;
3238 
3239  $lng->loadLanguageModule($this->object->getType());
3240 
3241  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
3242  $form = new ilPropertyFormGUI();
3243  $form->setFormAction($this->ctrl->getFormAction($this, "update"));
3244  $form->setTitle($this->lng->txt($this->object->getType() . "_edit"));
3245 
3246  $this->initFormTitleDescription($form);
3247 
3248  $this->initEditCustomForm($form);
3249 
3250  $form->addCommandButton("update", $this->lng->txt("save"));
3251  //$this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
3252 
3253  return $form;
3254  }
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
initEditCustomForm(ilPropertyFormGUI $a_form)
Add custom fields to update form.
+ Here is the call graph for this function:

◆ initFormPasswordInstruction()

ilContainerGUI::initFormPasswordInstruction ( )
protected

Init password form.

Returns

Definition at line 3089 of file class.ilContainerGUI.php.

References ilFormPropertyGUI\setRequired().

Referenced by savePasswordObject(), and showPasswordInstructionObject().

3090  {
3091  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
3092  $this->form = new ilPropertyFormGUI();
3093  $this->form->setFormAction($this->ctrl->getFormAction($this));
3094 
3095  // new password
3096  $ipass = new ilPasswordInputGUI($this->lng->txt("desired_password"), "new_password");
3097  $ipass->setRequired(true);
3098 
3099  $this->form->addItem($ipass);
3100  $this->form->addCommandButton("savePassword", $this->lng->txt("save"));
3101  $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
3102 
3103  $this->form->setTitle($this->lng->txt("chg_ilias_and_webfolder_password"));
3104  $this->form->setFormAction($this->ctrl->getFormAction($this));
3105 
3106  return $this->form;
3107  }
This class represents a property form user interface.
This class represents a password property in a property form.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initHeaderAction()

ilContainerGUI::initHeaderAction (   $a_sub_type = null,
  $a_sub_id = null 
)
protected

Add file manager link.

Parameters
<type>$a_sub_type
<type>$a_sub_id

Definition at line 3188 of file class.ilContainerGUI.php.

References ilFMSettings\getInstance().

3189  {
3190  $lg = parent::initHeaderAction($a_sub_type, $a_sub_id);
3191 
3192  // begin-patch fm
3193  include_once './Services/WebServices/FileManager/classes/class.ilFMSettings.php';
3194  if (ilFMSettings::getInstance()->isEnabled()) {
3195  if ($lg instanceof ilObjectListGUI) {
3196  $lg->addCustomCommand($this->ctrl->getLinkTarget($this, 'fileManagerLaunch'), 'fm_start', '_blank');
3197  }
3198  }
3199  // end-patch fm
3200  return $lg;
3201  }
Class ilObjectListGUI.
static getInstance()
Get singleton instance.
+ Here is the call graph for this function:

◆ initListPresentationForm()

ilContainerGUI::initListPresentationForm ( ilPropertyFormGUI  $form)
protected

Add list presentation settings to form.

Parameters
ilPropertyFormGUI$form
Returns
ilPropertyFormGUI

Definition at line 3369 of file class.ilContainerGUI.php.

References ilContainer\_lookupContainerSetting(), ilPropertyFormGUI\addItem(), and ilRadioOption\setValue().

Referenced by ilObjFolderGUI\initEditForm(), ilObjRootFolderGUI\initEditForm(), ilObjCategoryGUI\initEditForm(), ilObjCourseGUI\initEditForm(), and ilObjGroupGUI\initForm().

3370  {
3371  $lpres = new ilRadioGroupInputGUI($this->lng->txt('cont_list_presentation'), "list_presentation");
3372 
3373  $item_list = new ilRadioOption($this->lng->txt('cont_item_list'), "");
3374  //$item_list->setInfo($this->lng->txt('cont_item_list_info'));
3375  $lpres->addOption($item_list);
3376 
3377  $tile_view = new ilRadioOption($this->lng->txt('cont_tile_view'), "tile");
3378  //$tile_view->setInfo($this->lng->txt('cont_tile_view_info'));
3379  $lpres->addOption($tile_view);
3380 
3381  $lpres->setValue(
3382  ilContainer::_lookupContainerSetting($this->object->getId(), "list_presentation")
3383  );
3384 
3385  $form->addItem($lpres);
3386 
3387  return $form;
3388  }
This class represents an option in a radio group.
addItem($a_item)
Add Item (Property, SectionHeader).
This class represents a property in a property form.
setValue($a_value)
Set Value.
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initManualSortingOptionForm()

ilContainerGUI::initManualSortingOptionForm ( ilContainerSortingSettings  $settings,
  $element,
  $a_prefix,
  $a_sorting_settings 
)
protected

Add manual sorting options.

Definition at line 3442 of file class.ilContainerGUI.php.

References ilRadioOption\addSubItem(), ilContainerSortingSettings\getSortNewItemsOrder(), ilContainerSortingSettings\getSortNewItemsPosition(), initSortingDirectionForm(), ilRadioGroupInputGUI\setValue(), ilContainer\SORT_ACTIVATION, ilContainer\SORT_CREATION, ilContainer\SORT_NEW_ITEMS_ORDER_ACTIVATION, ilContainer\SORT_NEW_ITEMS_ORDER_CREATION, ilContainer\SORT_NEW_ITEMS_ORDER_TITLE, ilContainer\SORT_NEW_ITEMS_POSITION_BOTTOM, ilContainer\SORT_NEW_ITEMS_POSITION_TOP, and ilContainer\SORT_TITLE.

Referenced by initSortingForm().

3447  {
3448  $position = new ilRadioGroupInputGUI($this->lng->txt('sorting_new_items_position'), $a_prefix . '_new_items_position');
3449  $position->setValue($settings->getSortNewItemsPosition());
3450  $position->setRequired(true);
3451 
3452  //new items insert on top
3453  $new_top = new ilRadioOption(
3454  $this->lng->txt('sorting_new_items_at_top'),
3456  );
3457 
3458  $position->addOption($new_top);
3459 
3460  //new items insert at bottom
3461  $new_bottom = new ilRadioOption(
3462  $this->lng->txt('sorting_new_items_at_bottom'),
3464  );
3465 
3466  $position->addOption($new_bottom);
3467 
3468  $element->addSubItem($position);
3469 
3470  $order = new ilRadioGroupInputGUI($this->lng->txt('sorting_new_items_order'), $a_prefix . '_new_items_order');
3471  $order->setValue($settings->getSortNewItemsOrder());
3472  $order->setRequired(true);
3473 
3474  if (in_array(ilContainer::SORT_TITLE, $a_sorting_settings)) {
3475  //new items sort in alphabetical order
3476  $new_title = new ilRadioOption(
3477  $this->lng->txt('sorting_title_header'),
3479  );
3480 
3481  $order->addOption($new_title);
3482  }
3483 
3484  if (in_array(ilContainer::SORT_CREATION, $a_sorting_settings)) {
3485  //new items sort by creation date
3486  $new_creation = new ilRadioOption(
3487  $this->lng->txt('sorting_creation_header'),
3489  );
3490 
3491  $order->addOption($new_creation);
3492  }
3493 
3494 
3495  if (in_array(ilContainer::SORT_ACTIVATION, $a_sorting_settings)) {
3496  //new items by activation
3497  $new_activation = new ilRadioOption(
3498  $this->lng->txt('crs_sort_activation'),
3500  );
3501 
3502  $order->addOption($new_activation);
3503  }
3504 
3505  $element->addSubItem($order);
3506 
3507  $this->initSortingDirectionForm($settings, $element, 'manual');
3508 
3509  return $element;
3510  }
This class represents an option in a radio group.
const SORT_NEW_ITEMS_POSITION_TOP
initSortingDirectionForm(ilContainerSortingSettings $sorting_settings, $element, $a_prefix)
Add sorting direction.
const SORT_NEW_ITEMS_POSITION_BOTTOM
This class represents a property in a property form.
addSubItem($a_item)
Add Subitem.
const SORT_NEW_ITEMS_ORDER_CREATION
const SORT_NEW_ITEMS_ORDER_ACTIVATION
getSortNewItemsPosition()
GET new item position.
const SORT_NEW_ITEMS_ORDER_TITLE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSortingDirectionForm()

ilContainerGUI::initSortingDirectionForm ( ilContainerSortingSettings  $sorting_settings,
  $element,
  $a_prefix 
)
protected

Add sorting direction.

Parameters
ilFormPropertyGUI$element

Definition at line 3407 of file class.ilContainerGUI.php.

References $txt, ilRadioOption\addSubItem(), ilContainerSortingSettings\getSortDirection(), ilContainer\SORT_DIRECTION_ASC, and ilContainer\SORT_DIRECTION_DESC.

Referenced by initManualSortingOptionForm(), and initSortingForm().

3408  {
3409  if ($a_prefix == 'manual') {
3410  $txt = $this->lng->txt('sorting_new_items_direction');
3411  } else {
3412  $txt = $this->lng->txt('sorting_direction');
3413  }
3414 
3415  $direction = new ilRadioGroupInputGUI($txt, $a_prefix . '_sorting_direction');
3416  $direction->setValue($sorting_settings->getSortDirection());
3417  $direction->setRequired(true);
3418 
3419  // asc
3420  $asc = new ilRadioOption(
3421  $this->lng->txt('sorting_asc'),
3423  );
3424  $direction->addOption($asc);
3425 
3426  // desc
3427  $desc = new ilRadioOption(
3428  $this->lng->txt('sorting_desc'),
3430  );
3431  $direction->addOption($desc);
3432 
3433  $element->addSubItem($direction);
3434 
3435  return $element;
3436  }
This class represents an option in a radio group.
This class represents a property in a property form.
addSubItem($a_item)
Add Subitem.
$txt
Definition: error.php:13
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSortingForm()

ilContainerGUI::initSortingForm ( ilPropertyFormGUI  $form,
array  $a_sorting_settings 
)
protected

Append sorting settings to property form.

Parameters
ilPropertyFormGUI$form
type$a_sorting_settings

Definition at line 3299 of file class.ilContainerGUI.php.

References $settings, ilPropertyFormGUI\addItem(), initManualSortingOptionForm(), initSortingDirectionForm(), ilContainerSortingSettings\lookupSortModeFromParentContainer(), ilRadioOption\setInfo(), ilContainer\SORT_ACTIVATION, ilContainer\SORT_CREATION, ilContainer\SORT_INHERIT, ilContainer\SORT_MANUAL, ilContainer\SORT_TITLE, and ilContainerSortingSettings\sortModeToString().

Referenced by ilObjFolderGUI\initEditForm(), ilObjRootFolderGUI\initEditForm(), ilObjCategoryGUI\initEditForm(), ilObjCourseGUI\initEditForm(), and ilObjGroupGUI\initForm().

3300  {
3301  include_once('Services/Container/classes/class.ilContainerSortingSettings.php');
3302  include_once './Services/Container/classes/class.ilContainer.php';
3303 
3304  $settings = new ilContainerSortingSettings($this->object->getId());
3305  $sort = new ilRadioGroupInputGUI($this->lng->txt('sorting_header'), "sorting");
3306 
3307  if (in_array(ilContainer::SORT_INHERIT, $a_sorting_settings)) {
3308  $sort_inherit = new ilRadioOption();
3309  $sort_inherit->setTitle(
3310  $this->lng->txt('sort_inherit_prefix') .
3313  $this->object->getId()
3314  )
3315  ) . ') '
3316  );
3317  $sort_inherit->setValue(ilContainer::SORT_INHERIT);
3318  $sort_inherit->setInfo($this->lng->txt('sorting_info_inherit'));
3319  $sort->addOption($sort_inherit);
3320  }
3321  if (in_array(ilContainer::SORT_TITLE, $a_sorting_settings)) {
3322  $sort_title = new ilRadioOption(
3323  $this->lng->txt('sorting_title_header'),
3325  );
3326  $sort_title->setInfo($this->lng->txt('sorting_info_title'));
3327 
3328  $this->initSortingDirectionForm($settings, $sort_title, 'title');
3329  $sort->addOption($sort_title);
3330  }
3331  if (in_array(ilContainer::SORT_CREATION, $a_sorting_settings)) {
3332  $sort_activation = new ilRadioOption($this->lng->txt('sorting_creation_header'), ilContainer::SORT_CREATION);
3333  $sort_activation->setInfo($this->lng->txt('sorting_creation_info'));
3334  $this->initSortingDirectionForm($settings, $sort_activation, 'creation');
3335  $sort->addOption($sort_activation);
3336  }
3337  if (in_array(ilContainer::SORT_ACTIVATION, $a_sorting_settings)) {
3338  $sort_activation = new ilRadioOption($this->lng->txt('crs_sort_activation'), ilContainer::SORT_ACTIVATION);
3339  $sort_activation->setInfo($this->lng->txt('crs_sort_timing_info'));
3340  $this->initSortingDirectionForm($settings, $sort_activation, 'activation');
3341  $sort->addOption($sort_activation);
3342  }
3343  if (in_array(ilContainer::SORT_MANUAL, $a_sorting_settings)) {
3344  $sort_manual = new ilRadioOption(
3345  $this->lng->txt('sorting_manual_header'),
3347  );
3348  $sort_manual->setInfo($this->lng->txt('sorting_info_manual'));
3349  $this->initManualSortingOptionForm($settings, $sort_manual, "manual", $a_sorting_settings);
3350  $sort->addOption($sort_manual);
3351  }
3352 
3353  // Handle moved containers and there possibly invalid values
3354  if (in_array($settings->getSortMode(), $a_sorting_settings)) {
3355  $sort->setValue($settings->getSortMode());
3356  } else {
3357  $sort->setValue(ilContainer::SORT_TITLE);
3358  }
3359  $form->addItem($sort);
3360 
3361  return $form;
3362  }
initManualSortingOptionForm(ilContainerSortingSettings $settings, $element, $a_prefix, $a_sorting_settings)
Add manual sorting options.
This class represents an option in a radio group.
addItem($a_item)
Add Item (Property, SectionHeader).
setInfo($a_info)
Set Info.
initSortingDirectionForm(ilContainerSortingSettings $sorting_settings, $element, $a_prefix)
Add sorting direction.
This class represents a property in a property form.
static lookupSortModeFromParentContainer($a_obj_id)
Lookup sort mode from parent container.
static sortModeToString($a_sort_mode)
get String representation of sort mode
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initStylePropertiesForm()

ilContainerGUI::initStylePropertiesForm ( )

Init style properties form.

Definition at line 2853 of file class.ilContainerGUI.php.

References $_GET, ilObjectGUI\$ctrl, $ilCtrl, $ilSetting, ilObjectGUI\$lng, $settings, $tabs, ilObjectGUI\$tpl, ilObjStyleSheet\_getStandardStyles(), ilContainer\_lookupContainerSetting(), ilObjStyleSheet\_lookupStandard(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilUtil\formSelect(), ilPageObjectGUI\setStyleId(), ilPageObjectGUI\setTabHook(), and ilNonEditableValueGUI\setValue().

Referenced by editStylePropertiesObject().

2854  {
2855  $ilCtrl = $this->ctrl;
2856  $lng = $this->lng;
2857  $ilTabs = $this->tabs;
2859  $tpl = $this->tpl;
2860 
2861  $tpl->setTreeFlatIcon("", "");
2862  $ilTabs->clearTargets();
2864  $this->object->getId(),
2865  "xhtml_page"
2866  );
2867  if ($xpage_id > 0) {
2868  $ilTabs->setBackTarget(
2869  $lng->txt("cntr_back_to_old_editor"),
2870  $ilCtrl->getLinkTarget($this, "switchToOldEditor"),
2871  "_top"
2872  );
2873  } else {
2874  $ilTabs->setBackTarget($lng->txt("back"), "./goto.php?target=" . $this->object->getType() . "_" .
2875  $this->object->getRefId(), "_top");
2876  }
2877 
2878  include_once("./Services/Container/classes/class.ilContainerPageGUI.php");
2879  $page_gui = new ilContainerPageGUI($this->object->getId());
2880  $style_id = $this->object->getStyleSheetId();
2881  if (ilObject::_lookupType($style_id) == "sty") {
2882  $page_gui->setStyleId($style_id);
2883  } else {
2884  $style_id = 0;
2885  }
2886  $page_gui->setTabHook($this, "addPageTabs");
2887  $ilCtrl->getHTML($page_gui);
2888  $ilTabs->setTabActive("obj_sty");
2889 
2890  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
2891  $lng->loadLanguageModule("style");
2892 
2893  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
2894  $this->form = new ilPropertyFormGUI();
2895 
2896  $fixed_style = $ilSetting->get("fixed_content_style_id");
2897  // $style_id = $this->object->getStyleSheetId();
2898 
2899  if ($fixed_style > 0) {
2900  $st = new ilNonEditableValueGUI($lng->txt("wiki_current_style"));
2901  $st->setValue(ilObject::_lookupTitle($fixed_style) . " (" .
2902  $this->lng->txt("global_fixed") . ")");
2903  $this->form->addItem($st);
2904  } else {
2906  true,
2907  false,
2908  $_GET["ref_id"]
2909  );
2910 
2911  $st_styles[0] = $this->lng->txt("default");
2912  ksort($st_styles);
2913 
2914  if ($style_id > 0) {
2915  // individual style
2916  if (!ilObjStyleSheet::_lookupStandard($style_id)) {
2917  $st = new ilNonEditableValueGUI($lng->txt("style_current_style"));
2918  $st->setValue(ilObject::_lookupTitle($style_id));
2919  $this->form->addItem($st);
2920 
2921  //$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "edit"));
2922 
2923  // delete command
2924  $this->form->addCommandButton(
2925  "editStyle",
2926  $lng->txt("style_edit_style")
2927  );
2928  $this->form->addCommandButton(
2929  "deleteStyle",
2930  $lng->txt("style_delete_style")
2931  );
2932  //$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "delete"));
2933  }
2934  }
2935 
2936  if ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id)) {
2937  $style_sel = ilUtil::formSelect(
2938  $style_id,
2939  "style_id",
2940  $st_styles,
2941  false,
2942  true
2943  );
2944  $style_sel = new ilSelectInputGUI($lng->txt("style_current_style"), "style_id");
2945  $style_sel->setOptions($st_styles);
2946  $style_sel->setValue($style_id);
2947  $this->form->addItem($style_sel);
2948  //$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "create"));
2949  $this->form->addCommandButton(
2950  "saveStyleSettings",
2951  $lng->txt("save")
2952  );
2953  $this->form->addCommandButton(
2954  "createStyle",
2955  $lng->txt("sty_create_ind_style")
2956  );
2957  }
2958  }
2959  $this->form->setTitle($lng->txt("obj_sty"));
2960  $this->form->setFormAction($ilCtrl->getFormAction($this));
2961  }
This class represents a property form user interface.
Container page GUI class.
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
static _getStandardStyles( $a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
static _lookupStandard($a_id)
Lookup standard flag.
global $ilCtrl
Definition: ilias.php:18
static _lookupType($a_id, $a_reference=false)
lookup object type
setStyleId($a_styleid)
Set Style Id.
static formSelect( $selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
This class represents a non editable value in a property form.
global $ilSetting
Definition: privfeed.php:17
setTabHook($a_object, $a_function)
Set tab hook.
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isActiveAdministrationPanel()

ilContainerGUI::isActiveAdministrationPanel ( )

Definition at line 2477 of file class.ilContainerGUI.php.

References $_SESSION.

Referenced by addHeaderRow(), addStandardContainerSubTabs(), renderObject(), setColumnSettings(), ilObjCourseGUI\setContentSubTabs(), setPageEditorTabs(), setSideColumnReturn(), showAdministrationPanel(), and ilObjCourseGUI\showPossibleSubObjects().

2478  {
2479  // #10081
2480  if ($_SESSION["il_cont_admin_panel"] &&
2481  $this->object->getRefId() &&
2482  !$this->rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
2483  return false;
2484  }
2485 
2486  return $_SESSION["il_cont_admin_panel"];
2487  }
$_SESSION["AccountId"]
+ Here is the caller graph for this function:

◆ isActiveItemOrdering()

ilContainerGUI::isActiveItemOrdering ( )

Check if item ordering is enabled.

Returns
bool

Definition at line 1447 of file class.ilContainerGUI.php.

References ilContainerSortingSettings\_lookupSortMode(), isActiveOrdering(), and ilContainer\SORT_MANUAL.

1448  {
1449  if ($this->isActiveOrdering()) {
1450  return (ilContainerSortingSettings::_lookupSortMode($this->object->getId()) == ilContainer::SORT_MANUAL);
1451  }
1452  return false;
1453  }
isActiveOrdering()
Check if ordering is enabled.
static _lookupSortMode($a_obj_id)
lookup sort mode
+ Here is the call graph for this function:

◆ isActiveOrdering()

ilContainerGUI::isActiveOrdering ( )

Check if ordering is enabled.

Returns
bool

Definition at line 1438 of file class.ilContainerGUI.php.

Referenced by isActiveItemOrdering(), and showAdministrationPanel().

1439  {
1440  return $this->edit_order ? true : false;
1441  }
+ Here is the caller graph for this function:

◆ isMultiDownloadEnabled()

ilContainerGUI::isMultiDownloadEnabled ( )

Definition at line 1465 of file class.ilContainerGUI.php.

References $multi_download_enabled.

Referenced by showAdministrationPanel().

1466  {
1468  }
+ Here is the caller graph for this function:

◆ keepObjectsInClipboardObject()

ilContainerGUI::keepObjectsInClipboardObject ( )

Keep objects in the clipboard.

Definition at line 2126 of file class.ilContainerGUI.php.

References ilObjectGUI\$ctrl, and $ilCtrl.

Referenced by ilObjOrgUnitGUI\executeCommand(), and ilObjLearningSequenceGUI\executeCommand().

2127  {
2128  $ilCtrl = $this->ctrl;
2129 
2130  ilUtil::sendSuccess($this->lng->txt("obj_inserted_clipboard"), true);
2131  $ilCtrl->returnToParent($this);
2132  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ linkObject()

ilContainerGUI::linkObject ( )

create an new reference of an object in tree it's like a hard link of unix

public

Definition at line 1665 of file class.ilContainerGUI.php.

References $_GET, $_POST, $_SESSION, ilObjectGUI\$ctrl, $error, $ilCtrl, ilObjectGUI\$ilErr, ilObjectGUI\$object, $rbacsystem, ilObjectGUI\$ref_id, ilObjectFactory\getInstanceByRefId(), initAndDisplayLinkIntoMultipleObjectsObject(), and ilUtil\sendInfo().

Referenced by ilObjLearningSequenceGUI\executeCommand().

1666  {
1668  $ilCtrl = $this->ctrl;
1669  $ilErr = $this->error;
1670 
1671  $no_cut = [];
1672  $no_link = [];
1673 
1674  if ($_GET["item_ref_id"] != "") {
1675  $_POST["id"] = array($_GET["item_ref_id"]);
1676  }
1677 
1678  if (!isset($_POST["id"])) {
1679  $ilErr->raiseError($this->lng->txt("no_checkbox"), $ilErr->MESSAGE);
1680  }
1681 
1682  // CHECK ACCESS
1683  foreach ($_POST["id"] as $ref_id) {
1684  if (!$rbacsystem->checkAccess('delete', $ref_id)) {
1685  $no_cut[] = $ref_id;
1686  }
1687 
1689 
1690  if (!$this->objDefinition->allowLink($object->getType())) {
1691  $no_link[] = $object->getType();
1692  }
1693  }
1694 
1695  // NO ACCESS
1696  if (count($no_cut)) {
1697  $ilErr->raiseError($this->lng->txt("msg_no_perm_link") . " " .
1698  implode(',', $no_cut), $ilErr->MESSAGE);
1699  }
1700 
1701  if (count($no_link)) {
1702  //#12203
1703  $ilErr->raiseError($this->lng->txt("msg_obj_no_link"), $ilErr->MESSAGE);
1704  }
1705 
1706  // WRITE TO CLIPBOARD
1707  $clipboard["parent"] = $_GET["ref_id"];
1708  $clipboard["cmd"] = $ilCtrl->getCmd();
1709 
1710  foreach ($_POST["id"] as $ref_id) {
1711  $clipboard["ref_ids"][] = $ref_id;
1712  }
1713 
1714  $_SESSION["clipboard"] = $clipboard;
1715 
1716  $suffix = 'p';
1717  if (count($clipboard["ref_ids"]) == 1) {
1718  $suffix = 's';
1719  }
1720  ilUtil::sendInfo($this->lng->txt("msg_link_clipboard_" . $suffix), true);
1721 
1723  } // END LINK
$_SESSION["AccountId"]
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ modifyItemGUI()

ilContainerGUI::modifyItemGUI (   $a_item_list_gui,
  $a_item_data,
  $a_show_path 
)

Modify list gui for presentation in container.

Parameters
type$a_item_list_gui
type$a_item_data
type$a_show_path

Definition at line 2795 of file class.ilContainerGUI.php.

References ilObjectGUI\$lng.

Referenced by getAsynchItemListObject().

2796  {
2797  $lng = $this->lng;
2798 
2799  if ($a_show_path) {
2800  $a_item_list_gui->addCustomProperty(
2801  $lng->txt('path'),
2802  ilContainer::buildPath($a_item_data['ref_id'], $this->object->getRefId()),
2803  false,
2804  true
2805  );
2806  }
2807  }
+ Here is the caller graph for this function:

◆ newBlockTemplate()

& ilContainerGUI::newBlockTemplate ( )

determin admin commands

returns a new list block template

private

Returns
object block template

Definition at line 1135 of file class.ilContainerGUI.php.

References ilObjectGUI\$tpl.

1136  {
1137  $tpl = new ilTemplate(
1138  "tpl.container_list_block.html",
1139  true,
1140  true,
1141  "Services/Container"
1142  );
1143  $this->cur_row_type = "row_type_1";
1144  return $tpl;
1145  }

◆ pasteObject()

ilContainerGUI::pasteObject ( )

paste object from clipboard to current place Depending on the chosen command the object(s) are linked, copied or moved

public

Definition at line 2185 of file class.ilContainerGUI.php.

References $_GET, $_SESSION, ilObjectGUI\$ctrl, $error, $ilCtrl, ilObjectGUI\$ilErr, $ilLog, $ilUser, $log, $message, $rbacadmin, $rbacsystem, ilObjectGUI\$ref_id, ilObjectGUI\$tree, $user, ilConditionHandler\_adjustMovedObjectConditions(), ilChangeEvent\_catchupWriteEvents(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilChangeEvent\_recordWriteEvent(), clearObject(), and ilObjectFactory\getInstanceByRefId().

Referenced by ilObjOrgUnitGUI\performPaste().

2186  {
2189  $ilLog = $this->log;
2190  $tree = $this->tree;
2191  $ilUser = $this->user;
2192  $ilCtrl = $this->ctrl;
2193  $ilErr = $this->error;
2194 
2195  $exists = [];
2196  $no_paste = [];
2197  $is_child = [];
2198  $not_allowed_subobject = [];
2199 
2200  // BEGIN ChangeEvent: Record paste event.
2201  require_once('Services/Tracking/classes/class.ilChangeEvent.php');
2202  // END ChangeEvent: Record paste event.
2203 
2204  //var_dump($_SESSION["clipboard"]);exit;
2205  if (!in_array($_SESSION["clipboard"]["cmd"], array("cut","link","copy"))) {
2206  $message = get_class($this) . "::pasteObject(): cmd was neither 'cut','link' or 'copy'; may be a hack attempt!";
2207  $ilErr->raiseError($message, $ilErr->WARNING);
2208  }
2209 
2210  // this loop does all checks
2211  foreach ($_SESSION["clipboard"]["ref_ids"] as $ref_id) {
2212  $obj_data = ilObjectFactory::getInstanceByRefId($ref_id);
2213 
2214  // CHECK ACCESS
2215  if (!$rbacsystem->checkAccess('create', $this->object->getRefId(), $obj_data->getType())) {
2216  $no_paste[] = $ref_id;
2217  $no_paste_titles[] = $obj_data->getTitle();
2218  }
2219 
2220  // CHECK IF REFERENCE ALREADY EXISTS
2221  if ($this->object->getRefId() == $this->tree->getParentId($obj_data->getRefId())) {
2222  $exists[] = $ref_id;
2223  break;
2224  }
2225 
2226  // CHECK IF PASTE OBJECT SHALL BE CHILD OF ITSELF
2227  if ($this->tree->isGrandChild($ref_id, $this->object->getRefId())) {
2228  $is_child[] = ilObject::_lookupTitle(ilObject::_lookupObjId($ref_id));
2229  }
2230 
2231  if ($ref_id == $this->object->getRefId()) {
2232  $is_child[] = ilObject::_lookupTitle(ilObject::_lookupObjId($ref_id));
2233  }
2234 
2235  // CHECK IF OBJECT IS ALLOWED TO CONTAIN PASTED OBJECT AS SUBOBJECT
2236  $obj_type = $obj_data->getType();
2237 
2238  if (!in_array($obj_type, array_keys($this->object->getPossibleSubObjects()))) {
2239  $not_allowed_subobject[] = $obj_data->getType();
2240  }
2241  }
2242 
2244  // process checking results
2245  // BEGIN WebDAV: Copying an object into the same container is allowed
2246  if (count($exists) > 0 && $_SESSION["clipboard"]["cmd"] != "copy") {
2247  // END WebDAV: Copying an object into the same container is allowed
2248  $ilErr->raiseError($this->lng->txt("msg_obj_exists"), $ilErr->MESSAGE);
2249  }
2250 
2251  if (count($is_child) > 0) {
2252  $ilErr->raiseError(
2253  $this->lng->txt("msg_not_in_itself") . " " . implode(',', $is_child),
2254  $ilErr->MESSAGE
2255  );
2256  }
2257 
2258  if (count($not_allowed_subobject) > 0) {
2259  $ilErr->raiseError(
2260  $this->lng->txt("msg_may_not_contain") . " " . implode(',', $not_allowed_subobject),
2261  $ilErr->MESSAGE
2262  );
2263  }
2264 
2265  if (count($no_paste) > 0) {
2266  $ilErr->raiseError($this->lng->txt("msg_no_perm_paste") . " " .
2267  implode(',', $no_paste), $ilErr->MESSAGE);
2268  }
2269 
2270  // log pasteObject call
2271  $ilLog->write("ilObjectGUI::pasteObject(), cmd: " . $_SESSION["clipboard"]["cmd"]);
2272 
2274  // everything ok: now paste the objects to new location
2275 
2276  // to prevent multiple actions via back/reload button
2277  $ref_ids = $_SESSION["clipboard"]["ref_ids"];
2278  unset($_SESSION["clipboard"]["ref_ids"]);
2279 
2280  // BEGIN WebDAV: Support a copy command in the repository
2281  // process COPY command
2282  if ($_SESSION["clipboard"]["cmd"] == "copy") {
2283  unset($_SESSION["clipboard"]["cmd"]);
2284 
2285  // new implementation, redirects to ilObjectCopyGUI
2286  if (count($ref_ids) == 1) {
2287  $ilCtrl->setParameterByClass("ilobjectcopygui", "target", $this->object->getRefId());
2288  $ilCtrl->setParameterByClass("ilobjectcopygui", "source_id", $ref_ids[0]);
2289  $ilCtrl->redirectByClass("ilobjectcopygui", "saveTarget");
2290  } else {
2291  $ilCtrl->setParameterByClass("ilobjectcopygui", "target", $this->object->getRefId());
2292  $ilCtrl->setParameterByClass("ilobjectcopygui", "source_ids", implode("_", $ref_ids));
2293  $ilCtrl->redirectByClass("ilobjectcopygui", "saveTarget");
2294  }
2295 
2296 
2297 
2298  /* old implementation
2299 
2300  foreach($ref_ids as $ref_id)
2301  {
2302  $revIdMapping = array();
2303 
2304  $oldNode_data = $tree->getNodeData($ref_id);
2305  if ($oldNode_data['parent'] == $this->object->getRefId())
2306  {
2307  require_once 'Modules/File/classes/class.ilObjFileAccess.php';
2308  $newTitle = ilObjFileAccess::_appendNumberOfCopyToFilename($oldNode_data['title'],null);
2309  $newRef = $this->cloneNodes($ref_id, $this->object->getRefId(), $refIdMapping, $newTitle);
2310  }
2311  else
2312  {
2313  $newRef = $this->cloneNodes($ref_id, $this->object->getRefId(), $refIdMapping, null);
2314  }
2315 
2316  // BEGIN ChangeEvent: Record copy event.
2317  $old_parent_data = $tree->getParentNodeData($ref_id);
2318  $newNode_data = $tree->getNodeData($newRef);
2319  ilChangeEvent::_recordReadEvent($oldNode_data['type'], $ref_id,
2320  $oldNode_data['obj_id'], $ilUser->getId());
2321  ilChangeEvent::_recordWriteEvent($newNode_data['obj_id'], $ilUser->getId(), 'add',
2322  $this->object->getId());
2323  ilChangeEvent::_catchupWriteEvents($newNode_data['obj_id'], $ilUser->getId());
2324  // END ChangeEvent: Record copy event.
2325  }*/
2326 
2327  $ilLog->write("ilObjectGUI::pasteObject(), copy finished");
2328  }
2329  // END WebDAV: Support a Copy command in the repository
2330 
2331  // process CUT command
2332  if ($_SESSION["clipboard"]["cmd"] == "cut") {
2333  foreach ($ref_ids as $ref_id) {
2334  // Store old parent
2335  $old_parent = $tree->getParentId($ref_id);
2336  $this->tree->moveTree($ref_id, $this->object->getRefId());
2337  $rbacadmin->adjustMovedObjectPermissions($ref_id, $old_parent);
2338 
2339  include_once('./Services/Conditions/classes/class.ilConditionHandler.php');
2341 
2342  // BEGIN ChangeEvent: Record cut event.
2343  $node_data = $tree->getNodeData($ref_id);
2344  $old_parent_data = $tree->getNodeData($old_parent);
2346  $node_data['obj_id'],
2347  $ilUser->getId(),
2348  'remove',
2349  $old_parent_data['obj_id']
2350  );
2352  $node_data['obj_id'],
2353  $ilUser->getId(),
2354  'add',
2355  $this->object->getId()
2356  );
2357  ilChangeEvent::_catchupWriteEvents($node_data['obj_id'], $ilUser->getId());
2358  // END PATCH ChangeEvent: Record cut event.
2359  }
2360  } // END CUT
2361 
2362  // process LINK command
2363  if ($_SESSION["clipboard"]["cmd"] == "link") {
2364  foreach ($ref_ids as $ref_id) {
2365  // get node data
2366  $top_node = $this->tree->getNodeData($ref_id);
2367 
2368  // get subnodes of top nodes
2369  $subnodes[$ref_id] = $this->tree->getSubtree($top_node);
2370  }
2371 
2372  // now move all subtrees to new location
2373  foreach ($subnodes as $key => $subnode) {
2374  // first paste top_node....
2375  $obj_data = ilObjectFactory::getInstanceByRefId($ref_id);
2376  $new_ref_id = $obj_data->createReference();
2377  $obj_data->putInTree($_GET["ref_id"]);
2378  $obj_data->setPermissions($_GET["ref_id"]);
2379 
2380  // BEGIN ChangeEvent: Record link event.
2381  $node_data = $tree->getNodeData($new_ref_id);
2383  $node_data['obj_id'],
2384  $ilUser->getId(),
2385  'add',
2386  $this->object->getId()
2387  );
2388  ilChangeEvent::_catchupWriteEvents($node_data['obj_id'], $ilUser->getId());
2389  // END PATCH ChangeEvent: Record link event.
2390  }
2391 
2392  $ilLog->write("ilObjectGUI::pasteObject(), link finished");
2393  } // END LINK
2394 
2395  // save cmd for correct message output after clearing the clipboard
2396  $last_cmd = $_SESSION["clipboard"]["cmd"];
2397 
2398 
2399  // clear clipboard
2400  $this->clearObject();
2401 
2402  if ($last_cmd == "cut") {
2403  ilUtil::sendSuccess($this->lng->txt("msg_cut_copied"), true);
2404  }
2405  // BEGIN WebDAV: Support a copy command in repository
2406  elseif ($last_cmd == "copy") {
2407  ilUtil::sendSuccess($this->lng->txt("msg_cloned"), true);
2408  } elseif ($last_cmd == 'link') {
2409  // END WebDAV: Support copy command in repository
2410  ilUtil::sendSuccess($this->lng->txt("msg_linked"), true);
2411  }
2412 
2413  $this->ctrl->returnToParent($this);
2414  } // END PASTE
clearObject()
clear clipboard and go back to last object
$_SESSION["AccountId"]
$_GET["client_id"]
static _recordWriteEvent($obj_id, $usr_id, $action, $parent_obj_id=null)
Records a write event.
static _lookupTitle($a_id)
lookup object title
static _catchupWriteEvents($obj_id, $usr_id, $timestamp=null)
Catches up with all write events which occured before the specified timestamp.
global $ilCtrl
Definition: ilias.php:18
static _lookupObjId($a_id)
$ilUser
Definition: imgupload.php:18
static _adjustMovedObjectConditions($a_ref_id)
In the moment it is not allowed to create preconditions on objects that are located outside of a cour...
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
$message
Definition: xapiexit.php:14
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performPasteIntoMultipleObjectsObject()

ilContainerGUI::performPasteIntoMultipleObjectsObject ( )

Definition at line 1746 of file class.ilContainerGUI.php.

References $_POST, $_SESSION, ilObjectGUI\$ctrl, $error, ilObjectGUI\$ilErr, $ilLog, $ilUser, ilObjectGUI\$lng, $log, $message, $obj_data_cache, $rbacadmin, $rbacreview, $rbacsystem, ilObjectGUI\$ref_id, ilObjectGUI\$tree, $ui, $user, ilConditionHandler\_adjustMovedObjectConditions(), ilObjFileAccess\_appendNumberOfCopyToFilename(), ilChangeEvent\_catchupWriteEvents(), ilLink\_getLink(), ilChangeEvent\_recordReadEvent(), ilChangeEvent\_recordWriteEvent(), ilRbacLog\add(), clearObject(), cloneNodes(), ilRbacLog\gatherFaPa(), ilObjectFactory\getInstanceByRefId(), ilRbacLog\isActive(), ilRbacLog\LINK_OBJECT, ilUtil\sendFailure(), and showPasteTreeObject().

Referenced by ilObjOrgUnitGUI\executeCommand(), and ilObjLearningSequenceGUI\executeCommand().

1747  {
1751  $ilLog = $this->log;
1752  $tree = $this->tree;
1753  $ilObjDataCache = $this->obj_data_cache;
1754  $ilUser = $this->user;
1755  $ilErr = $this->error;
1756  $lng = $this->lng;
1757  $ctrl = $this->ctrl;
1758  $ui = $this->ui;
1759 
1760  $exists = [];
1761  $is_child = [];
1762  $not_allowed_subobject = [];
1763  $no_paste = [];
1764 
1765  $command = $_SESSION['clipboard']['cmd'];
1766  if (!in_array($command, array('cut', 'link', 'copy'))) {
1767  $message = __METHOD__ . ": cmd was neither 'cut', 'link' nor 'copy'; may be a hack attempt!";
1768  $ilErr->raiseError($message, $ilErr->WARNING);
1769  }
1770 
1771  if ($command == 'cut') {
1772  if (isset($_POST['node']) && (int) $_POST['node']) {
1773  $_POST['nodes'] = array($_POST['node']);
1774  }
1775  }
1776 
1777  if (!is_array($_POST['nodes']) || !count($_POST['nodes'])) {
1778  ilUtil::sendFailure($this->lng->txt('select_at_least_one_object'));
1779  switch ($command) {
1780  case 'cut':
1781  $this->showPasteTreeObject();
1782  break;
1783  case 'copy':
1784  $this->showPasteTreeObject();
1785  break;
1786  case 'link':
1787  $this->showPasteTreeObject();
1788  break;
1789  }
1790  return;
1791  }
1792 
1793  // this loop does all checks
1794  $folder_objects_cache = array();
1795  foreach ($_SESSION['clipboard']['ref_ids'] as $ref_id) {
1796  $obj_data = ilObjectFactory::getInstanceByRefId($ref_id);
1797  $current_parent_id = $tree->getParentId($obj_data->getRefId());
1798 
1799  foreach ($_POST['nodes'] as $folder_ref_id) {
1800  if (!array_key_exists($folder_ref_id, $folder_objects_cache)) {
1801  $folder_objects_cache[$folder_ref_id] = ilObjectFactory::getInstanceByRefId($folder_ref_id);
1802  }
1803 
1804  // CHECK ACCESS
1805  if (!$rbacsystem->checkAccess('create', $folder_ref_id, $obj_data->getType())) {
1806  $no_paste[] = sprintf($this->lng->txt('msg_no_perm_paste_object_in_folder'), $obj_data->getTitle() . ' [' . $obj_data->getRefId() . ']', $folder_objects_cache[$folder_ref_id]->getTitle() . ' [' . $folder_objects_cache[$folder_ref_id]->getRefId() . ']');
1807  }
1808 
1809  // CHECK IF REFERENCE ALREADY EXISTS
1810  if ($folder_ref_id == $current_parent_id) {
1811  $exists[] = sprintf($this->lng->txt('msg_obj_exists_in_folder'), $obj_data->getTitle() . ' [' . $obj_data->getRefId() . ']', $folder_objects_cache[$folder_ref_id]->getTitle() . ' [' . $folder_objects_cache[$folder_ref_id]->getRefId() . ']');
1812  }
1813 
1814  // CHECK IF PASTE OBJECT SHALL BE CHILD OF ITSELF
1815  if ($tree->isGrandChild($ref_id, $folder_ref_id) ||
1816  $ref_id == $folder_ref_id) {
1817  $is_child[] = sprintf($this->lng->txt('msg_paste_object_not_in_itself'), $obj_data->getTitle() . ' [' . $obj_data->getRefId() . ']');
1818  }
1819 
1820  // CHECK IF OBJECT IS ALLOWED TO CONTAIN PASTED OBJECT AS SUBOBJECT
1821  if (!in_array($obj_data->getType(), array_keys($folder_objects_cache[$folder_ref_id]->getPossibleSubObjects()))) {
1822  $not_allowed_subobject[] = sprintf(
1823  $this->lng->txt('msg_obj_may_not_contain_objects_of_type'),
1824  $folder_objects_cache[$folder_ref_id]->getTitle() . ' [' . $folder_objects_cache[$folder_ref_id]->getRefId() . ']',
1825  $lng->txt('obj_' . $obj_data->getType())
1826  );
1827  }
1828  }
1829  }
1830 
1832  // process checking results
1833  if (count($exists) && $command != "copy") {
1834  $error .= implode('<br />', $exists);
1835  }
1836 
1837  if (count($is_child)) {
1838  $error .= $error != '' ? '<br />' : '';
1839  $error .= implode('<br />', $is_child);
1840  }
1841 
1842  if (count($not_allowed_subobject)) {
1843  $error .= $error != '' ? '<br />' : '';
1844  $error .= implode('<br />', $not_allowed_subobject);
1845  }
1846 
1847  if (count($no_paste)) {
1848  $error .= $error != '' ? '<br />' : '';
1849  $error .= implode('<br />', $no_paste);
1850  }
1851 
1852  if ($error != '') {
1854  switch ($command) {
1855  case 'cut':
1856  $this->showPasteTreeObject();
1857  break;
1858  case 'copy':
1859  $this->showPasteTreeObject();
1860  break;
1861  case 'link':
1862  $this->showPasteTreeObject();
1863  break;
1864  }
1865  return;
1866  }
1867 
1868  // log pasteObject call
1869  $ilLog->write(__METHOD__ . ", cmd: " . $command);
1870 
1872  // everything ok: now paste the objects to new location
1873 
1874  // to prevent multiple actions via back/reload button
1875  $ref_ids = $_SESSION['clipboard']['ref_ids'];
1876  unset($_SESSION['clipboard']['ref_ids']);
1877 
1878  // BEGIN ChangeEvent: Record paste event.
1879  require_once('Services/Tracking/classes/class.ilChangeEvent.php');
1880  // END ChangeEvent: Record paste event.
1881 
1882  // process COPY command
1883  if ($command == 'copy') {
1884  foreach ($_POST['nodes'] as $folder_ref_id) {
1885  foreach ($ref_ids as $ref_id) {
1886  $revIdMapping = array();
1887 
1888  $oldNode_data = $tree->getNodeData($ref_id);
1889  if ($oldNode_data['parent'] == $folder_ref_id) {
1890  require_once 'Modules/File/classes/class.ilObjFileAccess.php';
1891  $newTitle = ilObjFileAccess::_appendNumberOfCopyToFilename($oldNode_data['title'], null);
1892  $newRef = $this->cloneNodes($ref_id, $folder_ref_id, $refIdMapping, $newTitle);
1893  } else {
1894  $newRef = $this->cloneNodes($ref_id, $folder_ref_id, $refIdMapping, null);
1895  }
1896 
1897  // BEGIN ChangeEvent: Record copy event.
1898  $old_parent_data = $tree->getParentNodeData($ref_id);
1899  $newNode_data = $tree->getNodeData($newRef);
1901  $oldNode_data['type'],
1902  $ref_id,
1903  $oldNode_data['obj_id'],
1904  $ilUser->getId()
1905  );
1907  $newNode_data['obj_id'],
1908  $ilUser->getId(),
1909  'add',
1910  $ilObjDataCache->lookupObjId($folder_ref_id)
1911  );
1912  ilChangeEvent::_catchupWriteEvents($newNode_data['obj_id'], $ilUser->getId());
1913  // END PATCH ChangeEvent: Record cut event.
1914  }
1915  }
1916 
1917  ilUtil::sendSuccess($this->lng->txt('msg_cloned'), true);
1918  } // END COPY
1919 
1920  // process CUT command
1921  if ($command == 'cut') {
1922  foreach ($_POST['nodes'] as $folder_ref_id) {
1923  foreach ($ref_ids as $ref_id) {
1924  // Store old parent
1925  $old_parent = $tree->getParentId($ref_id);
1926  $tree->moveTree($ref_id, $folder_ref_id);
1927  $rbacadmin->adjustMovedObjectPermissions($ref_id, $old_parent);
1928 
1929  include_once('./Services/Conditions/classes/class.ilConditionHandler.php');
1931 
1932  // BEGIN ChangeEvent: Record cut event.
1933  $node_data = $tree->getNodeData($ref_id);
1934  $old_parent_data = $tree->getNodeData($old_parent);
1936  $node_data['obj_id'],
1937  $ilUser->getId(),
1938  'remove',
1939  $old_parent_data['obj_id']
1940  );
1942  $node_data['obj_id'],
1943  $ilUser->getId(),
1944  'add',
1945  $ilObjDataCache->lookupObjId($folder_ref_id)
1946  );
1947  ilChangeEvent::_catchupWriteEvents($node_data['obj_id'], $ilUser->getId());
1948  // END PATCH ChangeEvent: Record cut event.
1949  }
1950 
1951  // prevent multiple iterations for cut cmommand
1952  break;
1953  }
1954 
1955  ilUtil::sendSuccess($this->lng->txt('msg_cut_copied'), true);
1956  } // END CUT
1957 
1958  // process LINK command
1959  if ($command == 'link') {
1960  $linked_to_folders = array();
1961 
1962  include_once "Services/AccessControl/classes/class.ilRbacLog.php";
1963  $rbac_log_active = ilRbacLog::isActive();
1964 
1965  foreach ($_POST['nodes'] as $folder_ref_id) {
1966  $linked_to_folders[$folder_ref_id] = $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($folder_ref_id));
1967 
1968  foreach ($ref_ids as $ref_id) {
1969  // get node data
1970  $top_node = $tree->getNodeData($ref_id);
1971 
1972  // get subnodes of top nodes
1973  $subnodes[$ref_id] = $tree->getSubtree($top_node);
1974  }
1975 
1976  // now move all subtrees to new location
1977  foreach ($subnodes as $key => $subnode) {
1978  // first paste top_node....
1979  $obj_data = ilObjectFactory::getInstanceByRefId($key);
1980  $new_ref_id = $obj_data->createReference();
1981  $obj_data->putInTree($folder_ref_id);
1982  $obj_data->setPermissions($folder_ref_id);
1983 
1984  // rbac log
1985  if ($rbac_log_active) {
1986  $rbac_log_roles = $rbacreview->getParentRoleIds($new_ref_id, false);
1987  $rbac_log = ilRbacLog::gatherFaPa($new_ref_id, array_keys($rbac_log_roles), true);
1988  ilRbacLog::add(ilRbacLog::LINK_OBJECT, $new_ref_id, $rbac_log, $key);
1989  }
1990 
1991  // BEGIN ChangeEvent: Record link event.
1992  $node_data = $tree->getNodeData($new_ref_id);
1994  $node_data['obj_id'],
1995  $ilUser->getId(),
1996  'add',
1997  $ilObjDataCache->lookupObjId($folder_ref_id)
1998  );
1999  ilChangeEvent::_catchupWriteEvents($node_data['obj_id'], $ilUser->getId());
2000  // END PATCH ChangeEvent: Record link event.
2001  }
2002 
2003  $ilLog->write(__METHOD__ . ', link finished');
2004  }
2005 
2006  $linked_targets = array();
2007  $links = [];
2008  if (count($linked_to_folders)) {
2009  require_once 'Services/Link/classes/class.ilLink.php';
2010  foreach ($linked_to_folders as $ref_id => $title) {
2011  $linked_targets[] = '<a href="' . ilLink::_getLink($ref_id) . '">' . $title . '</a>';
2012  $links[] = $ui->factory()->link()->standard($title, ilLink::_getLink($ref_id));
2013  }
2014  }
2015 
2016  $suffix = 'p';
2017  if (count($ref_ids) == 1) {
2018  $suffix = 's';
2019  }
2020 
2021  $mbox = $ui->factory()->messageBox()->success($this->lng->txt('mgs_objects_linked_to_the_following_folders_' . $suffix))
2022  ->withLinks($links);
2023 
2024  ilUtil::sendSuccess($ui->renderer()->render($mbox), true);
2025  } // END LINK
2026 
2027  // clear clipboard
2028  $this->clearObject();
2029 
2030  $this->ctrl->returnToParent($this);
2031  }
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
clearObject()
clear clipboard and go back to last object
$_SESSION["AccountId"]
static _appendNumberOfCopyToFilename($a_file_name, $nth_copy=null, $a_handle_extension=false)
Appends the text " - Copy" to a filename in the language of the current user.
static _recordWriteEvent($obj_id, $usr_id, $action, $parent_obj_id=null)
Records a write event.
static isActive()
static gatherFaPa($a_ref_id, array $a_role_ids, $a_add_action=false)
static _catchupWriteEvents($obj_id, $usr_id, $timestamp=null)
Catches up with all write events which occured before the specified timestamp.
showPasteTreeObject()
Show paste tree.
$ilUser
Definition: imgupload.php:18
const LINK_OBJECT
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static _adjustMovedObjectConditions($a_ref_id)
In the moment it is not allowed to create preconditions on objects that are located outside of a cour...
static add($a_action, $a_ref_id, array $a_diff, $a_source_ref_id=false)
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
$message
Definition: xapiexit.php:14
cloneNodes($srcRef, $dstRef, &$mapping, $newName=null)
Recursively clones all nodes of the RBAC tree.
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareOutput()

ilContainerGUI::prepareOutput (   $a_show_subobjects = true)

prepare output

Definition at line 488 of file class.ilContainerGUI.php.

References ilObjectGUI\getCreationMode(), ilMemberViewGUI\showMemberViewSwitch(), and showTreeFlatIcon().

Referenced by ilObjCategoryGUI\executeCommand(), ilObjRecoveryFolderGUI\executeCommand(), ilObjFolderGUI\executeCommand(), ilObjRootFolderGUI\executeCommand(), and executeCommand().

489  {
490  if (parent::prepareOutput($a_show_subobjects)) { // return false in admin mode
491  if ($this->getCreationMode() != true && $a_show_subobjects) {
492  // This method is called directly from ilContainerGUI::renderObject
493  #$this->showPossibleSubObjects();
494  $this->showTreeFlatIcon();
495 
496  // Member view
497  include_once './Services/Container/classes/class.ilMemberViewGUI.php';
498  ilMemberViewGUI::showMemberViewSwitch($this->object->getRefId());
499  }
500  }
501  }
static showMemberViewSwitch($a_ref_id)
Show member view switch.
getCreationMode()
get creation mode
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redrawListItemObject()

ilContainerGUI::redrawListItemObject ( )

Redraw a list item (ajax)

Parameters

Definition at line 3134 of file class.ilContainerGUI.php.

References $_GET, ilObjectGUI\$tpl, ilEventItems\_getItemsOfContainer(), exit, getContentGUI(), and ilObjectActivation\getItemsByEvent().

3135  {
3136  $tpl = $this->tpl;
3137 
3138  $html = null;
3139 
3140  $item_data = $this->object->getSubItems(false, false, (int) $_GET["child_ref_id"]);
3141  $container_view = $this->getContentGUI();
3142 
3143  // list item is session material (not part of "_all"-items - see below)
3144  include_once './Modules/Session/classes/class.ilEventItems.php';
3145  $event_items = ilEventItems::_getItemsOfContainer($this->object->getRefId());
3146  if (in_array((int) $_GET["child_ref_id"], $event_items)) {
3147  include_once('./Services/Object/classes/class.ilObjectActivation.php');
3148  foreach ($this->object->items["sess"] as $id) {
3149  $items = ilObjectActivation::getItemsByEvent($id['obj_id']);
3150  foreach ($items as $event_item) {
3151  if ($event_item["child"] == (int) $_GET["child_ref_id"]) {
3152  // sessions
3153  if ((int) $_GET["parent_ref_id"]) {
3154  $event_item["parent"] = (int) $_GET["parent_ref_id"];
3155  }
3156  $html = $container_view->renderItem($event_item);
3157  }
3158  }
3159  }
3160  }
3161 
3162  // "normal" list item
3163  if (!$html) {
3164  foreach ($this->object->items["_all"] as $id) {
3165  if ($id["child"] == (int) $_GET["child_ref_id"]) {
3166  $html = $container_view->renderItem($id);
3167  }
3168  }
3169  }
3170 
3171  if ($html) {
3172  echo $html;
3173 
3174  // we need to add onload code manually (rating, comments, etc.)
3175  echo $tpl->getOnLoadCodeForAsynch();
3176  }
3177 
3178  exit;
3179  }
getContentGUI()
Get content gui object.
exit
Definition: login.php:29
static getItemsByEvent($a_event_id)
Get session material / event items.
$_GET["client_id"]
static _getItemsOfContainer($a_ref_id)
+ Here is the call graph for this function:

◆ removeFromSystemObject()

ilContainerGUI::removeFromSystemObject ( )

remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method

public

Definition at line 3601 of file class.ilContainerGUI.php.

References $_POST.

3602  {
3603  $ru = new ilRepUtilGUI($this);
3604  $ru->removeObjectsFromSystem($_POST["trash_id"]);
3605  $this->ctrl->redirect($this, "trash");
3606  }
Repository GUI Utilities.
$_POST["username"]

◆ renderBlockAsynchObject()

ilContainerGUI::renderBlockAsynchObject ( )

render the object

Definition at line 643 of file class.ilContainerGUI.php.

References $_GET, exit, and getContentGUI().

644  {
645  $container_view = $this->getContentGUI();
646  echo $container_view->getSingleTypeBlockAsynch($_GET["type"]);
647  exit;
648  }
getContentGUI()
Get content gui object.
exit
Definition: login.php:29
$_GET["client_id"]
+ Here is the call graph for this function:

◆ renderObject()

ilContainerGUI::renderObject ( )

render the object

Definition at line 602 of file class.ilContainerGUI.php.

References $_GET, ilObjectGUI\$ctrl, $db, $ilCtrl, $ilDB, $ilSetting, $settings, $tabs, ilObjectGUI\$tpl, getContentGUI(), isActiveAdministrationPanel(), setContentSubTabs(), showAdministrationPanel(), showPermanentLink(), and showPossibleSubObjects().

Referenced by editOrderObject(), and enableMultiDownloadObject().

603  {
604  $ilDB = $this->db;
605  $tpl = $this->tpl;
606  $ilTabs = $this->tabs;
609 
610  $container_view = $this->getContentGUI();
611 
612  $this->setContentSubTabs();
613  if ($this->isActiveAdministrationPanel()) {
614  $ilTabs->activateSubTab("manage");
615  } else {
616  $ilTabs->activateSubTab("view_content");
617  }
618 
619  $container_view->setOutput();
620 
621  $this->adminCommands = $container_view->adminCommands;
622 
623  // it is important not to show the subobjects/admin panel here, since
624  // we will create nested forms in case, e.g. a news/calendar item is added
625  if ($ilCtrl->getNextClass() != "ilcolumngui") {
626  $this->showAdministrationPanel();
627  $this->showPossibleSubObjects();
628  }
629 
630  $this->showContainerFilter();
631 
632  $this->showPermanentLink();
633 
634  // add tree updater javascript
635  if ((int) $_GET["ref_id"] > 1 && $ilSetting->get("rep_tree_synchronize")) {
636  $ilCtrl->setParameter($this, "active_node", (int) $_GET["ref_id"]);
637  }
638  }
getContentGUI()
Get content gui object.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
showPossibleSubObjects()
show possible sub objects selection list
showPermanentLink()
show permanent link
setContentSubTabs()
Set content sub tabs.
global $ilSetting
Definition: privfeed.php:17
global $ilDB
showAdministrationPanel()
show administration panel
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetRowType()

ilContainerGUI::resetRowType ( )

Definition at line 1266 of file class.ilContainerGUI.php.

1267  {
1268  $this->cur_row_type = "";
1269  }

◆ restoreToNewLocationObject()

ilContainerGUI::restoreToNewLocationObject ( \ilPropertyFormGUI  $form = null)
protected
Parameters
\ilPropertyFormGUI | null$form

Definition at line 3611 of file class.ilContainerGUI.php.

3612  {
3613  $this->tabs_gui->activateTab('trash');
3614 
3615  $ru = new \ilRepUtilGUI($this);
3616  $ru->restoreToNewLocation();
3617  }

◆ saveListPresentation()

ilContainerGUI::saveListPresentation ( ilPropertyFormGUI  $form)
protected

Save list presentation setting.

Parameters
ilPropertyFormGUI$form

Definition at line 3394 of file class.ilContainerGUI.php.

References ilContainer\_writeContainerSetting(), and ilPropertyFormGUI\getInput().

Referenced by ilObjRootFolderGUI\getEditFormValues(), ilObjFolderGUI\updateCustom(), ilObjGroupGUI\updateObject(), ilObjCourseGUI\updateObject(), and ilObjCategoryGUI\updateObject().

3395  {
3396  $val = ($form->getInput('list_presentation') == "tile")
3397  ? "tile"
3398  : "";
3399  ilContainer::_writeContainerSetting($this->object->getId(), "list_presentation", $val);
3400  }
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
static _writeContainerSetting($a_id, $a_keyword, $a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ savePageContentObject()

ilContainerGUI::savePageContentObject ( )

Definition at line 1000 of file class.ilContainerGUI.php.

References $_POST, ilRTE\_cleanupMediaObjectUsage(), ilObjAdvancedEditing\_getUsedHTMLTagsAsString(), ilContainer\_lookupContainerSetting(), ilContainer\_writeContainerSetting(), and ilUtil\stripSlashes().

1001  {
1002  include_once("Services/XHTMLPage/classes/class.ilXHTMLPage.php");
1003  include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
1005  $this->object->getId(),
1006  "xhtml_page"
1007  );
1008 
1009  /*include_once("./Services/Form/classes/class.ilFormPropertyGUI.php");
1010  include_once("./Services/Form/classes/class.ilTextAreaInputGUI.php");
1011  $ta = new ilTextAreaInputGUI();
1012  $ta->setRteTagSet("extended_table_img");
1013  $tags = $ta->getRteTagString();*/
1014 
1015  //$text = ilUtil::stripSlashes($_POST["page_content"],
1016  // true,
1017  // $tags);
1018 
1019  $text = ilUtil::stripSlashes(
1020  $_POST["page_content"],
1021  true,
1023  );
1024  if ($xpage_id > 0) {
1025  $xpage = new ilXHTMLPage($xpage_id);
1026  $xpage->setContent($text);
1027  $xpage->save();
1028  } else {
1029  $xpage = new ilXHTMLPage();
1030  $xpage->setContent($text);
1031  $xpage->save();
1033  $this->object->getId(),
1034  "xhtml_page",
1035  $xpage->getId()
1036  );
1037  }
1038 
1039  include_once("Services/RTE/classes/class.ilRTE.php");
1041  $text,
1042  $this->object->getType() . ":html",
1043  $this->object->getId()
1044  );
1045 
1046  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1047  $this->ctrl->redirect($this, "");
1048  }
static _getUsedHTMLTagsAsString($a_module="")
Returns a string of all allowed HTML tags for text editing.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
XHTML Page class.
static _writeContainerSetting($a_id, $a_keyword, $a_value)
static _cleanupMediaObjectUsage($a_text, $a_usage_type, $a_usage_id)
Synchronises appearances of media objects in $a_text with media object usage table.
$_POST["username"]
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
+ Here is the call graph for this function:

◆ savePasswordObject()

ilContainerGUI::savePasswordObject ( )
protected

Save password.

Returns

Definition at line 3113 of file class.ilContainerGUI.php.

References $ilUser, $user, initFormPasswordInstruction(), and showPasswordInstructionObject().

3114  {
3115  $ilUser = $this->user;
3116 
3117  $form = $this->initFormPasswordInstruction();
3118  if ($form->checkInput()) {
3119  $ilUser->resetPassword($this->form->getInput('new_password'), $this->form->getInput('new_password'));
3120  ilUtil::sendSuccess($this->lng->txt('webdav_pwd_instruction_success'), true);
3121  $this->showPasswordInstructionObject(false);
3122  return true;
3123  }
3124  $form->setValuesByPost();
3126  }
showPasswordInstructionObject($a_init=true)
Show webdav password instruction.
initFormPasswordInstruction()
Init password form.
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ saveSortingObject()

ilContainerGUI::saveSortingObject ( )

Save Sorting.

public

Parameters

Definition at line 2725 of file class.ilContainerGUI.php.

References $_POST, and ilContainerSorting\_getInstance().

2726  {
2727  include_once('Services/Container/classes/class.ilContainerSorting.php');
2728  $sorting = ilContainerSorting::_getInstance($this->object->getId());
2729 
2730  // Allow comma
2731  $positions = str_replace(',', '.', $_POST['position']);
2732 
2733  $sorting->savePost($positions);
2734  ilUtil::sendSuccess($this->lng->txt('cntr_saved_sorting'), true);
2735  $this->ctrl->redirect($this, "editOrder");
2736  }
static _getInstance($a_obj_id)
get instance by obj_id
$_POST["username"]
+ Here is the call graph for this function:

◆ saveSortingSettings()

ilContainerGUI::saveSortingSettings ( ilPropertyFormGUI  $form)
protected

Save sorting settings.

Parameters
ilPropertyFormGUI$form

Definition at line 3516 of file class.ilContainerGUI.php.

References $settings, ilPropertyFormGUI\getInput(), ilContainer\SORT_ACTIVATION, ilContainer\SORT_CREATION, ilContainer\SORT_MANUAL, and ilContainer\SORT_TITLE.

Referenced by ilObjRootFolderGUI\getEditFormValues(), ilObjFolderGUI\updateCustom(), ilObjGroupGUI\updateObject(), ilObjCourseGUI\updateObject(), and ilObjCategoryGUI\updateObject().

3517  {
3518  include_once('Services/Container/classes/class.ilContainerSortingSettings.php');
3519  $settings = new ilContainerSortingSettings($this->object->getId());
3520  $settings->setSortMode($form->getInput("sorting"));
3521 
3522  switch ($form->getInput('sorting')) {
3524  $settings->setSortDirection($form->getInput('title_sorting_direction'));
3525  break;
3527  $settings->setSortDirection($form->getInput('activation_sorting_direction'));
3528  break;
3530  $settings->setSortDirection($form->getInput('creation_sorting_direction'));
3531  break;
3533  $settings->setSortNewItemsPosition($form->getInput('manual_new_items_position'));
3534  $settings->setSortNewItemsOrder($form->getInput('manual_new_items_order'));
3535  $settings->setSortDirection($form->getInput('manual_sorting_direction'));
3536  break;
3537  }
3538 
3539  $settings->update();
3540  }
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveStyleSettingsObject()

ilContainerGUI::saveStyleSettingsObject ( )

Save style settings.

Definition at line 2996 of file class.ilContainerGUI.php.

References $_POST, $ilSetting, $settings, ilObjStyleSheet\_lookupStandard(), and ilUtil\stripSlashes().

2997  {
2999 
3000  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
3001  if ($ilSetting->get("fixed_content_style_id") <= 0 &&
3002  (ilObjStyleSheet::_lookupStandard($this->object->getStyleSheetId())
3003  || $this->object->getStyleSheetId() == 0)) {
3004  $this->object->setStyleSheetId(ilUtil::stripSlashes($_POST["style_id"]));
3005  $this->object->update();
3006  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
3007  }
3008  $this->ctrl->redirect($this, "editStyleProperties");
3009  }
static _lookupStandard($a_id)
Lookup standard flag.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
global $ilSetting
Definition: privfeed.php:17
$_POST["username"]
+ Here is the call graph for this function:

◆ setColumnSettings()

ilContainerGUI::setColumnSettings ( ilColumnGUI  $column_gui)

May be overwritten in subclasses.

Definition at line 2492 of file class.ilContainerGUI.php.

References $access, isActiveAdministrationPanel(), ilColumnGUI\setAdminCommands(), ilColumnGUI\setBlockProperty(), and ilColumnGUI\setRepositoryItems().

2493  {
2494  $ilAccess = $this->access;
2495  parent::setColumnSettings($column_gui);
2496 
2497  $column_gui->setRepositoryItems(
2498  $this->object->getSubItems($this->isActiveAdministrationPanel(), true)
2499  );
2500 
2501  //if ($ilAccess->checkAccess("write", "", $this->object->getRefId())
2502  // && $this->allowBlocksConfigure())
2503  if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
2504  $column_gui->setBlockProperty("news", "settings", true);
2505  //$column_gui->setBlockProperty("news", "public_notifications_option", true);
2506  $column_gui->setBlockProperty("news", "default_visibility_option", true);
2507  $column_gui->setBlockProperty("news", "hide_news_block_option", true);
2508  }
2509 
2510  if ($this->isActiveAdministrationPanel()) {
2511  $column_gui->setAdminCommands(true);
2512  }
2513  }
setBlockProperty($a_block_type, $a_property, $a_value)
This function is supposed to be used for block type specific properties, that should be passed to ilB...
setRepositoryItems($a_repositoryitems)
Set Repository Items.
setAdminCommands($a_admincommands)
Set Administration Commmands.
+ Here is the call graph for this function:

◆ setContentSubTabs()

ilContainerGUI::setContentSubTabs ( )

Set content sub tabs.

Definition at line 654 of file class.ilContainerGUI.php.

References addStandardContainerSubTabs().

Referenced by renderObject().

655  {
657  }
addStandardContainerSubTabs($a_include_view=true)
Add standar container subtabs for view, manage, oderdering and text/media editor link.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPageEditorTabs()

ilContainerGUI::setPageEditorTabs ( )

Add page editor tabs.

Definition at line 1275 of file class.ilContainerGUI.php.

References ilObjectGUI\$lng, ilFrameTargetInfo\_getFrame(), and isActiveAdministrationPanel().

1276  {
1277  $lng = $this->lng;
1278 
1279  if (!$this->isActiveAdministrationPanel()
1280  || strtolower($this->ctrl->getCmdClass()) != "ilcontainerpagegui") {
1281  return;
1282  }
1283 
1284  $lng->loadLanguageModule("content");
1285  //$tabs_gui = new ilTabsGUI();
1286  //$tabs_gui->setSubTabs();
1287 
1288  // back to upper context
1289  $this->tabs_gui->setBackTarget(
1290  $this->lng->txt("obj_cat"),
1291  $this->ctrl->getLinkTarget($this, "frameset"),
1292  ilFrameTargetInfo::_getFrame("MainContent")
1293  );
1294 
1295  $this->tabs_gui->addTarget("edit", $this->ctrl->getLinkTargetByClass("ilcontainerpagegui", "view"), array("", "view"), "ilcontainerpagegui");
1296 
1297  //$this->tpl->setTabs($tabs_gui->getHTML());
1298  }
static _getFrame($a_class, $a_type='')
Get content frame name.
+ Here is the call graph for this function:

◆ setSideColumnReturn()

ilContainerGUI::setSideColumnReturn ( )

Set return point for side column actions.

Definition at line 3692 of file class.ilContainerGUI.php.

References $_GET, $container_filter_service, $DIC, $i, ilObjectGUI\$tpl, ilContainer\_lookupContainerSetting(), isActiveAdministrationPanel(), and ilUtil\sendInfo().

3693  {
3694  $this->ctrl->setReturn($this, "");
3695  }
+ Here is the call graph for this function:

◆ setTitleAndDescription()

ilContainerGUI::setTitleAndDescription ( )

called by prepare output

Definition at line 527 of file class.ilContainerGUI.php.

References ilObjectListGUIFactory\_getListGUIByType(), and ilContainer\_lookupContainerSetting().

528  {
529  if (ilContainer::_lookupContainerSetting($this->object->getId(), "hide_header_icon_and_title")) {
530  $this->tpl->setTitle((string) $this->object->getTitle(), true);
531  } else {
532  $this->tpl->setTitle((string) $this->object->getTitle());
533  $this->tpl->setDescription($this->object->getLongDescription());
534 
535  // set tile icon
536  $icon = ilObject::_getIcon($this->object->getId(), "big", $this->object->getType());
537  $this->tpl->setTitleIcon($icon, $this->lng->txt("obj_" . $this->object->getType()));
538 
539  include_once './Services/Object/classes/class.ilObjectListGUIFactory.php';
540  $lgui = ilObjectListGUIFactory::_getListGUIByType($this->object->getType());
541  $lgui->initItem($this->object->getRefId(), $this->object->getId(), $this->object->getType());
542  $this->tpl->setAlertProperties($lgui->getAlertProperties());
543  }
544  }
static _getListGUIByType($a_type, $a_context=ilObjectListGUI::CONTEXT_REPOSITORY)
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
+ Here is the call graph for this function:

◆ showAdministrationPanel()

ilContainerGUI::showAdministrationPanel ( )

show administration panel

Definition at line 662 of file class.ilContainerGUI.php.

References $_GET, $_SESSION, $access, $DIC, $GLOBALS, ilObjectGUI\$lng, ilObjectGUI\$ref_id, $toolbar, ilUtil\getImagePath(), isActiveAdministrationPanel(), isActiveOrdering(), isMultiDownloadEnabled(), and ilUtil\sendInfo().

Referenced by renderObject(), and ilObjOrgUnitGUI\updateSettings().

663  {
664  global $DIC;
665 
666  $ilAccess = $this->access;
667  $lng = $this->lng;
668 
669  $main_tpl = $DIC->ui()->mainTemplate();
670 
671  $lng->loadLanguageModule('cntr');
672 
673  if ($_SESSION["clipboard"]) {
674  // #11545
675  $main_tpl->setPageFormAction($this->ctrl->getFormAction($this));
676 
677  include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
678  $toolbar = new ilToolbarGUI();
679  $this->ctrl->setParameter($this, "type", "");
680  $this->ctrl->setParameter($this, "item_ref_id", "");
681 
682  $toolbar->addFormButton(
683  $this->lng->txt('paste_clipboard_items'),
684  'paste'
685  );
686 
687  $toolbar->addFormButton(
688  $this->lng->txt('clear_clipboard'),
689  'clear'
690  );
691 
692  $main_tpl->addAdminPanelToolbar($toolbar, true, false);
693  } elseif ($this->isActiveAdministrationPanel()) {
694  // #11545
695  $main_tpl->setPageFormAction($this->ctrl->getFormAction($this));
696 
697  include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
698  $toolbar = new ilToolbarGUI();
699  $this->ctrl->setParameter($this, "type", "");
700  $this->ctrl->setParameter($this, "item_ref_id", "");
701 
702  // if (!$_SESSION["clipboard"])
703  // {
704  if ($this->object->gotItems()) {
705  $toolbar->setLeadingImage(
706  ilUtil::getImagePath("arrow_upright.svg"),
707  $lng->txt("actions")
708  );
709  $toolbar->addFormButton(
710  $this->lng->txt('delete_selected_items'),
711  'delete'
712  );
713  $toolbar->addFormButton(
714  $this->lng->txt('move_selected_items'),
715  'cut'
716  );
717  $toolbar->addFormButton(
718  $this->lng->txt('copy_selected_items'),
719  'copy'
720  );
721  $toolbar->addFormButton(
722  $this->lng->txt('link_selected_items'),
723  'link'
724  );
725  // add download button if multi download enabled
726  $folder_set = new ilSetting('fold');
727  if ((bool) $folder_set->get('enable_multi_download') === true) {
728  $toolbar->addSeparator();
729  $toolbar->addFormButton(
730  $this->lng->txt('download_selected_items'),
731  'download'
732  );
733  }
734  }
735  if ($this->object->getType() == 'crs' or $this->object->getType() == 'grp') {
736  if ($this->object->gotItems()) {
737  $toolbar->addSeparator();
738  }
739 
740  $toolbar->addButton(
741  $this->lng->txt('cntr_adopt_content'),
742  $this->ctrl->getLinkTargetByClass(
743  'ilObjectCopyGUI',
744  'adoptContent'
745  )
746  );
747  }
748  // }
749  /*else
750  {
751 
752  if ($this->isMultiDownloadEnabled())
753  {
754  $toolbar->addSeparator();
755  $toolbar->addFormButton(
756  $this->lng->txt('download_selected_items'),
757  'download'
758  );
759  }
760  }*/
761 
762  $main_tpl->addAdminPanelToolbar(
763  $toolbar,
764  ($this->object->gotItems() && !$_SESSION["clipboard"]) ? true : false,
765  ($this->object->gotItems() && !$_SESSION["clipboard"]) ? true : false
766  );
767 
768  // form action needed, see http://www.ilias.de/mantis/view.php?id=9630
769  if ($this->object->gotItems()) {
770  $main_tpl->setPageFormAction($this->ctrl->getFormAction($this));
771  }
772  } else {
773  if ($this->edit_order) {
774  if ($this->object->gotItems() and $ilAccess->checkAccess("write", "", $this->object->getRefId())) {
775  include_once('./Services/Container/classes/class.ilContainer.php');
776 
777  if ($this->isActiveOrdering()) {
778  // #11843
779  $main_tpl->setPageFormAction($this->ctrl->getFormAction($this));
780 
781  include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
782  $toolbar = new ilToolbarGUI();
783  $this->ctrl->setParameter($this, "type", "");
784  $this->ctrl->setParameter($this, "item_ref_id", "");
785 
786  $toolbar->addFormButton(
787  $this->lng->txt('sorting_save'),
788  'saveSorting'
789  );
790 
791  $main_tpl->addAdminPanelToolbar($toolbar, true, false);
792  }
793  }
794  }
795 
796  // bugfix mantis 24559
797  // undoing an erroneous change inside mantis 23516 by adding "Download Multiple Objects"-functionality for non-admins
798  // as they don't have the possibility to use the multi-download-capability of the manage-tab
799  elseif ($this->isMultiDownloadEnabled()) {
800  // bugfix mantis 0021272
801  $ref_id = $_GET['ref_id'];
802  $num_files = $this->tree->getChildsByType($ref_id, "file");
803  $num_folders = $this->tree->getChildsByType($ref_id, "fold");
804  if (count($num_files) > 0 or count($num_folders) > 0) {
805  // #11843
806  $GLOBALS['tpl']->setPageFormAction($this->ctrl->getFormAction($this));
807 
808  include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
809  $toolbar = new ilToolbarGUI();
810  $this->ctrl->setParameter($this, "type", "");
811  $this->ctrl->setParameter($this, "item_ref_id", "");
812 
813  $toolbar->addFormButton(
814  $this->lng->txt('download_selected_items'),
815  'download'
816  );
817 
818  $GLOBALS['tpl']->addAdminPanelToolbar(
819  $toolbar,
820  $this->object->gotItems() ? true : false,
821  $this->object->gotItems() ? true : false
822  );
823  } else {
824  ilUtil::sendInfo($this->lng->txt('msg_no_downloadable_objects'), true);
825  }
826  }
827  }
828  }
$_SESSION["AccountId"]
$_GET["client_id"]
isActiveOrdering()
Check if ordering is enabled.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLinkListObject()

ilContainerGUI::showLinkListObject ( )

Definition at line 1055 of file class.ilContainerGUI.php.

References $_GET, $i, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjectGUI\$tree, $type, exit, and ilUtil\getStyleSheetLocation().

1056  {
1057  $lng = $this->lng;
1058  $tree = $this->tree;
1059 
1060  $tpl = new ilGlobalTemplate(
1061  "tpl.container_link_help.html",
1062  true,
1063  true,
1064  "Services/Container"
1065  );
1066 
1067  $type_ordering = array(
1068  "cat", "fold", "crs", "grp", "chat", "frm", "lres",
1069  "glo", "webr", "file", "exc",
1070  "tst", "svy", "mep", "qpl", "spl");
1071 
1072  $childs = $tree->getChilds($_GET["ref_id"]);
1073  foreach ($childs as $child) {
1074  if (in_array($child["type"], array("lm", "sahs", "htlm"))) {
1075  $cnt["lres"]++;
1076  } else {
1077  $cnt[$child["type"]]++;
1078  }
1079  }
1080 
1081  $tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
1082  $tpl->setVariable("TXT_HELP_HEADER", $lng->txt("help"));
1083  foreach ($type_ordering as $type) {
1084  $tpl->setCurrentBlock("row");
1085  $tpl->setVariable("ROWCOL", "tblrow" . ((($i++) % 2) + 1));
1086  if ($type != "lres") {
1087  $tpl->setVariable("TYPE", $lng->txt("objs_" . $type) .
1088  " (" . ((int) $cnt[$type]) . ")");
1089  } else {
1090  $tpl->setVariable("TYPE", $lng->txt("obj_lrss") .
1091  " (" . ((int) $cnt["lres"]) . ")");
1092  }
1093  $tpl->setVariable("TXT_LINK", "[list-" . $type . "]");
1094  $tpl->parseCurrentBlock();
1095  }
1096  $tpl->printToStdout();
1097  exit;
1098  }
exit
Definition: login.php:29
special template class to simplify handling of ITX/PEAR
$type
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
$i
Definition: metadata.php:24
+ Here is the call graph for this function:

◆ showPasswordInstructionObject()

ilContainerGUI::showPasswordInstructionObject (   $a_init = true)
protected

Show webdav password instruction.

Returns

Definition at line 3063 of file class.ilContainerGUI.php.

References $DIC, $toolbar, ilObjectGUI\$tpl, ilButton\getInstance(), ilWebDAVUriBuilder\getUriToMountInstructionModalByRef(), initFormPasswordInstruction(), and ilUtil\sendInfo().

Referenced by savePasswordObject().

3064  {
3065  global $DIC;
3066  $tpl = $this->tpl;
3067  $ilToolbar = $this->toolbar;
3068 
3069  if ($a_init) {
3070  ilUtil::sendInfo($this->lng->txt('webdav_pwd_instruction'));
3071  $this->initFormPasswordInstruction();
3072  }
3073 
3074  $uri_builder = new ilWebDAVUriBuilder($DIC->http()->request());
3075  $href = $uri_builder->getUriToMountInstructionModalByRef($this->object->getRefId());
3076 
3077  $btn = ilButton::getInstance();
3078  $btn->setCaption('mount_webfolder');
3079  $btn->setOnClick("triggerWebDAVModal('$href')");
3080  $ilToolbar->addButtonInstance($btn);
3081 
3082  $tpl->setContent($this->form->getHTML());
3083  }
static getInstance()
initFormPasswordInstruction()
Init password form.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$DIC
Definition: xapitoken.php:46
getUriToMountInstructionModalByRef(int $a_ref_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showPasteTreeObject()

ilContainerGUI::showPasteTreeObject ( )

Show paste tree.

Definition at line 2057 of file class.ilContainerGUI.php.

References $_SESSION, Vendor\Package\$b, $error, ilObjectGUI\$ilErr, $message, $tabs, $toolbar, ilUtil\getImagePath(), ilSubmitButton\getInstance(), and getTreeSelectorGUI().

Referenced by ilObjLearningSequenceGUI\executeCommand(), initAndDisplayCopyIntoMultipleObjectsObject(), initAndDisplayLinkIntoMultipleObjectsObject(), initAndDisplayMoveIntoObjectObject(), and performPasteIntoMultipleObjectsObject().

2058  {
2059  $ilTabs = $this->tabs;
2060  $ilToolbar = $this->toolbar;
2061  $ilErr = $this->error;
2062 
2063  $ilTabs->setTabActive('view_content');
2064 
2065  if (!in_array($_SESSION['clipboard']['cmd'], array('link', 'copy', 'cut'))) {
2066  $message = __METHOD__ . ": Unknown action.";
2067  $ilErr->raiseError($message, $ilErr->WARNING);
2068  }
2069  $cmd = $_SESSION['clipboard']['cmd'];
2070 
2071  //
2072  $exp = $this->getTreeSelectorGUI($cmd);
2073  if ($exp->handleCommand()) {
2074  return;
2075  }
2076  $output = $exp->getHTML();
2077 
2078  $txt_var = ($cmd == "copy")
2079  ? "copy"
2080  : "paste";
2081 
2082  // toolbars
2083  $t = new ilToolbarGUI();
2084  $t->setFormAction($this->ctrl->getFormAction($this, "performPasteIntoMultipleObjects"));
2085 
2086  include_once("./Services/UIComponent/Button/classes/class.ilSubmitButton.php");
2088  $b->setCaption($txt_var);
2089  $b->setCommand("performPasteIntoMultipleObjects");
2090 
2091  //$t->addFormButton($this->lng->txt($txt_var), "performPasteIntoMultipleObjects");
2092  $t->addStickyItem($b);
2093 
2094  $t->addSeparator();
2095  $this->lng->loadLanguageModule('obj');
2096  $t->addFormButton($this->lng->txt("obj_insert_into_clipboard"), "keepObjectsInClipboard");
2097 
2098  $t->addFormButton($this->lng->txt("cancel"), "cancelMoveLink");
2099  $t->setCloseFormTag(false);
2100  $t->setLeadingImage(ilUtil::getImagePath("arrow_upright.svg"), " ");
2101  $output = $t->getHTML() . $output;
2102  $t->setLeadingImage(ilUtil::getImagePath("arrow_downright.svg"), " ");
2103  $t->setCloseFormTag(true);
2104  $t->setOpenFormTag(false);
2105  $output .= "<br />" . $t->getHTML();
2106 
2107  $this->tpl->setContent($output);
2108  }
$_SESSION["AccountId"]
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$message
Definition: xapiexit.php:14
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showPermanentLink()

ilContainerGUI::showPermanentLink ( )

show permanent link

Definition at line 846 of file class.ilContainerGUI.php.

References $DIC, and ilObjectGUI\$tpl.

Referenced by ilObjGroupGUI\executeCommand(), ilObjCourseGUI\executeCommand(), and renderObject().

847  {
848  global $DIC;
849 
850  $tpl = $DIC->ui()->mainTemplate();
851 
852  $tpl->setPermanentLink(
853  $this->object->getType(),
854  $this->object->getRefId(),
855  "",
856  "_top"
857  );
858  }
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ showPossibleSubObjects()

ilContainerGUI::showPossibleSubObjects ( )

show possible sub objects selection list

Definition at line 549 of file class.ilContainerGUI.php.

References ilObjectAddNewItemGUI\render().

Referenced by renderObject().

550  {
551  include_once "Services/Object/classes/class.ilObjectAddNewItemGUI.php";
552  $gui = new ilObjectAddNewItemGUI($this->object->getRefId());
553  $gui->render();
554  }
Render add new item selector.
render()
Add new item selection to current page incl.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showTreeFlatIcon()

ilContainerGUI::showTreeFlatIcon ( )

Definition at line 503 of file class.ilContainerGUI.php.

References $_GET, $_SESSION, ilObjectGUI\$tpl, and ilMemberViewSettings\getInstance().

Referenced by prepareOutput().

504  {
505  $tpl = $this->tpl;
506 
507  // dont show icon, if role (permission gui->rolegui) is edited
508  if ($_GET["obj_id"] != "") {
509  return;
510  }
511  // hide for member view
512  include_once './Services/Container/classes/class.ilMemberViewSettings.php';
513  if (ilMemberViewSettings::getInstance()->isActive()) {
514  return;
515  }
516 
517  $mode = ($_SESSION["il_rep_mode"] == "flat")
518  ? "tree"
519  : "flat";
520  $link = "ilias.php?baseClass=ilRepositoryGUI&amp;cmd=frameset&amp;set_mode=" . $mode . "&amp;ref_id=" . $this->object->getRefId();
521  $tpl->setTreeFlatIcon($link, $mode);
522  }
$_SESSION["AccountId"]
$_GET["client_id"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ switchToOldEditorObject()

ilContainerGUI::switchToOldEditorObject ( )

Switch to old page editor.

Definition at line 874 of file class.ilContainerGUI.php.

References $_SESSION, ilObjectGUI\$ctrl, and $ilCtrl.

875  {
877 
878  $_SESSION["il_cntr_editor"] = "old";
879  $ilCtrl->redirect($this, "editPageFrame");
880  }
$_SESSION["AccountId"]
global $ilCtrl
Definition: ilias.php:18

◆ switchToStdEditorObject()

ilContainerGUI::switchToStdEditorObject ( )

Switch to standard page editor.

Definition at line 863 of file class.ilContainerGUI.php.

References $_SESSION, ilObjectGUI\$ctrl, and $ilCtrl.

864  {
866 
867  $_SESSION["il_cntr_editor"] = "std";
868  $ilCtrl->redirect($this, "editPageFrame");
869  }
$_SESSION["AccountId"]
global $ilCtrl
Definition: ilias.php:18

◆ trashApplyFilterObject()

ilContainerGUI::trashApplyFilterObject ( )

trash table apply filter

Definition at line 3566 of file class.ilContainerGUI.php.

References trashHandleFilter().

3567  {
3568  $this->trashHandleFilter(true, false);
3569  }
trashHandleFilter(bool $action_apply, bool $action_reset)
+ Here is the call graph for this function:

◆ trashHandleFilter()

ilContainerGUI::trashHandleFilter ( bool  $action_apply,
bool  $action_reset 
)
protected
Parameters
bool$action_apply

Definition at line 3582 of file class.ilContainerGUI.php.

References trashObject().

Referenced by trashApplyFilterObject(), and trashResetFilterObject().

3583  {
3584  $trash_table = new \ilTrashTableGUI($this, 'trash', $this->object->getRefId());
3585  $trash_table->init();
3586  $trash_table->resetOffset();
3587  if ($action_reset) {
3588  $trash_table->resetFilter();
3589  }
3590  if ($action_apply) {
3591  $trash_table->writeFilterToSession();
3592  }
3593  $this->trashObject();
3594  }
trashObject()
Show trash content of object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ trashObject()

ilContainerGUI::trashObject ( )

Show trash content of object.

public

Definition at line 3547 of file class.ilContainerGUI.php.

References ilObjectGUI\$tpl.

Referenced by ilObjLearningSequenceGUI\executeCommand(), and trashHandleFilter().

3548  {
3549  $tpl = $this->tpl;
3550 
3551  $this->tabs_gui->activateTab('trash');
3552 
3553  $trash_table = new \ilTrashTableGUI($this, 'trash', $this->object->getRefId());
3554  $trash_table->init();
3555  $trash_table->parse();
3556 
3557  $trash_table->setFilterCommand('trashApplyFilter');
3558  $trash_table->setResetCommand('trashResetFilter');
3559 
3560  $tpl->setContent($trash_table->getHTML());
3561  }
+ Here is the caller graph for this function:

◆ trashResetFilterObject()

ilContainerGUI::trashResetFilterObject ( )

trash table reset filter

Definition at line 3574 of file class.ilContainerGUI.php.

References trashHandleFilter().

3575  {
3576  $this->trashHandleFilter(false, true);
3577  }
trashHandleFilter(bool $action_apply, bool $action_reset)
+ Here is the call graph for this function:

◆ undeleteObject()

ilContainerGUI::undeleteObject ( )

Get objects back from trash.

Definition at line 3623 of file class.ilContainerGUI.php.

References $_GET, and $_POST.

Referenced by ilObjLearningSequenceGUI\executeCommand().

3624  {
3625  $ru = new ilRepUtilGUI($this);
3626  $ru->restoreObjects($_GET["ref_id"], $_POST["trash_id"]);
3627  $this->ctrl->redirect($this, "trash");
3628  }
$_GET["client_id"]
Repository GUI Utilities.
$_POST["username"]
+ Here is the caller graph for this function:

◆ useNewEditorObject()

ilContainerGUI::useNewEditorObject ( )

Use new editor (-> delete xhtml content page)

Definition at line 885 of file class.ilContainerGUI.php.

References $access, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, and ilContainer\_writeContainerSetting().

886  {
888  $ilAccess = $this->access;
889  $lng = $this->lng;
891 
892  if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
893  include_once("./Services/XHTMLPage/classes/class.ilXHTMLPage.php");
894 
895  /* keep old page content for now...
896  $xpage_id = ilContainer::_lookupContainerSetting($this->object->getId(),
897  "xhtml_page");
898  if ($xpage_id)
899  {
900  $xpage = new ilXHTMLPage($xpage_id);
901  }
902  */
903 
905  $this->object->getId(),
906  "xhtml_page",
907  0
908  );
909 
910  ilUtil::sendSuccess($lng->txt("cntr_switched_editor"), true);
911  }
912 
913  $ilCtrl->redirect($this, "editPageFrame");
914  }
global $ilCtrl
Definition: ilias.php:18
static _writeContainerSetting($a_id, $a_keyword, $a_value)
+ Here is the call graph for this function:

Field Documentation

◆ $access

◆ $app_event_handler

ilContainerGUI::$app_event_handler
protected

Definition at line 100 of file class.ilContainerGUI.php.

Referenced by ilObjLearningSequenceGUI\afterSave().

◆ $bl_cnt

ilContainerGUI::$bl_cnt = 1

Definition at line 102 of file class.ilContainerGUI.php.

◆ $container_filter_service

ilContainerGUI::$container_filter_service
protected

Definition at line 113 of file class.ilContainerGUI.php.

Referenced by setSideColumnReturn().

◆ $container_user_filter

ilContainerGUI::$container_user_filter = null
protected

Definition at line 118 of file class.ilContainerGUI.php.

◆ $db

ilContainerGUI::$db
protected

Definition at line 46 of file class.ilContainerGUI.php.

Referenced by renderObject().

◆ $error

◆ $global_screen

ilContainerGUI::$global_screen
protected

Definition at line 95 of file class.ilContainerGUI.php.

◆ $log

◆ $multi_download_enabled

ilContainerGUI::$multi_download_enabled = false

Definition at line 103 of file class.ilContainerGUI.php.

Referenced by isMultiDownloadEnabled().

◆ $obj_data_cache

ilContainerGUI::$obj_data_cache
protected

◆ $obj_definition

ilContainerGUI::$obj_definition
protected

Definition at line 61 of file class.ilContainerGUI.php.

Referenced by copyObject().

◆ $plugin_admin

ilContainerGUI::$plugin_admin
protected

Definition at line 91 of file class.ilContainerGUI.php.

Referenced by getAsynchItemListObject().

◆ $rbacadmin

ilContainerGUI::$rbacadmin
protected

◆ $rbacreview

◆ $rbacsystem

◆ $settings

◆ $tabs

◆ $toolbar

◆ $ui

ilContainerGUI::$ui
protected

Definition at line 108 of file class.ilContainerGUI.php.

Referenced by performPasteIntoMultipleObjectsObject().

◆ $ui_filter

ilContainerGUI::$ui_filter
protected

Definition at line 123 of file class.ilContainerGUI.php.

◆ $user


The documentation for this class was generated from the following file: