4 define(
"IL_COL_LEFT",
"left");
5 define(
"IL_COL_RIGHT",
"right");
6 define(
"IL_COL_CENTER",
"center");
8 define(
"IL_SCREEN_SIDE",
"");
9 define(
"IL_SCREEN_CENTER",
"center");
10 define(
"IL_SCREEN_FULL",
"full");
78 "ilNewsForContextBlockGUI" =>
"Services/News/",
79 "ilCalendarBlockGUI" =>
"Services/Calendar/",
80 "ilPDCalendarBlockGUI" =>
"Services/Calendar/",
81 "ilPDNotesBlockGUI" =>
"Services/Notes/",
82 "ilPDMailBlockGUI" =>
"Services/Mail/",
83 "ilUsersOnlineBlockGUI" =>
"Services/PersonalDesktop/",
84 "ilPDSysMessageBlockGUI" =>
"Services/Mail/",
85 "ilPDSelectedItemsBlockGUI" =>
"Services/PersonalDesktop/ItemsBlock/",
86 "ilBookmarkBlockGUI" =>
"Services/Bookmarks/",
87 "ilPDNewsBlockGUI" =>
"Services/News/",
88 "ilExternalFeedBlockGUI" =>
"Services/Block/",
89 "ilPDExternalFeedBlockGUI" =>
"Services/Feeds/",
90 'ilPDTaggingBlockGUI' =>
'Services/Tagging/',
91 'ilChatroomBlockGUI' =>
'Modules/Chatroom/',
92 'ilPollBlockGUI' =>
'Modules/Poll/',
93 'ilClassificationBlockGUI' =>
'Services/Classification/',
94 'ilPDPortfolioBlockGUI' =>
'Modules/Portfolio/',
95 "ilPDStudyProgrammeSimpleListGUI" =>
"Modules/StudyProgramme/",
96 "ilPDStudyProgrammeExpandableListGUI" =>
"Modules/StudyProgramme/",
97 "ilForumPostingDraftsBlockGUI" =>
"Modules/Forum/" 101 "ilPDMailBlockGUI" =>
"pdmail",
102 "ilPDNotesBlockGUI" =>
"pdnotes",
103 "ilUsersOnlineBlockGUI" =>
"pdusers",
104 "ilPDNewsBlockGUI" =>
"pdnews",
105 "ilBookmarkBlockGUI" =>
"pdbookm",
106 "ilNewsForContextBlockGUI" =>
"news",
107 "ilCalendarBlockGUI" =>
"cal",
108 "ilPDCalendarBlockGUI" =>
"pdcal",
109 "ilExternalFeedBlockGUI" =>
"feed",
110 "ilPDExternalFeedBlockGUI" =>
"pdfeed",
111 "ilPDSysMessageBlockGUI" =>
"pdsysmess",
112 "ilPDSelectedItemsBlockGUI" =>
"pditems",
113 'ilPDTaggingBlockGUI' =>
'pdtag',
114 'ilChatroomBlockGUI' =>
'chatviewer',
115 'ilPollBlockGUI' =>
'poll',
116 'ilClassificationBlockGUI' =>
'clsfct',
117 'ilPDPortfolioBlockGUI' =>
'pdportf',
118 "ilPDStudyProgrammeSimpleListGUI" =>
"prgsimplelist",
119 "ilPDStudyProgrammeExpandableListGUI" =>
"prgexpandablelist",
120 "ilForumPostingDraftsBlockGUI" =>
"pdfrmpostdraft" 171 "pd" =>
array(
"ilPDExternalFeedBlockGUI")
177 array(
"news" =>
true,
187 "chatviewer" =>
true,
188 "pdfrmpostdraft" =>
true,
194 array(
"pdfeed" =>
true);
201 public function __construct($a_col_type =
"", $a_side =
"", $use_std_context =
false)
205 $this->ctrl = $DIC->ctrl();
206 $this->lng = $DIC->language();
207 $this->
user = $DIC->user();
208 $this->tpl = $DIC[
"tpl"];
209 $this->browser = $DIC[
"ilBrowser"];
227 self::$locations[$className] =
$path;
242 self::$block_types[$className] = $identifier;
252 return $_GET[
"col_side"];
262 $this->coltype = $a_coltype;
272 return $this->coltype;
282 $this->side = $a_side;
302 $this->enableedit = $a_enableedit;
322 $this->repositorymode = $a_repositorymode;
342 $this->admincommands = $a_admincommands;
362 $this->movementmode = $a_movementmode;
382 $this->enablemovement = $a_enablemovement;
404 if (
$ilCtrl->getCmdClass() ==
"ilcolumngui") {
411 $cur_block_type =
"";
412 if (isset(
$_GET[
"block_type"]) &&
$_GET[
"block_type"]) {
413 $cur_block_type =
$_GET[
"block_type"];
414 } elseif (isset(
$_POST[
"block_type"])) {
415 $cur_block_type =
$_POST[
"block_type"];
418 if ($class = array_search($cur_block_type, self::$block_types)) {
419 include_once(
"./" . self::$locations[$class] .
"classes/" .
420 "class." . $class .
".php");
421 return call_user_func(
array($class,
'getScreenMode'));
436 $this->block_property[$a_block_type][$a_property] = $a_value;
441 return $this->block_property[$a_block_type];
446 $this->block_property = $a_block_properties;
456 $this->repositoryitems = $a_repositoryitems;
479 $next_class =
$ilCtrl->getNextClass();
480 $cmd =
$ilCtrl->getCmd(
"getHTML");
482 $cur_block_type = (
$_GET[
"block_type"])
483 ?
$_GET[
"block_type"]
486 if ($next_class !=
"") {
488 if ($gui_class = array_search($cur_block_type, self::$block_types)) {
489 include_once(
"./" . self::$locations[$gui_class] .
"classes/" .
490 "class." . $gui_class .
".php");
491 $ilCtrl->setParameter($this,
"block_type", $cur_block_type);
492 $block_gui =
new $gui_class();
493 $block_gui->setProperties($this->block_property[$cur_block_type]);
498 if (in_array($gui_class, $this->custom_blocks[$this->
getColType()]) ||
499 in_array($cur_block_type, $this->rep_block_types)) {
500 $block_class = substr($gui_class, 0, strlen($gui_class)-3);
501 include_once(
"./" . self::$locations[$gui_class] .
"classes/" .
502 "class." . $block_class .
".php");
503 $app_block =
new $block_class(
$_GET[
"block_id"]);
504 $block_gui->setBlock($app_block);
507 $ilCtrl->setParameter($this,
"block_type",
"");
512 return $this->$cmd();
525 $this->tpl =
new ilTemplate(
"tpl.column.html",
true,
true,
"Services/Block");
531 $this->addHiddenBlockSelector();
534 return $this->tpl->get();
547 $sum_moveable = count($this->blocks[$this->
getSide()]);
549 foreach ($this->blocks[$this->
getSide()] as $block) {
550 if (
$ilCtrl->getContextObjType() !=
"user" ||
556 $gui_class = $block[
"class"];
557 $block_class = substr($block[
"class"], 0, strlen($block[
"class"])-3);
560 include_once(
"./" . self::$locations[$gui_class] .
"classes/" .
561 "class." . $gui_class .
".php");
562 $block_gui =
new $gui_class();
563 if (isset($this->block_property[$block[
"type"]])) {
564 $block_gui->setProperties($this->block_property[$block[
"type"]]);
571 if ($block[
"custom"]) {
572 $path =
"./" . self::$locations[$gui_class] .
"classes/" .
573 "class." . $block_class .
".php";
574 if (file_exists(
$path)) {
576 $app_block =
new $block_class($block[
"id"]);
581 $block_gui->setBlock($app_block);
582 if (isset($block[
"ref_id"])) {
583 $block_gui->setRefId($block[
"ref_id"]);
587 $ilCtrl->setParameter($this,
"block_type", $block_gui->getBlockType());
588 $this->tpl->setCurrentBlock(
"col_block");
595 include_once(
"./Services/Block/classes/class.ilDummyBlockGUI.php");
597 $bl->setBlockId($block[
"id"]);
598 $bl->setBlockType($block[
"type"]);
599 $bl->setTitle(
$lng->txt(
"invisible_block"));
601 $html = $bl->getHTML();
606 $this->tpl->setVariable(
"BLOCK",
$html);
607 $this->tpl->parseCurrentBlock();
608 $ilCtrl->setParameter($this,
"block_type",
"");
612 if ($block[
"type"] !=
"pdsysmess" && $block[
"type"] !=
"pdfeedb" &&
613 $block[
"type"] !=
"news") {
625 public function addHiddenBlockSelector()
638 include_once(
"Services/Block/classes/class.ilBlockSetting.php");
639 $hidden_blocks =
array();
641 foreach ($this->blocks[$this->
getSide()] as $block) {
642 include_once(
"./" . self::$locations[$block[
"class"]] .
"classes/" .
643 "class." . $block[
"class"] .
".php");
645 if ($block[
"custom"] ==
false) {
646 if (
$ilCtrl->getContextObjType() ==
"user") {
648 $hidden_blocks[$block[
"type"]] =
$lng->txt(
'block_show_' . $block[
"type"]);
650 } elseif (
$ilCtrl->getContextObjType() !=
"") {
656 $hidden_blocks[$block[
"type"] .
"_" .
$ilCtrl->getContextObjId()] =
$lng->txt(
'block_show_' . $block[
"type"]);
665 include_once(
"./Services/Block/classes/class.ilCustomBlock.php");
667 $hidden_blocks[$block[
"type"] .
"_" . $block[
"id"]] = sprintf(
$lng->txt(
'block_show_x'), $cblock->getTitle());
671 if (count($hidden_blocks) > 0) {
672 foreach ($hidden_blocks as
$id =>
$title) {
674 $this->action_menu->addItem(
$title,
'',
$ilCtrl->getLinkTarget($this,
'activateBlock'));
675 $ilCtrl->setParameter($this,
'block',
'');
681 $add_blocks =
array();
683 if (is_array($this->custom_blocks[$this->
getColType()])) {
684 foreach ($this->custom_blocks[$this->
getColType()] as $block_class) {
685 include_once(
"./" . self::$locations[$block_class] .
"classes/" .
686 "class." . $block_class .
".php");
687 $block_type = call_user_func(
array($block_class,
'getBlockType'));
693 $add_blocks[$block_type] =
$lng->txt(
'block_create_' . $block_type);
699 if (count($add_blocks) > 0) {
701 $ilCtrl->setParameter($this,
'block_type',
$id);
702 $this->action_menu->addItem(
$title,
'',
$ilCtrl->getLinkTarget($this,
'addBlock'));
703 $ilCtrl->setParameter($this,
'block_type',
'');
720 $main_tpl = $DIC[
"tpl"];
723 include_once
'Services/jQuery/classes/class.iljQueryUtil.php';
727 if ($ilBrowser->isMobile() || $ilBrowser->isIpad()) {
728 $main_tpl->addJavaScript(
'./libs/bower/bower_components/jqueryui-touch-punch/jquery.ui.touch-punch.min.js');
730 $main_tpl->addJavaScript(
'./Services/Block/js/block_sorting.js');
735 $this->tpl->setVariable(
'BLOCK_SORTING_STORAGE_URL',
$ilCtrl->getLinkTarget($this,
'saveBlockSortingAsynch',
'',
true,
false));
736 $this->tpl->setVariable(
'BLOCK_COLUMNS', json_encode(
array(
'il_left_col',
'il_right_col')));
737 $this->tpl->setVariable(
'BLOCK_COLUMNS_SELECTOR',
'#il_left_col,#il_right_col');
754 $sum_moveable = count($this->blocks[$this->
getSide()]);
756 foreach ($this->blocks[$this->
getSide()] as $block) {
757 include_once(
"./" . self::$locations[$block[
"class"]] .
"classes/" .
758 "class." . $block[
"class"] .
".php");
762 if (!$block[
"custom"] &&
$ilCtrl->getContextObjType() !=
"" &&
$ilCtrl->getContextObjType() !=
"user") {
763 $block[
"id"] =
$ilCtrl->getContextObjId();
768 if (
$_GET[
"block_id"] ==
"block_" . $block[
"type"] .
"_" . $block[
"id"]) {
769 $gui_class = $block[
"class"];
770 $block_class = substr($block[
"class"], 0, strlen($block[
"class"])-3);
772 $block_gui =
new $gui_class();
773 $block_gui->setProperties($this->block_property[$block[
"type"]]);
779 if ($block[
"custom"]) {
780 include_once(
"./" . self::$locations[$gui_class] .
"classes/" .
781 "class." . $block_class .
".php");
782 $app_block =
new $block_class($block[
"id"]);
783 $block_gui->setBlock($app_block);
784 $block_gui->setRefId($block[
"ref_id"]);
787 $ilCtrl->setParameter($this,
"block_type", $block[
"type"]);
788 echo
$ilCtrl->getHTML($block_gui);
793 if ($block[
"type"] !=
"pdsysmess" && $block[
"type"] !=
"pdfeedb" 794 && $block[
"type"] !=
"news") {
800 echo
"Error: ilColumnGUI::updateBlock: Block '" .
801 $_GET[
"block_id"] .
"' unknown.";
813 if (
$_GET[
"block"] !=
"") {
814 $block = explode(
"_",
$_GET[
"block"]);
815 include_once(
"Services/Block/classes/class.ilBlockSetting.php");
819 $ilCtrl->returnToParent($this);
829 $class = array_search(
$_GET[
"block_type"], self::$block_types);
833 include_once(
"./" . self::$locations[$class] .
"classes/class." . $class .
".php");
834 $block_gui =
new $class();
835 $block_gui->setProperties($this->block_property[
$_GET[
"block_type"]]);
840 $ilCtrl->setParameter($this,
"block_type", $_GET[
"block_type"]);
842 $ilCtrl->setParameter($this,
"block_type",
"");
855 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
865 if (is_array($this->default_blocks[$this->
getColType()])) {
866 foreach ($this->default_blocks[$this->
getColType()] as $class => $def_side) {
867 $type = self::$block_types[$class];
877 if (
$type ==
"news") {
880 if (
$type ==
"cal") {
883 if (
$type ==
"pdsysmess") {
886 if (
$type ==
"pdfeedb") {
889 if (
$type ==
"clsfct") {
893 if (
$side ===
false) {
908 include_once(
"./Services/Block/classes/class.ilCustomBlock.php");
910 $custom_block->setContextObjId(
$ilCtrl->getContextObjId());
911 $custom_block->setContextObjType(
$ilCtrl->getContextObjType());
912 $c_blocks = $custom_block->queryBlocksForContext();
914 foreach ($c_blocks as $c_block) {
915 $type = $c_block[
"type"];
918 $class = array_search(
$type, self::$block_types);
924 if (
$side ===
false) {
932 "id" => $c_block[
"id"],
937 include_once(
"./Services/Block/classes/class.ilCustomBlock.php");
940 foreach ($this->rep_block_types as $block_type) {
942 if (!is_array($rep_items[$block_type])) {
945 foreach ($rep_items[$block_type] as $item) {
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];
953 $class = array_search(
$type, self::$block_types);
959 if (
$side ===
false) {
967 "id" => $c_block[
"id"],
969 "ref_id" => $item[
"ref_id"]);
975 include_once(
"./Services/Block/classes/class.ilCustomBlock.php");
977 $custom_block->setContextObjId(
$ilCtrl->getContextObjId());
978 $custom_block->setContextObjType(
$ilCtrl->getContextObjType());
979 $c_blocks = $custom_block->queryBlocksForContext(
false);
981 foreach ($c_blocks as $c_block) {
982 $type = $c_block[
"type"];
983 $class = array_search(
$type, self::$block_types);
993 "id" => $c_block[
"id"],
1016 if (isset($this->check_global_activation[
$a_type]) && $this->check_global_activation[$a_type]) {
1017 if ($a_type ==
'pdbookm') {
1022 } elseif ($a_type ==
'pdnotes') {
1027 } elseif ($a_type ==
'pdportf') {
1030 if ($prfa_set->get(
"pd_block",
false)) {
1035 } elseif ($a_type ==
'news') {
1036 include_once
'Services/Container/classes/class.ilContainer.php';
1040 $GLOBALS[
'ilCtrl']->getContextObjId(),
1044 } elseif ($a_type ==
'pdsysmess') {
1045 require_once
'Services/Mail/classes/class.ilObjMail.php';
1047 } elseif (
$ilSetting->get(
"block_activated_" . $a_type)) {
1049 } elseif ($a_type ==
'cal') {
1050 include_once(
'./Services/Calendar/classes/class.ilCalendarSettings.php');
1052 } elseif ($a_type ==
'pdcal') {
1053 include_once(
'./Services/Calendar/classes/class.ilCalendarSettings.php');
1055 } elseif ($a_type ==
"tagcld") {
1057 return (
bool) $tags_active->get(
"enable",
false);
1058 } elseif ($a_type ==
"clsfct") {
1059 if (
$ilCtrl->getContextObjType() ==
"cat") {
1063 return (
bool) $tags_active->get(
"enable",
false);
1078 if ($this->check_nr_limit[
$a_type]) {
1080 include_once(
"./Services/Block/classes/class.ilCustomBlock.php");
1082 $costum_block->setContextObjId(
$ilCtrl->getContextObjId());
1083 $costum_block->setContextObjType(
$ilCtrl->getContextObjType());
1084 $costum_block->setType($a_type);
1085 $res = $costum_block->queryCntBlockForContext();
1086 $cnt = (int)
$res[0][
"cnt"];
1092 if (
$ilSetting->get(
"block_limit_" . $a_type) > $cnt) {
1104 public function saveBlockSortingAsynch()
1124 foreach ($blocks as $block) {
1125 $bid = explode(
'_', $block);
__construct($a_col_type="", $a_side="", $use_std_context=false)
Constructor.
exceededLimit($a_type)
Check whether limit is not exceeded.
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static _getInstance()
get singleton instance
static addCustomBlockType($className, $identifier)
Adds the block type of the custom block gui.
static getCmdSide()
Get Column Side of Current Command.
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 ilB...
getAdminCommands()
Get Administration Commmands.
static _writeDetailLevel($a_type, $a_value, $a_user=0, $a_block_id=0)
Write detail level to database.
setMovementMode($a_movementmode)
Set Movement Mode.
static _writeSide($a_type, $a_value, $a_user=0, $a_block_id=0)
Write side to database.
BlockGUI class for dummy block.
activateBlock()
Activate hidden block.
setAllBlockProperties($a_block_properties)
static lookupCalendarActivated($a_obj_id)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static _lookupDetailLevel($a_type, $a_user=0, $a_block_id=0)
Lookup detail level.
if(!array_key_exists('StateId', $_REQUEST)) $id
executeCommand()
execute command
setEnableEdit($a_enableedit)
Set EnableEdit.
getHTML()
Get HTML for column.
getBlockProperties($a_block_type)
setColType($a_coltype)
Set Column Type.
const PD_SYS_MSG_OWN_BLOCK
setRepositoryItems($a_repositoryitems)
Set Repository Items.
foreach($_POST as $key=> $value) $res
setActionMenu($action_menu)
getRepositoryItems()
Get Repository Items.
Column user interface class.
setRepositoryMode($a_repositorymode)
Set RepositoryMode.
special template class to simplify handling of ITX/PEAR
getSide()
Get Side IL_COL_LEFT | IL_COL_RIGHT.
getEnableEdit()
Get EnableEdit.
getMovementMode()
Get Movement Mode.
getEnableMovement()
Get Enable Movement.
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.
static initjQueryUI($a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components.txt for included components)
static getScreenMode()
Get Screen Mode for current command.
updateBlock()
Update Block (asynchronous)
static initjQuery($a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
static addCustomBlockLocation($className, $path)
Adds location information of the custom block gui.
static _writeNumber($a_type, $a_value, $a_user=0, $a_block_id=0)
Write number to database.
setAdminCommands($a_admincommands)
Set Administration Commmands.
getRepositoryMode()
Get RepositoryMode.
isGloballyActivated($a_type)
Check whether a block type is globally activated.
setSide($a_side)
Set Side IL_COL_LEFT | IL_COL_RIGHT.
getColType()
Get Column Type.
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
setEnableMovement($a_enablemovement)
Set Enable Movement.
determineBlocks()
Determine which blocks to show.