ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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 41 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 170 of file class.ilColumnGUI.php.

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

174  {
175  global $DIC;
176 
177  $this->ctrl = $DIC->ctrl();
178  $this->lng = $DIC->language();
179  $this->user = $DIC->user();
180  $this->browser = $DIC->http()->agent();
181  $this->settings = $DIC->settings();
182  $this->setColType($a_col_type);
183  $this->setSide($a_side);
184 
185  $block_service = new ILIAS\Block\Service($DIC);
186  $this->request = $block_service->internal()
187  ->gui()
188  ->standardRequest();
189 
190  $this->dash_side_panel_settings = new ilDashboardSidePanelSettingsRepository();
191  }
setSide(string $a_side)
global $DIC
Definition: shib_login.php:25
setColType(string $a_coltype)
+ Here is the call graph for this function:

Member Function Documentation

◆ activateBlock()

ilColumnGUI::activateBlock ( )

Activate hidden block.

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

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

525  : void
526  {
527  $ilUser = $this->user;
528  $ilCtrl = $this->ctrl;
529 
530  if ($this->request->getBlock() != "") {
531  $block = explode("_", $this->request->getBlock());
532  ilBlockSetting::_writeDetailLevel($block[0], "2", $ilUser->getId(), (int) $block[1]);
533  }
534 
535  $ilCtrl->returnToParent($this);
536  }
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 541 of file class.ilColumnGUI.php.

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

541  : string
542  {
543  $ilCtrl = $this->ctrl;
544 
545  $class = array_search($this->request->getBlockType(), self::$block_types);
546 
547  // @todo: removed deprecated ilCtrl methods, this needs inspection by a maintainer.
548  // $ilCtrl->setCmdClass($class);
549  // $ilCtrl->setCmd("create");
550  $block_gui = new $class();
551  $block_gui->setProperties($this->block_property[$this->request->getBlockType()]);
552  $block_gui->setRepositoryMode($this->getRepositoryMode());
553  $block_gui->setEnableEdit($this->getEnableEdit());
554  $block_gui->setAdminCommands($this->getAdminCommands());
555 
556  $ilCtrl->setParameter($this, "block_type", $this->request->getBlockType());
557  $html = $ilCtrl->forwardCommand($block_gui);
558  $ilCtrl->setParameter($this, "block_type", "");
559  return $html;
560  }
+ 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 196 of file class.ilColumnGUI.php.

References $path.

199  : void {
200  self::$locations[$className] = $path;
201  }
$path
Definition: ltiservices.php:30

◆ 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 208 of file class.ilColumnGUI.php.

211  : void {
212  self::$block_types[$className] = $identifier;
213  }

◆ determineBlocks()

ilColumnGUI::determineBlocks ( )

Determine which blocks to show.

Definition at line 565 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().

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

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

785  : bool {
787  $ilCtrl = $this->ctrl;
788 
789  if ($this->check_nr_limit[$a_type]) {
790  if (!$this->getRepositoryMode()) {
791  $costum_block = new ilCustomBlock();
792  $costum_block->setContextObjId($ilCtrl->getContextObjId());
793  $costum_block->setContextObjType($ilCtrl->getContextObjType());
794  $costum_block->setType($a_type);
795  $res = $costum_block->queryCntBlockForContext();
796  $cnt = (int) $res[0]["cnt"];
797  } else {
798  return false; // not implemented for repository yet
799  }
800 
801 
802  if ($ilSetting->get("block_limit_" . $a_type) > $cnt) {
803  return false;
804  } else {
805  return true;
806  }
807  }
808  return false;
809  }
$res
Definition: ltiservices.php:69
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $ilSetting
Definition: privfeed.php:32
ilSetting $settings
+ Here is the call graph for this function:

◆ executeCommand()

ilColumnGUI::executeCommand ( )

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

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

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

◆ getActionMenu()

ilColumnGUI::getActionMenu ( )

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

References $action_menu.

818  {
819  return $this->action_menu;
820  }
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 281 of file class.ilColumnGUI.php.

References $admincommands.

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

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

◆ getBlockProperties()

ilColumnGUI::getBlockProperties ( string  $a_block_type)

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

327  : array {
328  return $this->block_property[$a_block_type];
329  }

◆ getCmdSide()

static ilColumnGUI::getCmdSide ( )
static

Get Column Side of Current Command.

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

References $DIC.

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

218  : ?string
219  {
220  global $DIC;
221 
222  $block_service = new ILIAS\Block\Service($DIC);
223  $request = $block_service->internal()
224  ->gui()
225  ->standardRequest();
226  return $request->getColSide();
227  }
global $DIC
Definition: shib_login.php:25
ILIAS Block StandardGUIRequest $request
+ Here is the caller graph for this function:

◆ getColType()

ilColumnGUI::getColType ( )

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

References $coltype.

Referenced by determineBlocks(), and executeCommand().

237  : string
238  {
239  return $this->coltype;
240  }
+ Here is the caller graph for this function:

◆ getEnableEdit()

ilColumnGUI::getEnableEdit ( )

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

References $enableedit.

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

260  : bool
261  {
262  return $this->enableedit;
263  }
+ Here is the caller graph for this function:

◆ getHTML()

ilColumnGUI::getHTML ( )

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

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

402  : string
403  {
404  $ilCtrl = $this->ctrl;
405 
406  $ilCtrl->setParameter($this, "col_side", $this->getSide());
407 
408  $this->tpl = new ilTemplate("tpl.column.html", true, true, "components/ILIAS/Block");
409  $this->determineBlocks();
410  $this->showBlocks();
411  return $this->tpl->get();
412  }
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 354 of file class.ilColumnGUI.php.

References $item_presentation.

Referenced by determineBlocks().

355  {
357  }
ItemPresentationManager $item_presentation
+ Here is the caller graph for this function:

◆ getRepositoryItems()

ilColumnGUI::getRepositoryItems ( )

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

References $repositoryitems.

343  : array
344  {
345  return $this->repositoryitems;
346  }

◆ getRepositoryMode()

ilColumnGUI::getRepositoryMode ( )

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

References $repositorymode.

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

271  : bool
272  {
273  return $this->repositorymode;
274  }
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilColumnGUI::getScreenMode ( )
static

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

References $DIC, IL_SCREEN_CENTER, and IL_SCREEN_SIDE.

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

286  : string
287  {
288  global $DIC;
289 
290  $ilCtrl = $DIC->ctrl();
291 
292  $block_service = new ILIAS\Block\Service($DIC);
293  $request = $block_service->internal()
294  ->gui()
295  ->standardRequest();
296 
297  if ($ilCtrl->getCmdClass() == "ilcolumngui") {
298  switch ($ilCtrl->getCmd()) {
299  case "addBlock":
300  return IL_SCREEN_CENTER;
301  }
302  }
303 
304  $cur_block_type = $request->getBlockType();
305 
306  if ($class = array_search($cur_block_type, self::$block_types)) {
307  return call_user_func(array($class, 'getScreenMode'));
308  }
309 
310  return IL_SCREEN_SIDE;
311  }
global $DIC
Definition: shib_login.php:25
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 250 of file class.ilColumnGUI.php.

References $side.

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

250  : string
251  {
252  return $this->side;
253  }
+ Here is the caller graph for this function:

◆ hasItemPresentationManager()

ilColumnGUI::hasItemPresentationManager ( )

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

Referenced by determineBlocks().

359  : bool
360  {
361  return isset($this->item_presentation);
362  }
+ 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 718 of file class.ilColumnGUI.php.

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

Referenced by determineBlocks().

720  : bool {
722  $ilCtrl = $this->ctrl;
723 
724  if ($a_type == 'pdfeed') {
725  return false;
726  }
727 
728  if (isset($this->check_global_activation[$a_type]) && $this->check_global_activation[$a_type]) {
729  if ($a_type === 'pd' . ilDashboardSidePanelSettingsRepository::NEWS) {
730  return ($this->dash_side_panel_settings->isEnabled($this->dash_side_panel_settings::NEWS) &&
731  $ilSetting->get('block_activated_news'));
732  } elseif ($a_type === 'pd' . ilDashboardSidePanelSettingsRepository::MAIL) {
733  return $this->dash_side_panel_settings->isEnabled($this->dash_side_panel_settings::MAIL);
734  } elseif ($a_type === 'pd' . ilDashboardSidePanelSettingsRepository::TASKS) {
735  return $this->dash_side_panel_settings->isEnabled($this->dash_side_panel_settings::TASKS);
736  } elseif ($a_type == 'news') {
737  return
738  $ilSetting->get('block_activated_news') &&
739 
740  (!in_array($ilCtrl->getContextObjType(), ["grp", "crs"]) ||
742  $GLOBALS['ilCtrl']->getContextObjId(),
744  "1"
745  )) &&
747  $GLOBALS['ilCtrl']->getContextObjId(),
748  'cont_show_news',
749  "1"
750  );
751  } elseif ($ilSetting->get("block_activated_" . $a_type)) {
752  return true;
753  } elseif ($a_type == 'cal' || $a_type == 'chcal') {
754  return ilCalendarSettings::lookupCalendarContentPresentationEnabled($ilCtrl->getContextObjId());
755  } elseif ($a_type === 'pd' . ilDashboardSidePanelSettingsRepository::CALENDAR) {
756  if (!$this->dash_side_panel_settings->isEnabled($this->dash_side_panel_settings::CALENDAR)) {
757  return false;
758  }
759  return ilCalendarSettings::_getInstance()->isEnabled();
760  } elseif ($a_type == "tagcld") {
761  $tags_active = new ilSetting("tags");
762  return (bool) $tags_active->get("enable", "0");
763  } elseif ($a_type == "clsfct") {
764  if ($ilCtrl->getContextObjType() == "cat") { // taxonomy presentation in classification block
765  return true;
766  }
767  $tags_active = new ilSetting("tags"); // tags presentation in classification block
768  return (bool) $tags_active->get("enable", "0");
769  } elseif (
770  $a_type === "tusu" &&
771  ilObjCourse::lookupTutorialBlockSettingEabled($ilCtrl->getContextObjId())
772  ) {
773  return true;
774  }
775  return false;
776  }
777  return true;
778  }
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)
$GLOBALS["DIC"]
Definition: wac.php:30
static lookupCalendarContentPresentationEnabled(int $obj_id)
global $ilSetting
Definition: privfeed.php:32
static lookupTutorialBlockSettingEabled(int $a_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 811 of file class.ilColumnGUI.php.

References $action_menu.

813  : void {
814  $this->action_menu = $action_menu;
815  }
ilAdvancedSelectionListGUI $action_menu

◆ setAdminCommands()

ilColumnGUI::setAdminCommands ( bool  $a_admincommands)

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

Referenced by ilContainerGUI\setColumnSettings().

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

◆ setAllBlockProperties()

ilColumnGUI::setAllBlockProperties ( array  $a_block_properties)

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

Referenced by ilInfoScreenGUI\setColumnSettings().

333  : void {
334  $this->block_property = $a_block_properties;
335  }
+ 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 317 of file class.ilColumnGUI.php.

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

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

◆ setColType()

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

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

Referenced by __construct().

232  : void
233  {
234  $this->coltype = $a_coltype;
235  }
+ Here is the caller graph for this function:

◆ setEnableEdit()

ilColumnGUI::setEnableEdit ( bool  $a_enableedit)

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

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

255  : void
256  {
257  $this->enableedit = $a_enableedit;
258  }
+ Here is the caller graph for this function:

◆ setItemPresentationManager()

ilColumnGUI::setItemPresentationManager ( ItemPresentationManager  $item_presentation)

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

References $item_presentation.

Referenced by ilContainerGUI\setColumnSettings().

350  : void {
351  $this->item_presentation = $item_presentation;
352  }
ItemPresentationManager $item_presentation
+ Here is the caller graph for this function:

◆ setRepositoryItems()

ilColumnGUI::setRepositoryItems ( array  $a_repositoryitems)

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

339  : void {
340  $this->repositoryitems = $a_repositoryitems;
341  }

◆ setRepositoryMode()

ilColumnGUI::setRepositoryMode ( bool  $a_repositorymode)

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

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

267  : void {
268  $this->repositorymode = $a_repositorymode;
269  }
+ 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 245 of file class.ilColumnGUI.php.

Referenced by __construct().

245  : void
246  {
247  $this->side = $a_side;
248  }
+ Here is the caller graph for this function:

◆ showBlocks()

ilColumnGUI::showBlocks ( )

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

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

Referenced by getHTML().

414  : void
415  {
416  $ilCtrl = $this->ctrl;
417  $ilUser = $this->user;
418 
419  $i = 1;
420  $sum_moveable = count($this->blocks[$this->getSide()]);
421 
422  foreach ($this->blocks[$this->getSide()] as $block) {
423  $gui_class = $block["class"] ?? null;
424  if (!is_string($gui_class)) {
425  continue;
426  }
427  $block_class = substr($gui_class, 0, strlen($gui_class) - 3);
428 
429  // get block gui class
430  $block_gui = new $gui_class();
431  if (isset($this->block_property[$block["type"]])) {
432  $block_gui->setProperties($this->block_property[$block["type"]]);
433  }
434  $block_gui->setRepositoryMode($this->getRepositoryMode());
435  $block_gui->setEnableEdit($this->getEnableEdit());
436  $block_gui->setAdminCommands($this->getAdminCommands());
437 
438  // get block for custom blocks
439  if ($block["custom"]) {
440  $path = "./../" . self::$locations[$gui_class] . "classes/" .
441  "class." . $block_class . ".php";
442  if (file_exists($path)) {
443  $app_block = new $block_class((int) $block["id"]);
444  } else {
445  // we only need generic block
446  $app_block = new ilCustomBlock((int) $block["id"]);
447  }
448  $block_gui->setBlock($app_block);
449  if (isset($block["ref_id"])) {
450  $block_gui->setRefId((int) $block["ref_id"]);
451  }
452  }
453 
454  $ilCtrl->setParameter($this, "block_type", $block_gui->getBlockType());
455  $this->tpl->setCurrentBlock("col_block");
456 
457  $html = $ilCtrl->getHTML($block_gui);
458 
459  // don't render a block if it's empty
460  if ($html != "") {
461  $this->tpl->setVariable("BLOCK", $html);
462  $this->tpl->parseCurrentBlock();
463  $ilCtrl->setParameter($this, "block_type", "");
464  }
465  }
466  }
$path
Definition: ltiservices.php:30
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ 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 472 of file class.ilColumnGUI.php.

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

472  : void
473  {
474  $ilCtrl = $this->ctrl;
475 
476  $this->determineBlocks();
477  $i = 1;
478  $sum_moveable = count($this->blocks[$this->getSide()]);
479 
480  foreach ($this->blocks[$this->getSide()] as $block) {
481  // set block id to context obj id,
482  // if block is not a custom block and context is not personal desktop
483  if (!$block["custom"] && $ilCtrl->getContextObjType() != "" && $ilCtrl->getContextObjType() != "user") {
484  $block["id"] = $ilCtrl->getContextObjId();
485  }
486 
487  if ($this->request->getBlockId() == "block_" . $block["type"] . "_" . $block["id"]) {
488  $gui_class = $block["class"];
489  $block_class = substr($block["class"], 0, strlen($block["class"]) - 3);
490 
491  $block_gui = new $gui_class();
492  $block_gui->setProperties($this->block_property[$block["type"]]);
493  $block_gui->setRepositoryMode($this->getRepositoryMode());
494  $block_gui->setEnableEdit($this->getEnableEdit());
495  $block_gui->setAdminCommands($this->getAdminCommands());
496 
497  // get block for custom blocks
498  if ($block["custom"]) {
499  $app_block = new $block_class($block["id"]);
500  $block_gui->setBlock($app_block);
501  $block_gui->setRefId($block["ref_id"]);
502  }
503 
504  $ilCtrl->setParameter($this, "block_type", $block["type"]);
505  echo $ilCtrl->getHTML($block_gui);
506  exit;
507  }
508 
509  // count (moveable) blocks
510  if ($block["type"] != "pdfeedb"
511  && $block["type"] != "news") {
512  $i++;
513  } else {
514  $sum_moveable--;
515  }
516  }
517  echo "Error: ilColumnGUI::updateBlock: Block '" .
518  $this->request->getBlockId() . "' unknown.";
519  exit;
520  }
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 66 of file class.ilColumnGUI.php.

Referenced by getActionMenu(), and setActionMenu().

◆ $admincommands

bool ilColumnGUI::$admincommands = false
protected

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

Referenced by getAdminCommands().

◆ $block_property

array ilColumnGUI::$block_property = array()
protected

Definition at line 64 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",
)

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

◆ $blocks

array ilColumnGUI::$blocks = []
protected

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

◆ $browser

AgentDetermination ilColumnGUI::$browser
protected

Definition at line 52 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)

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

◆ $check_nr_limit

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

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

◆ $coltype

string ilColumnGUI::$coltype
protected

Definition at line 44 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 141 of file class.ilColumnGUI.php.

◆ $dash_side_panel_settings

ilDashboardSidePanelSettingsRepository ilColumnGUI::$dash_side_panel_settings
protected

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

◆ $default_blocks

array ilColumnGUI::$default_blocks
protected

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

◆ $enableedit

bool ilColumnGUI::$enableedit = false
protected

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

Referenced by getEnableEdit().

◆ $item_presentation

ItemPresentationManager ilColumnGUI::$item_presentation = null
protected

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

Referenced by getItemPresentationManager(), and setItemPresentationManager().

◆ $lng

ilLanguage ilColumnGUI::$lng
protected

Definition at line 49 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/",
)

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

◆ $rep_block_types

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

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

◆ $repositoryitems

array ilColumnGUI::$repositoryitems
protected

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

Referenced by getRepositoryItems().

◆ $repositorymode

bool ilColumnGUI::$repositorymode = false
protected

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

Referenced by getRepositoryMode().

◆ $request

ILIAS Block StandardGUIRequest ilColumnGUI::$request
protected

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

◆ $settings

ilSetting ilColumnGUI::$settings
protected

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

Referenced by exceededLimit(), and isGloballyActivated().

◆ $side

string ilColumnGUI::$side = IL_COL_RIGHT
protected

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

Referenced by determineBlocks(), and getSide().

◆ $tpl

ilTemplate ilColumnGUI::$tpl
protected

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

◆ $type

string ilColumnGUI::$type
protected

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

◆ $user

ilObjUser ilColumnGUI::$user
protected

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

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


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