ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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...
 
 setMovementMode ($a_movementmode)
 Set Movement Mode. More...
 
 getMovementMode ()
 Get Movement Mode. More...
 
 setEnableMovement ($a_enablemovement)
 Set Enable Movement. More...
 
 getEnableMovement ()
 Get Enable Movement. 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

 $side = IL_COL_RIGHT
 
 $type
 
 $enableedit = false
 
 $repositorymode = false
 
 $repositoryitems = array()
 
 $rep_block_types = array("feed","poll")
 
 $block_property = array()
 
 $admincommands = null
 
 $movementmode = null
 
 $enablemovement = 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 155 of file class.ilColumnGUI.php.

References setColType(), and setSide().

156  {
157  $this->setColType($a_col_type);
158  $this->setSide($a_side);
159  }
setColType($a_coltype)
Set Column Type.
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 809 of file class.ilColumnGUI.php.

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

810  {
811  global $ilUser, $ilCtrl;
812 
813  if ($_GET["block"] != "")
814  {
815  $block = explode("_", $_GET["block"]);
816  include_once("Services/Block/classes/class.ilBlockSetting.php");
817  ilBlockSetting::_writeDetailLevel($block[0], 2, $ilUser->getId(), $block[1]);
818  }
819 
820  $ilCtrl->returnToParent($this);
821  }
static _writeDetailLevel($a_type, $a_value, $a_user=0, $a_block_id=0)
Write detail level to database.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ addBlock()

ilColumnGUI::addBlock ( )

Add a block.

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

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

828  {
829  global $ilCtrl;
830 
831  $class = array_search($_GET["block_type"], self::$block_types);
832 
833  $ilCtrl->setCmdClass($class);
834  $ilCtrl->setCmd("create");
835  include_once("./".self::$locations[$class]."classes/class.".$class.".php");
836  $block_gui = new $class();
837  $block_gui->setProperties($this->block_property[$_GET["block_type"]]);
838  $block_gui->setRepositoryMode($this->getRepositoryMode());
839  $block_gui->setEnableEdit($this->getEnableEdit());
840  $block_gui->setAdminCommands($this->getAdminCommands());
841 
842  $ilCtrl->setParameter($this, "block_type", $_GET["block_type"]);
843  $html = $ilCtrl->forwardCommand($block_gui);
844  $ilCtrl->setParameter($this, "block_type", "");
845  return $html;
846  }
getAdminCommands()
Get Administration Commmands.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
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 171 of file class.ilColumnGUI.php.

References $path.

172  {
173  self::$locations[$className] = $path;
174  }
$path
Definition: index.php:22

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

187  {
188  self::$block_types[$className] = $identifier;
189  }

◆ determineBlocks()

ilColumnGUI::determineBlocks ( )

Determine which blocks to show.

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

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

Referenced by getHTML(), and updateBlock().

852  {
853  global $ilUser, $ilCtrl, $ilSetting;
854 
855  include_once("./Services/Block/classes/class.ilBlockSetting.php");
856  $this->blocks[IL_COL_LEFT] = array();
857  $this->blocks[IL_COL_RIGHT] = array();
858  $this->blocks[IL_COL_CENTER] = array();
859 
860  $user_id = ($this->getColType() == "pd")
861  ? $ilUser->getId()
862  : 0;
863 
864  $def_nr = 1000;
865  if (is_array($this->default_blocks[$this->getColType()]))
866  {
867  foreach($this->default_blocks[$this->getColType()] as $class => $def_side)
868  {
869  $type = self::$block_types[$class];
870 
871  if ($this->isGloballyActivated($type))
872  {
873  $nr = ilBlockSetting::_lookupNr($type, $user_id);
874  if ($nr === false)
875  {
876  $nr = $def_nr++;
877  }
878 
879 
880  // extra handling for system messages, feedback block and news
881  if ($type == "news") // always show news first
882  {
883  $nr = -15;
884  }
885  if ($type == "cal")
886  {
887  $nr = -8;
888  }
889  if ($type == "pdsysmess") // always show sys mess first
890  {
891 // $nr = -15;
892  }
893  if ($type == "pdfeedb") // always show feedback request second
894  {
895  $nr = -10;
896  }
898  if ($side === false)
899  {
900  $side = $def_side;
901  }
902 
903  $this->blocks[$side][] = array(
904  "nr" => $nr,
905  "class" => $class,
906  "type" => $type,
907  "id" => 0,
908  "custom" => false);
909  }
910  }
911  }
912 
913  if (!$this->getRepositoryMode())
914  {
915  include_once("./Services/Block/classes/class.ilCustomBlock.php");
916  $custom_block = new ilCustomBlock();
917  $custom_block->setContextObjId($ilCtrl->getContextObjId());
918  $custom_block->setContextObjType($ilCtrl->getContextObjType());
919  $c_blocks = $custom_block->queryBlocksForContext();
920 
921  foreach($c_blocks as $c_block)
922  {
923  $type = $c_block["type"];
924 
925  if ($this->isGloballyActivated($type))
926  {
927  $class = array_search($type, self::$block_types);
928  $nr = ilBlockSetting::_lookupNr($type, $user_id, $c_block["id"]);
929  if ($nr === false)
930  {
931  $nr = $def_nr++;
932  }
933  $side = ilBlockSetting::_lookupSide($type, $user_id, $c_block["id"]);
934  if ($side === false)
935  {
937  }
938 
939  $this->blocks[$side][] = array(
940  "nr" => $nr,
941  "class" => $class,
942  "type" => $type,
943  "id" => $c_block["id"],
944  "custom" => true);
945  }
946  }
947  }
948  else // get all subitems
949  {
950  include_once("./Services/Block/classes/class.ilCustomBlock.php");
951  $rep_items = $this->getRepositoryItems();
952 
953  foreach($this->rep_block_types as $block_type)
954  {
955  if ($this->isGloballyActivated($block_type))
956  {
957  if (!is_array($rep_items[$block_type]))
958  {
959  continue;
960  }
961  foreach($rep_items[$block_type] as $item)
962  {
963  $costum_block = new ilCustomBlock();
964  $costum_block->setContextObjId($item["obj_id"]);
965  $costum_block->setContextObjType($block_type);
966  $c_blocks = $costum_block->queryBlocksForContext();
967  $c_block = $c_blocks[0];
968 
969  $type = $block_type;
970  $class = array_search($type, self::$block_types);
971  $nr = ilBlockSetting::_lookupNr($type, $user_id, $c_block["id"]);
972  if ($nr === false)
973  {
974  $nr = $def_nr++;
975  }
976  $side = ilBlockSetting::_lookupSide($type, $user_id, $c_block["id"]);
977  if ($side === false)
978  {
980  }
981 
982  $this->blocks[$side][] = array(
983  "nr" => $nr,
984  "class" => $class,
985  "type" => $type,
986  "id" => $c_block["id"],
987  "custom" => true,
988  "ref_id" => $item["ref_id"]);
989  }
990  }
991  }
992 
993  // repository object custom blocks
994  include_once("./Services/Block/classes/class.ilCustomBlock.php");
995  $custom_block = new ilCustomBlock();
996  $custom_block->setContextObjId($ilCtrl->getContextObjId());
997  $custom_block->setContextObjType($ilCtrl->getContextObjType());
998  $c_blocks = $custom_block->queryBlocksForContext(false); // get all sub-object types
999 
1000  foreach($c_blocks as $c_block)
1001  {
1002  $type = $c_block["type"];
1003  $class = array_search($type, self::$block_types);
1004 
1005  if($class)
1006  {
1007  $nr = $def_nr++;
1008  $side = IL_COL_RIGHT;
1009 
1010  $this->blocks[$side][] = array(
1011  "nr" => $nr,
1012  "class" => $class,
1013  "type" => $type,
1014  "id" => $c_block["id"],
1015  "custom" => true);
1016  }
1017  }
1018  }
1019 
1020 
1021  $this->blocks[IL_COL_LEFT] =
1022  ilUtil::sortArray($this->blocks[IL_COL_LEFT], "nr", "asc", true);
1023  $this->blocks[IL_COL_RIGHT] =
1024  ilUtil::sortArray($this->blocks[IL_COL_RIGHT], "nr", "asc", true);
1025  $this->blocks[IL_COL_CENTER] =
1026  ilUtil::sortArray($this->blocks[IL_COL_CENTER], "nr", "asc", true);
1027 
1028  }
const IL_COL_CENTER
const IL_COL_RIGHT
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
global $ilCtrl
Definition: ilias.php:18
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.
static _lookupNr($a_type, $a_user=0, $a_block_id=0)
Lookup number.
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
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 1094 of file class.ilColumnGUI.php.

References $_POST, $ilCtrl, $ilSetting, $ilUser, $res, $side, ilBlockSetting\_writeNumber(), ilBlockSetting\_writeSide(), exit, getColType(), getRepositoryMode(), IL_COL_LEFT, and IL_COL_RIGHT.

Referenced by showBlocks().

1095  {
1096  global $ilSetting, $ilCtrl;
1097 
1098  if ($this->check_nr_limit[$a_type])
1099  {
1100  if (!$this->getRepositoryMode())
1101  {
1102  include_once("./Services/Block/classes/class.ilCustomBlock.php");
1103  $costum_block = new ilCustomBlock();
1104  $costum_block->setContextObjId($ilCtrl->getContextObjId());
1105  $costum_block->setContextObjType($ilCtrl->getContextObjType());
1106  $costum_block->setType($a_type);
1107  $res = $costum_block->queryCntBlockForContext();
1108  $cnt = (int) $res[0]["cnt"];
1109  }
1110  else
1111  {
1112  return false; // not implemented for repository yet
1113  }
1114 
1115 
1116  if ($ilSetting->get("block_limit_".$a_type) > $cnt)
1117  {
1118  return false;
1119  }
1120  else
1121  {
1122  return true;
1123  }
1124  }
1125  return false;
1126  }
global $ilCtrl
Definition: ilias.php:18
This is the super class of all custom blocks.
global $ilSetting
Definition: privfeed.php:40
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 422 of file class.ilColumnGUI.php.

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

423  {
424  global $ilCtrl;
425 
426  $ilCtrl->setParameter($this, "col_side" ,$this->getSide());
427  //$ilCtrl->saveParameter($this, "col_side");
428 
429  $next_class = $ilCtrl->getNextClass();
430  $cmd = $ilCtrl->getCmd("getHTML");
431 
432  $cur_block_type = ($_GET["block_type"])
433  ? $_GET["block_type"]
434  : $_POST["block_type"];
435 
436  if ($next_class != "")
437  {
438  // forward to block
439  if ($gui_class = array_search($cur_block_type, self::$block_types))
440  {
441  include_once("./".self::$locations[$gui_class]."classes/".
442  "class.".$gui_class.".php");
443  $ilCtrl->setParameter($this, "block_type", $cur_block_type);
444  $block_gui = new $gui_class();
445  $block_gui->setProperties($this->block_property[$cur_block_type]);
446  $block_gui->setRepositoryMode($this->getRepositoryMode());
447  $block_gui->setEnableEdit($this->getEnableEdit());
448  $block_gui->setAdminCommands($this->getAdminCommands());
449 
450  if (in_array($gui_class, $this->custom_blocks[$this->getColType()]) ||
451  in_array($cur_block_type, $this->rep_block_types))
452  {
453  $block_class = substr($gui_class, 0, strlen($gui_class)-3);
454  include_once("./".self::$locations[$gui_class]."classes/".
455  "class.".$block_class.".php");
456  $app_block = new $block_class($_GET["block_id"]);
457  $block_gui->setBlock($app_block);
458  }
459  $html = $ilCtrl->forwardCommand($block_gui);
460  $ilCtrl->setParameter($this, "block_type", "");
461 
462  return $html;
463  }
464  }
465  else
466  {
467  return $this->$cmd();
468  }
469  }
getAdminCommands()
Get Administration Commmands.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
getSide()
Get Side IL_COL_LEFT | IL_COL_RIGHT.
getEnableEdit()
Get EnableEdit.
getRepositoryMode()
Get RepositoryMode.
getColType()
Get Column Type.
+ Here is the call graph for this function:

◆ getActionMenu()

ilColumnGUI::getActionMenu ( )
Returns

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

References $action_menu.

1183  {
1184  return $this->action_menu;
1185  }

◆ getAdminCommands()

ilColumnGUI::getAdminCommands ( )

Get Administration Commmands.

Returns
boolean Administration Commmands

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

References $admincommands.

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

297  {
298  return $this->admincommands;
299  }
+ Here is the caller graph for this function:

◆ getBlockProperties()

ilColumnGUI::getBlockProperties (   $a_block_type)

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

390  {
391  return $this->block_property[$a_block_type];
392  }

◆ getCmdSide()

static ilColumnGUI::getCmdSide ( )
static

Get Column Side of Current Command.

Returns
string Column Side

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

References $_GET.

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

197  {
198  return $_GET["col_side"];
199  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ getColType()

ilColumnGUI::getColType ( )

Get Column Type.

Returns
string Column Type

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

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

217  {
218  return $this->coltype;
219  }
+ Here is the caller graph for this function:

◆ getEnableEdit()

ilColumnGUI::getEnableEdit ( )

Get EnableEdit.

Returns
boolean EnableEdit

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

References $enableedit.

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

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

◆ getEnableMovement()

ilColumnGUI::getEnableMovement ( )

Get Enable Movement.

Returns
boolean Enable Movement

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

References $enablemovement.

Referenced by showBlocks().

337  {
338  return $this->enablemovement;
339  }
+ Here is the caller graph for this function:

◆ getHTML()

ilColumnGUI::getHTML ( )

Get HTML for column.

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

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

475  {
476  global $ilCtrl, $ilBench;
477 
478  $ilBench->start("Column", "getHTML");
479 
480  $ilCtrl->setParameter($this, "col_side" ,$this->getSide());
481 
482  $this->tpl = new ilTemplate("tpl.column.html", true, true, "Services/Block");
483 
484  $ilBench->start("Column", "determineBlocks");
485  $this->determineBlocks();
486  $ilBench->stop("Column", "determineBlocks");
487 
488  $ilBench->start("Column", "showBlocks");
489  $this->showBlocks();
490  $ilBench->stop("Column", "showBlocks");
491 
492  if ($this->getEnableEdit() || !$this->getRepositoryMode())
493  {
494  $this->addHiddenBlockSelector();
495  }
496 
497  $ilBench->stop("Column", "getHTML");
498 
499  return $this->tpl->get();
500  }
global $ilCtrl
Definition: ilias.php:18
special template class to simplify handling of ITX/PEAR
getSide()
Get Side IL_COL_LEFT | IL_COL_RIGHT.
getEnableEdit()
Get EnableEdit.
showBlocks()
Show blocks.
global $ilBench
Definition: ilias.php:18
getRepositoryMode()
Get RepositoryMode.
determineBlocks()
Determine which blocks to show.
+ Here is the call graph for this function:

◆ getMovementMode()

ilColumnGUI::getMovementMode ( )

Get Movement Mode.

Returns
boolean Movement Mode

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

References $movementmode.

Referenced by showBlocks().

317  {
318  return $this->movementmode;
319  }
+ Here is the caller graph for this function:

◆ getRepositoryItems()

ilColumnGUI::getRepositoryItems ( )

Get Repository Items.

Returns
array Repository Items

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

References $repositoryitems.

Referenced by determineBlocks().

415  {
416  return $this->repositoryitems;
417  }
+ Here is the caller graph for this function:

◆ getRepositoryMode()

ilColumnGUI::getRepositoryMode ( )

Get RepositoryMode.

Returns
boolean RepositoryMode

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

References $repositorymode.

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

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

◆ getScreenMode()

static ilColumnGUI::getScreenMode ( )
static

Get Screen Mode for current command.

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

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

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

345  {
346  global $ilCtrl;
347 
348  if ($ilCtrl->getCmdClass() == "ilcolumngui")
349  {
350  switch ($ilCtrl->getCmd())
351  {
352  case "addBlock":
353  return IL_SCREEN_CENTER;
354  }
355  }
356 
357  $cur_block_type = "";
358  if (isset($_GET["block_type"]) && $_GET["block_type"])
359  {
360  $cur_block_type = $_GET["block_type"];
361  }
362  else if (isset($_POST["block_type"]))
363  {
364  $cur_block_type = $_POST["block_type"];
365  }
366 
367  if ($class = array_search($cur_block_type, self::$block_types))
368  {
369  include_once("./".self::$locations[$class]."classes/".
370  "class.".$class.".php");
371  return call_user_func(array($class, 'getScreenMode'));
372  }
373 
374  return IL_SCREEN_SIDE;
375  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
const IL_SCREEN_CENTER
const IL_SCREEN_SIDE
+ 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 236 of file class.ilColumnGUI.php.

References $side.

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

237  {
238  return $this->side;
239  }
+ 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 1033 of file class.ilColumnGUI.php.

References $GLOBALS, $ilSetting, ilCalendarSettings\_getInstance(), ilContainer\_lookupContainerSetting(), and ilCalendarSettings\lookupCalendarActivated().

Referenced by determineBlocks(), and showBlocks().

1034  {
1035 
1036  global $ilSetting;
1037  if (isset($this->check_global_activation[$a_type]) && $this->check_global_activation[$a_type])
1038  {
1039  if ($a_type == 'pdbookm')
1040  {
1041  if (!$ilSetting->get("disable_bookmarks"))
1042  {
1043  return true;
1044  }
1045  return false;
1046  }
1047  else if ($a_type == 'pdnotes')
1048  {
1049  if (!$ilSetting->get("disable_notes"))
1050  {
1051  return true;
1052  }
1053  return false;
1054  }
1055  elseif($a_type == 'news')
1056  {
1057  include_once 'Services/Container/classes/class.ilContainer.php';
1058  return
1059  $ilSetting->get('block_activated_news') &&
1061  $GLOBALS['ilCtrl']->getContextObjId(),
1062  'cont_show_news',
1063  true
1064  );
1065  }
1066  else if ($ilSetting->get("block_activated_".$a_type))
1067  {
1068  return true;
1069  }
1070  elseif($a_type == 'cal')
1071  {
1072  include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
1073  return ilCalendarSettings::lookupCalendarActivated($GLOBALS['ilCtrl']->getContextObjId());
1074 
1075  }
1076  elseif($a_type == 'pdcal')
1077  {
1078  include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
1079  return ilCalendarSettings::_getInstance()->isEnabled();
1080  }
1081  elseif($a_type == "tagcld")
1082  {
1083  $tags_active = new ilSetting("tags");
1084  return (bool)$tags_active->get("enable", false);
1085  }
1086  return false;
1087  }
1088  return true;
1089  }
ILIAS Setting Class.
static _getInstance()
get singleton instance
static lookupCalendarActivated($a_obj_id)
$GLOBALS['ct_recipient']
global $ilSetting
Definition: privfeed.php:40
_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 1173 of file class.ilColumnGUI.php.

References $action_menu.

1174  {
1175  $this->action_menu = $action_menu;
1176  return $this;
1177  }

◆ setAdminCommands()

ilColumnGUI::setAdminCommands (   $a_admincommands)

Set Administration Commmands.

Parameters
boolean$a_admincommandsAdministration Commmands

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

287  {
288  $this->admincommands = $a_admincommands;
289  }

◆ setAllBlockProperties()

ilColumnGUI::setAllBlockProperties (   $a_block_properties)

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

395  {
396  $this->block_property = $a_block_properties;
397  }

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

Referenced by ilObjForumGUI\checkEnableColumnEdit().

385  {
386  $this->block_property[$a_block_type][$a_property] = $a_value;
387  }
+ Here is the caller graph for this function:

◆ setColType()

ilColumnGUI::setColType (   $a_coltype)

Set Column Type.

Parameters
string$a_coltypeColumn Type

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

Referenced by __construct().

207  {
208  $this->coltype = $a_coltype;
209  }
+ Here is the caller graph for this function:

◆ setEnableEdit()

ilColumnGUI::setEnableEdit (   $a_enableedit)

Set EnableEdit.

Parameters
boolean$a_enableeditEnableEdit

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

247  {
248  $this->enableedit = $a_enableedit;
249  }

◆ setEnableMovement()

ilColumnGUI::setEnableMovement (   $a_enablemovement)

Set Enable Movement.

Parameters
boolean$a_enablemovementEnable Movement

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

327  {
328  $this->enablemovement = $a_enablemovement;
329  }

◆ setMovementMode()

ilColumnGUI::setMovementMode (   $a_movementmode)

Set Movement Mode.

Parameters
boolean$a_movementmodeMovement Mode

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

307  {
308  $this->movementmode = $a_movementmode;
309  }

◆ setRepositoryItems()

ilColumnGUI::setRepositoryItems (   $a_repositoryitems)

Set Repository Items.

Parameters
array$a_repositoryitemsRepository Items

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

405  {
406  $this->repositoryitems = $a_repositoryitems;
407  }

◆ setRepositoryMode()

ilColumnGUI::setRepositoryMode (   $a_repositorymode)

Set RepositoryMode.

Parameters
boolean$a_repositorymodeRepositoryMode

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

Referenced by ilObjForumGUI\checkEnableColumnEdit().

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

Referenced by __construct().

227  {
228  $this->side = $a_side;
229  }
+ Here is the caller graph for this function:

◆ showBlocks()

ilColumnGUI::showBlocks ( )

Show blocks.

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

References $ilBench, $ilCtrl, $ilUser, $lng, $path, $tpl, ilBlockSetting\_lookupDetailLevel(), exceededLimit(), getAdminCommands(), getColType(), getEnableEdit(), getEnableMovement(), getMovementMode(), getRepositoryMode(), getSide(), IL_COL_CENTER, IL_COL_LEFT, IL_COL_RIGHT, iljQueryUtil\initjQuery(), iljQueryUtil\initjQueryUI(), and isGloballyActivated().

Referenced by getHTML().

506  {
507  global $ilCtrl, $lng, $ilUser, $ilBench;
508 
509  $i = 1;
510  $sum_moveable = count($this->blocks[$this->getSide()]);
511 
512  foreach($this->blocks[$this->getSide()] as $block)
513  {
514  if ($ilCtrl->getContextObjType() != "user" ||
515  ilBlockSetting::_lookupDetailLevel($block["type"],
516  $ilUser->getId(), $block["id"]) > 0)
517  {
518  $gui_class = $block["class"];
519  $block_class = substr($block["class"], 0, strlen($block["class"])-3);
520 
521  // get block gui class
522  include_once("./".self::$locations[$gui_class]."classes/".
523  "class.".$gui_class.".php");
524  $ilBench->start("Column", "instantiate-".$block["type"]);
525  $block_gui = new $gui_class();
526  $ilBench->stop("Column", "instantiate-".$block["type"]);
527  if (isset($this->block_property[$block["type"]]))
528  {
529  $block_gui->setProperties($this->block_property[$block["type"]]);
530  }
531  $block_gui->setRepositoryMode($this->getRepositoryMode());
532  $block_gui->setEnableEdit($this->getEnableEdit());
533  $block_gui->setAdminCommands($this->getAdminCommands());
534 
535  // get block for custom blocks
536  if ($block["custom"])
537  {
538  $path = "./".self::$locations[$gui_class]."classes/".
539  "class.".$block_class.".php";
540  if(file_exists($path))
541  {
542  include_once($path);
543  $app_block = new $block_class($block["id"]);
544  }
545  else
546  {
547  // we only need generic block
548  $app_block = new ilCustomBlock($block["id"]);
549  }
550  $block_gui->setBlock($app_block);
551  if (isset($block["ref_id"]))
552  {
553  $block_gui->setRefId($block["ref_id"]);
554  }
555  }
556 
557  $ilCtrl->setParameter($this, "block_type", $block_gui->getBlockType());
558  $this->tpl->setCurrentBlock("col_block");
559 
560  $ilBench->start("Column", "showBlocks-".$block_gui->getBlockType());
561  $html = $ilCtrl->getHTML($block_gui);
562  $ilBench->stop("Column", "showBlocks-".$block_gui->getBlockType());
563 
564  // dummy block, if non visible, but movement is ongoing
565  if ($html == "" && $this->getRepositoryMode() &&
566  $this->getMovementMode())
567  {
568  include_once("./Services/Block/classes/class.ilDummyBlockGUI.php");
569  $bl = new ilDummyBlockGUI();
570  $bl->setBlockId($block["id"]);
571  $bl->setBlockType($block["type"]);
572  $bl->setTitle($lng->txt("invisible_block"));
573  $bl->setConfigMode($this->getMovementMode());
574  $html = $bl->getHTML();
575  }
576 
577  // don't render a block if it's empty
578  if ($html != "")
579  {
580  $this->tpl->setVariable("BLOCK", $html);
581  $this->tpl->parseCurrentBlock();
582  $ilCtrl->setParameter($this, "block_type", "");
583  }
584 
585  // count (moveable) blocks
586  if ($block["type"] != "pdsysmess" && $block["type"] != "pdfeedb" &&
587  $block["type"] != "news")
588  {
589  $i++;
590  }
591  else
592  {
593  $sum_moveable--;
594  }
595  }
596  }
597  }
getAdminCommands()
Get Administration Commmands.
BlockGUI class for dummy block.
static _lookupDetailLevel($a_type, $a_user=0, $a_block_id=0)
Lookup detail level.
global $ilCtrl
Definition: ilias.php:18
getSide()
Get Side IL_COL_LEFT | IL_COL_RIGHT.
getEnableEdit()
Get EnableEdit.
getMovementMode()
Get Movement Mode.
This is the super class of all custom blocks.
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
$path
Definition: index.php:22
global $ilBench
Definition: ilias.php:18
getRepositoryMode()
Get RepositoryMode.
+ 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 740 of file class.ilColumnGUI.php.

References $_GET, $ilBench, $ilCtrl, determineBlocks(), exit, getAdminCommands(), getEnableEdit(), getRepositoryMode(), and getSide().

741  {
742  global $ilCtrl, $ilBench;
743 
744  $this->determineBlocks();
745  $i = 1;
746  $sum_moveable = count($this->blocks[$this->getSide()]);
747 
748  foreach ($this->blocks[$this->getSide()] as $block)
749  {
750 
751  include_once("./".self::$locations[$block["class"]]."classes/".
752  "class.".$block["class"].".php");
753 
754  // set block id to context obj id,
755  // if block is not a custom block and context is not personal desktop
756  if (!$block["custom"] && $ilCtrl->getContextObjType() != "" && $ilCtrl->getContextObjType() != "user")
757  {
758  $block["id"] = $ilCtrl->getContextObjId();
759  }
760 
761  //if (is_int(strpos($_GET["block_id"], "block_".$block["type"]."_".$block["id"])))
762 
763  if ($_GET["block_id"] == "block_".$block["type"]."_".$block["id"])
764  {
765  $gui_class = $block["class"];
766  $block_class = substr($block["class"], 0, strlen($block["class"])-3);
767 
768  $block_gui = new $gui_class();
769  $block_gui->setProperties($this->block_property[$block["type"]]);
770  $block_gui->setRepositoryMode($this->getRepositoryMode());
771  $block_gui->setEnableEdit($this->getEnableEdit());
772  $block_gui->setAdminCommands($this->getAdminCommands());
773 
774  // get block for custom blocks
775  if ($block["custom"])
776  {
777  include_once("./".self::$locations[$gui_class]."classes/".
778  "class.".$block_class.".php");
779  $app_block = new $block_class($block["id"]);
780  $block_gui->setBlock($app_block);
781  $block_gui->setRefId($block["ref_id"]);
782  }
783 
784  $ilCtrl->setParameter($this, "block_type", $block["type"]);
785  echo $ilCtrl->getHTML($block_gui);
786  $ilBench->save();
787  exit;
788  }
789 
790  // count (moveable) blocks
791  if ($block["type"] != "pdsysmess" && $block["type"] != "pdfeedb"
792  && $block["type"] != "news")
793  {
794  $i++;
795  }
796  else
797  {
798  $sum_moveable--;
799  }
800  }
801  echo "Error: ilColumnGUI::updateBlock: Block '".
802  $_GET["block_id"]."' unknown.";
803  exit;
804  }
exit
Definition: login.php:54
getAdminCommands()
Get Administration Commmands.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
getSide()
Get Side IL_COL_LEFT | IL_COL_RIGHT.
getEnableEdit()
Get EnableEdit.
global $ilBench
Definition: ilias.php:18
getRepositoryMode()
Get RepositoryMode.
determineBlocks()
Determine which blocks to show.
+ Here is the call graph for this function:

Field Documentation

◆ $action_menu

ilColumnGUI::$action_menu
protected

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

Referenced by getActionMenu(), and setActionMenu().

◆ $admincommands

ilColumnGUI::$admincommands = null
protected

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

Referenced by getAdminCommands().

◆ $block_property

ilColumnGUI::$block_property = array()
protected

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

◆ $block_types

ilColumnGUI::$block_types
staticprotected
Initial value:
= array(
"ilPDMailBlockGUI" => "pdmail",
"ilPDNotesBlockGUI" => "pdnotes",
"ilUsersOnlineBlockGUI" => "pdusers",
"ilPDNewsBlockGUI" => "pdnews",
"ilBookmarkBlockGUI" => "pdbookm",
"ilNewsForContextBlockGUI" => "news",
"ilCalendarBlockGUI" => "cal",
"ilPDCalendarBlockGUI" => "pdcal",
"ilExternalFeedBlockGUI" => "feed",
"ilPDExternalFeedBlockGUI" => "pdfeed",
"ilPDSysMessageBlockGUI" => "pdsysmess",
"ilPDSelectedItemsBlockGUI" => "pditems",
'ilPDTaggingBlockGUI' => 'pdtag',
'ilChatroomBlockGUI' => 'chatviewer',
'ilPollBlockGUI' => 'poll',
'ilClassificationBlockGUI' => 'clsfct',
)

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

◆ $check_global_activation

ilColumnGUI::$check_global_activation
protected
Initial value:
=
array("news" => true,
"cal" => true,
"pdcal" => true,
"pdnews" => true,
"pdfeed" => true,
"pdusers" => true,
"pdbookm" => true,
"pdtag" => true,
"pdnotes" => true,
"chatviewer" => true,
"tagcld" => true)

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

◆ $check_nr_limit

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

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

◆ $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("ilPDExternalFeedBlockGUI")
)

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

◆ $default_blocks

ilColumnGUI::$default_blocks
protected

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

◆ $enableedit

ilColumnGUI::$enableedit = false
protected

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

Referenced by getEnableEdit().

◆ $enablemovement

ilColumnGUI::$enablemovement = false
protected

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

Referenced by getEnableMovement().

◆ $locations

ilColumnGUI::$locations
staticprotected
Initial value:
= array(
"ilNewsForContextBlockGUI" => "Services/News/",
"ilCalendarBlockGUI" => "Services/Calendar/",
"ilPDCalendarBlockGUI" => "Services/Calendar/",
"ilPDNotesBlockGUI" => "Services/Notes/",
"ilPDMailBlockGUI" => "Services/Mail/",
"ilUsersOnlineBlockGUI" => "Services/PersonalDesktop/",
"ilPDSysMessageBlockGUI" => "Services/Mail/",
"ilPDSelectedItemsBlockGUI" => "Services/PersonalDesktop/",
"ilBookmarkBlockGUI" => "Services/Bookmarks/",
"ilPDNewsBlockGUI" => "Services/News/",
"ilExternalFeedBlockGUI" => "Services/Block/",
"ilPDExternalFeedBlockGUI" => "Services/Feeds/",
'ilPDTaggingBlockGUI' => 'Services/Tagging/',
'ilChatroomBlockGUI' => 'Modules/Chatroom/',
'ilPollBlockGUI' => 'Modules/Poll/',
'ilClassificationBlockGUI' => 'Services/Classification/',
)

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

◆ $movementmode

ilColumnGUI::$movementmode = null
protected

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

Referenced by getMovementMode().

◆ $rep_block_types

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

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

◆ $repositoryitems

ilColumnGUI::$repositoryitems = array()
protected

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

Referenced by getRepositoryItems().

◆ $repositorymode

ilColumnGUI::$repositorymode = false
protected

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

Referenced by getRepositoryMode().

◆ $side

ilColumnGUI::$side = IL_COL_RIGHT
protected

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

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

◆ $type

ilColumnGUI::$type
protected

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

Referenced by determineBlocks().


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