ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilColumnGUI Class Reference

Column user interface class. More...

+ Collaboration diagram for ilColumnGUI:

Public Member Functions

 __construct (string $a_col_type="", string $a_side="", bool $use_std_context=false)
 
 setColType (string $a_coltype)
 
 getColType ()
 
 setSide (string $a_side)
 
 getSide ()
 
 setEnableEdit (bool $a_enableedit)
 
 getEnableEdit ()
 
 setRepositoryMode (bool $a_repositorymode)
 
 getRepositoryMode ()
 
 setAdminCommands (bool $a_admincommands)
 
 getAdminCommands ()
 
 setBlockProperty (string $a_block_type, string $a_property, string $a_value)
 This function is supposed to be used for block type specific properties, that should be passed to ilBlockGUI->setProperty. More...
 
 getBlockProperties (string $a_block_type)
 
 setAllBlockProperties (array $a_block_properties)
 
 setRepositoryItems (array $a_repositoryitems)
 
 getRepositoryItems ()
 
 setItemPresentationManager (ItemPresentationManager $item_presentation)
 
 getItemPresentationManager ()
 
 hasItemPresentationManager ()
 
 executeCommand ()
 
 getHTML ()
 
 showBlocks ()
 
 updateBlock ()
 Update Block (asynchronous) More...
 
 activateBlock ()
 Activate hidden block. More...
 
 addBlock ()
 Add a block. More...
 
 determineBlocks ()
 Determine which blocks to show. More...
 
 setActionMenu (ilAdvancedSelectionListGUI $action_menu)
 
 getActionMenu ()
 

Static Public Member Functions

static addCustomBlockLocation (string $className, string $path)
 Adds location information of the custom block gui. More...
 
static addCustomBlockType (string $className, string $identifier)
 Adds the block type of the custom block gui. More...
 
static getCmdSide ()
 Get Column Side of Current Command. More...
 
static getScreenMode ()
 

Protected Member Functions

 isGloballyActivated (string $a_type)
 Check whether a block type is globally activated. More...
 
 exceededLimit (string $a_type)
 Check whether limit is not exceeded. More...
 

Protected Attributes

array $repositoryitems
 
string $coltype
 
ilDashboardSidePanelSettingsRepository $dash_side_panel_settings
 
ItemPresentationManager $item_presentation = null
 
ILIAS Block StandardGUIRequest $request
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilObjUser $user
 
ilTemplate $tpl
 
AgentDetermination $browser
 
ilSetting $settings
 
string $side = IL_COL_RIGHT
 
string $type
 
bool $enableedit = false
 
bool $repositorymode = false
 
array $blocks = []
 
array $rep_block_types = array("feed","poll")
 
array $block_property = array()
 
bool $admincommands = false
 
ilAdvancedSelectionListGUI $action_menu = null
 
array $default_blocks
 
array $custom_blocks
 
array $check_global_activation
 
array $check_nr_limit
 

Static Protected Attributes

static array $locations
 
static array $block_types
 

Detailed Description

Column user interface class.

This class is used on the personal desktop, the info screen class and witin container classes.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

ilColumnGUI: ilCalendarGUI ilColumnGUI:

Definition at line 42 of file class.ilColumnGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilColumnGUI::__construct ( string  $a_col_type = "",
string  $a_side = "",
bool  $use_std_context = false 
)

Definition at line 179 of file class.ilColumnGUI.php.

References $DIC, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), setColType(), setSide(), ILIAS\Repository\settings(), and ILIAS\Repository\user().

183  {
184  global $DIC;
185 
186  $this->ctrl = $DIC->ctrl();
187  $this->lng = $DIC->language();
188  $this->user = $DIC->user();
189  $this->browser = $DIC->http()->agent();
190  $this->settings = $DIC->settings();
191  $this->setColType($a_col_type);
192  $this->setSide($a_side);
193 
194  $block_service = new ILIAS\Block\Service($DIC);
195  $this->request = $block_service->internal()
196  ->gui()
197  ->standardRequest();
198 
199  $this->dash_side_panel_settings = new ilDashboardSidePanelSettingsRepository();
200  }
setSide(string $a_side)
global $DIC
Definition: shib_login.php:22
setColType(string $a_coltype)
+ Here is the call graph for this function:

Member Function Documentation

◆ activateBlock()

ilColumnGUI::activateBlock ( )

Activate hidden block.

Definition at line 534 of file class.ilColumnGUI.php.

References $ctrl, $user, ilBlockSetting\_writeDetailLevel(), and ILIAS\Repository\int().

534  : void
535  {
536  $ilUser = $this->user;
537  $ilCtrl = $this->ctrl;
538 
539  if ($this->request->getBlock() != "") {
540  $block = explode("_", $this->request->getBlock());
541  ilBlockSetting::_writeDetailLevel($block[0], "2", $ilUser->getId(), (int) $block[1]);
542  }
543 
544  $ilCtrl->returnToParent($this);
545  }
static _writeDetailLevel(string $a_type, string $a_value, int $a_user=0, int $a_block_id=0)
+ Here is the call graph for this function:

◆ addBlock()

ilColumnGUI::addBlock ( )

Add a block.

Definition at line 550 of file class.ilColumnGUI.php.

References $ctrl, getAdminCommands(), getEnableEdit(), and getRepositoryMode().

550  : string
551  {
552  $ilCtrl = $this->ctrl;
553 
554  $class = array_search($this->request->getBlockType(), self::$block_types);
555 
556  // @todo: removed deprecated ilCtrl methods, this needs inspection by a maintainer.
557  // $ilCtrl->setCmdClass($class);
558  // $ilCtrl->setCmd("create");
559  $block_gui = new $class();
560  $block_gui->setProperties($this->block_property[$this->request->getBlockType()]);
561  $block_gui->setRepositoryMode($this->getRepositoryMode());
562  $block_gui->setEnableEdit($this->getEnableEdit());
563  $block_gui->setAdminCommands($this->getAdminCommands());
564 
565  $ilCtrl->setParameter($this, "block_type", $this->request->getBlockType());
566  $html = $ilCtrl->forwardCommand($block_gui);
567  $ilCtrl->setParameter($this, "block_type", "");
568  return $html;
569  }
+ Here is the call graph for this function:

◆ addCustomBlockLocation()

static ilColumnGUI::addCustomBlockLocation ( string  $className,
string  $path 
)
static

Adds location information of the custom block gui.

Definition at line 205 of file class.ilColumnGUI.php.

References $path.

208  : void {
209  self::$locations[$className] = $path;
210  }
$path
Definition: ltiservices.php:29

◆ addCustomBlockType()

static ilColumnGUI::addCustomBlockType ( string  $className,
string  $identifier 
)
static

Adds the block type of the custom block gui.

Parameters
string$classNameThe name of the custom block gui class
string$identifierThe identifier (block type) of the custom block gui

Definition at line 217 of file class.ilColumnGUI.php.

220  : void {
221  self::$block_types[$className] = $identifier;
222  }

◆ determineBlocks()

ilColumnGUI::determineBlocks ( )

Determine which blocks to show.

Definition at line 574 of file class.ilColumnGUI.php.

References $ctrl, $side, $user, $user_id, ilBlockSetting\_lookupSide(), getColType(), getItemPresentationManager(), getRepositoryMode(), hasItemPresentationManager(), IL_COL_CENTER, IL_COL_LEFT, IL_COL_RIGHT, isGloballyActivated(), and ilArrayUtil\sortArray().

Referenced by getHTML(), and updateBlock().

574  : void
575  {
576  $ilUser = $this->user;
577  $ilCtrl = $this->ctrl;
578 
579  $this->blocks[IL_COL_LEFT] = array();
580  $this->blocks[IL_COL_RIGHT] = array();
581  $this->blocks[IL_COL_CENTER] = array();
582 
583  $user_id = 0;
584  if ($this->getColType() === 'pd') {
585  $user_id = $ilUser->getId();
586  $positions = array_flip($this->dash_side_panel_settings->getPositions());
587  }
588 
589  $def_nr = 1000;
590  if (isset($this->default_blocks[$this->getColType()])) {
591  foreach ($this->default_blocks[$this->getColType()] as $class => $def_side) {
592  $type = self::$block_types[$class];
593  if ($this->isGloballyActivated($type)) {
594  $nr = $def_nr++;
595 
596  // extra handling for system messages, feedback block and news
597  if ($type == "news") { // always show news first
598  $nr = -15;
599  }
600  if ($type == "cal") {
601  $nr = -8;
602  }
603  if ($type == "chcal") { // consultation hours always directly below calendar
604  $nr = -7;
605  }
606  if ($type == "tusu") { // tutorial support below calendar
607  $nr = -6;
608  }
609  if ($type == "pdfeedb") { // always show feedback request second
610  $nr = -10;
611  }
612  if ($type == "clsfct") { // mkunkel wants to have this on top
613  $nr = -16;
614  }
615  if ($type == "lpprogress") { // learning progress above news
616  $nr = -17;
617  }
619  if (is_null($side) || $side === "") {
620  $side = $def_side;
621  }
622  if ($side == IL_COL_LEFT) {
624  }
625 
626  if ($this->getColType() === 'pd' && in_array(substr($type, 2), $this->dash_side_panel_settings->getValidModules(), true)) {
627  $nr = $positions[substr($type, 2)] ?? $nr;
628  }
629 
630  $this->blocks[$side][] = array(
631  "nr" => $nr,
632  "class" => $class,
633  "type" => $type,
634  "id" => 0,
635  "custom" => false);
636  }
637  }
638  }
639 
640  if (!$this->getRepositoryMode()) {
641  $custom_block = new ilCustomBlock();
642  $custom_block->setContextObjId($ilCtrl->getContextObjId());
643  $custom_block->setContextObjType($ilCtrl->getContextObjType());
644  $c_blocks = $custom_block->queryBlocksForContext();
645 
646  foreach ($c_blocks as $c_block) {
647  $type = $c_block["type"];
648 
649  if ($this->isGloballyActivated($type)) {
650  $class = array_search($type, self::$block_types);
651  $nr = $def_nr++;
652  $side = ilBlockSetting::_lookupSide($type, $user_id, $c_block["id"]);
653  if (is_null($side)) {
655  }
656 
657  $this->blocks[$side][] = array(
658  "nr" => $nr,
659  "class" => $class,
660  "type" => $type,
661  "id" => $c_block["id"],
662  "custom" => true);
663  }
664  }
665  } else { // get all subitems
666  foreach ($this->rep_block_types as $block_type) {
667  if ($this->isGloballyActivated($block_type) && $this->hasItemPresentationManager()) {
668  $item_ref_ids = $this->getItemPresentationManager()->getRefIdsOfType($block_type);
669  foreach ($item_ref_ids as $item_ref_id) {
670  $item = $this->getItemPresentationManager()->getRawDataByRefId($item_ref_id);
671  $costum_block = new ilCustomBlock();
672  $costum_block->setContextObjId((int) $item["obj_id"]);
673  $costum_block->setContextObjType($block_type);
674  $c_blocks = $costum_block->queryBlocksForContext();
675  $c_block = $c_blocks[0];
676 
677  $type = $block_type;
678  $class = array_search($type, self::$block_types);
679  $nr = $def_nr++;
680  $side = ilBlockSetting::_lookupSide($type, $user_id, (int) $c_block["id"]);
681  if ($side == false) {
683  }
684 
685  $this->blocks[$side][] = array(
686  "nr" => $nr,
687  "class" => $class,
688  "type" => $type,
689  "id" => $c_block["id"],
690  "custom" => true,
691  "ref_id" => $item["ref_id"]);
692  }
693  }
694  }
695 
696  // repository object custom blocks
697  $custom_block = new ilCustomBlock();
698  $custom_block->setContextObjId($ilCtrl->getContextObjId());
699  $custom_block->setContextObjType($ilCtrl->getContextObjType());
700  $c_blocks = $custom_block->queryBlocksForContext(false); // get all sub-object types
701  foreach ($c_blocks as $c_block) {
702  $type = $c_block["type"];
703  $class = array_search($type, self::$block_types);
704 
705  if ($class) {
706  $nr = $def_nr++;
708 
709  $this->blocks[$side][] = array(
710  "nr" => $nr,
711  "class" => $class,
712  "type" => $type,
713  "id" => $c_block["id"],
714  "custom" => true);
715  }
716  }
717  }
718 
719  $this->blocks[IL_COL_LEFT] =
720  ilArrayUtil::sortArray($this->blocks[IL_COL_LEFT], "nr", "asc", true);
721  $this->blocks[IL_COL_RIGHT] =
722  ilArrayUtil::sortArray($this->blocks[IL_COL_RIGHT], "nr", "asc", true);
723  $this->blocks[IL_COL_CENTER] =
724  ilArrayUtil::sortArray($this->blocks[IL_COL_CENTER], "nr", "asc", true);
725  }
const IL_COL_CENTER
const IL_COL_RIGHT
isGloballyActivated(string $a_type)
Check whether a block type is globally activated.
This is the super class of all custom blocks.
static _lookupSide(string $a_type, int $a_user=0, int $a_block_id=0)
Lookup side.
const IL_COL_LEFT
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exceededLimit()

ilColumnGUI::exceededLimit ( string  $a_type)
protected

Check whether limit is not exceeded.

Definition at line 800 of file class.ilColumnGUI.php.

References $ctrl, $ilSetting, $res, $settings, getRepositoryMode(), and ILIAS\Repository\int().

802  : bool {
804  $ilCtrl = $this->ctrl;
805 
806  if ($this->check_nr_limit[$a_type]) {
807  if (!$this->getRepositoryMode()) {
808  $costum_block = new ilCustomBlock();
809  $costum_block->setContextObjId($ilCtrl->getContextObjId());
810  $costum_block->setContextObjType($ilCtrl->getContextObjType());
811  $costum_block->setType($a_type);
812  $res = $costum_block->queryCntBlockForContext();
813  $cnt = (int) $res[0]["cnt"];
814  } else {
815  return false; // not implemented for repository yet
816  }
817 
818 
819  if ($ilSetting->get("block_limit_" . $a_type) > $cnt) {
820  return false;
821  } else {
822  return true;
823  }
824  }
825  return false;
826  }
$res
Definition: ltiservices.php:66
This is the super class of all custom blocks.
global $ilSetting
Definition: privfeed.php:31
ilSetting $settings
+ Here is the call graph for this function:

◆ executeCommand()

ilColumnGUI::executeCommand ( )

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

References $ctrl, getAdminCommands(), getColType(), getEnableEdit(), getRepositoryMode(), getSide(), and ilCtrl\setParameter().

373  : string
374  {
375  $ilCtrl = $this->ctrl;
376 
377  $ilCtrl->setParameter($this, "col_side", $this->getSide());
378 
379  $next_class = $ilCtrl->getNextClass();
380  $cmd = $ilCtrl->getCmd("getHTML");
381 
382  $cur_block_type = $this->request->getBlockType();
383 
384  if ($next_class != "") {
385  // forward to block
386  if ($gui_class = array_search($cur_block_type, self::$block_types)) {
387  $ilCtrl->setParameter($this, "block_type", $cur_block_type);
388  $block_gui = new $gui_class();
389  $block_gui->setProperties($this->block_property[$cur_block_type] ?? []);
390  $block_gui->setRepositoryMode($this->getRepositoryMode());
391  $block_gui->setEnableEdit($this->getEnableEdit());
392  $block_gui->setAdminCommands($this->getAdminCommands());
393 
394  if (in_array($gui_class, $this->custom_blocks[$this->getColType()]) ||
395  in_array($cur_block_type, $this->rep_block_types)) {
396  $block_class = substr($gui_class, 0, strlen($gui_class) - 3);
397  $app_block = new $block_class($this->request->getBlockId());
398  $block_gui->setBlock($app_block);
399  }
400  $html = $ilCtrl->forwardCommand($block_gui);
401  $ilCtrl->setParameter($this, "block_type", "");
402 
403  return $html;
404  }
405  } else {
406  return (string) $this->$cmd();
407  }
408  return "";
409  }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ getActionMenu()

ilColumnGUI::getActionMenu ( )

Definition at line 834 of file class.ilColumnGUI.php.

References $action_menu.

835  {
836  return $this->action_menu;
837  }
ilAdvancedSelectionListGUI $action_menu
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ getAdminCommands()

ilColumnGUI::getAdminCommands ( )

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

References $admincommands.

Referenced by addBlock(), executeCommand(), showBlocks(), and updateBlock().

290  : bool
291  {
292  return $this->admincommands;
293  }
+ Here is the caller graph for this function:

◆ getBlockProperties()

ilColumnGUI::getBlockProperties ( string  $a_block_type)

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

336  : array {
337  return $this->block_property[$a_block_type];
338  }

◆ getCmdSide()

static ilColumnGUI::getCmdSide ( )
static

Get Column Side of Current Command.

Definition at line 227 of file class.ilColumnGUI.php.

References $DIC.

Referenced by ilContainerContentGUI\forwardToColumnGUI(), and ilObjectGUI\getCenterColumnHTML().

227  : ?string
228  {
229  global $DIC;
230 
231  $block_service = new ILIAS\Block\Service($DIC);
232  $request = $block_service->internal()
233  ->gui()
234  ->standardRequest();
235  return $request->getColSide();
236  }
global $DIC
Definition: shib_login.php:22
ILIAS Block StandardGUIRequest $request
+ Here is the caller graph for this function:

◆ getColType()

ilColumnGUI::getColType ( )

Definition at line 246 of file class.ilColumnGUI.php.

References $coltype.

Referenced by determineBlocks(), and executeCommand().

246  : string
247  {
248  return $this->coltype;
249  }
+ Here is the caller graph for this function:

◆ getEnableEdit()

ilColumnGUI::getEnableEdit ( )

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

References $enableedit.

Referenced by addBlock(), executeCommand(), showBlocks(), and updateBlock().

269  : bool
270  {
271  return $this->enableedit;
272  }
+ Here is the caller graph for this function:

◆ getHTML()

ilColumnGUI::getHTML ( )

Definition at line 411 of file class.ilColumnGUI.php.

References $ctrl, determineBlocks(), getSide(), ilCtrl\setParameter(), and showBlocks().

411  : string
412  {
413  $ilCtrl = $this->ctrl;
414 
415  $ilCtrl->setParameter($this, "col_side", $this->getSide());
416 
417  $this->tpl = new ilTemplate("tpl.column.html", true, true, "components/ILIAS/Block");
418  $this->determineBlocks();
419  $this->showBlocks();
420  return $this->tpl->get();
421  }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
determineBlocks()
Determine which blocks to show.
+ Here is the call graph for this function:

◆ getItemPresentationManager()

ilColumnGUI::getItemPresentationManager ( )

Definition at line 363 of file class.ilColumnGUI.php.

References $item_presentation.

Referenced by determineBlocks().

364  {
366  }
ItemPresentationManager $item_presentation
+ Here is the caller graph for this function:

◆ getRepositoryItems()

ilColumnGUI::getRepositoryItems ( )

Definition at line 352 of file class.ilColumnGUI.php.

References $repositoryitems.

352  : array
353  {
354  return $this->repositoryitems;
355  }

◆ getRepositoryMode()

ilColumnGUI::getRepositoryMode ( )

Definition at line 280 of file class.ilColumnGUI.php.

References $repositorymode.

Referenced by addBlock(), determineBlocks(), exceededLimit(), executeCommand(), showBlocks(), and updateBlock().

280  : bool
281  {
282  return $this->repositorymode;
283  }
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilColumnGUI::getScreenMode ( )
static

Definition at line 295 of file class.ilColumnGUI.php.

References $DIC, IL_SCREEN_CENTER, and IL_SCREEN_SIDE.

Referenced by ilContainerContentGUI\forwardToColumnGUI(), and ilObjectGUI\getCenterColumnHTML().

295  : string
296  {
297  global $DIC;
298 
299  $ilCtrl = $DIC->ctrl();
300 
301  $block_service = new ILIAS\Block\Service($DIC);
302  $request = $block_service->internal()
303  ->gui()
304  ->standardRequest();
305 
306  if ($ilCtrl->getCmdClass() == "ilcolumngui") {
307  switch ($ilCtrl->getCmd()) {
308  case "addBlock":
309  return IL_SCREEN_CENTER;
310  }
311  }
312 
313  $cur_block_type = $request->getBlockType();
314 
315  if ($class = array_search($cur_block_type, self::$block_types)) {
316  return call_user_func(array($class, 'getScreenMode'));
317  }
318 
319  return IL_SCREEN_SIDE;
320  }
global $DIC
Definition: shib_login.php:22
const IL_SCREEN_CENTER
const IL_SCREEN_SIDE
ILIAS Block StandardGUIRequest $request
+ Here is the caller graph for this function:

◆ getSide()

ilColumnGUI::getSide ( )

Definition at line 259 of file class.ilColumnGUI.php.

References $side.

Referenced by executeCommand(), getHTML(), showBlocks(), and updateBlock().

259  : string
260  {
261  return $this->side;
262  }
+ Here is the caller graph for this function:

◆ hasItemPresentationManager()

ilColumnGUI::hasItemPresentationManager ( )

Definition at line 368 of file class.ilColumnGUI.php.

Referenced by determineBlocks().

368  : bool
369  {
370  return isset($this->item_presentation);
371  }
+ Here is the caller graph for this function:

◆ isGloballyActivated()

ilColumnGUI::isGloballyActivated ( string  $a_type)
protected

Check whether a block type is globally activated.

Definition at line 730 of file class.ilColumnGUI.php.

References $ctrl, $GLOBALS, $ilSetting, $settings, ilCalendarSettings\_getInstance(), ilContainer\_lookupContainerSetting(), ilDashboardSidePanelSettingsRepository\CALENDAR, ilObjectLP\getInstance(), ilCalendarSettings\lookupCalendarContentPresentationEnabled(), ilObjCourse\lookupTutorialBlockSettingEabled(), ilLPObjSettings\LP_MODE_COLLECTION, ilDashboardSidePanelSettingsRepository\MAIL, ilDashboardSidePanelSettingsRepository\NEWS, ilDashboardSidePanelSettingsRepository\TASKS, and ilObjectServiceSettingsGUI\USE_NEWS.

Referenced by determineBlocks().

732  : bool {
734  $ilCtrl = $this->ctrl;
735 
736  if ($a_type == 'pdfeed') {
737  return false;
738  }
739 
740  if (isset($this->check_global_activation[$a_type]) && $this->check_global_activation[$a_type]) {
741  if ($a_type === 'pd' . ilDashboardSidePanelSettingsRepository::NEWS) {
742  return ($this->dash_side_panel_settings->isEnabled($this->dash_side_panel_settings::NEWS) &&
743  $ilSetting->get('block_activated_news'));
744  } elseif ($a_type === 'pd' . ilDashboardSidePanelSettingsRepository::MAIL) {
745  return $this->dash_side_panel_settings->isEnabled($this->dash_side_panel_settings::MAIL);
746  } elseif ($a_type === 'pd' . ilDashboardSidePanelSettingsRepository::TASKS) {
747  return $this->dash_side_panel_settings->isEnabled($this->dash_side_panel_settings::TASKS);
748  } elseif ($a_type == 'news') {
749  return
750  $ilSetting->get('block_activated_news') &&
751 
752  (!in_array($ilCtrl->getContextObjType(), ["grp", "crs"]) ||
754  $GLOBALS['ilCtrl']->getContextObjId(),
756  "1"
757  )) &&
759  $GLOBALS['ilCtrl']->getContextObjId(),
760  'cont_show_news',
761  "1"
762  );
763  } elseif ($ilSetting->get("block_activated_" . $a_type)) {
764  return true;
765  } elseif ($a_type == 'cal' || $a_type == 'chcal') {
766  return ilCalendarSettings::lookupCalendarContentPresentationEnabled($ilCtrl->getContextObjId());
767  } elseif ($a_type === 'pd' . ilDashboardSidePanelSettingsRepository::CALENDAR) {
768  if (!$this->dash_side_panel_settings->isEnabled($this->dash_side_panel_settings::CALENDAR)) {
769  return false;
770  }
771  return ilCalendarSettings::_getInstance()->isEnabled();
772  } elseif ($a_type == "tagcld") {
773  $tags_active = new ilSetting("tags");
774  return (bool) $tags_active->get("enable", "0");
775  } elseif ($a_type == "clsfct") {
776  if ($ilCtrl->getContextObjType() == "cat") { // taxonomy presentation in classification block
777  return true;
778  }
779  $tags_active = new ilSetting("tags"); // tags presentation in classification block
780  return (bool) $tags_active->get("enable", "0");
781  } elseif (
782  $a_type === "tusu" &&
783  ilObjCourse::lookupTutorialBlockSettingEabled($ilCtrl->getContextObjId())
784  ) {
785  return true;
786  } elseif ($a_type === "lpprogress") {
787  $obj_lp = ilObjectLP::getInstance($ilCtrl->getContextObjId());
788  $progress_block_settings = (new TrackingView())->progressBlock()->settings()->repository();
789  return $obj_lp->getCurrentMode() === ilLPObjSettings::LP_MODE_COLLECTION &&
790  $progress_block_settings->isBlockShownForObject($ilCtrl->getContextObjId());
791  }
792  return false;
793  }
794  return true;
795  }
$GLOBALS["DIC"]
Definition: wac.php:53
static lookupCalendarContentPresentationEnabled(int $obj_id)
global $ilSetting
Definition: privfeed.php:31
static lookupTutorialBlockSettingEabled(int $a_obj_id)
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
static getInstance(int $obj_id)
ilSetting $settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setActionMenu()

ilColumnGUI::setActionMenu ( ilAdvancedSelectionListGUI  $action_menu)

Definition at line 828 of file class.ilColumnGUI.php.

References $action_menu.

830  : void {
831  $this->action_menu = $action_menu;
832  }
ilAdvancedSelectionListGUI $action_menu

◆ setAdminCommands()

ilColumnGUI::setAdminCommands ( bool  $a_admincommands)

Definition at line 285 of file class.ilColumnGUI.php.

Referenced by ilContainerGUI\setColumnSettings().

285  : void
286  {
287  $this->admincommands = $a_admincommands;
288  }
+ Here is the caller graph for this function:

◆ setAllBlockProperties()

ilColumnGUI::setAllBlockProperties ( array  $a_block_properties)

Definition at line 340 of file class.ilColumnGUI.php.

Referenced by ilInfoScreenGUI\setColumnSettings().

342  : void {
343  $this->block_property = $a_block_properties;
344  }
+ Here is the caller graph for this function:

◆ setBlockProperty()

ilColumnGUI::setBlockProperty ( string  $a_block_type,
string  $a_property,
string  $a_value 
)

This function is supposed to be used for block type specific properties, that should be passed to ilBlockGUI->setProperty.

Definition at line 326 of file class.ilColumnGUI.php.

Referenced by ilContainerGUI\setColumnSettings(), and ilObjForumGUI\setColumnSettings().

330  : void {
331  $this->block_property[$a_block_type][$a_property] = $a_value;
332  }
+ Here is the caller graph for this function:

◆ setColType()

ilColumnGUI::setColType ( string  $a_coltype)
Parameters
string$a_coltypeColumn Type

Definition at line 241 of file class.ilColumnGUI.php.

Referenced by __construct().

241  : void
242  {
243  $this->coltype = $a_coltype;
244  }
+ Here is the caller graph for this function:

◆ setEnableEdit()

ilColumnGUI::setEnableEdit ( bool  $a_enableedit)

Definition at line 264 of file class.ilColumnGUI.php.

Referenced by ilInfoScreenGUI\setColumnSettings(), and ilObjectGUI\setColumnSettings().

264  : void
265  {
266  $this->enableedit = $a_enableedit;
267  }
+ Here is the caller graph for this function:

◆ setItemPresentationManager()

ilColumnGUI::setItemPresentationManager ( ItemPresentationManager  $item_presentation)

Definition at line 357 of file class.ilColumnGUI.php.

References $item_presentation.

Referenced by ilContainerGUI\setColumnSettings().

359  : void {
360  $this->item_presentation = $item_presentation;
361  }
ItemPresentationManager $item_presentation
+ Here is the caller graph for this function:

◆ setRepositoryItems()

ilColumnGUI::setRepositoryItems ( array  $a_repositoryitems)

Definition at line 346 of file class.ilColumnGUI.php.

348  : void {
349  $this->repositoryitems = $a_repositoryitems;
350  }

◆ setRepositoryMode()

ilColumnGUI::setRepositoryMode ( bool  $a_repositorymode)

Definition at line 274 of file class.ilColumnGUI.php.

Referenced by ilInfoScreenGUI\setColumnSettings(), ilObjectGUI\setColumnSettings(), and ilObjForumGUI\setColumnSettings().

276  : void {
277  $this->repositorymode = $a_repositorymode;
278  }
+ Here is the caller graph for this function:

◆ setSide()

ilColumnGUI::setSide ( string  $a_side)
Parameters
string$a_sideSide IL_COL_LEFT | IL_COL_RIGHT

Definition at line 254 of file class.ilColumnGUI.php.

Referenced by __construct().

254  : void
255  {
256  $this->side = $a_side;
257  }
+ Here is the caller graph for this function:

◆ showBlocks()

ilColumnGUI::showBlocks ( )

Definition at line 423 of file class.ilColumnGUI.php.

References $ctrl, $path, $user, getAdminCommands(), getEnableEdit(), getRepositoryMode(), getSide(), and null.

Referenced by getHTML().

423  : void
424  {
425  $ilCtrl = $this->ctrl;
426  $ilUser = $this->user;
427 
428  $i = 1;
429  $sum_moveable = count($this->blocks[$this->getSide()]);
430 
431  foreach ($this->blocks[$this->getSide()] as $block) {
432  $gui_class = $block["class"] ?? null;
433  if (!is_string($gui_class)) {
434  continue;
435  }
436  $block_class = substr($gui_class, 0, strlen($gui_class) - 3);
437 
438  // get block gui class
439  $block_gui = new $gui_class();
440  if (isset($this->block_property[$block["type"]])) {
441  $block_gui->setProperties($this->block_property[$block["type"]]);
442  }
443  $block_gui->setRepositoryMode($this->getRepositoryMode());
444  $block_gui->setEnableEdit($this->getEnableEdit());
445  $block_gui->setAdminCommands($this->getAdminCommands());
446 
447  // get block for custom blocks
448  if ($block["custom"]) {
449  $path = "./../" . self::$locations[$gui_class] . "classes/" .
450  "class." . $block_class . ".php";
451  if (file_exists($path)) {
452  $app_block = new $block_class((int) $block["id"]);
453  } else {
454  // we only need generic block
455  $app_block = new ilCustomBlock((int) $block["id"]);
456  }
457  $block_gui->setBlock($app_block);
458  if (isset($block["ref_id"])) {
459  $block_gui->setRefId((int) $block["ref_id"]);
460  }
461  }
462 
463  $ilCtrl->setParameter($this, "block_type", $block_gui->getBlockType());
464  $this->tpl->setCurrentBlock("col_block");
465 
466  $html = $ilCtrl->getHTML($block_gui);
467 
468  // don't render a block if it's empty
469  if ($html != "") {
470  $this->tpl->setVariable("BLOCK", $html);
471  $this->tpl->parseCurrentBlock();
472  $ilCtrl->setParameter($this, "block_type", "");
473  }
474  }
475  }
$path
Definition: ltiservices.php:29
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This is the super class of all custom blocks.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateBlock()

ilColumnGUI::updateBlock ( )

Update Block (asynchronous)

Definition at line 481 of file class.ilColumnGUI.php.

References $ctrl, determineBlocks(), exit, getAdminCommands(), getEnableEdit(), getRepositoryMode(), and getSide().

481  : void
482  {
483  $ilCtrl = $this->ctrl;
484 
485  $this->determineBlocks();
486  $i = 1;
487  $sum_moveable = count($this->blocks[$this->getSide()]);
488 
489  foreach ($this->blocks[$this->getSide()] as $block) {
490  // set block id to context obj id,
491  // if block is not a custom block and context is not personal desktop
492  if (!$block["custom"] && $ilCtrl->getContextObjType() != "" && $ilCtrl->getContextObjType() != "user") {
493  $block["id"] = $ilCtrl->getContextObjId();
494  }
495 
496  if ($this->request->getBlockId() == "block_" . $block["type"] . "_" . $block["id"]) {
497  $gui_class = $block["class"];
498  $block_class = substr($block["class"], 0, strlen($block["class"]) - 3);
499 
500  $block_gui = new $gui_class();
501  $block_gui->setProperties($this->block_property[$block["type"]]);
502  $block_gui->setRepositoryMode($this->getRepositoryMode());
503  $block_gui->setEnableEdit($this->getEnableEdit());
504  $block_gui->setAdminCommands($this->getAdminCommands());
505 
506  // get block for custom blocks
507  if ($block["custom"]) {
508  $app_block = new $block_class($block["id"]);
509  $block_gui->setBlock($app_block);
510  $block_gui->setRefId($block["ref_id"]);
511  }
512 
513  $ilCtrl->setParameter($this, "block_type", $block["type"]);
514  echo $ilCtrl->getHTML($block_gui);
515  exit;
516  }
517 
518  // count (moveable) blocks
519  if ($block["type"] != "pdfeedb"
520  && $block["type"] != "news") {
521  $i++;
522  } else {
523  $sum_moveable--;
524  }
525  }
526  echo "Error: ilColumnGUI::updateBlock: Block '" .
527  $this->request->getBlockId() . "' unknown.";
528  exit;
529  }
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
determineBlocks()
Determine which blocks to show.
+ Here is the call graph for this function:

Field Documentation

◆ $action_menu

ilAdvancedSelectionListGUI ilColumnGUI::$action_menu = null
protected

Definition at line 67 of file class.ilColumnGUI.php.

Referenced by getActionMenu(), and setActionMenu().

◆ $admincommands

bool ilColumnGUI::$admincommands = false
protected

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

Referenced by getAdminCommands().

◆ $block_property

array ilColumnGUI::$block_property = array()
protected

Definition at line 65 of file class.ilColumnGUI.php.

◆ $block_types

array ilColumnGUI::$block_types
staticprotected
Initial value:
= array(
"ilPDMailBlockGUI" => 'pd' . ilDashboardSidePanelSettingsRepository::MAIL,
"ilPDTasksBlockGUI" => 'pd' . ilDashboardSidePanelSettingsRepository::TASKS,
"ilPDNewsBlockGUI" => 'pd' . ilDashboardSidePanelSettingsRepository::NEWS,
"ilNewsForContextBlockGUI" => "news",
"ilCalendarBlockGUI" => "cal",
"ilTutorialSupportBlockGUI" => "tusu",
"ilPDCalendarBlockGUI" => 'pd' . ilDashboardSidePanelSettingsRepository::CALENDAR,
"ilConsultationHoursCalendarBlockGUI" => "chcal",
"ilSelectedItemsBlockGUI" => "pditems",
'ilPollBlockGUI' => 'poll',
'ilClassificationBlockGUI' => 'clsfct',
"ilPDStudyProgrammeSimpleListGUI" => "prgsimplelist",
"ilPDStudyProgrammeExpandableListGUI" => "prgexpandablelist",
"ilLPProgressBlockGUI" => "lpprogress"
)

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

◆ $blocks

array ilColumnGUI::$blocks = []
protected

Definition at line 60 of file class.ilColumnGUI.php.

◆ $browser

AgentDetermination ilColumnGUI::$browser
protected

Definition at line 53 of file class.ilColumnGUI.php.

◆ $check_global_activation

array ilColumnGUI::$check_global_activation
protected
Initial value:
=
array("news" => true,
"cal" => true,
"chcal" => true,
"tusu" => true,
"pdtag" => true,
"tagcld" => true,
"clsfct" => true,
"lpprogress" => true)

Definition at line 162 of file class.ilColumnGUI.php.

◆ $check_nr_limit

array ilColumnGUI::$check_nr_limit
protected
Initial value:
=
array("pdfeed" => true)

Definition at line 176 of file class.ilColumnGUI.php.

◆ $coltype

string ilColumnGUI::$coltype
protected

Definition at line 45 of file class.ilColumnGUI.php.

Referenced by getColType().

◆ $ctrl

◆ $custom_blocks

array ilColumnGUI::$custom_blocks
protected
Initial value:
= array(
"cat" => array(),
"crs" => array(),
"grp" => array(),
"frm" => array(),
"root" => array(),
"info" => array(),
"fold" => array(),
"pd" => array()
)

Definition at line 149 of file class.ilColumnGUI.php.

◆ $dash_side_panel_settings

ilDashboardSidePanelSettingsRepository ilColumnGUI::$dash_side_panel_settings
protected

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

◆ $default_blocks

array ilColumnGUI::$default_blocks
protected

Definition at line 109 of file class.ilColumnGUI.php.

◆ $enableedit

bool ilColumnGUI::$enableedit = false
protected

Definition at line 58 of file class.ilColumnGUI.php.

Referenced by getEnableEdit().

◆ $item_presentation

ItemPresentationManager ilColumnGUI::$item_presentation = null
protected

Definition at line 47 of file class.ilColumnGUI.php.

Referenced by getItemPresentationManager(), and setItemPresentationManager().

◆ $lng

ilLanguage ilColumnGUI::$lng
protected

Definition at line 50 of file class.ilColumnGUI.php.

◆ $locations

array ilColumnGUI::$locations
staticprotected
Initial value:
= array(
"ilNewsForContextBlockGUI" => "components/ILIAS/News/",
"ilCalendarBlockGUI" => "components/ILIAS/Calendar/",
"ilTutorialSupportBlockGUI" => "components/ILIAS/Course/",
"ilPDCalendarBlockGUI" => "components/ILIAS/Calendar/",
"ilConsultationHoursCalendarBlockGUI" => "components/ILIAS/Calendar/",
"ilPDTasksBlockGUI" => "components/ILIAS/Tasks/",
"ilPDMailBlockGUI" => "components/ILIAS/Mail/",
"ilSelectedItemsBlockGUI" => "components/ILIAS/Dashboard/Block/",
"ilPDNewsBlockGUI" => "components/ILIAS/News/",
'ilPollBlockGUI' => 'components/ILIAS/Poll/',
'ilClassificationBlockGUI' => 'components/ILIAS/Classification/',
"ilPDStudyProgrammeSimpleListGUI" => "components/ILIAS/StudyProgramme/",
"ilPDStudyProgrammeExpandableListGUI" => "components/ILIAS/StudyProgramme/",
"ilLPProgressBlockGUI" => "components/ILIAS/Tracking/"
)

Definition at line 74 of file class.ilColumnGUI.php.

◆ $rep_block_types

array ilColumnGUI::$rep_block_types = array("feed","poll")
protected

Definition at line 63 of file class.ilColumnGUI.php.

◆ $repositoryitems

array ilColumnGUI::$repositoryitems
protected

Definition at line 44 of file class.ilColumnGUI.php.

Referenced by getRepositoryItems().

◆ $repositorymode

bool ilColumnGUI::$repositorymode = false
protected

Definition at line 59 of file class.ilColumnGUI.php.

Referenced by getRepositoryMode().

◆ $request

ILIAS Block StandardGUIRequest ilColumnGUI::$request
protected

Definition at line 48 of file class.ilColumnGUI.php.

◆ $settings

ilSetting ilColumnGUI::$settings
protected

Definition at line 54 of file class.ilColumnGUI.php.

Referenced by exceededLimit(), and isGloballyActivated().

◆ $side

string ilColumnGUI::$side = IL_COL_RIGHT
protected

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

Referenced by determineBlocks(), and getSide().

◆ $tpl

ilTemplate ilColumnGUI::$tpl
protected

Definition at line 52 of file class.ilColumnGUI.php.

◆ $type

string ilColumnGUI::$type
protected

Definition at line 57 of file class.ilColumnGUI.php.

◆ $user

ilObjUser ilColumnGUI::$user
protected

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

Referenced by activateBlock(), determineBlocks(), and showBlocks().


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