ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 171 of file class.ilColumnGUI.php.

References setColType(), and setSide().

172  {
173  $this->setColType($a_col_type);
174  $this->setSide($a_side);
175  }
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 825 of file class.ilColumnGUI.php.

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

826  {
827  global $ilUser, $ilCtrl;
828 
829  if ($_GET["block"] != "")
830  {
831  $block = explode("_", $_GET["block"]);
832  include_once("Services/Block/classes/class.ilBlockSetting.php");
833  ilBlockSetting::_writeDetailLevel($block[0], 2, $ilUser->getId(), $block[1]);
834  }
835 
836  $ilCtrl->returnToParent($this);
837  }
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
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ addBlock()

ilColumnGUI::addBlock ( )

Add a block.

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

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

844  {
845  global $ilCtrl;
846 
847  $class = array_search($_GET["block_type"], self::$block_types);
848 
849  $ilCtrl->setCmdClass($class);
850  $ilCtrl->setCmd("create");
851  include_once("./".self::$locations[$class]."classes/class.".$class.".php");
852  $block_gui = new $class();
853  $block_gui->setProperties($this->block_property[$_GET["block_type"]]);
854  $block_gui->setRepositoryMode($this->getRepositoryMode());
855  $block_gui->setEnableEdit($this->getEnableEdit());
856  $block_gui->setAdminCommands($this->getAdminCommands());
857 
858  $ilCtrl->setParameter($this, "block_type", $_GET["block_type"]);
859  $html = $ilCtrl->forwardCommand($block_gui);
860  $ilCtrl->setParameter($this, "block_type", "");
861  return $html;
862  }
getAdminCommands()
Get Administration Commmands.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
getEnableEdit()
Get EnableEdit.
getRepositoryMode()
Get RepositoryMode.
$html
Definition: example_001.php:87
+ 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 187 of file class.ilColumnGUI.php.

References $path.

188  {
189  self::$locations[$className] = $path;
190  }
$path
Definition: aliased.php:25

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

203  {
204  self::$block_types[$className] = $identifier;
205  }

◆ determineBlocks()

ilColumnGUI::determineBlocks ( )

Determine which blocks to show.

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

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

Referenced by getHTML(), and updateBlock().

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

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

Referenced by showBlocks().

1141  {
1142  global $ilSetting, $ilCtrl;
1143 
1144  if ($this->check_nr_limit[$a_type])
1145  {
1146  if (!$this->getRepositoryMode())
1147  {
1148  include_once("./Services/Block/classes/class.ilCustomBlock.php");
1149  $costum_block = new ilCustomBlock();
1150  $costum_block->setContextObjId($ilCtrl->getContextObjId());
1151  $costum_block->setContextObjType($ilCtrl->getContextObjType());
1152  $costum_block->setType($a_type);
1153  $res = $costum_block->queryCntBlockForContext();
1154  $cnt = (int) $res[0]["cnt"];
1155  }
1156  else
1157  {
1158  return false; // not implemented for repository yet
1159  }
1160 
1161 
1162  if ($ilSetting->get("block_limit_".$a_type) > $cnt)
1163  {
1164  return false;
1165  }
1166  else
1167  {
1168  return true;
1169  }
1170  }
1171  return false;
1172  }
global $ilCtrl
Definition: ilias.php:18
$a_type
Definition: workflow.php:93
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 438 of file class.ilColumnGUI.php.

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

439  {
440  global $ilCtrl;
441 
442  $ilCtrl->setParameter($this, "col_side" ,$this->getSide());
443  //$ilCtrl->saveParameter($this, "col_side");
444 
445  $next_class = $ilCtrl->getNextClass();
446  $cmd = $ilCtrl->getCmd("getHTML");
447 
448  $cur_block_type = ($_GET["block_type"])
449  ? $_GET["block_type"]
450  : $_POST["block_type"];
451 
452  if ($next_class != "")
453  {
454  // forward to block
455  if ($gui_class = array_search($cur_block_type, self::$block_types))
456  {
457  include_once("./".self::$locations[$gui_class]."classes/".
458  "class.".$gui_class.".php");
459  $ilCtrl->setParameter($this, "block_type", $cur_block_type);
460  $block_gui = new $gui_class();
461  $block_gui->setProperties($this->block_property[$cur_block_type]);
462  $block_gui->setRepositoryMode($this->getRepositoryMode());
463  $block_gui->setEnableEdit($this->getEnableEdit());
464  $block_gui->setAdminCommands($this->getAdminCommands());
465 
466  if (in_array($gui_class, $this->custom_blocks[$this->getColType()]) ||
467  in_array($cur_block_type, $this->rep_block_types))
468  {
469  $block_class = substr($gui_class, 0, strlen($gui_class)-3);
470  include_once("./".self::$locations[$gui_class]."classes/".
471  "class.".$block_class.".php");
472  $app_block = new $block_class($_GET["block_id"]);
473  $block_gui->setBlock($app_block);
474  }
475  $html = $ilCtrl->forwardCommand($block_gui);
476  $ilCtrl->setParameter($this, "block_type", "");
477 
478  return $html;
479  }
480  }
481  else
482  {
483  return $this->$cmd();
484  }
485  }
getAdminCommands()
Get Administration Commmands.
$_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.
$_POST["username"]
$html
Definition: example_001.php:87
getColType()
Get Column Type.
+ Here is the call graph for this function:

◆ getActionMenu()

ilColumnGUI::getActionMenu ( )
Returns

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

References $action_menu.

1229  {
1230  return $this->action_menu;
1231  }

◆ getAdminCommands()

ilColumnGUI::getAdminCommands ( )

Get Administration Commmands.

Returns
boolean Administration Commmands

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

References $admincommands.

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

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

◆ getBlockProperties()

ilColumnGUI::getBlockProperties (   $a_block_type)

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

406  {
407  return $this->block_property[$a_block_type];
408  }

◆ getCmdSide()

static ilColumnGUI::getCmdSide ( )
static

Get Column Side of Current Command.

Returns
string Column Side

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

References $_GET.

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

213  {
214  return $_GET["col_side"];
215  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ getColType()

ilColumnGUI::getColType ( )

Get Column Type.

Returns
string Column Type

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

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

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

◆ getEnableEdit()

ilColumnGUI::getEnableEdit ( )

Get EnableEdit.

Returns
boolean EnableEdit

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

References $enableedit.

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

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

◆ getEnableMovement()

ilColumnGUI::getEnableMovement ( )

Get Enable Movement.

Returns
boolean Enable Movement

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

References $enablemovement.

Referenced by showBlocks().

353  {
354  return $this->enablemovement;
355  }
+ Here is the caller graph for this function:

◆ getHTML()

ilColumnGUI::getHTML ( )

Get HTML for column.

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

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

491  {
492  global $ilCtrl, $ilBench;
493 
494  $ilBench->start("Column", "getHTML");
495 
496  $ilCtrl->setParameter($this, "col_side" ,$this->getSide());
497 
498  $this->tpl = new ilTemplate("tpl.column.html", true, true, "Services/Block");
499 
500  $ilBench->start("Column", "determineBlocks");
501  $this->determineBlocks();
502  $ilBench->stop("Column", "determineBlocks");
503 
504  $ilBench->start("Column", "showBlocks");
505  $this->showBlocks();
506  $ilBench->stop("Column", "showBlocks");
507 
508  if ($this->getEnableEdit() || !$this->getRepositoryMode())
509  {
510  $this->addHiddenBlockSelector();
511  }
512 
513  $ilBench->stop("Column", "getHTML");
514 
515  return $this->tpl->get();
516  }
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 332 of file class.ilColumnGUI.php.

References $movementmode.

Referenced by showBlocks().

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

◆ getRepositoryItems()

ilColumnGUI::getRepositoryItems ( )

Get Repository Items.

Returns
array Repository Items

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

References $repositoryitems.

Referenced by determineBlocks().

431  {
432  return $this->repositoryitems;
433  }
+ Here is the caller graph for this function:

◆ getRepositoryMode()

ilColumnGUI::getRepositoryMode ( )

Get RepositoryMode.

Returns
boolean RepositoryMode

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

References $repositorymode.

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

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

◆ getScreenMode()

static ilColumnGUI::getScreenMode ( )
static

Get Screen Mode for current command.

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

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

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

361  {
362  global $ilCtrl;
363 
364  if ($ilCtrl->getCmdClass() == "ilcolumngui")
365  {
366  switch ($ilCtrl->getCmd())
367  {
368  case "addBlock":
369  return IL_SCREEN_CENTER;
370  }
371  }
372 
373  $cur_block_type = "";
374  if (isset($_GET["block_type"]) && $_GET["block_type"])
375  {
376  $cur_block_type = $_GET["block_type"];
377  }
378  else if (isset($_POST["block_type"]))
379  {
380  $cur_block_type = $_POST["block_type"];
381  }
382 
383  if ($class = array_search($cur_block_type, self::$block_types))
384  {
385  include_once("./".self::$locations[$class]."classes/".
386  "class.".$class.".php");
387  return call_user_func(array($class, 'getScreenMode'));
388  }
389 
390  return IL_SCREEN_SIDE;
391  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
const IL_SCREEN_CENTER
Create styles array
The data for the language used.
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 252 of file class.ilColumnGUI.php.

References $side.

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

253  {
254  return $this->side;
255  }
+ 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 1053 of file class.ilColumnGUI.php.

References $a_type, $GLOBALS, $ilCtrl, $ilSetting, ilCalendarSettings\_getInstance(), ilContainer\_lookupContainerSetting(), ilCalendarSettings\lookupCalendarActivated(), and ilObjMail\PD_SYS_MSG_OWN_BLOCK.

Referenced by determineBlocks(), and showBlocks().

1054  {
1055  global $ilSetting, $ilCtrl;
1056 
1057  if (isset($this->check_global_activation[$a_type]) && $this->check_global_activation[$a_type])
1058  {
1059  if ($a_type == 'pdbookm')
1060  {
1061  if (!$ilSetting->get("disable_bookmarks"))
1062  {
1063  return true;
1064  }
1065  return false;
1066  }
1067  else if ($a_type == 'pdnotes')
1068  {
1069  if (!$ilSetting->get("disable_notes"))
1070  {
1071  return true;
1072  }
1073  return false;
1074  }
1075  else if ($a_type == 'pdportf')
1076  {
1077  if ($ilSetting->get("user_portfolios"))
1078  {
1079  $prfa_set = new ilSetting("prfa");
1080  if ($prfa_set->get("pd_block", false))
1081  {
1082  return true;
1083  }
1084  }
1085  return false;
1086  }
1087  elseif($a_type == 'news')
1088  {
1089  include_once 'Services/Container/classes/class.ilContainer.php';
1090  return
1091  $ilSetting->get('block_activated_news') &&
1093  $GLOBALS['ilCtrl']->getContextObjId(),
1094  'cont_show_news',
1095  true
1096  );
1097  }
1098  else if($a_type == 'pdsysmess')
1099  {
1100  require_once 'Services/Mail/classes/class.ilObjMail.php';
1101  return ((int)$ilSetting->get('pd_sys_msg_mode')) == ilObjMail::PD_SYS_MSG_OWN_BLOCK;
1102  }
1103  else if ($ilSetting->get("block_activated_".$a_type))
1104  {
1105  return true;
1106  }
1107  elseif($a_type == 'cal')
1108  {
1109  include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
1110  return ilCalendarSettings::lookupCalendarActivated($GLOBALS['ilCtrl']->getContextObjId());
1111 
1112  }
1113  elseif($a_type == 'pdcal')
1114  {
1115  include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
1116  return ilCalendarSettings::_getInstance()->isEnabled();
1117  }
1118  elseif($a_type == "tagcld")
1119  {
1120  $tags_active = new ilSetting("tags");
1121  return (bool)$tags_active->get("enable", false);
1122  }
1123  elseif($a_type == "clsfct")
1124  {
1125  if ($ilCtrl->getContextObjType() == "cat") // taxonomy presentation in classification block
1126  {
1127  return true;
1128  }
1129  $tags_active = new ilSetting("tags"); // tags presentation in classification block
1130  return (bool)$tags_active->get("enable", false);
1131  }
1132  return false;
1133  }
1134  return true;
1135  }
ILIAS Setting Class.
static _getInstance()
get singleton instance
static lookupCalendarActivated($a_obj_id)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
global $ilCtrl
Definition: ilias.php:18
const PD_SYS_MSG_OWN_BLOCK
$a_type
Definition: workflow.php:93
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=NULL)
Lookup a container setting.
global $ilSetting
Definition: privfeed.php:17
+ 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 1219 of file class.ilColumnGUI.php.

References $action_menu.

1220  {
1221  $this->action_menu = $action_menu;
1222  return $this;
1223  }

◆ setAdminCommands()

ilColumnGUI::setAdminCommands (   $a_admincommands)

Set Administration Commmands.

Parameters
boolean$a_admincommandsAdministration Commmands

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

Referenced by ilContainerGUI\setColumnSettings().

303  {
304  $this->admincommands = $a_admincommands;
305  }
+ Here is the caller graph for this function:

◆ setAllBlockProperties()

ilColumnGUI::setAllBlockProperties (   $a_block_properties)

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

411  {
412  $this->block_property = $a_block_properties;
413  }

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

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

401  {
402  $this->block_property[$a_block_type][$a_property] = $a_value;
403  }
+ Here is the caller graph for this function:

◆ setColType()

ilColumnGUI::setColType (   $a_coltype)

Set Column Type.

Parameters
string$a_coltypeColumn Type

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

Referenced by __construct().

223  {
224  $this->coltype = $a_coltype;
225  }
+ Here is the caller graph for this function:

◆ setEnableEdit()

ilColumnGUI::setEnableEdit (   $a_enableedit)

Set EnableEdit.

Parameters
boolean$a_enableeditEnableEdit

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

Referenced by ilObjectGUI\setColumnSettings().

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

◆ setEnableMovement()

ilColumnGUI::setEnableMovement (   $a_enablemovement)

Set Enable Movement.

Parameters
boolean$a_enablemovementEnable Movement

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

Referenced by ilContainerGUI\setColumnSettings().

343  {
344  $this->enablemovement = $a_enablemovement;
345  }
+ Here is the caller graph for this function:

◆ setMovementMode()

ilColumnGUI::setMovementMode (   $a_movementmode)

Set Movement Mode.

Parameters
boolean$a_movementmodeMovement Mode

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

323  {
324  $this->movementmode = $a_movementmode;
325  }

◆ setRepositoryItems()

ilColumnGUI::setRepositoryItems (   $a_repositoryitems)

Set Repository Items.

Parameters
array$a_repositoryitemsRepository Items

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

Referenced by ilContainerGUI\setColumnSettings().

421  {
422  $this->repositoryitems = $a_repositoryitems;
423  }
+ Here is the caller graph for this function:

◆ setRepositoryMode()

ilColumnGUI::setRepositoryMode (   $a_repositorymode)

Set RepositoryMode.

Parameters
boolean$a_repositorymodeRepositoryMode

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

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

283  {
284  $this->repositorymode = $a_repositorymode;
285  }
+ 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 242 of file class.ilColumnGUI.php.

Referenced by __construct().

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

◆ showBlocks()

ilColumnGUI::showBlocks ( )

Show blocks.

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

References $html, $ilBench, $ilCtrl, $ilUser, $lng, $path, $title, $tpl, ilBlockSetting\_lookupDetailLevel(), array, 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().

522  {
523  global $ilCtrl, $lng, $ilUser, $ilBench;
524 
525  $i = 1;
526  $sum_moveable = count($this->blocks[$this->getSide()]);
527 
528  foreach($this->blocks[$this->getSide()] as $block)
529  {
530  if ($ilCtrl->getContextObjType() != "user" ||
531  ilBlockSetting::_lookupDetailLevel($block["type"],
532  $ilUser->getId(), $block["id"]) > 0)
533  {
534  $gui_class = $block["class"];
535  $block_class = substr($block["class"], 0, strlen($block["class"])-3);
536 
537  // get block gui class
538  include_once("./".self::$locations[$gui_class]."classes/".
539  "class.".$gui_class.".php");
540  $ilBench->start("Column", "instantiate-".$block["type"]);
541  $block_gui = new $gui_class();
542  $ilBench->stop("Column", "instantiate-".$block["type"]);
543  if (isset($this->block_property[$block["type"]]))
544  {
545  $block_gui->setProperties($this->block_property[$block["type"]]);
546  }
547  $block_gui->setRepositoryMode($this->getRepositoryMode());
548  $block_gui->setEnableEdit($this->getEnableEdit());
549  $block_gui->setAdminCommands($this->getAdminCommands());
550 
551  // get block for custom blocks
552  if ($block["custom"])
553  {
554  $path = "./".self::$locations[$gui_class]."classes/".
555  "class.".$block_class.".php";
556  if(file_exists($path))
557  {
558  include_once($path);
559  $app_block = new $block_class($block["id"]);
560  }
561  else
562  {
563  // we only need generic block
564  $app_block = new ilCustomBlock($block["id"]);
565  }
566  $block_gui->setBlock($app_block);
567  if (isset($block["ref_id"]))
568  {
569  $block_gui->setRefId($block["ref_id"]);
570  }
571  }
572 
573  $ilCtrl->setParameter($this, "block_type", $block_gui->getBlockType());
574  $this->tpl->setCurrentBlock("col_block");
575 
576  $ilBench->start("Column", "showBlocks-".$block_gui->getBlockType());
577  $html = $ilCtrl->getHTML($block_gui);
578  $ilBench->stop("Column", "showBlocks-".$block_gui->getBlockType());
579 
580  // dummy block, if non visible, but movement is ongoing
581  if ($html == "" && $this->getRepositoryMode() &&
582  $this->getMovementMode())
583  {
584  include_once("./Services/Block/classes/class.ilDummyBlockGUI.php");
585  $bl = new ilDummyBlockGUI();
586  $bl->setBlockId($block["id"]);
587  $bl->setBlockType($block["type"]);
588  $bl->setTitle($lng->txt("invisible_block"));
589  $bl->setConfigMode($this->getMovementMode());
590  $html = $bl->getHTML();
591  }
592 
593  // don't render a block if it's empty
594  if ($html != "")
595  {
596  $this->tpl->setVariable("BLOCK", $html);
597  $this->tpl->parseCurrentBlock();
598  $ilCtrl->setParameter($this, "block_type", "");
599  }
600 
601  // count (moveable) blocks
602  if ($block["type"] != "pdsysmess" && $block["type"] != "pdfeedb" &&
603  $block["type"] != "news")
604  {
605  $i++;
606  }
607  else
608  {
609  $sum_moveable--;
610  }
611  }
612  }
613  }
$path
Definition: aliased.php:25
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.
$ilUser
Definition: imgupload.php:18
getMovementMode()
Get Movement Mode.
This is the super class of all custom blocks.
global $lng
Definition: privfeed.php:17
global $ilBench
Definition: ilias.php:18
getRepositoryMode()
Get RepositoryMode.
$html
Definition: example_001.php:87
+ 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 756 of file class.ilColumnGUI.php.

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

757  {
758  global $ilCtrl, $ilBench;
759 
760  $this->determineBlocks();
761  $i = 1;
762  $sum_moveable = count($this->blocks[$this->getSide()]);
763 
764  foreach ($this->blocks[$this->getSide()] as $block)
765  {
766 
767  include_once("./".self::$locations[$block["class"]]."classes/".
768  "class.".$block["class"].".php");
769 
770  // set block id to context obj id,
771  // if block is not a custom block and context is not personal desktop
772  if (!$block["custom"] && $ilCtrl->getContextObjType() != "" && $ilCtrl->getContextObjType() != "user")
773  {
774  $block["id"] = $ilCtrl->getContextObjId();
775  }
776 
777  //if (is_int(strpos($_GET["block_id"], "block_".$block["type"]."_".$block["id"])))
778 
779  if ($_GET["block_id"] == "block_".$block["type"]."_".$block["id"])
780  {
781  $gui_class = $block["class"];
782  $block_class = substr($block["class"], 0, strlen($block["class"])-3);
783 
784  $block_gui = new $gui_class();
785  $block_gui->setProperties($this->block_property[$block["type"]]);
786  $block_gui->setRepositoryMode($this->getRepositoryMode());
787  $block_gui->setEnableEdit($this->getEnableEdit());
788  $block_gui->setAdminCommands($this->getAdminCommands());
789 
790  // get block for custom blocks
791  if ($block["custom"])
792  {
793  include_once("./".self::$locations[$gui_class]."classes/".
794  "class.".$block_class.".php");
795  $app_block = new $block_class($block["id"]);
796  $block_gui->setBlock($app_block);
797  $block_gui->setRefId($block["ref_id"]);
798  }
799 
800  $ilCtrl->setParameter($this, "block_type", $block["type"]);
801  echo $ilCtrl->getHTML($block_gui);
802  $ilBench->save();
803  exit;
804  }
805 
806  // count (moveable) blocks
807  if ($block["type"] != "pdsysmess" && $block["type"] != "pdfeedb"
808  && $block["type"] != "news")
809  {
810  $i++;
811  }
812  else
813  {
814  $sum_moveable--;
815  }
816  }
817  echo "Error: ilColumnGUI::updateBlock: Block '".
818  $_GET["block_id"]."' unknown.";
819  exit;
820  }
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:
"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',
'ilPDPortfolioBlockGUI' => 'pdportf',
"ilPDStudyProgrammeSimpleListGUI" => "prgsimplelist",
"ilPDStudyProgrammeExpandableListGUI" => "prgexpandablelist",
"ilForumPostingDraftsBlockGUI" => "pdfrmpostdraft"
)

Definition at line 70 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,
"pdsysmess" => true,
"pdnotes" => true,
"chatviewer" => true,
"pdfrmpostdraft" => true,
"tagcld" => true,
"pdportf" => true,
"clsfct" => true)

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

◆ $check_nr_limit

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

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

◆ $custom_blocks

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

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

◆ $default_blocks

ilColumnGUI::$default_blocks
protected

Definition at line 94 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:
"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/',
'ilPDPortfolioBlockGUI' => 'Modules/Portfolio/',
"ilPDStudyProgrammeSimpleListGUI" => "Modules/StudyProgramme/",
"ilPDStudyProgrammeExpandableListGUI" => "Modules/StudyProgramme/",
"ilForumPostingDraftsBlockGUI" => "Modules/Forum/"
)

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: