ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 
 insertPageEmbeddedBlocks ($a_output_html)
 Insert blocks into container page. 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
 
 $container_gui
 
 $container_obj
 

Protected Member Functions

 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
 

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 91 of file class.ilContainerContentGUI.php.

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

92  {
93  global $DIC;
94 
95  $this->tpl = $DIC["tpl"];
96  $this->ctrl = $DIC->ctrl();
97  $this->user = $DIC->user();
98  $this->lng = $DIC->language();
99  $this->access = $DIC->access();
100  $this->plugin_admin = $DIC["ilPluginAdmin"];
101  $this->db = $DIC->database();
102  $this->rbacsystem = $DIC->rbac()->system();
103  $this->settings = $DIC->settings();
104  $this->obj_definition = $DIC["objDefinition"];
105  $tpl = $DIC["tpl"];
106 
107  $this->container_gui = $container_gui_obj;
108  $this->container_obj = $this->container_gui->object;
109 
110  $tpl->addJavaScript("./Services/Container/js/Container.js");
111 
112  $this->log = ilLoggerFactory::getLogger('cont');
113  }
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
settings()
Definition: settings.php:2
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

Member Function Documentation

◆ __forwardToColumnGUI()

ilContainerContentGUI::__forwardToColumnGUI ( )
finalprivate

Get columngui output.

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

References $access, $ctrl, $html, $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().

309  {
311  $ilAccess = $this->access;
312 
313  include_once("Services/Block/classes/class.ilColumnGUI.php");
314 
315  // this gets us the subitems we need in setColumnSettings()
316  // todo: this should be done in ilCourseGUI->getSubItems
317 
318  $obj_id = ilObject::_lookupObjId($this->getContainerObject()->getRefId());
319  $obj_type = ilObject::_lookupType($obj_id);
320 
321  if (!$ilCtrl->isAsynch()) {
322  //if ($column_gui->getScreenMode() != IL_SCREEN_SIDE)
324  // right column wants center
326  $column_gui = new ilColumnGUI($obj_type, IL_COL_RIGHT);
327  $this->getContainerGUI()->setColumnSettings($column_gui);
328  $html = $ilCtrl->forwardCommand($column_gui);
329  }
330  // left column wants center
332  $column_gui = new ilColumnGUI($obj_type, IL_COL_LEFT);
333  $this->getContainerGUI()->setColumnSettings($column_gui);
334  $html = $ilCtrl->forwardCommand($column_gui);
335  }
336  } else {
337  $html = $this->getMainContent();
338  }
339  }
340 
341  return $html;
342  }
static getCmdSide()
Get Column Side of Current Command.
const IL_COL_RIGHT
global $ilCtrl
Definition: ilias.php:18
getMainContent()
Get content HTML for main column, this one must be overwritten in derived classes.
getContainerGUI()
Get container GUI object.
Column user interface class.
static _lookupObjId($a_id)
getContainerObject()
Get container object.
static _lookupType($a_id, $a_reference=false)
lookup object type
static getScreenMode()
Get Screen Mode for current command.
const IL_SCREEN_SIDE
$html
Definition: example_001.php:87
const IL_COL_LEFT
+ 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 445 of file class.ilContainerContentGUI.php.

Referenced by determinePageEmbeddedBlocks().

446  {
447  $this->embedded_block[$block_type][] = $block_parameter;
448  }
+ Here is the caller graph for this function:

◆ clearAdminCommandsDetermination()

ilContainerContentGUI::clearAdminCommandsDetermination ( )
protected

cleaer administration commands determination

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

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

348  {
349  $this->adminCommands = false;
350  }
+ 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 355 of file class.ilContainerContentGUI.php.

References $rbacsystem, and getContainerGUI().

Referenced by renderItem().

356  {
358 
359  //echo "-".$a_admin_com_included_in_list."-";
360 
361  if (!$this->adminCommands) {
362  if (!$this->getContainerGUI()->isActiveAdministrationPanel()) {
363  if ($rbacsystem->checkAccess("delete", $a_ref_id)) {
364  $this->adminCommands = true;
365  }
366  } else {
367  $this->adminCommands = $a_admin_com_included_in_list;
368  }
369  }
370  }
getContainerGUI()
Get container GUI object.
+ 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 420 of file class.ilContainerContentGUI.php.

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

Referenced by insertPageEmbeddedBlocks().

421  {
422  $type_grps = $this->getGroupedObjTypes();
423 
424  // iterate all types
425  foreach ($type_grps as $type => $v) {
426  // set template (overall or type specific)
427  if (is_int(strpos($a_container_page_html, "[list-" . $type . "]"))) {
428  $this->addEmbeddedBlock("type", $type);
429  }
430  }
431 
432  // determine item groups
433  while (preg_match('~\[(item-group-([0-9]*))\]~i', $a_container_page_html, $found)) {
434  $this->addEmbeddedBlock("itgr", (int) $found[2]);
435 
436  $a_container_page_html = preg_replace('~\[' . $found[1] . '\]~i', $html, $a_container_page_html);
437  }
438  }
$type
addEmbeddedBlock($block_type, $block_parameter)
Add embedded block.
$html
Definition: example_001.php:87
getGroupedObjTypes()
Get grouped repository object types.
+ 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 245 of file class.ilContainerContentGUI.php.

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

Referenced by setOutput().

246  {
248  $tpl = $this->tpl;
249  $ilDB = $this->db;
250 
251  $ilCtrl->saveParameterByClass("ilcolumngui", "col_return");
252 
253  $tpl->addOnLoadCode("il.Object.setRedrawListItemUrl('" .
254  $ilCtrl->getLinkTarget($this->container_gui, "redrawListItem", "", true) . "');");
255 
256  $tpl->addOnLoadCode("il.Object.setRatingUrl('" .
257  $ilCtrl->getLinkTargetByClass(
258  array(get_class($this->container_gui), "ilcommonactiondispatchergui", "ilratinggui"),
259  "saveRating",
260  "",
261  true,
262  false
263  ) . "');");
264 
265  switch ($ilCtrl->getNextClass()) {
266  case "ilcolumngui":
267  $this->container_gui->setSideColumnReturn();
268  $html = $this->__forwardToColumnGUI();
269  break;
270 
271  default:
272  $ilDB->useSlave(true);
273  $html = $this->getMainContent();
274  $ilDB->useSlave(false);
275  break;
276  }
277 
278  return $html;
279  }
__forwardToColumnGUI()
Get columngui output.
global $ilCtrl
Definition: ilias.php:18
getMainContent()
Get content HTML for main column, this one must be overwritten in derived classes.
Create styles array
The data for the language used.
global $ilDB
$html
Definition: example_001.php:87
+ 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

protected

Parameters

Definition at line 122 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 453 of file class.ilContainerContentGUI.php.

454  {
455  return $this->embedded_block;
456  }

◆ getGroupedObjTypes()

ilContainerContentGUI::getGroupedObjTypes ( )

Get grouped repository object types.

Returns
array array of object types

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

References $obj_definition, and getContainerObject().

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

724  {
725  $objDefinition = $this->obj_definition;
726 
727  if (empty($this->type_grps)) {
728  $this->type_grps =
729  $objDefinition->getGroupedRepositoryObjectTypes($this->getContainerObject()->getType());
730  }
731  return $this->type_grps;
732  }
getContainerObject()
Get container object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIntroduction()

ilContainerContentGUI::getIntroduction ( )

Get introduction.

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

References $ctrl, $ilCtrl, $ilUser, $lng, $tpl, $user, and ilObject\_getIcon().

Referenced by ilContainerByTypeContentGUI\getMainContent().

738  {
740  $lng = $this->lng;
742 
743  $lng->loadLanguageModule("rep");
744 
745  $tpl = new ilTemplate("tpl.rep_intro.html", true, true, "Services/Repository");
746  $tpl->setVariable("IMG_REP_LARGE", ilObject::_getIcon("", "big", "root"));
747  $tpl->setVariable("TXT_WELCOME", $lng->txt("rep_intro"));
748  $tpl->setVariable("TXT_INTRO_1", $lng->txt("rep_intro1"));
749  $tpl->setVariable("TXT_INTRO_2", $lng->txt("rep_intro2"));
750  $tpl->setVariable("TXT_INTRO_3", sprintf($lng->txt("rep_intro3"), $lng->txt("add")));
751  $tpl->setVariable("TXT_INTRO_4", sprintf($lng->txt("rep_intro4"), $lng->txt("cat_add")));
752  $tpl->setVariable("TXT_INTRO_5", $lng->txt("rep_intro5"));
753  $tpl->setVariable("TXT_INTRO_6", $lng->txt("rep_intro6"));
754 
755  return $tpl->get();
756  }
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
global $ilCtrl
Definition: ilias.php:18
special template class to simplify handling of ITX/PEAR
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getItemGroupsHTML()

ilContainerContentGUI::getItemGroupsHTML (   $a_pos = 0)

Get item groups HTML.

Parameters

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

References renderItemGroup().

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

765  {
766  if (is_array($this->items["itgr"])) {
767  foreach ($this->items["itgr"] as $itgr) {
768  if (!$this->renderer->hasCustomBlock($itgr["child"])) {
769  $this->renderItemGroup($itgr);
770 
771  $this->renderer->setBlockPosition($itgr["ref_id"], ++$a_pos);
772  }
773  }
774  }
775  return $a_pos;
776  }
renderItemGroup($a_itgr)
Render item group.
+ 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 375 of file class.ilContainerContentGUI.php.

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

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

376  {
377  include_once 'Services/Object/classes/class.ilObjectListGUIFactory.php';
378 
379  // get item list gui object
380  if (!is_object($this->list_gui[$item_data["type"]])) {
381  $item_list_gui =&ilObjectListGUIFactory::_getListGUIByType($item_data["type"]);
382  $item_list_gui->setContainerObject($this->getContainerGUI());
383  $this->list_gui[$item_data["type"]] =&$item_list_gui;
384  } else {
385  $item_list_gui =&$this->list_gui[$item_data["type"]];
386  }
387 
388  // unique js-ids
389  $item_list_gui->setParentRefId($item_data["parent"]);
390 
391  $item_list_gui->setDefaultCommandParameters(array());
392  $item_list_gui->disableTitleLink(false);
393  $item_list_gui->resetConditionTarget();
394 
395  // show administration command buttons (or not)
396  if (!$this->getContainerGUI()->isActiveAdministrationPanel()) {
397  // $item_list_gui->enableDelete(false);
398 // $item_list_gui->enableLink(false);
399 // $item_list_gui->enableCut(false);
400  }
401 
402  // activate common social commands
403  $item_list_gui->enableComments(true);
404  $item_list_gui->enableNotes(true);
405  $item_list_gui->enableTags(true);
406  $item_list_gui->enableRating(true);
407 
408  // reset
409  $item_list_gui->forceVisibleOnly(false);
410 
411  // container specific modifications
412  $this->getContainerGUI()->modifyItemGUI($item_list_gui, $item_data, $a_show_path);
413 
414  return $item_list_gui;
415  }
getContainerGUI()
Get container GUI object.
Create styles array
The data for the language used.
static _getListGUIByType($a_type, $a_context=ilObjectListGUI::CONTEXT_REPOSITORY)
+ 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.

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 195 of file class.ilContainerContentGUI.php.

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

Referenced by setOutput().

196  {
198  $lng = $this->lng;
200  $ilAccess = $this->access;
201  $ilPluginAdmin = $this->plugin_admin;
202 
203  $ilCtrl->saveParameterByClass("ilcolumngui", "col_return");
204 
205  $obj_id = ilObject::_lookupObjId($this->getContainerObject()->getRefId());
206  $obj_type = ilObject::_lookupType($obj_id);
207 
208  include_once("Services/Block/classes/class.ilColumnGUI.php");
209  $column_gui = new ilColumnGUI($obj_type, IL_COL_RIGHT);
210 
211  if ($column_gui->getScreenMode() == IL_SCREEN_FULL) {
212  return "";
213  }
214 
215  $this->getContainerGUI()->setColumnSettings($column_gui);
216 
217  if ($ilCtrl->getNextClass() == "ilcolumngui" &&
218  $column_gui->getCmdSide() == IL_COL_RIGHT &&
219  $column_gui->getScreenMode() == IL_SCREEN_SIDE) {
220  $html = $ilCtrl->forwardCommand($column_gui);
221  } else {
222  if (!$ilCtrl->isAsynch()) {
223  $html = "";
224 
225  // user interface plugin slot + default rendering
226  include_once("./Services/UIComponent/classes/class.ilUIHookProcessor.php");
227  $uip = new ilUIHookProcessor(
228  "Services/Container",
229  "right_column",
230  array("container_content_gui" => $this)
231  );
232  if (!$uip->replaced()) {
233  $html = $ilCtrl->getHTML($column_gui);
234  }
235  $html = $uip->getHTML($html);
236  }
237  }
238 
239  return $html;
240  }
const IL_COL_RIGHT
global $ilCtrl
Definition: ilias.php:18
const IL_SCREEN_FULL
getContainerGUI()
Get container GUI object.
Column user interface class.
static _lookupObjId($a_id)
getContainerObject()
Get container object.
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
const IL_SCREEN_SIDE
$html
Definition: example_001.php:87
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initRenderer()

ilContainerContentGUI::initRenderer ( )
protected

Init container renderer.

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

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

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

291  {
292  include_once('./Services/Container/classes/class.ilContainerSorting.php');
293  $sorting = ilContainerSorting::_getInstance($this->getContainerObject()->getId());
294 
295  include_once "Services/Container/classes/class.ilContainerRenderer.php";
296  $this->renderer = new ilContainerRenderer(
297  ($this->getContainerGUI()->isActiveAdministrationPanel() && !$_SESSION["clipboard"]),
298  $this->getContainerGUI()->isMultiDownloadEnabled(),
299  $this->getContainerGUI()->isActiveOrdering() && (get_class($this) != "ilContainerObjectiveGUI") // no block sorting in objective view
300  ,
301  $sorting->getBlockPositions()
302  );
303  }
$_SESSION["AccountId"]
getContainerGUI()
Get container GUI object.
getContainerObject()
Get container object.
static _getInstance($a_obj_id)
get instance by obj_id
Class ilContainerRenderer.
+ 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 687 of file class.ilContainerContentGUI.php.

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

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

688  {
689  $this->determinePageEmbeddedBlocks($a_output_html);
690  $this->renderPageEmbeddedBlocks($this->items);
691 
692  // iterate all types
693  foreach ($this->getGroupedObjTypes() as $type => $v) {
694  // set template (overall or type specific)
695  if (is_int(strpos($a_output_html, "[list-" . $type . "]"))) {
696  $a_output_html = preg_replace(
697  '~\[list-' . $type . '\]~i',
698  $this->renderer->renderSingleTypeBlock($type),
699  $a_output_html
700  );
701  }
702  }
703 
704  // insert all item groups
705  while (preg_match('~\[(item-group-([0-9]*))\]~i', $a_output_html, $found)) {
706  $itgr_ref_id = (int) $found[2];
707 
708  $a_output_html = preg_replace(
709  '~\[' . $found[1] . '\]~i',
710  $this->renderer->renderSingleCustomBlock($itgr_ref_id),
711  $a_output_html
712  );
713  }
714 
715  return $a_output_html;
716  }
determinePageEmbeddedBlocks($a_container_page_html)
Determine all blocks that are embedded in the container page.
$type
renderPageEmbeddedBlocks()
Render Page Embedded Blocks.
getGroupedObjTypes()
Get grouped repository object types.
+ 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
arrayitem data
Returns
string item HTML

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

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

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

514  {
516  $ilAccess = $this->access;
518 
519  // Pass type, obj_id and tree to checkAccess method to improve performance
520  if (!$ilAccess->checkAccess('visible', '', $a_item_data['ref_id'], $a_item_data['type'], $a_item_data['obj_id'], $a_item_data['tree'])) {
521  return '';
522  }
523  $item_list_gui = $this->getItemGUI($a_item_data);
524  if ($ilSetting->get("icon_position_in_lists") == "item_rows" ||
525  $a_item_data["type"] == "sess" || $a_force_icon) {
526  $item_list_gui->enableIcon(true);
527  }
528 
529  if ($this->getContainerGUI()->isActiveAdministrationPanel() && !$_SESSION["clipboard"]) {
530  $item_list_gui->enableCheckbox(true);
531  } elseif ($this->getContainerGUI()->isMultiDownloadEnabled()) {
532  // display multi download checkboxes
533  $item_list_gui->enableDownloadCheckbox($a_item_data["ref_id"], true);
534  }
535 
536  if ($this->getContainerGUI()->isActiveItemOrdering() && ($a_item_data['type'] != 'sess' || get_class($this) != 'ilContainerSessionsContentGUI')) {
537  $item_list_gui->setPositionInputField(
538  $a_pos_prefix . "[" . $a_item_data["ref_id"] . "]",
539  sprintf('%d', (int) $a_position*10)
540  );
541  }
542 
543  if ($a_item_data['type'] == 'sess' and get_class($this) != 'ilContainerObjectiveGUI') {
544  switch ($this->getDetailsLevel($a_item_data['obj_id'])) {
545  case self::DETAILS_TITLE:
546  $item_list_gui->setDetailsLevel(ilObjectListGUI::DETAILS_MINIMAL);
547  $item_list_gui->enableExpand(true);
548  $item_list_gui->setExpanded(false);
549  $item_list_gui->enableDescription(false);
550  $item_list_gui->enableProperties(true);
551  break;
552 
553  case self::DETAILS_ALL:
554  $item_list_gui->setDetailsLevel(ilObjectListGUI::DETAILS_ALL);
555  $item_list_gui->enableExpand(true);
556  $item_list_gui->setExpanded(true);
557  $item_list_gui->enableDescription(true);
558  $item_list_gui->enableProperties(true);
559  break;
560 
561  default:
562  $item_list_gui->setDetailsLevel(ilObjectListGUI::DETAILS_ALL);
563  $item_list_gui->enableExpand(true);
564  $item_list_gui->enableDescription(true);
565  $item_list_gui->enableProperties(true);
566  break;
567  }
568  }
569 
570  if (method_exists($this, "addItemDetails")) {
571  $this->addItemDetails($item_list_gui, $a_item_data);
572  }
573 
574  // show subitems
575  if ($a_item_data['type'] == 'sess' and (
576  $this->getDetailsLevel($a_item_data['obj_id']) != self::DETAILS_TITLE or
577  $this->getContainerGUI()->isActiveAdministrationPanel() or
578  $this->getContainerGUI()->isActiveItemOrdering()
579  )
580  ) {
581  $pos = 1;
582 
583  include_once('./Services/Container/classes/class.ilContainerSorting.php');
584  include_once('./Services/Object/classes/class.ilObjectActivation.php');
585  $items = ilObjectActivation::getItemsByEvent($a_item_data['obj_id']);
586  $items = ilContainerSorting::_getInstance($this->getContainerObject()->getId())->sortSubItems('sess', $a_item_data['obj_id'], $items);
587  $items = ilContainer::getCompleteDescriptions($items);
588 
589  $item_readable = $ilAccess->checkAccess('read', '', $a_item_data['ref_id']);
590 
591  foreach ($items as $item) {
592  // TODO: this should be removed and be handled by if(strlen($sub_item_html))
593  // see mantis: 0003944
594  if (!$ilAccess->checkAccess('visible', '', $item['ref_id'])) {
595  continue;
596  }
597 
598  $item_list_gui2 = $this->getItemGUI($item);
599  $item_list_gui2->enableIcon(true);
600  $item_list_gui2->enableItemDetailLinks(false);
601 
602  // unique js-ids
603  $item_list_gui2->setParentRefId($a_item_data['ref_id']);
604 
605  // @see mantis 10488
606  if (!$item_readable and !$ilAccess->checkAccess('write', '', $item['ref_id'])) {
607  $item_list_gui2->forceVisibleOnly(true);
608  }
609 
610  if ($this->getContainerGUI()->isActiveAdministrationPanel() && !$_SESSION["clipboard"]) {
611  $item_list_gui2->enableCheckbox(true);
612  } elseif ($this->getContainerGUI()->isMultiDownloadEnabled()) {
613  // display multi download checkbox
614  $item_list_gui2->enableDownloadCheckbox($item['ref_id'], true);
615  }
616 
617  if ($this->getContainerGUI()->isActiveItemOrdering()) {
618  $item_list_gui2->setPositionInputField(
619  "[sess][" . $a_item_data['obj_id'] . "][" . $item["ref_id"] . "]",
620  sprintf('%d', (int) $pos*10)
621  );
622  $pos++;
623  }
624 
625  // #10611
626  ilObjectActivation::addListGUIActivationProperty($item_list_gui2, $item);
627 
628  $sub_item_html = $item_list_gui2->getListItemHTML(
629  $item['ref_id'],
630  $item['obj_id'],
631  $item['title'],
632  $item['description']
633  );
634 
635  $this->determineAdminCommands($item["ref_id"], $item_list_gui2->adminCommandsIncluded());
636  if (strlen($sub_item_html)) {
637  $item_list_gui->addSubItemHTML($sub_item_html);
638  }
639  }
640  }
641 
642 
643  if ($ilSetting->get("item_cmd_asynch")) {
644  $asynch = true;
645  $ilCtrl->setParameter($this->container_gui, "cmdrefid", $a_item_data['ref_id']);
646  $asynch_url = $ilCtrl->getLinkTarget(
647  $this->container_gui,
648  "getAsynchItemList",
649  "",
650  true,
651  false
652  );
653  $ilCtrl->setParameter($this->container_gui, "cmdrefid", "");
654 
655  //#0020343
656  $fold_set = new ilSetting('fold');
657  if ($a_item_data['type'] == 'fold' && $fold_set->get("bgtask_download") && $fold_set->get("enable_download_folder")) {
658  include_once "Services/BackgroundTask/classes/class.ilFolderDownloadBackgroundTaskHandler.php";
660  }
661  }
662 
663  include_once "Services/Object/classes/class.ilObjectActivation.php";
664  ilObjectActivation::addListGUIActivationProperty($item_list_gui, $a_item_data);
665 
666  $html = $item_list_gui->getListItemHTML(
667  $a_item_data['ref_id'],
668  $a_item_data['obj_id'],
669  $a_item_data['title'],
670  $a_item_data['description'],
671  $asynch,
672  false,
673  $asynch_url
674  );
675  $this->determineAdminCommands(
676  $a_item_data["ref_id"],
677  $item_list_gui->adminCommandsIncluded()
678  );
679 
680 
681  return $html;
682  }
determineAdminCommands($a_ref_id, $a_admin_com_included_in_list=false)
determin admin commands
static getItemsByEvent($a_event_id)
Get session material / event items.
$_SESSION["AccountId"]
static initObjectListAction()
init js for background download
getItemGUI($item_data, $a_show_path=false)
Get ListGUI object for item.
global $ilCtrl
Definition: ilias.php:18
getContainerGUI()
Get container GUI object.
getDetailsLevel($a_item_id)
get details level
getContainerObject()
Get container object.
static addListGUIActivationProperty(ilObjectListGUI $a_list_gui, array &$a_item)
Get timing details for list gui.
global $ilSetting
Definition: privfeed.php:17
static _getInstance($a_obj_id)
get instance by obj_id
static getCompleteDescriptions(array $objects)
overwrites description fields to long or short description in an assoc array keys needed (obj_id and ...
$html
Definition: example_001.php:87
+ 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

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

References $access, $data, $html2, $ilUser, $user, ilContainerSorting\_getInstance(), ilItemGroupBehaviour\ALWAYS_OPEN, array, 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().

785  {
786  $ilAccess = $this->access;
788 
789  // #16493
790  $perm_ok = ($ilAccess->checkAccess("visible", "", $a_itgr['ref_id']) &&
791  $ilAccess->checkAccess("read", "", $a_itgr['ref_id']));
792 
793  include_once('./Services/Container/classes/class.ilContainerSorting.php');
794  include_once('./Services/Object/classes/class.ilObjectActivation.php');
795  $items = ilObjectActivation::getItemsByItemGroup($a_itgr['ref_id']);
796 
797  // if no permission is given, set the items to "rendered" but
798  // do not display the whole block
799  if (!$perm_ok) {
800  foreach ($items as $item) {
801  $this->renderer->hideItem($item["child"]);
802  }
803  return;
804  }
805 
806  $item_list_gui = $this->getItemGUI($a_itgr);
807  $item_list_gui->enableNotes(false);
808  $item_list_gui->enableTags(false);
809  $item_list_gui->enableComments(false);
810  $item_list_gui->enableTimings(false);
811  $item_list_gui->getListItemHTML(
812  $a_itgr["ref_id"],
813  $a_itgr["obj_id"],
814  $a_itgr["title"],
815  $a_itgr["description"]
816  );
817  $commands_html = $item_list_gui->getCommandsHTML();
818 
819  // determine behaviour
820  include_once("./Modules/ItemGroup/classes/class.ilObjItemGroup.php");
821  include_once("./Modules/ItemGroup/classes/class.ilItemGroupBehaviour.php");
822  $beh = ilObjItemGroup::lookupBehaviour($a_itgr["obj_id"]);
823  include_once("./Services/Container/classes/class.ilContainerBlockPropertiesStorage.php");
824  $stored_val = ilContainerBlockPropertiesStorage::getProperty("itgr_" . $a_itgr["ref_id"], $ilUser->getId(), "opened");
825  if ($stored_val !== false && $beh != ilItemGroupBehaviour::ALWAYS_OPEN) {
826  $beh = ($stored_val == "1")
829  }
830 
831  $data = array(
832  "behaviour" => $beh,
833  "store-url" => "./ilias.php?baseClass=ilcontainerblockpropertiesstorage&cmd=store" .
834  "&cont_block_id=itgr_" . $a_itgr['ref_id']
835  );
836  if (ilObjItemGroup::lookupHideTitle($a_itgr["obj_id"]) &&
837  !$this->getContainerGUI()->isActiveAdministrationPanel()) {
838  $this->renderer->addCustomBlock($a_itgr["ref_id"], "", $commands_html, $data);
839  } else {
840  $this->renderer->addCustomBlock($a_itgr["ref_id"], $a_itgr["title"], $commands_html, $data);
841  }
842 
843 
844  // render item group sub items
845 
847  $this->getContainerObject()->getId()
848  )->sortSubItems('itgr', $a_itgr['obj_id'], $items);
849 
850  // #18285
851  $items = ilContainer::getCompleteDescriptions($items);
852 
853  $position = 1;
854  foreach ($items as $item) {
855  // we are NOT using hasItem() here, because item might be in multiple item groups
856  $html2 = $this->renderItem($item, $position++, false, "[itgr][" . $a_itgr['obj_id'] . "]");
857  if ($html2 != "") {
858  // :TODO: show it multiple times?
859  $this->renderer->addItemToBlock($a_itgr["ref_id"], $item["type"], $item["child"], $html2, true);
860  }
861  }
862  }
static lookupHideTitle($a_id)
Lookup hide title.
static getProperty($a_block_id, $a_user_id, $a_property)
Get property in session or db.
$html2
Definition: 42richText.php:71
getItemGUI($item_data, $a_show_path=false)
Get ListGUI object for item.
static lookupBehaviour($a_id)
Lookup behaviour.
getContainerGUI()
Get container GUI object.
getContainerObject()
Get container object.
$ilUser
Definition: imgupload.php:18
renderItem($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
Render an item.
Create styles array
The data for the language used.
static getItemsByItemGroup($a_item_group_ref_id)
Get materials of item group.
static _getInstance($a_obj_id)
get instance by obj_id
static getCompleteDescriptions(array $objects)
overwrites description fields to long or short description in an assoc array keys needed (obj_id and ...
+ 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 461 of file class.ilContainerContentGUI.php.

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

Referenced by insertPageEmbeddedBlocks().

462  {
463  $lng = $this->lng;
464 
465  // item groups
466  if (is_array($this->embedded_block["itgr"])) {
467  $item_groups = array();
468  if (is_array($this->items["itgr"])) {
469  foreach ($this->items["itgr"] as $ig) {
470  $item_groups[$ig["ref_id"]] = $ig;
471  }
472  }
473 
474  foreach ($this->embedded_block["itgr"] as $ref_id) {
475  if (isset($item_groups[$ref_id])) {
476  $this->renderItemGroup($item_groups[$ref_id]);
477  }
478  }
479  }
480 
481  // type specific blocks
482  if (is_array($this->embedded_block["type"])) {
483  foreach ($this->embedded_block["type"] as $k => $type) {
484  if (is_array($this->items[$type]) &&
485  $this->renderer->addTypeBlock($type)) {
486  // :TODO: obsolete?
487  if ($type == 'sess') {
488  $this->items['sess'] = ilUtil::sortArray($this->items['sess'], 'start', 'ASC', true, true);
489  }
490 
491  $position = 1;
492 
493  foreach ($this->items[$type] as $k => $item_data) {
494  if (!$this->renderer->hasItem($item_data["child"])) {
495  $html = $this->renderItem($item_data, $position++);
496  if ($html != "") {
497  $this->renderer->addItemToBlock($type, $item_data["type"], $item_data["child"], $html);
498  }
499  }
500  }
501  }
502  }
503  }
504  }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
$type
renderItem($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
Render an item.
Create styles array
The data for the language used.
renderItemGroup($a_itgr)
Render item group.
$html
Definition: example_001.php:87
+ 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 153 of file class.ilContainerContentGUI.php.

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

154  {
155  $tpl = $this->tpl;
157 
158  // note: we do not want to get the center html in case of
159  // asynchronous calls to blocks in the right column (e.g. news)
160  // see #13012
161  if ($ilCtrl->getNextClass() == "ilcolumngui" &&
162  $ilCtrl->isAsynch()) {
163  $tpl->setRightContent($this->getRightColumnHTML());
164  }
165 
166  // BEGIN ChangeEvent: record read event.
167  require_once('Services/Tracking/classes/class.ilChangeEvent.php');
169  //global $log;
170  //$log->write("setOutput");
171 
172  $obj_id = ilObject::_lookupObjId($this->getContainerObject()->getRefId());
174  $this->getContainerObject()->getType(),
175  $this->getContainerObject()->getRefId(),
176  $obj_id,
177  $ilUser->getId()
178  );
179  // END ChangeEvent: record read event.
180 
181 
182  $tpl->setContent($this->getCenterColumnHTML());
183 
184  // see above, all other cases (this was the old position of setRightContent,
185  // maybe the position above is ok and all ifs can be removed)
186  if ($ilCtrl->getNextClass() != "ilcolumngui" ||
187  !$ilCtrl->isAsynch()) {
188  $tpl->setRightContent($this->getRightColumnHTML());
189  }
190  }
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.
global $ilCtrl
Definition: ilias.php:18
static _lookupObjId($a_id)
getContainerObject()
Get container object.
$ilUser
Definition: imgupload.php:18
getCenterColumnHTML()
Get HTML for center column.
getRightColumnHTML()
Get HTML for right column.
+ Here is the call graph for this function:

Field Documentation

◆ $access

◆ $container_gui

ilContainerContentGUI::$container_gui

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

Referenced by getContainerGUI().

◆ $container_obj

ilContainerContentGUI::$container_obj

Definition at line 80 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 72 of file class.ilContainerContentGUI.php.

Referenced by getDetailsLevel().

◆ $lng

◆ $log

ilContainerContentGUI::$log
protected

Definition at line 85 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

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

◆ $settings

ilContainerContentGUI::$settings
protected

◆ $tpl

◆ $user

◆ DETAILS_ALL

const ilContainerContentGUI::DETAILS_ALL = 2

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

◆ DETAILS_DEACTIVATED

const ilContainerContentGUI::DETAILS_DEACTIVATED = 0

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

◆ DETAILS_TITLE

const ilContainerContentGUI::DETAILS_TITLE = 1

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


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