ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilContainerContentGUI Class Reference

Parent class of all container content GUIs. More...

+ Inheritance diagram for ilContainerContentGUI:
+ Collaboration diagram for ilContainerContentGUI:

Public Member Functions

 __construct (&$container_gui_obj)
 Constructor. More...
 
 getContainerObject ()
 Get container object. More...
 
 getContainerGUI ()
 Get container GUI object. More...
 
 setOutput ()
 Sets view output into column layout. More...
 
 getMainContent ()
 Get content HTML for main column, this one must be overwritten in derived classes. More...
 
 determinePageEmbeddedBlocks ($a_container_page_html)
 Determine all blocks that are embedded in the container page. More...
 
 addEmbeddedBlock ($block_type, $block_parameter)
 Add embedded block. More...
 
 getEmbeddedBlocks ()
 Get page embedded blocks. More...
 
 renderPageEmbeddedBlocks ()
 Render Page Embedded Blocks. More...
 
 renderItem ($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
 Render an item. More...
 
 renderCard ($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
 Render card. More...
 
 insertPageEmbeddedBlocks ($a_output_html)
 Insert blocks into container page. More...
 
 getSingleTypeBlockAsynch ($type)
 Render single block. More...
 
 getGroupedObjTypes ()
 Get grouped repository object types. More...
 
 getIntroduction ()
 Get introduction. More...
 
 getItemGroupsHTML ($a_pos=0)
 Get item groups HTML. More...
 
 renderItemGroup ($a_itgr)
 Render item group. More...
 

Data Fields

const DETAILS_DEACTIVATED = 0
 
const DETAILS_TITLE = 1
 
const DETAILS_ALL = 2
 
const VIEW_MODE_LIST = 0
 
const VIEW_MODE_TILE = 1
 
 $container_gui
 
 $container_obj
 

Protected Member Functions

 getViewMode ()
 Get view mode. More...
 
 getDetailsLevel ($a_item_id)
 get details level More...
 
 getRightColumnHTML ()
 Get HTML for right column. More...
 
 getCenterColumnHTML ()
 Get HTML for center column. More...
 
 initRenderer ()
 Init container renderer. More...
 
 clearAdminCommandsDetermination ()
 cleaer administration commands determination More...
 
 determineAdminCommands ($a_ref_id, $a_admin_com_included_in_list=false)
 determin admin commands More...
 
 getItemGUI ($item_data, $a_show_path=false)
 Get ListGUI object for item. More...
 

Protected Attributes

 $tpl
 
 $ctrl
 
 $user
 
 $lng
 
 $access
 
 $plugin_admin
 
 $db
 
 $rbacsystem
 
 $settings
 
 $obj_definition
 
 $details_level = self::DETAILS_DEACTIVATED
 
 $renderer
 
 $log
 
 $view_mode
 

Private Member Functions

 __forwardToColumnGUI ()
 Get columngui output. More...
 

Detailed Description

Parent class of all container content GUIs.

These classes are responsible for displaying the content, i.e. the side column and main column and its subitems in container objects.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 16 of file class.ilContainerContentGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilContainerContentGUI::__construct ( $container_gui_obj)

Constructor.

Definition at line 99 of file class.ilContainerContentGUI.php.

100 {
101 global $DIC;
102
103 $this->tpl = $DIC["tpl"];
104 $this->ctrl = $DIC->ctrl();
105 $this->user = $DIC->user();
106 $this->lng = $DIC->language();
107 $this->access = $DIC->access();
108 $this->plugin_admin = $DIC["ilPluginAdmin"];
109 $this->db = $DIC->database();
110 $this->rbacsystem = $DIC->rbac()->system();
111 $this->settings = $DIC->settings();
112 $this->obj_definition = $DIC["objDefinition"];
113 $tpl = $DIC["tpl"];
114
115 $this->container_gui = $container_gui_obj;
116 $this->container_obj = $this->container_gui->object;
117
118 $tpl->addJavaScript("./Services/Container/js/Container.js");
119
120 $this->log = ilLoggerFactory::getLogger('cont');
121
122 $this->view_mode = (ilContainer::_lookupContainerSetting($this->container_obj->getId(), "list_presentation") == "tile" && !$this->container_gui->isActiveAdministrationPanel() && !$this->container_gui->isActiveOrdering())
123 ? self::VIEW_MODE_TILE
124 : self::VIEW_MODE_LIST;
125 }
user()
Definition: user.php:4
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
static getLogger($a_component_id)
Get component logger.
settings()
Definition: settings.php:2
$DIC
Definition: xapitoken.php:46

References $DIC, $tpl, ilContainer\_lookupContainerSetting(), ilLoggerFactory\getLogger(), settings(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ __forwardToColumnGUI()

ilContainerContentGUI::__forwardToColumnGUI ( )
private

Get columngui output.

Definition at line 334 of file class.ilContainerContentGUI.php.

335 {
337 $ilAccess = $this->access;
338
339 include_once("Services/Block/classes/class.ilColumnGUI.php");
340
341 // this gets us the subitems we need in setColumnSettings()
342 // todo: this should be done in ilCourseGUI->getSubItems
343
344 $obj_id = ilObject::_lookupObjId($this->getContainerObject()->getRefId());
345 $obj_type = ilObject::_lookupType($obj_id);
346
347 if (!$ilCtrl->isAsynch()) {
348 //if ($column_gui->getScreenMode() != IL_SCREEN_SIDE)
350 // right column wants center
352 $column_gui = new ilColumnGUI($obj_type, IL_COL_RIGHT);
353 $this->getContainerGUI()->setColumnSettings($column_gui);
354 $html = $ilCtrl->forwardCommand($column_gui);
355 }
356 // left column wants center
358 $column_gui = new ilColumnGUI($obj_type, IL_COL_LEFT);
359 $this->getContainerGUI()->setColumnSettings($column_gui);
360 $html = $ilCtrl->forwardCommand($column_gui);
361 }
362 } else {
363 $html = $this->getMainContent();
364 }
365 }
366
367 return $html;
368 }
const IL_SCREEN_SIDE
const IL_COL_RIGHT
const IL_COL_LEFT
Column user interface class.
static getScreenMode()
Get Screen Mode for current command.
static getCmdSide()
Get Column Side of Current Command.
getContainerObject()
Get container object.
getContainerGUI()
Get container GUI object.
getMainContent()
Get content HTML for main column, this one must be overwritten in derived classes.
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
global $ilCtrl
Definition: ilias.php:18

References $access, $ctrl, $ilCtrl, ilObject\_lookupObjId(), ilObject\_lookupType(), ilColumnGUI\getCmdSide(), getContainerGUI(), getContainerObject(), getMainContent(), ilColumnGUI\getScreenMode(), IL_COL_LEFT, IL_COL_RIGHT, and IL_SCREEN_SIDE.

Referenced by getCenterColumnHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addEmbeddedBlock()

ilContainerContentGUI::addEmbeddedBlock (   $block_type,
  $block_parameter 
)

Add embedded block.

Parameters

Definition at line 479 of file class.ilContainerContentGUI.php.

480 {
481 $this->embedded_block[$block_type][] = $block_parameter;
482 }

Referenced by determinePageEmbeddedBlocks().

+ Here is the caller graph for this function:

◆ clearAdminCommandsDetermination()

ilContainerContentGUI::clearAdminCommandsDetermination ( )
protected

cleaer administration commands determination

Definition at line 373 of file class.ilContainerContentGUI.php.

374 {
375 $this->adminCommands = false;
376 }

Referenced by ilContainerSessionsContentGUI\__showMaterials(), ilContainerSimpleContentGUI\__showMaterials(), ilContainerByTypeContentGUI\renderItemList(), ilContainerObjectiveGUI\showMaterials(), and ilContainerObjectiveGUI\showObjectives().

+ Here is the caller graph for this function:

◆ determineAdminCommands()

ilContainerContentGUI::determineAdminCommands (   $a_ref_id,
  $a_admin_com_included_in_list = false 
)
protected

determin admin commands

Definition at line 381 of file class.ilContainerContentGUI.php.

382 {
384
385 //echo "-".$a_admin_com_included_in_list."-";
386
387 if (!$this->adminCommands) {
388 if (!$this->getContainerGUI()->isActiveAdministrationPanel()) {
389 if ($rbacsystem->checkAccess("delete", $a_ref_id)) {
390 $this->adminCommands = true;
391 }
392 } else {
393 $this->adminCommands = $a_admin_com_included_in_list;
394 }
395 }
396 }

References $rbacsystem, and getContainerGUI().

Referenced by renderItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ determinePageEmbeddedBlocks()

ilContainerContentGUI::determinePageEmbeddedBlocks (   $a_container_page_html)

Determine all blocks that are embedded in the container page.

Definition at line 454 of file class.ilContainerContentGUI.php.

455 {
456 $type_grps = $this->getGroupedObjTypes();
457
458 // iterate all types
459 foreach ($type_grps as $type => $v) {
460 // set template (overall or type specific)
461 if (is_int(strpos($a_container_page_html, "[list-" . $type . "]"))) {
462 $this->addEmbeddedBlock("type", $type);
463 }
464 }
465
466 // determine item groups
467 while (preg_match('~\[(item-group-([0-9]*))\]~i', $a_container_page_html, $found)) {
468 $this->addEmbeddedBlock("itgr", (int) $found[2]);
469
470 $a_container_page_html = preg_replace('~\[' . $found[1] . '\]~i', $html, $a_container_page_html);
471 }
472 }
getGroupedObjTypes()
Get grouped repository object types.
addEmbeddedBlock($block_type, $block_parameter)
Add embedded block.
$type

References $type, addEmbeddedBlock(), and getGroupedObjTypes().

Referenced by insertPageEmbeddedBlocks().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCenterColumnHTML()

ilContainerContentGUI::getCenterColumnHTML ( )
protected

Get HTML for center column.

Definition at line 269 of file class.ilContainerContentGUI.php.

270 {
274
275 $ilCtrl->saveParameterByClass("ilcolumngui", "col_return");
276
277 $tpl->addOnLoadCode("il.Object.setRedrawListItemUrl('" .
278 $ilCtrl->getLinkTarget($this->container_gui, "redrawListItem", "", true) . "');");
279
280 $tpl->addOnLoadCode("il.Object.setRatingUrl('" .
281 $ilCtrl->getLinkTargetByClass(
282 array(get_class($this->container_gui), "ilcommonactiondispatchergui", "ilratinggui"),
283 "saveRating",
284 "",
285 true,
286 false
287 ) . "');");
288
289 switch ($ilCtrl->getNextClass()) {
290 case "ilcolumngui":
291 $this->container_gui->setSideColumnReturn();
292 $html = $this->__forwardToColumnGUI();
293 break;
294
295 default:
296 $ilDB->useSlave(true);
297 $html = $this->getMainContent();
298 $ilDB->useSlave(false);
299 break;
300 }
301
302 return $html;
303 }
__forwardToColumnGUI()
Get columngui output.
global $ilDB

References $ctrl, $db, $ilCtrl, $ilDB, $tpl, __forwardToColumnGUI(), and getMainContent().

Referenced by setOutput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getContainerGUI()

◆ getContainerObject()

◆ getDetailsLevel()

ilContainerContentGUI::getDetailsLevel (   $a_item_id)
protected

get details level

@access protected

Parameters

return

Reimplemented in ilContainerObjectiveGUI, ilContainerByTypeContentGUI, ilContainerSessionsContentGUI, and ilContainerSimpleContentGUI.

Definition at line 143 of file class.ilContainerContentGUI.php.

References $details_level.

Referenced by renderItem().

+ Here is the caller graph for this function:

◆ getEmbeddedBlocks()

ilContainerContentGUI::getEmbeddedBlocks ( )

Get page embedded blocks.

Definition at line 487 of file class.ilContainerContentGUI.php.

488 {
489 return $this->embedded_block;
490 }

◆ getGroupedObjTypes()

ilContainerContentGUI::getGroupedObjTypes ( )

Get grouped repository object types.

Returns
array array of object types

Definition at line 849 of file class.ilContainerContentGUI.php.

850 {
851 $objDefinition = $this->obj_definition;
852
853 if (empty($this->type_grps)) {
854 $this->type_grps =
855 $objDefinition->getGroupedRepositoryObjectTypes($this->getContainerObject()->getType());
856 }
857 return $this->type_grps;
858 }

References $obj_definition, and getContainerObject().

Referenced by determinePageEmbeddedBlocks(), insertPageEmbeddedBlocks(), and ilContainerByTypeContentGUI\renderItemList().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIntroduction()

ilContainerContentGUI::getIntroduction ( )

Get introduction.

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

864 {
868
869 $lng->loadLanguageModule("rep");
870
871 $tpl = new ilTemplate("tpl.rep_intro.html", true, true, "Services/Repository");
872 $tpl->setVariable("IMG_REP_LARGE", ilObject::_getIcon("", "big", "root"));
873 $tpl->setVariable("TXT_WELCOME", $lng->txt("rep_intro"));
874 $tpl->setVariable("TXT_INTRO_1", $lng->txt("rep_intro1"));
875 $tpl->setVariable("TXT_INTRO_2", $lng->txt("rep_intro2"));
876 $tpl->setVariable("TXT_INTRO_3", sprintf($lng->txt("rep_intro3"), $lng->txt("add")));
877 $tpl->setVariable("TXT_INTRO_4", sprintf($lng->txt("rep_intro4"), $lng->txt("cat_add")));
878 $tpl->setVariable("TXT_INTRO_5", $lng->txt("rep_intro5"));
879 $tpl->setVariable("TXT_INTRO_6", $lng->txt("rep_intro6"));
880
881 return $tpl->get();
882 }
special template class to simplify handling of ITX/PEAR
$ilUser
Definition: imgupload.php:18

References $ctrl, $ilCtrl, $ilUser, $lng, $tpl, and $user.

Referenced by ilContainerByTypeContentGUI\getMainContent().

+ Here is the caller graph for this function:

◆ getItemGroupsHTML()

ilContainerContentGUI::getItemGroupsHTML (   $a_pos = 0)

Get item groups HTML.

Parameters

return

Definition at line 890 of file class.ilContainerContentGUI.php.

891 {
892 if (is_array($this->items["itgr"])) {
893 foreach ($this->items["itgr"] as $itgr) {
894 if (!$this->renderer->hasCustomBlock($itgr["child"])) {
895 $this->renderItemGroup($itgr);
896
897 $this->renderer->setBlockPosition($itgr["ref_id"], ++$a_pos);
898 }
899 }
900 }
901 return $a_pos;
902 }
renderItemGroup($a_itgr)
Render item group.

References renderItemGroup().

Referenced by ilContainerSessionsContentGUI\__showMaterials(), ilContainerSimpleContentGUI\__showMaterials(), ilContainerByTypeContentGUI\renderItemList(), and ilContainerObjectiveGUI\showMaterials().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getItemGUI()

ilContainerContentGUI::getItemGUI (   $item_data,
  $a_show_path = false 
)
protected

Get ListGUI object for item.

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

402 {
403 include_once 'Services/Object/classes/class.ilObjectListGUIFactory.php';
404
405 // get item list gui object
406 if (!is_object($this->list_gui[$item_data["type"]])) {
407 $item_list_gui = &ilObjectListGUIFactory::_getListGUIByType($item_data["type"]);
408 $item_list_gui->setContainerObject($this->getContainerGUI());
409 $this->list_gui[$item_data["type"]] = &$item_list_gui;
410 } else {
411 $item_list_gui = &$this->list_gui[$item_data["type"]];
412 }
413
414 // unique js-ids
415 $item_list_gui->setParentRefId($item_data["parent"]);
416
417 $item_list_gui->setDefaultCommandParameters(array());
418 $item_list_gui->disableTitleLink(false);
419 $item_list_gui->resetConditionTarget();
420
421 if ($this->container_obj->isClassificationFilterActive()) {
422 $item_list_gui->enablePath(
423 true,
424 $this->container_obj->getRefId(),
426 );
427 }
428
429 // show administration command buttons (or not)
430 if (!$this->getContainerGUI()->isActiveAdministrationPanel()) {
431 // $item_list_gui->enableDelete(false);
432// $item_list_gui->enableLink(false);
433// $item_list_gui->enableCut(false);
434 }
435
436 // activate common social commands
437 $item_list_gui->enableComments(true);
438 $item_list_gui->enableNotes(true);
439 $item_list_gui->enableTags(true);
440 $item_list_gui->enableRating(true);
441
442 // reset
443 $item_list_gui->forceVisibleOnly(false);
444
445 // container specific modifications
446 $this->getContainerGUI()->modifyItemGUI($item_list_gui, $item_data, $a_show_path);
447
448 return $item_list_gui;
449 }
static _getListGUIByType($a_type, $a_context=ilObjectListGUI::CONTEXT_REPOSITORY)
PathGUI which handles materials assigned to sessions.

References ilObjectListGUIFactory\_getListGUIByType(), and getContainerGUI().

Referenced by renderCard(), renderItem(), renderItemGroup(), and ilContainerObjectiveGUI\renderObjective().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMainContent()

ilContainerContentGUI::getMainContent ( )
abstract

Get content HTML for main column, this one must be overwritten in derived classes.

Reimplemented in ilContainerByTypeContentGUI, ilContainerObjectiveGUI, ilContainerSessionsContentGUI, and ilContainerSimpleContentGUI.

Referenced by __forwardToColumnGUI(), and getCenterColumnHTML().

+ Here is the caller graph for this function:

◆ getRightColumnHTML()

ilContainerContentGUI::getRightColumnHTML ( )
protected

Get HTML for right column.

Definition at line 216 of file class.ilContainerContentGUI.php.

217 {
221 $ilAccess = $this->access;
222 $ilPluginAdmin = $this->plugin_admin;
223
224 $ilCtrl->saveParameterByClass("ilcolumngui", "col_return");
225
226 $obj_id = ilObject::_lookupObjId($this->getContainerObject()->getRefId());
227 $obj_type = ilObject::_lookupType($obj_id);
228
229 include_once("Services/Block/classes/class.ilColumnGUI.php");
230 $column_gui = new ilColumnGUI($obj_type, IL_COL_RIGHT);
231
232 if ($column_gui->getScreenMode() == IL_SCREEN_FULL) {
233 return "";
234 }
235
236 $this->getContainerGUI()->setColumnSettings($column_gui);
237
238 if ($ilCtrl->getNextClass() == "ilcolumngui" &&
239 $column_gui->getCmdSide() == IL_COL_RIGHT &&
240 $column_gui->getScreenMode() == IL_SCREEN_SIDE) {
241 $html = $ilCtrl->forwardCommand($column_gui);
242 } else {
243 $render_content = ($ilCtrl->getNextClass() == "" &&
244 in_array($ilCtrl->getCmd(), ["view", "render"]));
245 $render_content = false;
246 if (!$ilCtrl->isAsynch() || $render_content) {
247 $html = "";
248
249 // user interface plugin slot + default rendering
250 include_once("./Services/UIComponent/classes/class.ilUIHookProcessor.php");
251 $uip = new ilUIHookProcessor(
252 "Services/Container",
253 "right_column",
254 array("container_content_gui" => $this)
255 );
256 if (!$uip->replaced()) {
257 $html = $ilCtrl->getHTML($column_gui);
258 }
259 $html = $uip->getHTML($html);
260 }
261 }
262
263 return $html;
264 }
const IL_SCREEN_FULL
Class ilUIHookProcessor.

References $access, $ctrl, $ilCtrl, $ilUser, $lng, $plugin_admin, $user, ilObject\_lookupObjId(), ilObject\_lookupType(), getContainerGUI(), getContainerObject(), IL_COL_RIGHT, IL_SCREEN_FULL, and IL_SCREEN_SIDE.

Referenced by setOutput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSingleTypeBlockAsynch()

ilContainerContentGUI::getSingleTypeBlockAsynch (   $type)

Render single block.

Parameters
stringblock id
Returns
string

Definition at line 797 of file class.ilContainerContentGUI.php.

798 {
799 $this->initRenderer();
800 // get all sub items
801 $this->items = $this->getContainerObject()->getSubItems(
802 $this->getContainerGUI()->isActiveAdministrationPanel()
803 );
804
805
806 $ref_ids = array_map(function ($i) {
807 $parts = explode("_", $i);
808 return $parts[2];
809 }, $_POST["ids"]);
810
811 // iterate all types
812 if (is_array($this->items[$type]) &&
813 $this->renderer->addTypeBlock($type)) {
814 //$this->renderer->setBlockPosition($type, ++$pos);
815
816 $position = 1;
817 foreach ($this->items[$type] as $item_data) {
818 $item_ref_id = $item_data["child"];
819
820 if (in_array($item_ref_id, $ref_ids)) {
821 continue;
822 }
823
824 if ($this->block_limit > 0 && $position == $this->block_limit + 1) {
825 if ($position == $this->block_limit + 1) {
826 // render more button
827 $this->renderer->addShowMoreButton($type);
828 }
829 continue;
830 }
831
832 if (!$this->renderer->hasItem($item_ref_id)) {
833 $html = $this->renderItem($item_data, $position++);
834 if ($html != "") {
835 $this->renderer->addItemToBlock($type, $item_data["type"], $item_ref_id, $html);
836 }
837 }
838 }
839 }
840
841 return $this->renderer->renderSingleTypeBlock($type);
842 }
$_POST["username"]
initRenderer()
Init container renderer.
renderItem($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
Render an item.
$i
Definition: metadata.php:24

References $_POST, $i, $type, getContainerGUI(), getContainerObject(), initRenderer(), and renderItem().

+ Here is the call graph for this function:

◆ getViewMode()

ilContainerContentGUI::getViewMode ( )
protected

Get view mode.

Definition at line 130 of file class.ilContainerContentGUI.php.

References $view_mode.

Referenced by renderItem().

+ Here is the caller graph for this function:

◆ initRenderer()

ilContainerContentGUI::initRenderer ( )
protected

Init container renderer.

Definition at line 314 of file class.ilContainerContentGUI.php.

315 {
316 include_once('./Services/Container/classes/class.ilContainerSorting.php');
317 $sorting = ilContainerSorting::_getInstance($this->getContainerObject()->getId());
318
319 include_once "Services/Container/classes/class.ilContainerRenderer.php";
320 $this->renderer = new ilContainerRenderer(
321 ($this->getContainerGUI()->isActiveAdministrationPanel() && !$_SESSION["clipboard"]),
322 $this->getContainerGUI()->isMultiDownloadEnabled(),
323 $this->getContainerGUI()->isActiveOrdering() && (get_class($this) != "ilContainerObjectiveGUI") // no block sorting in objective view
324 ,
325 $sorting->getBlockPositions(),
326 $this->container_gui,
327 $this->getViewMode()
328 );
329 }
$_SESSION["AccountId"]
Class ilContainerRenderer.
static _getInstance($a_obj_id)
get instance by obj_id

References $_SESSION, ilContainerSorting\_getInstance(), getContainerGUI(), and getContainerObject().

Referenced by ilContainerSessionsContentGUI\__showMaterials(), ilContainerSimpleContentGUI\__showMaterials(), ilContainerObjectiveGUI\getMainContent(), getSingleTypeBlockAsynch(), and ilContainerByTypeContentGUI\renderItemList().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertPageEmbeddedBlocks()

ilContainerContentGUI::insertPageEmbeddedBlocks (   $a_output_html)

Insert blocks into container page.

Definition at line 760 of file class.ilContainerContentGUI.php.

761 {
762 $this->determinePageEmbeddedBlocks($a_output_html);
763 $this->renderPageEmbeddedBlocks($this->items);
764
765 // iterate all types
766 foreach ($this->getGroupedObjTypes() as $type => $v) {
767 // set template (overall or type specific)
768 if (is_int(strpos($a_output_html, "[list-" . $type . "]"))) {
769 $a_output_html = preg_replace(
770 '~\[list-' . $type . '\]~i',
771 $this->renderer->renderSingleTypeBlock($type),
772 $a_output_html
773 );
774 }
775 }
776
777 // insert all item groups
778 while (preg_match('~\[(item-group-([0-9]*))\]~i', $a_output_html, $found)) {
779 $itgr_ref_id = (int) $found[2];
780
781 $a_output_html = preg_replace(
782 '~\[' . $found[1] . '\]~i',
783 $this->renderer->renderSingleCustomBlock($itgr_ref_id),
784 $a_output_html
785 );
786 }
787
788 return $a_output_html;
789 }
renderPageEmbeddedBlocks()
Render Page Embedded Blocks.
determinePageEmbeddedBlocks($a_container_page_html)
Determine all blocks that are embedded in the container page.

References $type, determinePageEmbeddedBlocks(), getGroupedObjTypes(), and renderPageEmbeddedBlocks().

Referenced by ilContainerSessionsContentGUI\__showMaterials(), ilContainerSimpleContentGUI\__showMaterials(), ilContainerByTypeContentGUI\renderItemList(), and ilContainerObjectiveGUI\showObjectives().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderCard()

ilContainerContentGUI::renderCard (   $a_item_data,
  $a_position = 0,
  $a_force_icon = false,
  $a_pos_prefix = "" 
)

Render card.

Parameters
$a_item_data
int$a_position
bool$a_force_icon
string$a_pos_prefix
Returns
string

Definition at line 725 of file class.ilContainerContentGUI.php.

726 {
727 global $DIC;
728 $f = $DIC->ui()->factory();
729 $user = $DIC->user();
730
731 $item_list_gui = $this->getItemGUI($a_item_data);
732 $item_list_gui->setAjaxHash(ilCommonActionDispatcherGUI::buildAjaxHash(
734 $a_item_data['ref_id'],
735 $a_item_data['type'],
736 $a_item_data['obj_id']
737 ));
738 $item_list_gui->initItem(
739 $a_item_data['ref_id'],
740 $a_item_data['obj_id'],
741 $a_item_data['type'],
742 $a_item_data['title'],
743 $a_item_data['description']
744 );
745
746 // actions
747 $item_list_gui->insertCommands();
748 return $item_list_gui->getAsCard(
749 $a_item_data['ref_id'],
750 (int) $a_item_data['obj_id'],
751 (string) $a_item_data['type'],
752 (string) $a_item_data['title'],
753 (string) $a_item_data['description']
754 );
755 }
static buildAjaxHash( $a_node_type, $a_node_id, $a_obj_type, $a_obj_id, $a_sub_type=null, $a_sub_id=null, $a_news_id=0)
Build ajax hash.
getItemGUI($item_data, $a_show_path=false)
Get ListGUI object for item.

References $DIC, Vendor\Package\$f, $user, ilCommonActionDispatcherGUI\buildAjaxHash(), getItemGUI(), and ilCommonActionDispatcherGUI\TYPE_REPOSITORY.

Referenced by renderItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderItem()

ilContainerContentGUI::renderItem (   $a_item_data,
  $a_position = 0,
  $a_force_icon = false,
  $a_pos_prefix = "" 
)

Render an item.

Parameters
$a_item_data
int$a_position
bool$a_force_icon
string$a_pos_prefix
Returns
string

Definition at line 548 of file class.ilContainerContentGUI.php.

549 {
551 $ilAccess = $this->access;
553
554 // Pass type, obj_id and tree to checkAccess method to improve performance
555 if (!$ilAccess->checkAccess('visible', '', $a_item_data['ref_id'], $a_item_data['type'], $a_item_data['obj_id'], $a_item_data['tree'])) {
556 return '';
557 }
558
559 if ($this->getViewMode() == self::VIEW_MODE_TILE) {
560 return $this->renderCard($a_item_data, $a_position, $a_force_icon, $a_pos_prefix);
561 }
562
563 $item_list_gui = $this->getItemGUI($a_item_data);
564 if ($ilSetting->get("icon_position_in_lists") == "item_rows" ||
565 $a_item_data["type"] == "sess" || $a_force_icon) {
566 $item_list_gui->enableIcon(true);
567 }
568
569 if ($this->getContainerGUI()->isActiveAdministrationPanel() && !$_SESSION["clipboard"]) {
570 $item_list_gui->enableCheckbox(true);
571 } elseif ($this->getContainerGUI()->isMultiDownloadEnabled()) {
572 // display multi download checkboxes
573 $item_list_gui->enableDownloadCheckbox($a_item_data["ref_id"], true);
574 }
575
576 if ($this->getContainerGUI()->isActiveItemOrdering() && ($a_item_data['type'] != 'sess' || get_class($this) != 'ilContainerSessionsContentGUI')) {
577 $item_list_gui->setPositionInputField(
578 $a_pos_prefix . "[" . $a_item_data["ref_id"] . "]",
579 sprintf('%d', (int) $a_position * 10)
580 );
581 }
582
583 if ($a_item_data['type'] == 'sess' and get_class($this) != 'ilContainerObjectiveGUI') {
584 switch ($this->getDetailsLevel($a_item_data['obj_id'])) {
586 $item_list_gui->setDetailsLevel(ilObjectListGUI::DETAILS_MINIMAL);
587 $item_list_gui->enableExpand(true);
588 $item_list_gui->setExpanded(false);
589 $item_list_gui->enableDescription(false);
590 $item_list_gui->enableProperties(true);
591 break;
592
594 $item_list_gui->setDetailsLevel(ilObjectListGUI::DETAILS_ALL);
595 $item_list_gui->enableExpand(true);
596 $item_list_gui->setExpanded(true);
597 $item_list_gui->enableDescription(true);
598 $item_list_gui->enableProperties(true);
599 break;
600
601 default:
602 $item_list_gui->setDetailsLevel(ilObjectListGUI::DETAILS_ALL);
603 $item_list_gui->enableExpand(true);
604 $item_list_gui->enableDescription(true);
605 $item_list_gui->enableProperties(true);
606 break;
607 }
608 }
609
610 if (method_exists($this, "addItemDetails")) {
611 $this->addItemDetails($item_list_gui, $a_item_data);
612 }
613
614 // show subitems
615 if ($a_item_data['type'] == 'sess' and (
616 $this->getDetailsLevel($a_item_data['obj_id']) != self::DETAILS_TITLE or
617 $this->getContainerGUI()->isActiveAdministrationPanel() or
618 $this->getContainerGUI()->isActiveItemOrdering()
619 )
620 ) {
621 $pos = 1;
622
623 include_once('./Services/Container/classes/class.ilContainerSorting.php');
624 include_once('./Services/Object/classes/class.ilObjectActivation.php');
625 $items = ilObjectActivation::getItemsByEvent($a_item_data['obj_id']);
626 $items = ilContainerSorting::_getInstance($this->getContainerObject()->getId())->sortSubItems('sess', $a_item_data['obj_id'], $items);
628
629 $item_readable = $ilAccess->checkAccess('read', '', $a_item_data['ref_id']);
630
631 foreach ($items as $item) {
632 // TODO: this should be removed and be handled by if(strlen($sub_item_html))
633 // see mantis: 0003944
634 if (!$ilAccess->checkAccess('visible', '', $item['ref_id'])) {
635 continue;
636 }
637
638 $item_list_gui2 = $this->getItemGUI($item);
639 $item_list_gui2->enableIcon(true);
640 $item_list_gui2->enableItemDetailLinks(false);
641
642 // unique js-ids
643 $item_list_gui2->setParentRefId($a_item_data['ref_id']);
644
645 // @see mantis 10488
646 if (!$item_readable and !$ilAccess->checkAccess('write', '', $item['ref_id'])) {
647 $item_list_gui2->forceVisibleOnly(true);
648 }
649
650 if ($this->getContainerGUI()->isActiveAdministrationPanel() && !$_SESSION["clipboard"]) {
651 $item_list_gui2->enableCheckbox(true);
652 } elseif ($this->getContainerGUI()->isMultiDownloadEnabled()) {
653 // display multi download checkbox
654 $item_list_gui2->enableDownloadCheckbox($item['ref_id'], true);
655 }
656
657 if ($this->getContainerGUI()->isActiveItemOrdering()) {
658 $item_list_gui2->setPositionInputField(
659 "[sess][" . $a_item_data['obj_id'] . "][" . $item["ref_id"] . "]",
660 sprintf('%d', (int) $pos * 10)
661 );
662 $pos++;
663 }
664
665 // #10611
667
668 $sub_item_html = $item_list_gui2->getListItemHTML(
669 $item['ref_id'],
670 $item['obj_id'],
671 $item['title'],
672 $item['description']
673 );
674
675 $this->determineAdminCommands($item["ref_id"], $item_list_gui2->adminCommandsIncluded());
676 if (strlen($sub_item_html)) {
677 $item_list_gui->addSubItemHTML($sub_item_html);
678 }
679 }
680 }
681
682
683 if ($ilSetting->get("item_cmd_asynch")) {
684 $asynch = true;
685 $ilCtrl->setParameter($this->container_gui, "cmdrefid", $a_item_data['ref_id']);
686 $asynch_url = $ilCtrl->getLinkTarget(
687 $this->container_gui,
688 "getAsynchItemList",
689 "",
690 true,
691 false
692 );
693 $ilCtrl->setParameter($this->container_gui, "cmdrefid", "");
694 }
695
696 include_once "Services/Object/classes/class.ilObjectActivation.php";
697 ilObjectActivation::addListGUIActivationProperty($item_list_gui, $a_item_data);
698
699 $html = $item_list_gui->getListItemHTML(
700 $a_item_data['ref_id'],
701 $a_item_data['obj_id'],
702 $a_item_data['title'],
703 $a_item_data['description'],
704 $asynch,
705 false,
706 $asynch_url
707 );
709 $a_item_data["ref_id"],
710 $item_list_gui->adminCommandsIncluded()
711 );
712
713
714 return $html;
715 }
getDetailsLevel($a_item_id)
get details level
renderCard($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
Render card.
determineAdminCommands($a_ref_id, $a_admin_com_included_in_list=false)
determin admin commands
static getCompleteDescriptions(array $objects)
overwrites description fields to long or short description in an assoc array keys needed (obj_id and ...
static addListGUIActivationProperty(ilObjectListGUI $a_list_gui, array &$a_item)
Get timing details for list gui.
static getItemsByEvent($a_event_id)
Get session material / event items.
global $ilSetting
Definition: privfeed.php:17

References $_SESSION, $access, $ctrl, $ilCtrl, $ilSetting, $settings, ilContainerSorting\_getInstance(), ilObjectActivation\addListGUIActivationProperty(), DETAILS_ALL, ilObjectListGUI\DETAILS_ALL, ilObjectListGUI\DETAILS_MINIMAL, DETAILS_TITLE, determineAdminCommands(), ilContainer\getCompleteDescriptions(), getContainerGUI(), getContainerObject(), getDetailsLevel(), getItemGUI(), ilObjectActivation\getItemsByEvent(), getViewMode(), and renderCard().

Referenced by ilContainerSessionsContentGUI\__showMaterials(), ilContainerSimpleContentGUI\__showMaterials(), getSingleTypeBlockAsynch(), renderItemGroup(), ilContainerByTypeContentGUI\renderItemList(), renderPageEmbeddedBlocks(), ilContainerObjectiveGUI\renderTest(), and ilContainerObjectiveGUI\showMaterials().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderItemGroup()

ilContainerContentGUI::renderItemGroup (   $a_itgr)

Render item group.

Parameters

return

Definition at line 910 of file class.ilContainerContentGUI.php.

911 {
912 $ilAccess = $this->access;
914
915 // #16493
916 $perm_ok = ($ilAccess->checkAccess("visible", "", $a_itgr['ref_id']) &&
917 $ilAccess->checkAccess("read", "", $a_itgr['ref_id']));
918
919 include_once('./Services/Container/classes/class.ilContainerSorting.php');
920 include_once('./Services/Object/classes/class.ilObjectActivation.php');
921 $items = ilObjectActivation::getItemsByItemGroup($a_itgr['ref_id']);
922
923 // get all valid ids (this is filtered)
924 $all_ids = array_map(function($i) {
925 return $i["child"];
926 }, $this->items["_all"]);
927
928 // remove filtered items
929 $items = array_filter($items, function ($i) use ($all_ids) {
930 return in_array($i["ref_id"], $all_ids);
931 });
932
933 // if no permission is given, set the items to "rendered" but
934 // do not display the whole block
935 if (!$perm_ok) {
936 foreach ($items as $item) {
937 $this->renderer->hideItem($item["child"]);
938 }
939 return;
940 }
941
942 $item_list_gui = $this->getItemGUI($a_itgr);
943 $item_list_gui->enableNotes(false);
944 $item_list_gui->enableTags(false);
945 $item_list_gui->enableComments(false);
946 $item_list_gui->enableTimings(false);
947 $item_list_gui->getListItemHTML(
948 $a_itgr["ref_id"],
949 $a_itgr["obj_id"],
950 $a_itgr["title"],
951 $a_itgr["description"]
952 );
953 $commands_html = $item_list_gui->getCommandsHTML();
954
955 // determine behaviour
956 include_once("./Modules/ItemGroup/classes/class.ilObjItemGroup.php");
957 include_once("./Modules/ItemGroup/classes/class.ilItemGroupBehaviour.php");
958 $beh = ilObjItemGroup::lookupBehaviour($a_itgr["obj_id"]);
959 include_once("./Services/Container/classes/class.ilContainerBlockPropertiesStorage.php");
960 $stored_val = ilContainerBlockPropertiesStorage::getProperty("itgr_" . $a_itgr["ref_id"], $ilUser->getId(), "opened");
961 if ($stored_val !== false && $beh != ilItemGroupBehaviour::ALWAYS_OPEN) {
962 $beh = ($stored_val == "1")
965 }
966
967 $data = array(
968 "behaviour" => $beh,
969 "store-url" => "./ilias.php?baseClass=ilcontainerblockpropertiesstorage&cmd=store" .
970 "&cont_block_id=itgr_" . $a_itgr['ref_id']
971 );
972 if (ilObjItemGroup::lookupHideTitle($a_itgr["obj_id"]) &&
973 !$this->getContainerGUI()->isActiveAdministrationPanel()) {
974 $this->renderer->addCustomBlock($a_itgr["ref_id"], "", $commands_html, $data);
975 } else {
976 $this->renderer->addCustomBlock($a_itgr["ref_id"], $a_itgr["title"], $commands_html, $data);
977 }
978
979
980 // render item group sub items
981
983 $this->getContainerObject()->getId()
984 )->sortSubItems('itgr', $a_itgr['obj_id'], $items);
985
986 // #18285
988
989 $position = 1;
990 foreach ($items as $item) {
991 // we are NOT using hasItem() here, because item might be in multiple item groups
992 $html2 = $this->renderItem($item, $position++, false, "[itgr][" . $a_itgr['obj_id'] . "]");
993 if ($html2 != "") {
994 // :TODO: show it multiple times?
995 $this->renderer->addItemToBlock($a_itgr["ref_id"], $item["type"], $item["child"], $html2, true);
996 }
997 }
998 }
static getProperty($a_block_id, $a_user_id, $a_property)
Get property in session or db.
static lookupBehaviour($a_id)
Lookup behaviour.
static lookupHideTitle($a_id)
Lookup hide title.
static getItemsByItemGroup($a_item_group_ref_id)
Get materials of item group.
$data
Definition: storeScorm.php:23

References $access, $data, $i, $ilUser, $user, ilContainerSorting\_getInstance(), ilItemGroupBehaviour\ALWAYS_OPEN, ilItemGroupBehaviour\EXPANDABLE_CLOSED, ilItemGroupBehaviour\EXPANDABLE_OPEN, ilContainer\getCompleteDescriptions(), getContainerGUI(), getContainerObject(), getItemGUI(), ilObjectActivation\getItemsByItemGroup(), ilContainerBlockPropertiesStorage\getProperty(), ilObjItemGroup\lookupBehaviour(), ilObjItemGroup\lookupHideTitle(), and renderItem().

Referenced by getItemGroupsHTML(), and renderPageEmbeddedBlocks().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderPageEmbeddedBlocks()

ilContainerContentGUI::renderPageEmbeddedBlocks ( )

Render Page Embedded Blocks.

Definition at line 495 of file class.ilContainerContentGUI.php.

496 {
498
499 // item groups
500 if (is_array($this->embedded_block["itgr"])) {
501 $item_groups = array();
502 if (is_array($this->items["itgr"])) {
503 foreach ($this->items["itgr"] as $ig) {
504 $item_groups[$ig["ref_id"]] = $ig;
505 }
506 }
507
508 foreach ($this->embedded_block["itgr"] as $ref_id) {
509 if (isset($item_groups[$ref_id])) {
510 $this->renderItemGroup($item_groups[$ref_id]);
511 }
512 }
513 }
514
515 // type specific blocks
516 if (is_array($this->embedded_block["type"])) {
517 foreach ($this->embedded_block["type"] as $k => $type) {
518 if (is_array($this->items[$type]) &&
519 $this->renderer->addTypeBlock($type)) {
520 // :TODO: obsolete?
521 if ($type == 'sess') {
522 $this->items['sess'] = ilUtil::sortArray($this->items['sess'], 'start', 'ASC', true, true);
523 }
524
525 $position = 1;
526
527 foreach ($this->items[$type] as $k => $item_data) {
528 if (!$this->renderer->hasItem($item_data["child"])) {
529 $html = $this->renderItem($item_data, $position++);
530 if ($html != "") {
531 $this->renderer->addItemToBlock($type, $item_data["type"], $item_data["child"], $html);
532 }
533 }
534 }
535 }
536 }
537 }
538 }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray

References $lng, $type, renderItem(), renderItemGroup(), and ilUtil\sortArray().

Referenced by insertPageEmbeddedBlocks().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setOutput()

ilContainerContentGUI::setOutput ( )

Sets view output into column layout.

This method sets the output of the right and main column in the global standard template.

Definition at line 174 of file class.ilContainerContentGUI.php.

175 {
178
179 // note: we do not want to get the center html in case of
180 // asynchronous calls to blocks in the right column (e.g. news)
181 // see #13012
182 if ($ilCtrl->getNextClass() == "ilcolumngui" &&
183 $ilCtrl->isAsynch()) {
184 $tpl->setRightContent($this->getRightColumnHTML());
185 }
186
187 // BEGIN ChangeEvent: record read event.
188 require_once('Services/Tracking/classes/class.ilChangeEvent.php');
190
191 $obj_id = ilObject::_lookupObjId($this->getContainerObject()->getRefId());
193 $this->getContainerObject()->getType(),
194 $this->getContainerObject()->getRefId(),
195 $obj_id,
196 $ilUser->getId()
197 );
198 // END ChangeEvent: record read event.
199
200 $html = $this->getCenterColumnHTML();
201 if (strlen($html)) {
202 $tpl->setContent($html);
203 }
204
205 // see above, all other cases (this was the old position of setRightContent,
206 // maybe the position above is ok and all ifs can be removed)
207 if ($ilCtrl->getNextClass() != "ilcolumngui" ||
208 !$ilCtrl->isAsynch()) {
209 $tpl->setRightContent($this->getRightColumnHTML());
210 }
211 }
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.
getCenterColumnHTML()
Get HTML for center column.
getRightColumnHTML()
Get HTML for right column.

References $ctrl, $ilCtrl, $ilUser, $tpl, $user, ilObject\_lookupObjId(), ilChangeEvent\_recordReadEvent(), getCenterColumnHTML(), getContainerObject(), and getRightColumnHTML().

+ Here is the call graph for this function:

Field Documentation

◆ $access

◆ $container_gui

ilContainerContentGUI::$container_gui

Definition at line 82 of file class.ilContainerContentGUI.php.

Referenced by getContainerGUI().

◆ $container_obj

ilContainerContentGUI::$container_obj

Definition at line 83 of file class.ilContainerContentGUI.php.

Referenced by getContainerObject().

◆ $ctrl

◆ $db

ilContainerContentGUI::$db
protected

Definition at line 51 of file class.ilContainerContentGUI.php.

Referenced by getCenterColumnHTML().

◆ $details_level

ilContainerContentGUI::$details_level = self::DETAILS_DEACTIVATED
protected

Definition at line 75 of file class.ilContainerContentGUI.php.

Referenced by getDetailsLevel().

◆ $lng

◆ $log

ilContainerContentGUI::$log
protected

Definition at line 88 of file class.ilContainerContentGUI.php.

◆ $obj_definition

ilContainerContentGUI::$obj_definition
protected

Definition at line 66 of file class.ilContainerContentGUI.php.

Referenced by getGroupedObjTypes().

◆ $plugin_admin

ilContainerContentGUI::$plugin_admin
protected

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

Referenced by getRightColumnHTML().

◆ $rbacsystem

ilContainerContentGUI::$rbacsystem
protected

Definition at line 56 of file class.ilContainerContentGUI.php.

Referenced by determineAdminCommands().

◆ $renderer

ilContainerContentGUI::$renderer
protected

◆ $settings

ilContainerContentGUI::$settings
protected

◆ $tpl

◆ $user

◆ $view_mode

ilContainerContentGUI::$view_mode
protected

Definition at line 93 of file class.ilContainerContentGUI.php.

Referenced by getViewMode().

◆ DETAILS_ALL

◆ DETAILS_DEACTIVATED

◆ DETAILS_TITLE

◆ VIEW_MODE_LIST

const ilContainerContentGUI::VIEW_MODE_LIST = 0

◆ VIEW_MODE_TILE

const ilContainerContentGUI::VIEW_MODE_TILE = 1

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