ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables 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 ()
 
 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

string $coltype
 
ilDashboardSidePanelSettingsRepository $dash_side_panel_settings
 
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 $repositoryitems = array()
 
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 40 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 166 of file class.ilColumnGUI.php.

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

170  {
171  global $DIC;
172 
173  $this->ctrl = $DIC->ctrl();
174  $this->lng = $DIC->language();
175  $this->user = $DIC->user();
176  $this->browser = $DIC->http()->agent();
177  $this->settings = $DIC->settings();
178  $this->setColType($a_col_type);
179  $this->setSide($a_side);
180 
181  $block_service = new ILIAS\Block\Service($DIC);
182  $this->request = $block_service->internal()
183  ->gui()
184  ->standardRequest();
185 
186  $this->dash_side_panel_settings = new ilDashboardSidePanelSettingsRepository();
187  }
setSide(string $a_side)
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setColType(string $a_coltype)
+ Here is the call graph for this function:

Member Function Documentation

◆ activateBlock()

ilColumnGUI::activateBlock ( )

Activate hidden block.

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

References $ctrl, $ilUser, $user, and ilBlockSetting\_writeDetailLevel().

506  : void
507  {
509  $ilCtrl = $this->ctrl;
510 
511  if ($this->request->getBlock() != "") {
512  $block = explode("_", $this->request->getBlock());
513  ilBlockSetting::_writeDetailLevel($block[0], 2, $ilUser->getId(), $block[1]);
514  }
515 
516  $ilCtrl->returnToParent($this);
517  }
static _writeDetailLevel(string $a_type, string $a_value, int $a_user=0, int $a_block_id=0)
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:

◆ addBlock()

ilColumnGUI::addBlock ( )

Add a block.

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

References $ctrl, getAdminCommands(), getEnableEdit(), getRepositoryMode(), and ilCtrl\setCmdClass().

522  : string
523  {
524  $ilCtrl = $this->ctrl;
525 
526  $class = array_search($this->request->getBlockType(), self::$block_types);
527 
528  $ilCtrl->setCmdClass($class);
529  $ilCtrl->setCmd("create");
530  $block_gui = new $class();
531  $block_gui->setProperties($this->block_property[$this->request->getBlockType()]);
532  $block_gui->setRepositoryMode($this->getRepositoryMode());
533  $block_gui->setEnableEdit($this->getEnableEdit());
534  $block_gui->setAdminCommands($this->getAdminCommands());
535 
536  $ilCtrl->setParameter($this, "block_type", $this->request->getBlockType());
537  $html = $ilCtrl->forwardCommand($block_gui);
538  $ilCtrl->setParameter($this, "block_type", "");
539  return $html;
540  }
setCmdClass($a_cmd_class)
+ 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 192 of file class.ilColumnGUI.php.

References $path.

195  : void {
196  self::$locations[$className] = $path;
197  }
$path
Definition: ltiservices.php:32

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

207  : void {
208  self::$block_types[$className] = $identifier;
209  }

◆ determineBlocks()

ilColumnGUI::determineBlocks ( )

Determine which blocks to show.

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

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

Referenced by getHTML(), and updateBlock().

545  : void
546  {
548  $ilCtrl = $this->ctrl;
549 
550  $this->blocks[IL_COL_LEFT] = array();
551  $this->blocks[IL_COL_RIGHT] = array();
552  $this->blocks[IL_COL_CENTER] = array();
553 
554  $user_id = ($this->getColType() === "pd")
555  ? $ilUser->getId()
556  : 0;
557 
558  $def_nr = 1000;
559  if (isset($this->default_blocks[$this->getColType()])) {
560  foreach ($this->default_blocks[$this->getColType()] as $class => $def_side) {
561  $type = self::$block_types[$class];
562  if ($this->isGloballyActivated($type)) {
563  $nr = $def_nr++;
564 
565  // extra handling for system messages, feedback block and news
566  if ($type == "news") { // always show news first
567  $nr = -15;
568  }
569  if ($type == "cal") {
570  $nr = -8;
571  }
572  if ($type == "chcal") { // consultation hours always directly below calendar
573  $nr = -7;
574  }
575  if ($type == "pdfeedb") { // always show feedback request second
576  $nr = -10;
577  }
578  if ($type == "clsfct") { // mkunkel wants to have this on top
579  $nr = -16;
580  }
582  if (is_null($side) || $side === "") {
583  $side = $def_side;
584  }
585  if ($side == IL_COL_LEFT) {
587  }
588  $this->blocks[$side][] = array(
589  "nr" => $nr,
590  "class" => $class,
591  "type" => $type,
592  "id" => 0,
593  "custom" => false);
594  }
595  }
596  }
597 
598  if (!$this->getRepositoryMode()) {
599  $custom_block = new ilCustomBlock();
600  $custom_block->setContextObjId($ilCtrl->getContextObjId());
601  $custom_block->setContextObjType($ilCtrl->getContextObjType());
602  $c_blocks = $custom_block->queryBlocksForContext();
603 
604  foreach ($c_blocks as $c_block) {
605  $type = $c_block["type"];
606 
607  if ($this->isGloballyActivated($type)) {
608  $class = array_search($type, self::$block_types);
609  $nr = $def_nr++;
610  $side = ilBlockSetting::_lookupSide($type, $user_id, $c_block["id"]);
611  if (is_null($side)) {
613  }
614 
615  $this->blocks[$side][] = array(
616  "nr" => $nr,
617  "class" => $class,
618  "type" => $type,
619  "id" => $c_block["id"],
620  "custom" => true);
621  }
622  }
623  } else { // get all subitems
624  $rep_items = $this->getRepositoryItems();
625  foreach ($this->rep_block_types as $block_type) {
626  if ($this->isGloballyActivated($block_type)) {
627  if (!isset($rep_items[$block_type]) || !is_array($rep_items[$block_type])) {
628  continue;
629  }
630  foreach ($rep_items[$block_type] as $item) {
631  $costum_block = new ilCustomBlock();
632  $costum_block->setContextObjId((int) $item["obj_id"]);
633  $costum_block->setContextObjType($block_type);
634  $c_blocks = $costum_block->queryBlocksForContext();
635  $c_block = $c_blocks[0];
636 
637  $type = $block_type;
638  $class = array_search($type, self::$block_types);
639  $nr = $def_nr++;
640  $side = ilBlockSetting::_lookupSide($type, $user_id, (int) $c_block["id"]);
641  if ($side == false) {
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  "ref_id" => $item["ref_id"]);
652  }
653  }
654  }
655 
656  // repository object custom blocks
657  $custom_block = new ilCustomBlock();
658  $custom_block->setContextObjId($ilCtrl->getContextObjId());
659  $custom_block->setContextObjType($ilCtrl->getContextObjType());
660  $c_blocks = $custom_block->queryBlocksForContext(false); // get all sub-object types
661  foreach ($c_blocks as $c_block) {
662  $type = $c_block["type"];
663  $class = array_search($type, self::$block_types);
664 
665  if ($class) {
666  $nr = $def_nr++;
668 
669  $this->blocks[$side][] = array(
670  "nr" => $nr,
671  "class" => $class,
672  "type" => $type,
673  "id" => $c_block["id"],
674  "custom" => true);
675  }
676  }
677  }
678 
679  $this->blocks[IL_COL_LEFT] =
680  ilArrayUtil::sortArray($this->blocks[IL_COL_LEFT], "nr", "asc", true);
681  $this->blocks[IL_COL_RIGHT] =
682  ilArrayUtil::sortArray($this->blocks[IL_COL_RIGHT], "nr", "asc", true);
683  $this->blocks[IL_COL_CENTER] =
684  ilArrayUtil::sortArray($this->blocks[IL_COL_CENTER], "nr", "asc", true);
685  }
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...
$ilUser
Definition: imgupload.php:34
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 750 of file class.ilColumnGUI.php.

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

752  : bool {
754  $ilCtrl = $this->ctrl;
755 
756  if ($this->check_nr_limit[$a_type]) {
757  if (!$this->getRepositoryMode()) {
758  $costum_block = new ilCustomBlock();
759  $costum_block->setContextObjId($ilCtrl->getContextObjId());
760  $costum_block->setContextObjType($ilCtrl->getContextObjType());
761  $costum_block->setType($a_type);
762  $res = $costum_block->queryCntBlockForContext();
763  $cnt = (int) $res[0]["cnt"];
764  } else {
765  return false; // not implemented for repository yet
766  }
767 
768 
769  if ($ilSetting->get("block_limit_" . $a_type) > $cnt) {
770  return false;
771  } else {
772  return true;
773  }
774  }
775  return false;
776  }
$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:17
ilSetting $settings
+ Here is the call graph for this function:

◆ executeCommand()

ilColumnGUI::executeCommand ( )

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

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

344  : string
345  {
346  $ilCtrl = $this->ctrl;
347 
348  $ilCtrl->setParameter($this, "col_side", $this->getSide());
349 
350  $next_class = $ilCtrl->getNextClass();
351  $cmd = $ilCtrl->getCmd("getHTML");
352 
353  $cur_block_type = $this->request->getBlockType();
354 
355  if ($next_class != "") {
356  // forward to block
357  if ($gui_class = array_search($cur_block_type, self::$block_types)) {
358  $ilCtrl->setParameter($this, "block_type", $cur_block_type);
359  $block_gui = new $gui_class();
360  $block_gui->setProperties($this->block_property[$cur_block_type] ?? []);
361  $block_gui->setRepositoryMode($this->getRepositoryMode());
362  $block_gui->setEnableEdit($this->getEnableEdit());
363  $block_gui->setAdminCommands($this->getAdminCommands());
364 
365  if (in_array($gui_class, $this->custom_blocks[$this->getColType()]) ||
366  in_array($cur_block_type, $this->rep_block_types)) {
367  $block_class = substr($gui_class, 0, strlen($gui_class) - 3);
368  $app_block = new $block_class($this->request->getBlockId());
369  $block_gui->setBlock($app_block);
370  }
371  $html = $ilCtrl->forwardCommand($block_gui);
372  $ilCtrl->setParameter($this, "block_type", "");
373 
374  return $html;
375  }
376  } else {
377  return (string) $this->$cmd();
378  }
379  return "";
380  }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ getActionMenu()

ilColumnGUI::getActionMenu ( )

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

References $action_menu.

785  {
786  return $this->action_menu;
787  }
ilAdvancedSelectionListGUI $action_menu

◆ getAdminCommands()

ilColumnGUI::getAdminCommands ( )

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

References $admincommands.

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

277  : bool
278  {
279  return $this->admincommands;
280  }
+ Here is the caller graph for this function:

◆ getBlockProperties()

ilColumnGUI::getBlockProperties ( string  $a_block_type)

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

323  : array {
324  return $this->block_property[$a_block_type];
325  }

◆ getCmdSide()

static ilColumnGUI::getCmdSide ( )
static

Get Column Side of Current Command.

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

References $DIC.

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

214  : ?string
215  {
216  global $DIC;
217 
218  $block_service = new ILIAS\Block\Service($DIC);
219  $request = $block_service->internal()
220  ->gui()
221  ->standardRequest();
222  return $request->getColSide();
223  }
global $DIC
Definition: feed.php:28
ILIAS Block StandardGUIRequest $request
+ Here is the caller graph for this function:

◆ getColType()

ilColumnGUI::getColType ( )

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

References $coltype.

Referenced by determineBlocks(), and executeCommand().

233  : string
234  {
235  return $this->coltype;
236  }
+ Here is the caller graph for this function:

◆ getEnableEdit()

ilColumnGUI::getEnableEdit ( )

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

References $enableedit.

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

256  : bool
257  {
258  return $this->enableedit;
259  }
+ Here is the caller graph for this function:

◆ getHTML()

ilColumnGUI::getHTML ( )

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

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

382  : string
383  {
384  $ilCtrl = $this->ctrl;
385 
386  $ilCtrl->setParameter($this, "col_side", $this->getSide());
387 
388  $this->tpl = new ilTemplate("tpl.column.html", true, true, "Services/Block");
389  $this->determineBlocks();
390  $this->showBlocks();
391  return $this->tpl->get();
392  }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
determineBlocks()
Determine which blocks to show.
+ Here is the call graph for this function:

◆ getRepositoryItems()

ilColumnGUI::getRepositoryItems ( )

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

References $repositoryitems.

Referenced by determineBlocks().

339  : array
340  {
341  return $this->repositoryitems;
342  }
+ Here is the caller graph for this function:

◆ getRepositoryMode()

ilColumnGUI::getRepositoryMode ( )

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

References $repositorymode.

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

267  : bool
268  {
269  return $this->repositorymode;
270  }
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilColumnGUI::getScreenMode ( )
static

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

References $DIC, IL_SCREEN_CENTER, and IL_SCREEN_SIDE.

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

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

References $side.

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

246  : string
247  {
248  return $this->side;
249  }
+ 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 690 of file class.ilColumnGUI.php.

References $ctrl, $GLOBALS, $ilSetting, $settings, ilCalendarSettings\_getInstance(), ilContainer\_lookupContainerSetting(), ilCalendarSettings\lookupCalendarContentPresentationEnabled(), and ilObjectServiceSettingsGUI\USE_NEWS.

Referenced by determineBlocks().

692  : bool {
694  $ilCtrl = $this->ctrl;
695 
696  if ($a_type == 'pdfeed') {
697  return false;
698  }
699 
700  if (isset($this->check_global_activation[$a_type]) && $this->check_global_activation[$a_type]) {
701  if ($a_type == 'pdnews') {
702  return ($this->dash_side_panel_settings->isEnabled($this->dash_side_panel_settings::NEWS) &&
703  $ilSetting->get('block_activated_news'));
704  } elseif ($a_type == 'pdmail') {
705  return $this->dash_side_panel_settings->isEnabled($this->dash_side_panel_settings::MAIL);
706  } elseif ($a_type == 'pdtasks') {
707  return $this->dash_side_panel_settings->isEnabled($this->dash_side_panel_settings::TASKS);
708  } elseif ($a_type == 'news') {
709  return
710  $ilSetting->get('block_activated_news') &&
711 
712  (!in_array($ilCtrl->getContextObjType(), ["grp", "crs"]) ||
714  $GLOBALS['ilCtrl']->getContextObjId(),
716  "1"
717  )) &&
719  $GLOBALS['ilCtrl']->getContextObjId(),
720  'cont_show_news',
721  "1"
722  );
723  } elseif ($ilSetting->get("block_activated_" . $a_type)) {
724  return true;
725  } elseif ($a_type == 'cal' || $a_type == 'chcal') {
726  return ilCalendarSettings::lookupCalendarContentPresentationEnabled($ilCtrl->getContextObjId());
727  } elseif ($a_type == 'pdcal') {
728  if (!$this->dash_side_panel_settings->isEnabled($this->dash_side_panel_settings::CALENDAR)) {
729  return false;
730  }
731  return ilCalendarSettings::_getInstance()->isEnabled();
732  } elseif ($a_type == "tagcld") {
733  $tags_active = new ilSetting("tags");
734  return (bool) $tags_active->get("enable", "0");
735  } elseif ($a_type == "clsfct") {
736  if ($ilCtrl->getContextObjType() == "cat") { // taxonomy presentation in classification block
737  return true;
738  }
739  $tags_active = new ilSetting("tags"); // tags presentation in classification block
740  return (bool) $tags_active->get("enable", "0");
741  }
742  return false;
743  }
744  return true;
745  }
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static lookupCalendarContentPresentationEnabled(int $obj_id)
global $ilSetting
Definition: privfeed.php:17
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 778 of file class.ilColumnGUI.php.

References $action_menu.

Referenced by ilDashboardGUI\initColumn().

780  : void {
781  $this->action_menu = $action_menu;
782  }
ilAdvancedSelectionListGUI $action_menu
+ Here is the caller graph for this function:

◆ setAdminCommands()

ilColumnGUI::setAdminCommands ( bool  $a_admincommands)

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

Referenced by ilContainerGUI\setColumnSettings().

272  : void
273  {
274  $this->admincommands = $a_admincommands;
275  }
+ Here is the caller graph for this function:

◆ setAllBlockProperties()

ilColumnGUI::setAllBlockProperties ( array  $a_block_properties)

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

Referenced by ilInfoScreenGUI\setColumnSettings().

329  : void {
330  $this->block_property = $a_block_properties;
331  }
+ 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 313 of file class.ilColumnGUI.php.

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

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

◆ setColType()

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

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

Referenced by __construct().

228  : void
229  {
230  $this->coltype = $a_coltype;
231  }
+ Here is the caller graph for this function:

◆ setEnableEdit()

ilColumnGUI::setEnableEdit ( bool  $a_enableedit)

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

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

251  : void
252  {
253  $this->enableedit = $a_enableedit;
254  }
+ Here is the caller graph for this function:

◆ setRepositoryItems()

ilColumnGUI::setRepositoryItems ( array  $a_repositoryitems)

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

Referenced by ilContainerGUI\setColumnSettings().

335  : void {
336  $this->repositoryitems = $a_repositoryitems;
337  }
+ Here is the caller graph for this function:

◆ setRepositoryMode()

ilColumnGUI::setRepositoryMode ( bool  $a_repositorymode)

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

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

263  : void {
264  $this->repositorymode = $a_repositorymode;
265  }
+ 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 241 of file class.ilColumnGUI.php.

Referenced by __construct().

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

◆ showBlocks()

ilColumnGUI::showBlocks ( )

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

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

Referenced by getHTML().

394  : void
395  {
396  $ilCtrl = $this->ctrl;
398 
399  $i = 1;
400  $sum_moveable = count($this->blocks[$this->getSide()]);
401 
402  foreach ($this->blocks[$this->getSide()] as $block) {
403  $gui_class = $block["class"] ?? null;
404  if (!is_string($gui_class)) {
405  continue;
406  }
407  $block_class = substr($gui_class, 0, strlen($gui_class) - 3);
408 
409  // get block gui class
410  $block_gui = new $gui_class();
411  if (isset($this->block_property[$block["type"]])) {
412  $block_gui->setProperties($this->block_property[$block["type"]]);
413  }
414  $block_gui->setRepositoryMode($this->getRepositoryMode());
415  $block_gui->setEnableEdit($this->getEnableEdit());
416  $block_gui->setAdminCommands($this->getAdminCommands());
417 
418  // get block for custom blocks
419  if ($block["custom"]) {
420  $path = "./" . self::$locations[$gui_class] . "classes/" .
421  "class." . $block_class . ".php";
422  if (file_exists($path)) {
423  $app_block = new $block_class((int) $block["id"]);
424  } else {
425  // we only need generic block
426  $app_block = new ilCustomBlock((int) $block["id"]);
427  }
428  $block_gui->setBlock($app_block);
429  if (isset($block["ref_id"])) {
430  $block_gui->setRefId((int) $block["ref_id"]);
431  }
432  }
433 
434  $ilCtrl->setParameter($this, "block_type", $block_gui->getBlockType());
435  $this->tpl->setCurrentBlock("col_block");
436 
437  $html = $ilCtrl->getHTML($block_gui);
438 
439  // don't render a block if it's empty
440  if ($html != "") {
441  $this->tpl->setVariable("BLOCK", $html);
442  $this->tpl->parseCurrentBlock();
443  $ilCtrl->setParameter($this, "block_type", "");
444  }
445  }
446  }
$path
Definition: ltiservices.php:32
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ilUser
Definition: imgupload.php:34
$i
Definition: metadata.php:41
+ 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 452 of file class.ilColumnGUI.php.

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

452  : void
453  {
454  $ilCtrl = $this->ctrl;
455 
456  $this->determineBlocks();
457  $i = 1;
458  $sum_moveable = count($this->blocks[$this->getSide()]);
459 
460  foreach ($this->blocks[$this->getSide()] as $block) {
461 
462  // set block id to context obj id,
463  // if block is not a custom block and context is not personal desktop
464  if (!$block["custom"] && $ilCtrl->getContextObjType() != "" && $ilCtrl->getContextObjType() != "user") {
465  $block["id"] = $ilCtrl->getContextObjId();
466  }
467 
468  if ($this->request->getBlockId() == "block_" . $block["type"] . "_" . $block["id"]) {
469  $gui_class = $block["class"];
470  $block_class = substr($block["class"], 0, strlen($block["class"]) - 3);
471 
472  $block_gui = new $gui_class();
473  $block_gui->setProperties($this->block_property[$block["type"]]);
474  $block_gui->setRepositoryMode($this->getRepositoryMode());
475  $block_gui->setEnableEdit($this->getEnableEdit());
476  $block_gui->setAdminCommands($this->getAdminCommands());
477 
478  // get block for custom blocks
479  if ($block["custom"]) {
480  $app_block = new $block_class($block["id"]);
481  $block_gui->setBlock($app_block);
482  $block_gui->setRefId($block["ref_id"]);
483  }
484 
485  $ilCtrl->setParameter($this, "block_type", $block["type"]);
486  echo $ilCtrl->getHTML($block_gui);
487  exit;
488  }
489 
490  // count (moveable) blocks
491  if ($block["type"] != "pdfeedb"
492  && $block["type"] != "news") {
493  $i++;
494  } else {
495  $sum_moveable--;
496  }
497  }
498  echo "Error: ilColumnGUI::updateBlock: Block '" .
499  $this->request->getBlockId() . "' unknown.";
500  exit;
501  }
exit
Definition: login.php:28
determineBlocks()
Determine which blocks to show.
$i
Definition: metadata.php:41
+ 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" => "pdmail",
"ilPDTasksBlockGUI" => "pdtasks",
"ilPDNewsBlockGUI" => "pdnews",
"ilNewsForContextBlockGUI" => "news",
"ilCalendarBlockGUI" => "cal",
"ilPDCalendarBlockGUI" => "pdcal",
"ilConsultationHoursCalendarBlockGUI" => "chcal",
"ilPDSelectedItemsBlockGUI" => "pditems",
'ilPollBlockGUI' => 'poll',
'ilClassificationBlockGUI' => 'clsfct',
"ilPDStudyProgrammeSimpleListGUI" => "prgsimplelist",
"ilPDStudyProgrammeExpandableListGUI" => "prgexpandablelist",
)

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

◆ $check_global_activation

array ilColumnGUI::$check_global_activation
protected
Initial value:
=
array("news" => true,
"cal" => true,
"pdcal" => true,
"chcal" => true,
"pdnews" => true,
"pdtag" => true,
"pdmail" => true,
"pdtasks" => true,
"tagcld" => true,
"clsfct" => true)

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

◆ $check_nr_limit

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

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

◆ $coltype

string ilColumnGUI::$coltype
protected

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

◆ $dash_side_panel_settings

ilDashboardSidePanelSettingsRepository ilColumnGUI::$dash_side_panel_settings
protected

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

◆ $default_blocks

array ilColumnGUI::$default_blocks
protected

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

◆ $enableedit

bool ilColumnGUI::$enableedit = false
protected

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

Referenced by getEnableEdit().

◆ $lng

ilLanguage ilColumnGUI::$lng
protected

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

◆ $locations

array ilColumnGUI::$locations
staticprotected
Initial value:
= array(
"ilNewsForContextBlockGUI" => "Services/News/",
"ilCalendarBlockGUI" => "Services/Calendar/",
"ilPDCalendarBlockGUI" => "Services/Calendar/",
"ilConsultationHoursCalendarBlockGUI" => "Services/Calendar/",
"ilPDTasksBlockGUI" => "Services/Tasks/",
"ilPDMailBlockGUI" => "Services/Mail/",
"ilPDSelectedItemsBlockGUI" => "Services/Dashboard/ItemsBlock/",
"ilPDNewsBlockGUI" => "Services/News/",
'ilPollBlockGUI' => 'Modules/Poll/',
'ilClassificationBlockGUI' => 'Services/Classification/',
"ilPDStudyProgrammeSimpleListGUI" => "Modules/StudyProgramme/",
"ilPDStudyProgrammeExpandableListGUI" => "Modules/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 = array()
protected

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

Referenced by getRepositoryItems().

◆ $repositorymode

bool ilColumnGUI::$repositorymode = false
protected

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

Referenced by getRepositoryMode().

◆ $request

ILIAS Block StandardGUIRequest ilColumnGUI::$request
protected

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

◆ $settings

ilSetting ilColumnGUI::$settings
protected

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

Referenced by exceededLimit(), and isGloballyActivated().

◆ $side

string ilColumnGUI::$side = IL_COL_RIGHT
protected

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

Referenced by determineBlocks(), and getSide().

◆ $tpl

ilTemplate ilColumnGUI::$tpl
protected

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

◆ $type

string ilColumnGUI::$type
protected

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

◆ $user

ilObjUser ilColumnGUI::$user
protected

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

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


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