ILIAS  release_4-4 Revision
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...
 
 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 147 of file class.ilColumnGUI.php.

References setColType(), and setSide().

148  {
149  $this->setColType($a_col_type);
150  $this->setSide($a_side);
151  }
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 792 of file class.ilColumnGUI.php.

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

793  {
794  global $ilUser, $ilCtrl;
795 
796  if ($_GET["block"] != "")
797  {
798  $block = explode("_", $_GET["block"]);
799  include_once("Services/Block/classes/class.ilBlockSetting.php");
800  ilBlockSetting::_writeDetailLevel($block[0], 2, $ilUser->getId(), $block[1]);
801  }
802 
803  $ilCtrl->returnToParent($this);
804  }
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 809 of file class.ilColumnGUI.php.

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

811  {
812  global $ilCtrl;
813 
814  $class = array_search($_GET["block_type"], self::$block_types);
815 
816  $ilCtrl->setCmdClass($class);
817  $ilCtrl->setCmd("create");
818  include_once("./".self::$locations[$class]."classes/class.".$class.".php");
819  $block_gui = new $class();
820  $block_gui->setProperties($this->block_property[$_GET["block_type"]]);
821  $block_gui->setRepositoryMode($this->getRepositoryMode());
822  $block_gui->setEnableEdit($this->getEnableEdit());
823  $block_gui->setAdminCommands($this->getAdminCommands());
824 
825  $ilCtrl->setParameter($this, "block_type", $_GET["block_type"]);
826  $html = $ilCtrl->forwardCommand($block_gui);
827  $ilCtrl->setParameter($this, "block_type", "");
828  return $html;
829  }
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 163 of file class.ilColumnGUI.php.

References $path.

164  {
165  self::$locations[$className] = $path;
166  }
$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 178 of file class.ilColumnGUI.php.

179  {
180  self::$block_types[$className] = $identifier;
181  }

◆ determineBlocks()

ilColumnGUI::determineBlocks ( )

Determine which blocks to show.

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

835  {
836  global $ilUser, $ilCtrl, $ilSetting;
837 
838  include_once("./Services/Block/classes/class.ilBlockSetting.php");
839  $this->blocks[IL_COL_LEFT] = array();
840  $this->blocks[IL_COL_RIGHT] = array();
841  $this->blocks[IL_COL_CENTER] = array();
842 
843  $user_id = ($this->getColType() == "pd")
844  ? $ilUser->getId()
845  : 0;
846 
847  $def_nr = 1000;
848  if (is_array($this->default_blocks[$this->getColType()]))
849  {
850  foreach($this->default_blocks[$this->getColType()] as $class => $def_side)
851  {
852  $type = self::$block_types[$class];
853 
854  if ($this->isGloballyActivated($type))
855  {
856  $nr = ilBlockSetting::_lookupNr($type, $user_id);
857  if ($nr === false)
858  {
859  $nr = $def_nr++;
860  }
861 
862 
863  // extra handling for system messages, feedback block and news
864  if ($type == "news") // always show news first
865  {
866  $nr = -15;
867  }
868  if ($type == "cal")
869  {
870  $nr = -8;
871  }
872  if ($type == "pdsysmess") // always show sys mess first
873  {
874 // $nr = -15;
875  }
876  if ($type == "pdfeedb") // always show feedback request second
877  {
878  $nr = -10;
879  }
881  if ($side === false)
882  {
883  $side = $def_side;
884  }
885 
886  $this->blocks[$side][] = array(
887  "nr" => $nr,
888  "class" => $class,
889  "type" => $type,
890  "id" => 0,
891  "custom" => false);
892  }
893  }
894  }
895 
896  if (!$this->getRepositoryMode())
897  {
898  include_once("./Services/Block/classes/class.ilCustomBlock.php");
899  $costum_block = new ilCustomBlock();
900  $costum_block->setContextObjId($ilCtrl->getContextObjId());
901  $costum_block->setContextObjType($ilCtrl->getContextObjType());
902  $c_blocks = $costum_block->queryBlocksForContext();
903 
904  foreach($c_blocks as $c_block)
905  {
906  $type = $c_block["type"];
907 
908  if ($this->isGloballyActivated($type))
909  {
910  $class = array_search($type, self::$block_types);
911  $nr = ilBlockSetting::_lookupNr($type, $user_id, $c_block["id"]);
912  if ($nr === false)
913  {
914  $nr = $def_nr++;
915  }
916  $side = ilBlockSetting::_lookupSide($type, $user_id, $c_block["id"]);
917  if ($side === false)
918  {
920  }
921 
922  $this->blocks[$side][] = array(
923  "nr" => $nr,
924  "class" => $class,
925  "type" => $type,
926  "id" => $c_block["id"],
927  "custom" => true);
928  }
929  }
930  }
931  else // get all subitems
932  {
933  include_once("./Services/Block/classes/class.ilCustomBlock.php");
934  $rep_items = $this->getRepositoryItems();
935 
936  foreach($this->rep_block_types as $block_type)
937  {
938  if ($this->isGloballyActivated($block_type))
939  {
940  if (!is_array($rep_items[$block_type]))
941  {
942  continue;
943  }
944  foreach($rep_items[$block_type] as $item)
945  {
946  $costum_block = new ilCustomBlock();
947  $costum_block->setContextObjId($item["obj_id"]);
948  $costum_block->setContextObjType($block_type);
949  $c_blocks = $costum_block->queryBlocksForContext();
950  $c_block = $c_blocks[0];
951 
952  $type = $block_type;
953  $class = array_search($type, self::$block_types);
954  $nr = ilBlockSetting::_lookupNr($type, $user_id, $c_block["id"]);
955  if ($nr === false)
956  {
957  $nr = $def_nr++;
958  }
959  $side = ilBlockSetting::_lookupSide($type, $user_id, $c_block["id"]);
960  if ($side === false)
961  {
963  }
964 
965  $this->blocks[$side][] = array(
966  "nr" => $nr,
967  "class" => $class,
968  "type" => $type,
969  "id" => $c_block["id"],
970  "custom" => true,
971  "ref_id" => $item["ref_id"]);
972  }
973  }
974  }
975  }
976 
977 
978  $this->blocks[IL_COL_LEFT] =
979  ilUtil::sortArray($this->blocks[IL_COL_LEFT], "nr", "asc", true);
980  $this->blocks[IL_COL_RIGHT] =
981  ilUtil::sortArray($this->blocks[IL_COL_RIGHT], "nr", "asc", true);
982  $this->blocks[IL_COL_CENTER] =
983  ilUtil::sortArray($this->blocks[IL_COL_CENTER], "nr", "asc", true);
984 
985  }
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 1046 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().

1047  {
1048  global $ilSetting, $ilCtrl;
1049 
1050  if ($this->check_nr_limit[$a_type])
1051  {
1052  if (!$this->getRepositoryMode())
1053  {
1054  include_once("./Services/Block/classes/class.ilCustomBlock.php");
1055  $costum_block = new ilCustomBlock();
1056  $costum_block->setContextObjId($ilCtrl->getContextObjId());
1057  $costum_block->setContextObjType($ilCtrl->getContextObjType());
1058  $costum_block->setType($a_type);
1059  $res = $costum_block->queryCntBlockForContext();
1060  $cnt = (int) $res[0]["cnt"];
1061  }
1062  else
1063  {
1064  return false; // not implemented for repository yet
1065  }
1066 
1067 
1068  if ($ilSetting->get("block_limit_".$a_type) > $cnt)
1069  {
1070  return false;
1071  }
1072  else
1073  {
1074  return true;
1075  }
1076  }
1077  return false;
1078  }
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 414 of file class.ilColumnGUI.php.

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

415  {
416  global $ilCtrl;
417 
418  $ilCtrl->setParameter($this, "col_side" ,$this->getSide());
419  //$ilCtrl->saveParameter($this, "col_side");
420 
421  $next_class = $ilCtrl->getNextClass();
422  $cmd = $ilCtrl->getCmd("getHTML");
423 
424  $cur_block_type = ($_GET["block_type"])
425  ? $_GET["block_type"]
426  : $_POST["block_type"];
427 
428  if ($next_class != "")
429  {
430  // forward to block
431  if ($gui_class = array_search($cur_block_type, self::$block_types))
432  {
433  include_once("./".self::$locations[$gui_class]."classes/".
434  "class.".$gui_class.".php");
435  $ilCtrl->setParameter($this, "block_type", $cur_block_type);
436  $block_gui = new $gui_class();
437  $block_gui->setProperties($this->block_property[$cur_block_type]);
438  $block_gui->setRepositoryMode($this->getRepositoryMode());
439  $block_gui->setEnableEdit($this->getEnableEdit());
440  $block_gui->setAdminCommands($this->getAdminCommands());
441 
442  if (in_array($gui_class, $this->custom_blocks[$this->getColType()]) ||
443  in_array($cur_block_type, $this->rep_block_types))
444  {
445  $block_class = substr($gui_class, 0, strlen($gui_class)-3);
446  include_once("./".self::$locations[$gui_class]."classes/".
447  "class.".$block_class.".php");
448  $app_block = new $block_class($_GET["block_id"]);
449  $block_gui->setBlock($app_block);
450  }
451  $html = $ilCtrl->forwardCommand($block_gui);
452  $ilCtrl->setParameter($this, "block_type", "");
453 
454  return $html;
455  }
456  }
457  else
458  {
459  return $this->$cmd();
460  }
461  }
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 1134 of file class.ilColumnGUI.php.

References $action_menu.

1135  {
1136  return $this->action_menu;
1137  }

◆ getAdminCommands()

ilColumnGUI::getAdminCommands ( )

Get Administration Commmands.

Returns
boolean Administration Commmands

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

References $admincommands.

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

289  {
290  return $this->admincommands;
291  }
+ Here is the caller graph for this function:

◆ getBlockProperties()

ilColumnGUI::getBlockProperties (   $a_block_type)

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

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

◆ getCmdSide()

static ilColumnGUI::getCmdSide ( )
static

Get Column Side of Current Command.

Returns
string Column Side

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

References $_GET.

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

189  {
190  return $_GET["col_side"];
191  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ getColType()

ilColumnGUI::getColType ( )

Get Column Type.

Returns
string Column Type

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

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

209  {
210  return $this->coltype;
211  }
+ Here is the caller graph for this function:

◆ getEnableEdit()

ilColumnGUI::getEnableEdit ( )

Get EnableEdit.

Returns
boolean EnableEdit

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

References $enableedit.

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

249  {
250  return $this->enableedit;
251  }
+ Here is the caller graph for this function:

◆ getEnableMovement()

ilColumnGUI::getEnableMovement ( )

Get Enable Movement.

Returns
boolean Enable Movement

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

References $enablemovement.

Referenced by showBlocks().

329  {
330  return $this->enablemovement;
331  }
+ Here is the caller graph for this function:

◆ getHTML()

ilColumnGUI::getHTML ( )

Get HTML for column.

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

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

467  {
468  global $ilCtrl, $ilBench;
469 
470  $ilBench->start("Column", "getHTML");
471 
472  $ilCtrl->setParameter($this, "col_side" ,$this->getSide());
473 
474  $this->tpl = new ilTemplate("tpl.column.html", true, true, "Services/Block");
475 
476  $ilBench->start("Column", "determineBlocks");
477  $this->determineBlocks();
478  $ilBench->stop("Column", "determineBlocks");
479 
480  $ilBench->start("Column", "showBlocks");
481  $this->showBlocks();
482  $ilBench->stop("Column", "showBlocks");
483 
484  if ($this->getEnableEdit() || !$this->getRepositoryMode())
485  {
486  $this->addHiddenBlockSelector();
487  }
488 
489  $ilBench->stop("Column", "getHTML");
490 
491  return $this->tpl->get();
492  }
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 308 of file class.ilColumnGUI.php.

References $movementmode.

Referenced by showBlocks().

309  {
310  return $this->movementmode;
311  }
+ Here is the caller graph for this function:

◆ getRepositoryItems()

ilColumnGUI::getRepositoryItems ( )

Get Repository Items.

Returns
array Repository Items

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

References $repositoryitems.

Referenced by determineBlocks().

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

◆ getRepositoryMode()

ilColumnGUI::getRepositoryMode ( )

Get RepositoryMode.

Returns
boolean RepositoryMode

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

References $repositorymode.

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

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

◆ getScreenMode()

static ilColumnGUI::getScreenMode ( )
static

Get Screen Mode for current command.

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

337  {
338  global $ilCtrl;
339 
340  if ($ilCtrl->getCmdClass() == "ilcolumngui")
341  {
342  switch ($ilCtrl->getCmd())
343  {
344  case "addBlock":
345  return IL_SCREEN_CENTER;
346  }
347  }
348 
349  $cur_block_type = "";
350  if (isset($_GET["block_type"]) && $_GET["block_type"])
351  {
352  $cur_block_type = $_GET["block_type"];
353  }
354  else if (isset($_POST["block_type"]))
355  {
356  $cur_block_type = $_POST["block_type"];
357  }
358 
359  if ($class = array_search($cur_block_type, self::$block_types))
360  {
361  include_once("./".self::$locations[$class]."classes/".
362  "class.".$class.".php");
363  return call_user_func(array($class, 'getScreenMode'));
364  }
365 
366  return IL_SCREEN_SIDE;
367  }
$_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 228 of file class.ilColumnGUI.php.

References $side.

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

229  {
230  return $this->side;
231  }
+ 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 990 of file class.ilColumnGUI.php.

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

Referenced by determineBlocks(), and showBlocks().

991  {
992 
993  global $ilSetting;
994  if (isset($this->check_global_activation[$a_type]) && $this->check_global_activation[$a_type])
995  {
996  if ($a_type == 'pdbookm')
997  {
998  if (!$ilSetting->get("disable_bookmarks"))
999  {
1000  return true;
1001  }
1002  return false;
1003  }
1004  else if ($a_type == 'pdnotes')
1005  {
1006  if (!$ilSetting->get("disable_notes"))
1007  {
1008  return true;
1009  }
1010  return false;
1011  }
1012  elseif($a_type == 'news')
1013  {
1014  include_once 'Services/Container/classes/class.ilContainer.php';
1015  return
1016  $ilSetting->get('block_activated_news') &&
1018  $GLOBALS['ilCtrl']->getContextObjId(),
1019  'cont_show_news',
1020  true
1021  );
1022  }
1023  else if ($ilSetting->get("block_activated_".$a_type))
1024  {
1025  return true;
1026  }
1027  elseif($a_type == 'cal')
1028  {
1029  include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
1030  return ilCalendarSettings::lookupCalendarActivated($GLOBALS['ilCtrl']->getContextObjId());
1031 
1032  }
1033  elseif($a_type == 'pdcal')
1034  {
1035  include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
1036  return ilCalendarSettings::_getInstance()->isEnabled();
1037  }
1038  return false;
1039  }
1040  return true;
1041  }
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 1125 of file class.ilColumnGUI.php.

References $action_menu.

1126  {
1127  $this->action_menu = $action_menu;
1128  return $this;
1129  }

◆ setAdminCommands()

ilColumnGUI::setAdminCommands (   $a_admincommands)

Set Administration Commmands.

Parameters
boolean$a_admincommandsAdministration Commmands

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

279  {
280  $this->admincommands = $a_admincommands;
281  }

◆ setAllBlockProperties()

ilColumnGUI::setAllBlockProperties (   $a_block_properties)

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

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

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

Referenced by ilObjForumGUI\checkEnableColumnEdit().

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

◆ setColType()

ilColumnGUI::setColType (   $a_coltype)

Set Column Type.

Parameters
string$a_coltypeColumn Type

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

Referenced by __construct().

199  {
200  $this->coltype = $a_coltype;
201  }
+ Here is the caller graph for this function:

◆ setEnableEdit()

ilColumnGUI::setEnableEdit (   $a_enableedit)

Set EnableEdit.

Parameters
boolean$a_enableeditEnableEdit

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

239  {
240  $this->enableedit = $a_enableedit;
241  }

◆ setEnableMovement()

ilColumnGUI::setEnableMovement (   $a_enablemovement)

Set Enable Movement.

Parameters
boolean$a_enablemovementEnable Movement

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

319  {
320  $this->enablemovement = $a_enablemovement;
321  }

◆ setMovementMode()

ilColumnGUI::setMovementMode (   $a_movementmode)

Set Movement Mode.

Parameters
boolean$a_movementmodeMovement Mode

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

299  {
300  $this->movementmode = $a_movementmode;
301  }

◆ setRepositoryItems()

ilColumnGUI::setRepositoryItems (   $a_repositoryitems)

Set Repository Items.

Parameters
array$a_repositoryitemsRepository Items

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

397  {
398  $this->repositoryitems = $a_repositoryitems;
399  }

◆ setRepositoryMode()

ilColumnGUI::setRepositoryMode (   $a_repositorymode)

Set RepositoryMode.

Parameters
boolean$a_repositorymodeRepositoryMode

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

Referenced by ilObjForumGUI\checkEnableColumnEdit().

259  {
260  $this->repositorymode = $a_repositorymode;
261  }
+ 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 218 of file class.ilColumnGUI.php.

Referenced by __construct().

219  {
220  $this->side = $a_side;
221  }
+ Here is the caller graph for this function:

◆ showBlocks()

ilColumnGUI::showBlocks ( )

Show blocks.

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

References $ilBench, $ilCtrl, $ilUser, $lng, $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().

498  {
499  global $ilCtrl, $lng, $ilUser, $ilBench;
500 
501  $i = 1;
502  $sum_moveable = count($this->blocks[$this->getSide()]);
503 
504  foreach($this->blocks[$this->getSide()] as $block)
505  {
506  if ($ilCtrl->getContextObjType() != "user" ||
507  ilBlockSetting::_lookupDetailLevel($block["type"],
508  $ilUser->getId(), $block["id"]) > 0)
509  {
510  $gui_class = $block["class"];
511  $block_class = substr($block["class"], 0, strlen($block["class"])-3);
512 
513  // get block gui class
514  include_once("./".self::$locations[$gui_class]."classes/".
515  "class.".$gui_class.".php");
516  $ilBench->start("Column", "instantiate-".$block["type"]);
517  $block_gui = new $gui_class();
518  $ilBench->stop("Column", "instantiate-".$block["type"]);
519  if (isset($this->block_property[$block["type"]]))
520  {
521  $block_gui->setProperties($this->block_property[$block["type"]]);
522  }
523  $block_gui->setRepositoryMode($this->getRepositoryMode());
524  $block_gui->setEnableEdit($this->getEnableEdit());
525  $block_gui->setAdminCommands($this->getAdminCommands());
526 
527  // get block for custom blocks
528  if ($block["custom"])
529  {
530  include_once("./".self::$locations[$gui_class]."classes/".
531  "class.".$block_class.".php");
532  $app_block = new $block_class($block["id"]);
533  $block_gui->setBlock($app_block);
534  if (isset($block["ref_id"]))
535  {
536  $block_gui->setRefId($block["ref_id"]);
537  }
538  }
539 
540  $ilCtrl->setParameter($this, "block_type", $block_gui->getBlockType());
541  $this->tpl->setCurrentBlock("col_block");
542 
543  $ilBench->start("Column", "showBlocks-".$block_gui->getBlockType());
544  $html = $ilCtrl->getHTML($block_gui);
545  $ilBench->stop("Column", "showBlocks-".$block_gui->getBlockType());
546 
547  // dummy block, if non visible, but movement is ongoing
548  if ($html == "" && $this->getRepositoryMode() &&
549  $this->getMovementMode())
550  {
551  include_once("./Services/Block/classes/class.ilDummyBlockGUI.php");
552  $bl = new ilDummyBlockGUI();
553  $bl->setBlockId($block["id"]);
554  $bl->setBlockType($block["type"]);
555  $bl->setTitle($lng->txt("invisible_block"));
556  $bl->setConfigMode($this->getMovementMode());
557  $html = $bl->getHTML();
558  }
559 
560  // don't render a block if it's empty
561  if ($html != "")
562  {
563  $this->tpl->setVariable("BLOCK", $html);
564  $this->tpl->parseCurrentBlock();
565  $ilCtrl->setParameter($this, "block_type", "");
566  }
567 
568  // count (moveable) blocks
569  if ($block["type"] != "pdsysmess" && $block["type"] != "pdfeedb" &&
570  $block["type"] != "news")
571  {
572  $i++;
573  }
574  else
575  {
576  $sum_moveable--;
577  }
578  }
579  }
580  }
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.
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
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 723 of file class.ilColumnGUI.php.

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

724  {
725  global $ilCtrl, $ilBench;
726 
727  $this->determineBlocks();
728  $i = 1;
729  $sum_moveable = count($this->blocks[$this->getSide()]);
730 
731  foreach ($this->blocks[$this->getSide()] as $block)
732  {
733 
734  include_once("./".self::$locations[$block["class"]]."classes/".
735  "class.".$block["class"].".php");
736 
737  // set block id to context obj id,
738  // if block is not a custom block and context is not personal desktop
739  if (!$block["custom"] && $ilCtrl->getContextObjType() != "" && $ilCtrl->getContextObjType() != "user")
740  {
741  $block["id"] = $ilCtrl->getContextObjId();
742  }
743 
744  //if (is_int(strpos($_GET["block_id"], "block_".$block["type"]."_".$block["id"])))
745 
746  if ($_GET["block_id"] == "block_".$block["type"]."_".$block["id"])
747  {
748  $gui_class = $block["class"];
749  $block_class = substr($block["class"], 0, strlen($block["class"])-3);
750 
751  $block_gui = new $gui_class();
752  $block_gui->setProperties($this->block_property[$block["type"]]);
753  $block_gui->setRepositoryMode($this->getRepositoryMode());
754  $block_gui->setEnableEdit($this->getEnableEdit());
755  $block_gui->setAdminCommands($this->getAdminCommands());
756 
757  // get block for custom blocks
758  if ($block["custom"])
759  {
760  include_once("./".self::$locations[$gui_class]."classes/".
761  "class.".$block_class.".php");
762  $app_block = new $block_class($block["id"]);
763  $block_gui->setBlock($app_block);
764  $block_gui->setRefId($block["ref_id"]);
765  }
766 
767  $ilCtrl->setParameter($this, "block_type", $block["type"]);
768  echo $ilCtrl->getHTML($block_gui);
769  $ilBench->save();
770  exit;
771  }
772 
773  // count (moveable) blocks
774  if ($block["type"] != "pdsysmess" && $block["type"] != "pdfeedb"
775  && $block["type"] != "news")
776  {
777  $i++;
778  }
779  else
780  {
781  $sum_moveable--;
782  }
783  }
784  echo "Error: ilColumnGUI::updateBlock: Block '".
785  $_GET["block_id"]."' unknown.";
786  exit;
787  }
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",
"ilHtmlBlockGUI" => "html",
'ilPDTaggingBlockGUI' => 'pdtag',
'ilChatroomBlockGUI' => 'chatviewer',
'ilPollBlockGUI' => 'poll'
)

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)

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

◆ $check_nr_limit

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

Definition at line 139 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(),
"pd" => array("ilPDExternalFeedBlockGUI")
)

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

◆ $default_blocks

ilColumnGUI::$default_blocks
protected
Initial value:
= array(
"cat" => array("ilNewsForContextBlockGUI" => IL_COL_RIGHT),
"crs" => array(
"ilNewsForContextBlockGUI" => IL_COL_RIGHT,
"ilCalendarBlockGUI" => IL_COL_RIGHT
),
"grp" => array(
"ilNewsForContextBlockGUI" => IL_COL_RIGHT,
"ilCalendarBlockGUI" => IL_COL_RIGHT),
"frm" => array("ilNewsForContextBlockGUI" => IL_COL_RIGHT),
"root" => array(),
"info" => array(
"ilNewsForContextBlockGUI" => IL_COL_RIGHT),
"pd" => array(
"ilPDCalendarBlockGUI" => IL_COL_RIGHT,
"ilPDSysMessageBlockGUI" => IL_COL_LEFT,
"ilPDNewsBlockGUI" => IL_COL_LEFT,
"ilPDSelectedItemsBlockGUI" => IL_COL_CENTER,
"ilPDMailBlockGUI" => IL_COL_RIGHT,
"ilPDNotesBlockGUI" => IL_COL_RIGHT,
"ilUsersOnlineBlockGUI" => IL_COL_RIGHT,
"ilBookmarkBlockGUI" => IL_COL_RIGHT,
"ilPDTaggingBlockGUI" => IL_COL_RIGHT,
"ilChatroomBlockGUI" => IL_COL_RIGHT
)
)

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/",
"ilHtmlBlockGUI" => "Services/Block/",
'ilPDTaggingBlockGUI' => 'Services/Tagging/',
'ilChatroomBlockGUI' => 'Modules/Chatroom/',
'ilPollBlockGUI' => 'Modules/Poll/'
)

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: