ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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$

@ilCtrl_IsCalledBy ilColumnGUI: ilCalendarGUI @ilCtrl_Calls 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 165 of file class.ilColumnGUI.php.

166 {
167 $this->setColType($a_col_type);
168 $this->setSide($a_side);
169 }
setColType($a_coltype)
Set Column Type.
setSide($a_side)
Set Side IL_COL_LEFT | IL_COL_RIGHT.

References setColType(), and setSide().

+ Here is the call graph for this function:

Member Function Documentation

◆ activateBlock()

ilColumnGUI::activateBlock ( )

Activate hidden block.

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

820 {
821 global $ilUser, $ilCtrl;
822
823 if ($_GET["block"] != "")
824 {
825 $block = explode("_", $_GET["block"]);
826 include_once("Services/Block/classes/class.ilBlockSetting.php");
827 ilBlockSetting::_writeDetailLevel($block[0], 2, $ilUser->getId(), $block[1]);
828 }
829
830 $ilCtrl->returnToParent($this);
831 }
$_GET["client_id"]
static _writeDetailLevel($a_type, $a_value, $a_user=0, $a_block_id=0)
Write detail level to database.
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15

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

+ Here is the call graph for this function:

◆ addBlock()

ilColumnGUI::addBlock ( )

Add a block.

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

838 {
839 global $ilCtrl;
840
841 $class = array_search($_GET["block_type"], self::$block_types);
842
843 $ilCtrl->setCmdClass($class);
844 $ilCtrl->setCmd("create");
845 include_once("./".self::$locations[$class]."classes/class.".$class.".php");
846 $block_gui = new $class();
847 $block_gui->setProperties($this->block_property[$_GET["block_type"]]);
848 $block_gui->setRepositoryMode($this->getRepositoryMode());
849 $block_gui->setEnableEdit($this->getEnableEdit());
850 $block_gui->setAdminCommands($this->getAdminCommands());
851
852 $ilCtrl->setParameter($this, "block_type", $_GET["block_type"]);
853 $html = $ilCtrl->forwardCommand($block_gui);
854 $ilCtrl->setParameter($this, "block_type", "");
855 return $html;
856 }
getRepositoryMode()
Get RepositoryMode.
getEnableEdit()
Get EnableEdit.
getAdminCommands()
Get Administration Commmands.
$html
Definition: example_001.php:87

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

+ Here is the call graph for this function:

◆ addCustomBlockLocation()

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

Adds location information of the custom block gui.

@access public

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

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

182 {
183 self::$locations[$className] = $path;
184 }
$path
Definition: index.php:22

References $path.

◆ addCustomBlockType()

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

Adds the block type of the custom block gui.

@access public

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

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

197 {
198 self::$block_types[$className] = $identifier;
199 }

◆ determineBlocks()

ilColumnGUI::determineBlocks ( )

Determine which blocks to show.

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

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

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().

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

1121 {
1122 global $ilSetting, $ilCtrl;
1123
1124 if ($this->check_nr_limit[$a_type])
1125 {
1126 if (!$this->getRepositoryMode())
1127 {
1128 include_once("./Services/Block/classes/class.ilCustomBlock.php");
1129 $costum_block = new ilCustomBlock();
1130 $costum_block->setContextObjId($ilCtrl->getContextObjId());
1131 $costum_block->setContextObjType($ilCtrl->getContextObjType());
1132 $costum_block->setType($a_type);
1133 $res = $costum_block->queryCntBlockForContext();
1134 $cnt = (int) $res[0]["cnt"];
1135 }
1136 else
1137 {
1138 return false; // not implemented for repository yet
1139 }
1140
1141
1142 if ($ilSetting->get("block_limit_".$a_type) > $cnt)
1143 {
1144 return false;
1145 }
1146 else
1147 {
1148 return true;
1149 }
1150 }
1151 return false;
1152 }

References $ilCtrl, $ilSetting, $res, and getRepositoryMode().

+ Here is the call graph for this function:

◆ executeCommand()

& ilColumnGUI::executeCommand ( )

execute command

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

433 {
434 global $ilCtrl;
435
436 $ilCtrl->setParameter($this, "col_side" ,$this->getSide());
437 //$ilCtrl->saveParameter($this, "col_side");
438
439 $next_class = $ilCtrl->getNextClass();
440 $cmd = $ilCtrl->getCmd("getHTML");
441
442 $cur_block_type = ($_GET["block_type"])
443 ? $_GET["block_type"]
444 : $_POST["block_type"];
445
446 if ($next_class != "")
447 {
448 // forward to block
449 if ($gui_class = array_search($cur_block_type, self::$block_types))
450 {
451 include_once("./".self::$locations[$gui_class]."classes/".
452 "class.".$gui_class.".php");
453 $ilCtrl->setParameter($this, "block_type", $cur_block_type);
454 $block_gui = new $gui_class();
455 $block_gui->setProperties($this->block_property[$cur_block_type]);
456 $block_gui->setRepositoryMode($this->getRepositoryMode());
457 $block_gui->setEnableEdit($this->getEnableEdit());
458 $block_gui->setAdminCommands($this->getAdminCommands());
459
460 if (in_array($gui_class, $this->custom_blocks[$this->getColType()]) ||
461 in_array($cur_block_type, $this->rep_block_types))
462 {
463 $block_class = substr($gui_class, 0, strlen($gui_class)-3);
464 include_once("./".self::$locations[$gui_class]."classes/".
465 "class.".$block_class.".php");
466 $app_block = new $block_class($_GET["block_id"]);
467 $block_gui->setBlock($app_block);
468 }
469 $html = $ilCtrl->forwardCommand($block_gui);
470 $ilCtrl->setParameter($this, "block_type", "");
471
472 return $html;
473 }
474 }
475 else
476 {
477 return $this->$cmd();
478 }
479 }
getSide()
Get Side IL_COL_LEFT | IL_COL_RIGHT.
$_POST['username']
Definition: cron.php:12
$cmd
Definition: sahs_server.php:35

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

+ Here is the call graph for this function:

◆ getActionMenu()

ilColumnGUI::getActionMenu ( )
Returns
\ilAdvancedSelectionListGUI

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

1209 {
1210 return $this->action_menu;
1211 }

References $action_menu.

◆ getAdminCommands()

ilColumnGUI::getAdminCommands ( )

Get Administration Commmands.

Returns
boolean Administration Commmands

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

307 {
309 }

References $admincommands.

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

+ Here is the caller graph for this function:

◆ getBlockProperties()

ilColumnGUI::getBlockProperties (   $a_block_type)

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

400 {
401 return $this->block_property[$a_block_type];
402 }

◆ getCmdSide()

static ilColumnGUI::getCmdSide ( )
static

Get Column Side of Current Command.

Returns
string Column Side

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

207 {
208 return $_GET["col_side"];
209 }

References $_GET.

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

+ Here is the caller graph for this function:

◆ getColType()

ilColumnGUI::getColType ( )

Get Column Type.

Returns
string Column Type

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

227 {
228 return $this->coltype;
229 }

Referenced by determineBlocks(), and executeCommand().

+ Here is the caller graph for this function:

◆ getEnableEdit()

ilColumnGUI::getEnableEdit ( )

Get EnableEdit.

Returns
boolean EnableEdit

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

267 {
268 return $this->enableedit;
269 }

References $enableedit.

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

+ Here is the caller graph for this function:

◆ getEnableMovement()

ilColumnGUI::getEnableMovement ( )

Get Enable Movement.

Returns
boolean Enable Movement

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

347 {
349 }

References $enablemovement.

◆ getHTML()

ilColumnGUI::getHTML ( )

Get HTML for column.

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

485 {
486 global $ilCtrl, $ilBench;
487
488 $ilBench->start("Column", "getHTML");
489
490 $ilCtrl->setParameter($this, "col_side" ,$this->getSide());
491
492 $this->tpl = new ilTemplate("tpl.column.html", true, true, "Services/Block");
493
494 $ilBench->start("Column", "determineBlocks");
495 $this->determineBlocks();
496 $ilBench->stop("Column", "determineBlocks");
497
498 $ilBench->start("Column", "showBlocks");
499 $this->showBlocks();
500 $ilBench->stop("Column", "showBlocks");
501
502 if ($this->getEnableEdit() || !$this->getRepositoryMode())
503 {
504 $this->addHiddenBlockSelector();
505 }
506
507 $ilBench->stop("Column", "getHTML");
508
509 return $this->tpl->get();
510 }
showBlocks()
Show blocks.
determineBlocks()
Determine which blocks to show.
special template class to simplify handling of ITX/PEAR
global $ilBench
Definition: ilias.php:18

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

+ Here is the call graph for this function:

◆ getMovementMode()

ilColumnGUI::getMovementMode ( )

Get Movement Mode.

Returns
boolean Movement Mode

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

327 {
328 return $this->movementmode;
329 }

References $movementmode.

Referenced by showBlocks().

+ Here is the caller graph for this function:

◆ getRepositoryItems()

ilColumnGUI::getRepositoryItems ( )

Get Repository Items.

Returns
array Repository Items

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

425 {
427 }

References $repositoryitems.

Referenced by determineBlocks().

+ Here is the caller graph for this function:

◆ getRepositoryMode()

ilColumnGUI::getRepositoryMode ( )

Get RepositoryMode.

Returns
boolean RepositoryMode

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

287 {
289 }

References $repositorymode.

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

+ Here is the caller graph for this function:

◆ getScreenMode()

static ilColumnGUI::getScreenMode ( )
static

Get Screen Mode for current command.

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

355 {
356 global $ilCtrl;
357
358 if ($ilCtrl->getCmdClass() == "ilcolumngui")
359 {
360 switch ($ilCtrl->getCmd())
361 {
362 case "addBlock":
363 return IL_SCREEN_CENTER;
364 }
365 }
366
367 $cur_block_type = "";
368 if (isset($_GET["block_type"]) && $_GET["block_type"])
369 {
370 $cur_block_type = $_GET["block_type"];
371 }
372 else if (isset($_POST["block_type"]))
373 {
374 $cur_block_type = $_POST["block_type"];
375 }
376
377 if ($class = array_search($cur_block_type, self::$block_types))
378 {
379 include_once("./".self::$locations[$class]."classes/".
380 "class.".$class.".php");
381 return call_user_func(array($class, 'getScreenMode'));
382 }
383
384 return IL_SCREEN_SIDE;
385 }
const IL_SCREEN_SIDE
const IL_SCREEN_CENTER

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

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

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

247 {
248 return $this->side;
249 }

References $side.

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

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

1048 {
1049
1050 global $ilSetting;
1051 if (isset($this->check_global_activation[$a_type]) && $this->check_global_activation[$a_type])
1052 {
1053 if ($a_type == 'pdbookm')
1054 {
1055 if (!$ilSetting->get("disable_bookmarks"))
1056 {
1057 return true;
1058 }
1059 return false;
1060 }
1061 else if ($a_type == 'pdnotes')
1062 {
1063 if (!$ilSetting->get("disable_notes"))
1064 {
1065 return true;
1066 }
1067 return false;
1068 }
1069 else if ($a_type == 'pdportf')
1070 {
1071 if ($ilSetting->get("user_portfolios"))
1072 {
1073 $prfa_set = new ilSetting("prfa");
1074 if ($prfa_set->get("pd_block", false))
1075 {
1076 return true;
1077 }
1078 }
1079 return false;
1080 }
1081 elseif($a_type == 'news')
1082 {
1083 include_once 'Services/Container/classes/class.ilContainer.php';
1084 return
1085 $ilSetting->get('block_activated_news') &&
1087 $GLOBALS['ilCtrl']->getContextObjId(),
1088 'cont_show_news',
1089 true
1090 );
1091 }
1092 else if ($ilSetting->get("block_activated_".$a_type))
1093 {
1094 return true;
1095 }
1096 elseif($a_type == 'cal')
1097 {
1098 include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
1099 return ilCalendarSettings::lookupCalendarActivated($GLOBALS['ilCtrl']->getContextObjId());
1100
1101 }
1102 elseif($a_type == 'pdcal')
1103 {
1104 include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
1105 return ilCalendarSettings::_getInstance()->isEnabled();
1106 }
1107 elseif($a_type == "tagcld")
1108 {
1109 $tags_active = new ilSetting("tags");
1110 return (bool)$tags_active->get("enable", false);
1111 }
1112 return false;
1113 }
1114 return true;
1115 }
static _getInstance()
get singleton instance
static lookupCalendarActivated($a_obj_id)
_lookupContainerSetting($a_id, $a_keyword, $a_default_value=NULL)
Lookup a container setting.
ILIAS Setting Class.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276

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

Referenced by determineBlocks().

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

1200 {
1201 $this->action_menu = $action_menu;
1202 return $this;
1203 }

References $action_menu.

◆ setAdminCommands()

ilColumnGUI::setAdminCommands (   $a_admincommands)

Set Administration Commmands.

Parameters
boolean$a_admincommandsAdministration Commmands

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

297 {
298 $this->admincommands = $a_admincommands;
299 }

◆ setAllBlockProperties()

ilColumnGUI::setAllBlockProperties (   $a_block_properties)

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

405 {
406 $this->block_property = $a_block_properties;
407 }

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

395 {
396 $this->block_property[$a_block_type][$a_property] = $a_value;
397 }

◆ setColType()

ilColumnGUI::setColType (   $a_coltype)

Set Column Type.

Parameters
string$a_coltypeColumn Type

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

217 {
218 $this->coltype = $a_coltype;
219 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setEnableEdit()

ilColumnGUI::setEnableEdit (   $a_enableedit)

Set EnableEdit.

Parameters
boolean$a_enableeditEnableEdit

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

257 {
258 $this->enableedit = $a_enableedit;
259 }

◆ setEnableMovement()

ilColumnGUI::setEnableMovement (   $a_enablemovement)

Set Enable Movement.

Parameters
boolean$a_enablemovementEnable Movement

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

337 {
338 $this->enablemovement = $a_enablemovement;
339 }

◆ setMovementMode()

ilColumnGUI::setMovementMode (   $a_movementmode)

Set Movement Mode.

Parameters
boolean$a_movementmodeMovement Mode

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

317 {
318 $this->movementmode = $a_movementmode;
319 }

◆ setRepositoryItems()

ilColumnGUI::setRepositoryItems (   $a_repositoryitems)

Set Repository Items.

Parameters
array$a_repositoryitemsRepository Items

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

415 {
416 $this->repositoryitems = $a_repositoryitems;
417 }

◆ setRepositoryMode()

ilColumnGUI::setRepositoryMode (   $a_repositorymode)

Set RepositoryMode.

Parameters
boolean$a_repositorymodeRepositoryMode

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

277 {
278 $this->repositorymode = $a_repositorymode;
279 }

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

237 {
238 $this->side = $a_side;
239 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ showBlocks()

ilColumnGUI::showBlocks ( )

Show blocks.

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

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

References $html, $ilBench, $ilCtrl, $ilUser, $lng, $path, ilBlockSetting\_lookupDetailLevel(), getAdminCommands(), getEnableEdit(), getMovementMode(), getRepositoryMode(), and getSide().

Referenced by getHTML().

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

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

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

+ 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',
'ilPDPortfolioBlockGUI' => 'pdportf',
"ilPDStudyProgrammeSimpleListGUI" => "prgsimplelist",
"ilPDStudyProgrammeExpandableListGUI" => "prgexpandablelist"
)

Definition at line 69 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,
"pdportf" => true)

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

◆ $check_nr_limit

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

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

◆ $default_blocks

ilColumnGUI::$default_blocks
protected

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

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(), 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: