ILIAS  release_7 Revision v7.30-3-g800a261c036
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 ($a_col_type="", $a_side="", $use_std_context=false)
 Constructor. More...
 
 setColType ($a_coltype)
 Set Column Type. More...
 
 getColType ()
 Get Column Type. More...
 
 setSide ($a_side)
 Set Side IL_COL_LEFT | IL_COL_RIGHT. More...
 
 getSide ()
 Get Side IL_COL_LEFT | IL_COL_RIGHT. More...
 
 setEnableEdit ($a_enableedit)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode. More...
 
 getRepositoryMode ()
 Get RepositoryMode. More...
 
 setAdminCommands ($a_admincommands)
 Set Administration Commmands. More...
 
 getAdminCommands ()
 Get Administration Commmands. More...
 
 setBlockProperty ($a_block_type, $a_property, $a_value)
 This function is supposed to be used for block type specific properties, that should be passed to ilBlockGUI->setProperty. More...
 
 getBlockProperties ($a_block_type)
 
 setAllBlockProperties ($a_block_properties)
 
 setRepositoryItems ($a_repositoryitems)
 Set Repository Items. More...
 
 getRepositoryItems ()
 Get Repository Items. More...
 
 executeCommand ()
 execute command More...
 
 getHTML ()
 Get HTML for column. More...
 
 showBlocks ()
 Show blocks. More...
 
 updateBlock ()
 Update Block (asynchronous) More...
 
 activateBlock ()
 Activate hidden block. More...
 
 addBlock ()
 Add a block. More...
 
 determineBlocks ()
 Determine which blocks to show. More...
 
 setActionMenu ($action_menu)
 
 getActionMenu ()
 

Static Public Member Functions

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

Protected Member Functions

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

Protected Attributes

 $ctrl
 
 $lng
 
 $user
 
 $tpl
 
 $browser
 
 $settings
 
 $side = IL_COL_RIGHT
 
 $type
 
 $enableedit = false
 
 $repositorymode = false
 
 $repositoryitems = array()
 
 $rep_block_types = array("feed","poll")
 
 $block_property = array()
 
 $admincommands = false
 
 $action_menu
 
 $default_blocks
 
 $custom_blocks
 
 $check_global_activation
 
 $check_nr_limit
 

Static Protected Attributes

static $locations
 
static $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
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

ilColumnGUI: ilCalendarGUI ilColumnGUI:

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters

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

References $DIC, setColType(), setSide(), settings(), and user().

181  {
182  global $DIC;
183 
184  $this->ctrl = $DIC->ctrl();
185  $this->lng = $DIC->language();
186  $this->user = $DIC->user();
187  $this->tpl = $DIC["tpl"];
188  $this->browser = $DIC["ilBrowser"];
189  $this->settings = $DIC->settings();
190  $this->setColType($a_col_type);
191  $this->setSide($a_side);
192 
193  $this->dash_side_panel_settings = new ilDashboardSidePanelSettingsRepository();
194  }
settings()
Definition: settings.php:2
setColType($a_coltype)
Set Column Type.
user()
Definition: user.php:4
global $DIC
Definition: goto.php:24
setSide($a_side)
Set Side IL_COL_LEFT | IL_COL_RIGHT.
+ Here is the call graph for this function:

Member Function Documentation

◆ activateBlock()

ilColumnGUI::activateBlock ( )

Activate hidden block.

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

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

703  {
705  $ilCtrl = $this->ctrl;
706 
707  if ($_GET["block"] != "") {
708  $block = explode("_", $_GET["block"]);
709  include_once("Services/Block/classes/class.ilBlockSetting.php");
710  ilBlockSetting::_writeDetailLevel($block[0], 2, $ilUser->getId(), $block[1]);
711  }
712 
713  $ilCtrl->returnToParent($this);
714  }
static _writeDetailLevel($a_type, $a_value, $a_user=0, $a_block_id=0)
Write detail level to database.
$_GET["client_id"]
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ addBlock()

ilColumnGUI::addBlock ( )

Add a block.

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

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

720  {
721  $ilCtrl = $this->ctrl;
722 
723  $class = array_search($_GET["block_type"], self::$block_types);
724 
725  $ilCtrl->setCmdClass($class);
726  $ilCtrl->setCmd("create");
727  include_once("./" . self::$locations[$class] . "classes/class." . $class . ".php");
728  $block_gui = new $class();
729  $block_gui->setProperties($this->block_property[$_GET["block_type"]]);
730  $block_gui->setRepositoryMode($this->getRepositoryMode());
731  $block_gui->setEnableEdit($this->getEnableEdit());
732  $block_gui->setAdminCommands($this->getAdminCommands());
733 
734  $ilCtrl->setParameter($this, "block_type", $_GET["block_type"]);
735  $html = $ilCtrl->forwardCommand($block_gui);
736  $ilCtrl->setParameter($this, "block_type", "");
737  return $html;
738  }
getAdminCommands()
Get Administration Commmands.
$_GET["client_id"]
getEnableEdit()
Get EnableEdit.
getRepositoryMode()
Get RepositoryMode.
+ Here is the call graph for this function:

◆ addCustomBlockLocation()

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

Adds location information of the custom block gui.

public

Parameters
stringThe name of the custom block gui class
stringThe path of the custom block gui class

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

207  {
208  self::$locations[$className] = $path;
209  }

◆ addCustomBlockType()

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

Adds the block type of the custom block gui.

public

Parameters
stringThe name of the custom block gui class
stringThe identifier (block type) of the custom block gui

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

222  {
223  self::$block_types[$className] = $identifier;
224  }

◆ determineBlocks()

ilColumnGUI::determineBlocks ( )

Determine which blocks to show.

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

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

Referenced by getHTML(), and updateBlock().

744  {
746  $ilCtrl = $this->ctrl;
748 
749  include_once("./Services/Block/classes/class.ilBlockSetting.php");
750  $this->blocks[IL_COL_LEFT] = array();
751  $this->blocks[IL_COL_RIGHT] = array();
752  $this->blocks[IL_COL_CENTER] = array();
753 
754  $user_id = ($this->getColType() == "pd")
755  ? $ilUser->getId()
756  : 0;
757 
758  $def_nr = 1000;
759  if (is_array($this->default_blocks[$this->getColType()])) {
760  foreach ($this->default_blocks[$this->getColType()] as $class => $def_side) {
761  $type = self::$block_types[$class];
762 
763  if ($this->isGloballyActivated($type)) {
764  $nr = $def_nr++;
765 
766  // extra handling for system messages, feedback block and news
767  if ($type == "news") { // always show news first
768  $nr = -15;
769  }
770  if ($type == "cal") {
771  $nr = -8;
772  }
773  if ($type == "chcal") { // consultation hours always directly below calendar
774  $nr = -7;
775  }
776  if ($type == "pdfeedb") { // always show feedback request second
777  $nr = -10;
778  }
779  if ($type == "clsfct") { // mkunkel wants to have this on top
780  $nr = -16;
781  }
783  if ($side === false) {
784  $side = $def_side;
785  }
786  if ($side == IL_COL_LEFT) {
788  }
789 
790  $this->blocks[$side][] = array(
791  "nr" => $nr,
792  "class" => $class,
793  "type" => $type,
794  "id" => 0,
795  "custom" => false);
796  }
797  }
798  }
799 
800  if (!$this->getRepositoryMode()) {
801  include_once("./Services/Block/classes/class.ilCustomBlock.php");
802  $custom_block = new ilCustomBlock();
803  $custom_block->setContextObjId($ilCtrl->getContextObjId());
804  $custom_block->setContextObjType($ilCtrl->getContextObjType());
805  $c_blocks = $custom_block->queryBlocksForContext();
806 
807  foreach ($c_blocks as $c_block) {
808  $type = $c_block["type"];
809 
810  if ($this->isGloballyActivated($type)) {
811  $class = array_search($type, self::$block_types);
812  $nr = $def_nr++;
813  $side = ilBlockSetting::_lookupSide($type, $user_id, $c_block["id"]);
814  if ($side === false) {
816  }
817 
818  $this->blocks[$side][] = array(
819  "nr" => $nr,
820  "class" => $class,
821  "type" => $type,
822  "id" => $c_block["id"],
823  "custom" => true);
824  }
825  }
826  } else { // get all subitems
827  include_once("./Services/Block/classes/class.ilCustomBlock.php");
828  $rep_items = $this->getRepositoryItems();
829 
830  foreach ($this->rep_block_types as $block_type) {
831  if ($this->isGloballyActivated($block_type)) {
832  if (!is_array($rep_items[$block_type])) {
833  continue;
834  }
835  foreach ($rep_items[$block_type] as $item) {
836  $costum_block = new ilCustomBlock();
837  $costum_block->setContextObjId($item["obj_id"]);
838  $costum_block->setContextObjType($block_type);
839  $c_blocks = $costum_block->queryBlocksForContext();
840  $c_block = $c_blocks[0];
841 
842  $type = $block_type;
843  $class = array_search($type, self::$block_types);
844  $nr = $def_nr++;
845  $side = ilBlockSetting::_lookupSide($type, $user_id, $c_block["id"]);
846  if ($side === false) {
848  }
849 
850  $this->blocks[$side][] = array(
851  "nr" => $nr,
852  "class" => $class,
853  "type" => $type,
854  "id" => $c_block["id"],
855  "custom" => true,
856  "ref_id" => $item["ref_id"]);
857  }
858  }
859  }
860 
861  // repository object custom blocks
862  include_once("./Services/Block/classes/class.ilCustomBlock.php");
863  $custom_block = new ilCustomBlock();
864  $custom_block->setContextObjId($ilCtrl->getContextObjId());
865  $custom_block->setContextObjType($ilCtrl->getContextObjType());
866  $c_blocks = $custom_block->queryBlocksForContext(false); // get all sub-object types
867 
868  foreach ($c_blocks as $c_block) {
869  $type = $c_block["type"];
870  $class = array_search($type, self::$block_types);
871 
872  if ($class) {
873  $nr = $def_nr++;
875 
876  $this->blocks[$side][] = array(
877  "nr" => $nr,
878  "class" => $class,
879  "type" => $type,
880  "id" => $c_block["id"],
881  "custom" => true);
882  }
883  }
884  }
885 
886 
887  $this->blocks[IL_COL_LEFT] =
888  ilUtil::sortArray($this->blocks[IL_COL_LEFT], "nr", "asc", true);
889  $this->blocks[IL_COL_RIGHT] =
890  ilUtil::sortArray($this->blocks[IL_COL_RIGHT], "nr", "asc", true);
891  $this->blocks[IL_COL_CENTER] =
892  ilUtil::sortArray($this->blocks[IL_COL_CENTER], "nr", "asc", true);
893  }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
const IL_COL_CENTER
const IL_COL_RIGHT
getRepositoryItems()
Get Repository Items.
static _lookupSide($a_type, $a_user=0, $a_block_id=0)
Lookup side.
This is the super class of all custom blocks.
global $ilSetting
Definition: privfeed.php:17
$ilUser
Definition: imgupload.php:18
getRepositoryMode()
Get RepositoryMode.
isGloballyActivated($a_type)
Check whether a block type is globally activated.
getColType()
Get Column Type.
const IL_COL_LEFT
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exceededLimit()

ilColumnGUI::exceededLimit (   $a_type)
protected

Check whether limit is not exceeded.

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

References $_POST, $ctrl, $i, $ilSetting, $ilUser, $res, $response, $settings, $side, $user, ilBlockSetting\_writeNumber(), ilBlockSetting\_writeSide(), exit, getColType(), getRepositoryMode(), IL_COL_LEFT, and IL_COL_RIGHT.

Referenced by showBlocks().

960  {
962  $ilCtrl = $this->ctrl;
963 
964  if ($this->check_nr_limit[$a_type]) {
965  if (!$this->getRepositoryMode()) {
966  include_once("./Services/Block/classes/class.ilCustomBlock.php");
967  $costum_block = new ilCustomBlock();
968  $costum_block->setContextObjId($ilCtrl->getContextObjId());
969  $costum_block->setContextObjType($ilCtrl->getContextObjType());
970  $costum_block->setType($a_type);
971  $res = $costum_block->queryCntBlockForContext();
972  $cnt = (int) $res[0]["cnt"];
973  } else {
974  return false; // not implemented for repository yet
975  }
976 
977 
978  if ($ilSetting->get("block_limit_" . $a_type) > $cnt) {
979  return false;
980  } else {
981  return true;
982  }
983  }
984  return false;
985  }
foreach($_POST as $key=> $value) $res
This is the super class of all custom blocks.
global $ilSetting
Definition: privfeed.php:17
getRepositoryMode()
Get RepositoryMode.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilColumnGUI::executeCommand ( )

execute command

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

References $_GET, $_POST, $ctrl, getAdminCommands(), getColType(), getEnableEdit(), getRepositoryMode(), and getSide().

414  {
415  $ilCtrl = $this->ctrl;
416 
417  $ilCtrl->setParameter($this, "col_side", $this->getSide());
418  //$ilCtrl->saveParameter($this, "col_side");
419 
420  $next_class = $ilCtrl->getNextClass();
421  $cmd = $ilCtrl->getCmd("getHTML");
422 
423  $cur_block_type = ($_GET["block_type"])
424  ? $_GET["block_type"]
425  : $_POST["block_type"];
426 
427  if ($next_class != "") {
428  // forward to block
429  if ($gui_class = array_search($cur_block_type, self::$block_types)) {
430  include_once("./" . self::$locations[$gui_class] . "classes/" .
431  "class." . $gui_class . ".php");
432  $ilCtrl->setParameter($this, "block_type", $cur_block_type);
433  $block_gui = new $gui_class();
434  $block_gui->setProperties($this->block_property[$cur_block_type]);
435  $block_gui->setRepositoryMode($this->getRepositoryMode());
436  $block_gui->setEnableEdit($this->getEnableEdit());
437  $block_gui->setAdminCommands($this->getAdminCommands());
438 
439  if (in_array($gui_class, $this->custom_blocks[$this->getColType()]) ||
440  in_array($cur_block_type, $this->rep_block_types)) {
441  $block_class = substr($gui_class, 0, strlen($gui_class) - 3);
442  include_once("./" . self::$locations[$gui_class] . "classes/" .
443  "class." . $block_class . ".php");
444  $app_block = new $block_class($_GET["block_id"]);
445  $block_gui->setBlock($app_block);
446  }
447  $html = $ilCtrl->forwardCommand($block_gui);
448  $ilCtrl->setParameter($this, "block_type", "");
449 
450  return $html;
451  }
452  } else {
453  return $this->$cmd();
454  }
455  }
getAdminCommands()
Get Administration Commmands.
$_GET["client_id"]
getSide()
Get Side IL_COL_LEFT | IL_COL_RIGHT.
getEnableEdit()
Get EnableEdit.
getRepositoryMode()
Get RepositoryMode.
$_POST["username"]
getColType()
Get Column Type.
+ Here is the call graph for this function:

◆ getActionMenu()

ilColumnGUI::getActionMenu ( )
Returns

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

References $action_menu.

1038  {
1039  return $this->action_menu;
1040  }

◆ getAdminCommands()

ilColumnGUI::getAdminCommands ( )

Get Administration Commmands.

Returns
boolean Administration Commmands

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

References $admincommands.

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

332  {
333  return $this->admincommands;
334  }
+ Here is the caller graph for this function:

◆ getBlockProperties()

ilColumnGUI::getBlockProperties (   $a_block_type)

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

381  {
382  return $this->block_property[$a_block_type];
383  }

◆ getCmdSide()

static ilColumnGUI::getCmdSide ( )
static

Get Column Side of Current Command.

Returns
string Column Side

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

References $_GET.

Referenced by ilContainerContentGUI\__forwardToColumnGUI(), ilCourseContentGUI\__forwardToColumnGUI(), and ilObjectGUI\getCenterColumnHTML().

232  {
233  return $_GET["col_side"];
234  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ getColType()

ilColumnGUI::getColType ( )

Get Column Type.

Returns
string Column Type

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

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

252  {
253  return $this->coltype;
254  }
+ Here is the caller graph for this function:

◆ getEnableEdit()

ilColumnGUI::getEnableEdit ( )

Get EnableEdit.

Returns
boolean EnableEdit

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

References $enableedit.

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

292  {
293  return $this->enableedit;
294  }
+ Here is the caller graph for this function:

◆ getHTML()

ilColumnGUI::getHTML ( )

Get HTML for column.

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

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

461  {
462  $ilCtrl = $this->ctrl;
463 
464  $ilCtrl->setParameter($this, "col_side", $this->getSide());
465 
466  $this->tpl = new ilTemplate("tpl.column.html", true, true, "Services/Block");
467  $this->determineBlocks();
468  $this->showBlocks();
469 
470  if ($this->getEnableEdit() || !$this->getRepositoryMode()) {
471  $this->addHiddenBlockSelector();
472  }
473 
474  return $this->tpl->get();
475  }
getSide()
Get Side IL_COL_LEFT | IL_COL_RIGHT.
getEnableEdit()
Get EnableEdit.
showBlocks()
Show blocks.
getRepositoryMode()
Get RepositoryMode.
determineBlocks()
Determine which blocks to show.
+ Here is the call graph for this function:

◆ getRepositoryItems()

ilColumnGUI::getRepositoryItems ( )

Get Repository Items.

Returns
array Repository Items

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

References $repositoryitems.

Referenced by determineBlocks().

406  {
407  return $this->repositoryitems;
408  }
+ Here is the caller graph for this function:

◆ getRepositoryMode()

ilColumnGUI::getRepositoryMode ( )

Get RepositoryMode.

Returns
boolean RepositoryMode

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

References $repositorymode.

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

312  {
313  return $this->repositorymode;
314  }
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilColumnGUI::getScreenMode ( )
static

Get Screen Mode for current command.

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

References $_GET, $_POST, $DIC, IL_SCREEN_CENTER, and IL_SCREEN_SIDE.

Referenced by ilContainerContentGUI\__forwardToColumnGUI(), ilCourseContentGUI\__forwardToColumnGUI(), and ilObjectGUI\getCenterColumnHTML().

340  {
341  global $DIC;
342 
343  $ilCtrl = $DIC->ctrl();
344 
345  if ($ilCtrl->getCmdClass() == "ilcolumngui") {
346  switch ($ilCtrl->getCmd()) {
347  case "addBlock":
348  return IL_SCREEN_CENTER;
349  }
350  }
351 
352  $cur_block_type = "";
353  if (isset($_GET["block_type"]) && $_GET["block_type"]) {
354  $cur_block_type = $_GET["block_type"];
355  } elseif (isset($_POST["block_type"])) {
356  $cur_block_type = $_POST["block_type"];
357  }
358 
359  if ($class = array_search($cur_block_type, self::$block_types)) {
360  include_once("./" . self::$locations[$class] . "classes/" .
361  "class." . $class . ".php");
362  return call_user_func(array($class, 'getScreenMode'));
363  }
364 
365  return IL_SCREEN_SIDE;
366  }
$_GET["client_id"]
global $DIC
Definition: goto.php:24
const IL_SCREEN_CENTER
const IL_SCREEN_SIDE
$_POST["username"]
+ Here is the caller graph for this function:

◆ getSide()

ilColumnGUI::getSide ( )

Get Side IL_COL_LEFT | IL_COL_RIGHT.

Returns
string Side IL_COL_LEFT | IL_COL_RIGHT

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

References $side.

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

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

◆ isGloballyActivated()

ilColumnGUI::isGloballyActivated (   $a_type)
protected

Check whether a block type is globally activated.

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

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

Referenced by determineBlocks(), and showBlocks().

899  {
901  $ilCtrl = $this->ctrl;
902 
903  if ($a_type == 'pdfeed') {
904  return false;
905  }
906 
907  if (isset($this->check_global_activation[$a_type]) && $this->check_global_activation[$a_type]) {
908  if ($a_type == 'pdnews') {
909  return ($this->dash_side_panel_settings->isEnabled($this->dash_side_panel_settings::NEWS) &&
910  $ilSetting->get('block_activated_news'));
911  } elseif ($a_type == 'pdmail') {
912  return $this->dash_side_panel_settings->isEnabled($this->dash_side_panel_settings::MAIL);
913  } elseif ($a_type == 'pdtasks') {
914  return $this->dash_side_panel_settings->isEnabled($this->dash_side_panel_settings::TASKS);
915  } elseif ($a_type == 'news') {
916  include_once 'Services/Container/classes/class.ilContainer.php';
917  return
918  $ilSetting->get('block_activated_news') &&
919 
920  (!in_array($ilCtrl->getContextObjType(), ["grp", "crs"]) ||
922  $GLOBALS['ilCtrl']->getContextObjId(),
924  true
925  )) &&
927  $GLOBALS['ilCtrl']->getContextObjId(),
928  'cont_show_news',
929  true
930  );
931  } elseif ($ilSetting->get("block_activated_" . $a_type)) {
932  return true;
933  } elseif ($a_type == 'cal' || $a_type == 'chcal') {
934  return ilCalendarSettings::lookupCalendarContentPresentationEnabled($ilCtrl->getContextObjId());
935  } elseif ($a_type == 'pdcal') {
936  if (!$this->dash_side_panel_settings->isEnabled($this->dash_side_panel_settings::CALENDAR)) {
937  return false;
938  }
939  include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
940  return ilCalendarSettings::_getInstance()->isEnabled();
941  } elseif ($a_type == "tagcld") {
942  $tags_active = new ilSetting("tags");
943  return (bool) $tags_active->get("enable", false);
944  } elseif ($a_type == "clsfct") {
945  if ($ilCtrl->getContextObjType() == "cat") { // taxonomy presentation in classification block
946  return true;
947  }
948  $tags_active = new ilSetting("tags"); // tags presentation in classification block
949  return (bool) $tags_active->get("enable", false);
950  }
951  return false;
952  }
953  return true;
954  }
static _getInstance()
get singleton instance
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static lookupCalendarContentPresentationEnabled(int $obj_id)
global $ilSetting
Definition: privfeed.php:17
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setActionMenu()

ilColumnGUI::setActionMenu (   $action_menu)
Parameters
\ilAdvancedSelectionListGUI$action_menu
Returns
ilColumnGUI

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

References $action_menu.

1029  {
1030  $this->action_menu = $action_menu;
1031  return $this;
1032  }

◆ setAdminCommands()

ilColumnGUI::setAdminCommands (   $a_admincommands)

Set Administration Commmands.

Parameters
boolean$a_admincommandsAdministration Commmands

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

Referenced by ilContainerGUI\setColumnSettings().

322  {
323  $this->admincommands = $a_admincommands;
324  }
+ Here is the caller graph for this function:

◆ setAllBlockProperties()

ilColumnGUI::setAllBlockProperties (   $a_block_properties)

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

386  {
387  $this->block_property = $a_block_properties;
388  }

◆ setBlockProperty()

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

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

Parameters
string$a_propertyproperty name
string$a_valueproperty value

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

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

376  {
377  $this->block_property[$a_block_type][$a_property] = $a_value;
378  }
+ Here is the caller graph for this function:

◆ setColType()

ilColumnGUI::setColType (   $a_coltype)

Set Column Type.

Parameters
string$a_coltypeColumn Type

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

Referenced by __construct().

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

◆ setEnableEdit()

ilColumnGUI::setEnableEdit (   $a_enableedit)

Set EnableEdit.

Parameters
boolean$a_enableeditEnableEdit

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

Referenced by ilObjectGUI\setColumnSettings().

282  {
283  $this->enableedit = $a_enableedit;
284  }
+ Here is the caller graph for this function:

◆ setRepositoryItems()

ilColumnGUI::setRepositoryItems (   $a_repositoryitems)

Set Repository Items.

Parameters
array$a_repositoryitemsRepository Items

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

Referenced by ilContainerGUI\setColumnSettings().

396  {
397  $this->repositoryitems = $a_repositoryitems;
398  }
+ Here is the caller graph for this function:

◆ setRepositoryMode()

ilColumnGUI::setRepositoryMode (   $a_repositorymode)

Set RepositoryMode.

Parameters
boolean$a_repositorymodeRepositoryMode

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

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

302  {
303  $this->repositorymode = $a_repositorymode;
304  }
+ Here is the caller graph for this function:

◆ setSide()

ilColumnGUI::setSide (   $a_side)

Set Side IL_COL_LEFT | IL_COL_RIGHT.

Parameters
string$a_sideSide IL_COL_LEFT | IL_COL_RIGHT

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

Referenced by __construct().

262  {
263  $this->side = $a_side;
264  }
+ Here is the caller graph for this function:

◆ showBlocks()

ilColumnGUI::showBlocks ( )

Show blocks.

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

References $ctrl, $i, $ilUser, $lng, $user, ilBlockSetting\_lookupDetailLevel(), exceededLimit(), getAdminCommands(), getColType(), getEnableEdit(), getRepositoryMode(), getSide(), IL_COL_RIGHT, and isGloballyActivated().

Referenced by getHTML().

481  {
482  $ilCtrl = $this->ctrl;
483  $lng = $this->lng;
485 
486  $i = 1;
487  $sum_moveable = count($this->blocks[$this->getSide()]);
488 
489  foreach ($this->blocks[$this->getSide()] as $block) {
490  if ($ilCtrl->getContextObjType() != "user" ||
492  $block["type"],
493  $ilUser->getId(),
494  $block["id"]
495  ) > 0) {
496  $gui_class = $block["class"];
497  $block_class = substr($block["class"], 0, strlen($block["class"]) - 3);
498 
499  // get block gui class
500  include_once("./" . self::$locations[$gui_class] . "classes/" .
501  "class." . $gui_class . ".php");
502  $block_gui = new $gui_class();
503  if (isset($this->block_property[$block["type"]])) {
504  $block_gui->setProperties($this->block_property[$block["type"]]);
505  }
506  $block_gui->setRepositoryMode($this->getRepositoryMode());
507  $block_gui->setEnableEdit($this->getEnableEdit());
508  $block_gui->setAdminCommands($this->getAdminCommands());
509 
510  // get block for custom blocks
511  if ($block["custom"]) {
512  $path = "./" . self::$locations[$gui_class] . "classes/" .
513  "class." . $block_class . ".php";
514  if (file_exists($path)) {
515  include_once($path);
516  $app_block = new $block_class($block["id"]);
517  } else {
518  // we only need generic block
519  $app_block = new ilCustomBlock($block["id"]);
520  }
521  $block_gui->setBlock($app_block);
522  if (isset($block["ref_id"])) {
523  $block_gui->setRefId($block["ref_id"]);
524  }
525  }
526 
527  $ilCtrl->setParameter($this, "block_type", $block_gui->getBlockType());
528  $this->tpl->setCurrentBlock("col_block");
529 
530  $html = $ilCtrl->getHTML($block_gui);
531 
532  // don't render a block if it's empty
533  if ($html != "") {
534  $this->tpl->setVariable("BLOCK", $html);
535  $this->tpl->parseCurrentBlock();
536  $ilCtrl->setParameter($this, "block_type", "");
537  }
538 
539  // count (moveable) blocks
540  if ($block["type"] != "pdfeedb" &&
541  $block["type"] != "news") {
542  $i++;
543  } else {
544  $sum_moveable--;
545  }
546  }
547  }
548  }
getAdminCommands()
Get Administration Commmands.
static _lookupDetailLevel($a_type, $a_user=0, $a_block_id=0)
Lookup detail level.
getSide()
Get Side IL_COL_LEFT | IL_COL_RIGHT.
getEnableEdit()
Get EnableEdit.
This is the super class of all custom blocks.
$ilUser
Definition: imgupload.php:18
getRepositoryMode()
Get RepositoryMode.
$i
Definition: metadata.php:24
+ 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 642 of file class.ilColumnGUI.php.

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

643  {
644  $ilCtrl = $this->ctrl;
645 
646  $this->determineBlocks();
647  $i = 1;
648  $sum_moveable = count($this->blocks[$this->getSide()]);
649 
650  foreach ($this->blocks[$this->getSide()] as $block) {
651  include_once("./" . self::$locations[$block["class"]] . "classes/" .
652  "class." . $block["class"] . ".php");
653 
654  // set block id to context obj id,
655  // if block is not a custom block and context is not personal desktop
656  if (!$block["custom"] && $ilCtrl->getContextObjType() != "" && $ilCtrl->getContextObjType() != "user") {
657  $block["id"] = $ilCtrl->getContextObjId();
658  }
659 
660  //if (is_int(strpos($_GET["block_id"], "block_".$block["type"]."_".$block["id"])))
661 
662  if ($_GET["block_id"] == "block_" . $block["type"] . "_" . $block["id"]) {
663  $gui_class = $block["class"];
664  $block_class = substr($block["class"], 0, strlen($block["class"]) - 3);
665 
666  $block_gui = new $gui_class();
667  $block_gui->setProperties($this->block_property[$block["type"]]);
668  $block_gui->setRepositoryMode($this->getRepositoryMode());
669  $block_gui->setEnableEdit($this->getEnableEdit());
670  $block_gui->setAdminCommands($this->getAdminCommands());
671 
672  // get block for custom blocks
673  if ($block["custom"]) {
674  include_once("./" . self::$locations[$gui_class] . "classes/" .
675  "class." . $block_class . ".php");
676  $app_block = new $block_class($block["id"]);
677  $block_gui->setBlock($app_block);
678  $block_gui->setRefId($block["ref_id"]);
679  }
680 
681  $ilCtrl->setParameter($this, "block_type", $block["type"]);
682  echo $ilCtrl->getHTML($block_gui);
683  exit;
684  }
685 
686  // count (moveable) blocks
687  if ($block["type"] != "pdfeedb"
688  && $block["type"] != "news") {
689  $i++;
690  } else {
691  $sum_moveable--;
692  }
693  }
694  echo "Error: ilColumnGUI::updateBlock: Block '" .
695  $_GET["block_id"] . "' unknown.";
696  exit;
697  }
exit
Definition: login.php:29
getAdminCommands()
Get Administration Commmands.
$_GET["client_id"]
getSide()
Get Side IL_COL_LEFT | IL_COL_RIGHT.
getEnableEdit()
Get EnableEdit.
getRepositoryMode()
Get RepositoryMode.
determineBlocks()
Determine which blocks to show.
$i
Definition: metadata.php:24
+ Here is the call graph for this function:

Field Documentation

◆ $action_menu

ilColumnGUI::$action_menu
protected

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

Referenced by getActionMenu(), and setActionMenu().

◆ $admincommands

ilColumnGUI::$admincommands = false
protected

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

Referenced by getAdminCommands().

◆ $block_property

ilColumnGUI::$block_property = array()
protected

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

◆ $block_types

ilColumnGUI::$block_types
staticprotected
Initial value:
= array(
"ilPDMailBlockGUI" => "pdmail",
"ilPDTasksBlockGUI" => "pdtasks",
"ilPDNewsBlockGUI" => "pdnews",
"ilNewsForContextBlockGUI" => "news",
"ilCalendarBlockGUI" => "cal",
"ilPDCalendarBlockGUI" => "pdcal",
"ilConsultationHoursCalendarBlockGUI" => "chcal",
"ilExternalFeedBlockGUI" => "feed",
"ilPDExternalFeedBlockGUI" => "pdfeed",
"ilPDSelectedItemsBlockGUI" => "pditems",
'ilPollBlockGUI' => 'poll',
'ilClassificationBlockGUI' => 'clsfct',
"ilPDStudyProgrammeSimpleListGUI" => "prgsimplelist",
"ilPDStudyProgrammeExpandableListGUI" => "prgexpandablelist",
)

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

◆ $browser

ilColumnGUI::$browser
protected

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

◆ $check_global_activation

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

◆ $check_nr_limit

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

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

◆ $ctrl

◆ $custom_blocks

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

◆ $default_blocks

ilColumnGUI::$default_blocks
protected

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

◆ $enableedit

ilColumnGUI::$enableedit = false
protected

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

Referenced by getEnableEdit().

◆ $lng

ilColumnGUI::$lng
protected

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

Referenced by showBlocks().

◆ $locations

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/",
"ilExternalFeedBlockGUI" => "Modules/ExternalFeed/",
"ilPDExternalFeedBlockGUI" => "Services/Feeds/",
'ilPollBlockGUI' => 'Modules/Poll/',
'ilClassificationBlockGUI' => 'Services/Classification/',
"ilPDStudyProgrammeSimpleListGUI" => "Modules/StudyProgramme/",
"ilPDStudyProgrammeExpandableListGUI" => "Modules/StudyProgramme/",
)

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

◆ $rep_block_types

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

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

◆ $repositoryitems

ilColumnGUI::$repositoryitems = array()
protected

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

Referenced by getRepositoryItems().

◆ $repositorymode

ilColumnGUI::$repositorymode = false
protected

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

Referenced by getRepositoryMode().

◆ $settings

ilColumnGUI::$settings
protected

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

Referenced by determineBlocks(), exceededLimit(), and isGloballyActivated().

◆ $side

ilColumnGUI::$side = IL_COL_RIGHT
protected

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

Referenced by determineBlocks(), exceededLimit(), and getSide().

◆ $tpl

ilColumnGUI::$tpl
protected

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

◆ $type

ilColumnGUI::$type
protected

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

Referenced by determineBlocks().

◆ $user

ilColumnGUI::$user
protected

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

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


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