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 "ilPDSysMessageBlockGUI" =>
"Services/Mail/",
84 "ilPDSelectedItemsBlockGUI" =>
"Services/PersonalDesktop/ItemsBlock/",
85 "ilBookmarkBlockGUI" =>
"Services/Bookmarks/",
86 "ilPDNewsBlockGUI" =>
"Services/News/",
87 "ilExternalFeedBlockGUI" =>
"Services/Block/",
88 "ilPDExternalFeedBlockGUI" =>
"Services/Feeds/",
89 'ilPDTaggingBlockGUI' =>
'Services/Tagging/',
90 'ilChatroomBlockGUI' =>
'Modules/Chatroom/',
91 'ilPollBlockGUI' =>
'Modules/Poll/',
92 'ilClassificationBlockGUI' =>
'Services/Classification/',
93 'ilPDPortfolioBlockGUI' =>
'Modules/Portfolio/',
94 "ilPDStudyProgrammeSimpleListGUI" =>
"Modules/StudyProgramme/",
95 "ilPDStudyProgrammeExpandableListGUI" =>
"Modules/StudyProgramme/",
96 "ilForumPostingDraftsBlockGUI" =>
"Modules/Forum/" 100 "ilPDMailBlockGUI" =>
"pdmail",
101 "ilPDNotesBlockGUI" =>
"pdnotes",
102 "ilPDNewsBlockGUI" =>
"pdnews",
103 "ilBookmarkBlockGUI" =>
"pdbookm",
104 "ilNewsForContextBlockGUI" =>
"news",
105 "ilCalendarBlockGUI" =>
"cal",
106 "ilPDCalendarBlockGUI" =>
"pdcal",
107 "ilExternalFeedBlockGUI" =>
"feed",
108 "ilPDExternalFeedBlockGUI" =>
"pdfeed",
109 "ilPDSysMessageBlockGUI" =>
"pdsysmess",
110 "ilPDSelectedItemsBlockGUI" =>
"pditems",
111 'ilPDTaggingBlockGUI' =>
'pdtag',
112 'ilChatroomBlockGUI' =>
'chatviewer',
113 'ilPollBlockGUI' =>
'poll',
114 'ilClassificationBlockGUI' =>
'clsfct',
115 'ilPDPortfolioBlockGUI' =>
'pdportf',
116 "ilPDStudyProgrammeSimpleListGUI" =>
"prgsimplelist",
117 "ilPDStudyProgrammeExpandableListGUI" =>
"prgexpandablelist",
118 "ilForumPostingDraftsBlockGUI" =>
"pdfrmpostdraft" 137 "frm" => array(
"ilNewsForContextBlockGUI" =>
IL_COL_RIGHT),
168 "pd" => array(
"ilPDExternalFeedBlockGUI")
174 array(
"news" =>
true,
183 "chatviewer" =>
true,
184 "pdfrmpostdraft" =>
true,
190 array(
"pdfeed" =>
true);
197 public function __construct($a_col_type =
"", $a_side =
"", $use_std_context =
false)
201 $this->ctrl = $DIC->ctrl();
202 $this->lng = $DIC->language();
203 $this->
user = $DIC->user();
204 $this->tpl = $DIC[
"tpl"];
205 $this->browser = $DIC[
"ilBrowser"];
223 self::$locations[$className] =
$path;
238 self::$block_types[$className] = $identifier;
248 return $_GET[
"col_side"];
258 $this->coltype = $a_coltype;
268 return $this->coltype;
278 $this->side = $a_side;
298 $this->enableedit = $a_enableedit;
318 $this->repositorymode = $a_repositorymode;
338 $this->admincommands = $a_admincommands;
358 $this->movementmode = $a_movementmode;
378 $this->enablemovement = $a_enablemovement;
400 if (
$ilCtrl->getCmdClass() ==
"ilcolumngui") {
407 $cur_block_type =
"";
408 if (isset(
$_GET[
"block_type"]) &&
$_GET[
"block_type"]) {
409 $cur_block_type =
$_GET[
"block_type"];
410 } elseif (isset(
$_POST[
"block_type"])) {
411 $cur_block_type =
$_POST[
"block_type"];
414 if ($class = array_search($cur_block_type, self::$block_types)) {
415 include_once(
"./" . self::$locations[$class] .
"classes/" .
416 "class." . $class .
".php");
417 return call_user_func(array($class,
'getScreenMode'));
432 $this->block_property[$a_block_type][$a_property] = $a_value;
437 return $this->block_property[$a_block_type];
442 $this->block_property = $a_block_properties;
452 $this->repositoryitems = $a_repositoryitems;
475 $next_class =
$ilCtrl->getNextClass();
476 $cmd =
$ilCtrl->getCmd(
"getHTML");
478 $cur_block_type = (
$_GET[
"block_type"])
479 ?
$_GET[
"block_type"]
482 if ($next_class !=
"") {
484 if ($gui_class = array_search($cur_block_type, self::$block_types)) {
485 include_once(
"./" . self::$locations[$gui_class] .
"classes/" .
486 "class." . $gui_class .
".php");
487 $ilCtrl->setParameter($this,
"block_type", $cur_block_type);
488 $block_gui =
new $gui_class();
489 $block_gui->setProperties($this->block_property[$cur_block_type]);
494 if (in_array($gui_class, $this->custom_blocks[$this->
getColType()]) ||
495 in_array($cur_block_type, $this->rep_block_types)) {
496 $block_class = substr($gui_class, 0, strlen($gui_class) - 3);
497 include_once(
"./" . self::$locations[$gui_class] .
"classes/" .
498 "class." . $block_class .
".php");
499 $app_block =
new $block_class(
$_GET[
"block_id"]);
500 $block_gui->setBlock($app_block);
503 $ilCtrl->setParameter($this,
"block_type",
"");
508 return $this->$cmd();
521 $this->tpl =
new ilTemplate(
"tpl.column.html",
true,
true,
"Services/Block");
527 $this->addHiddenBlockSelector();
530 return $this->tpl->get();
543 $sum_moveable = count($this->blocks[$this->
getSide()]);
545 foreach ($this->blocks[$this->
getSide()] as $block) {
546 if (
$ilCtrl->getContextObjType() !=
"user" ||
552 $gui_class = $block[
"class"];
553 $block_class = substr($block[
"class"], 0, strlen($block[
"class"]) - 3);
556 include_once(
"./" . self::$locations[$gui_class] .
"classes/" .
557 "class." . $gui_class .
".php");
558 $block_gui =
new $gui_class();
559 if (isset($this->block_property[$block[
"type"]])) {
560 $block_gui->setProperties($this->block_property[$block[
"type"]]);
567 if ($block[
"custom"]) {
568 $path =
"./" . self::$locations[$gui_class] .
"classes/" .
569 "class." . $block_class .
".php";
570 if (file_exists(
$path)) {
572 $app_block =
new $block_class($block[
"id"]);
577 $block_gui->setBlock($app_block);
578 if (isset($block[
"ref_id"])) {
579 $block_gui->setRefId($block[
"ref_id"]);
583 $ilCtrl->setParameter($this,
"block_type", $block_gui->getBlockType());
584 $this->tpl->setCurrentBlock(
"col_block");
591 include_once(
"./Services/Block/classes/class.ilDummyBlockGUI.php");
593 $bl->setBlockId($block[
"id"]);
594 $bl->setBlockType($block[
"type"]);
595 $bl->setTitle(
$lng->txt(
"invisible_block"));
597 $html = $bl->getHTML();
602 $this->tpl->setVariable(
"BLOCK",
$html);
603 $this->tpl->parseCurrentBlock();
604 $ilCtrl->setParameter($this,
"block_type",
"");
608 if ($block[
"type"] !=
"pdsysmess" && $block[
"type"] !=
"pdfeedb" &&
609 $block[
"type"] !=
"news") {
621 public function addHiddenBlockSelector()
634 include_once(
"Services/Block/classes/class.ilBlockSetting.php");
635 $hidden_blocks = array();
637 foreach ($this->blocks[$this->
getSide()] as $block) {
638 include_once(
"./" . self::$locations[$block[
"class"]] .
"classes/" .
639 "class." . $block[
"class"] .
".php");
641 if ($block[
"custom"] ==
false) {
642 if (
$ilCtrl->getContextObjType() ==
"user") {
644 $hidden_blocks[$block[
"type"]] =
$lng->txt(
'block_show_' . $block[
"type"]);
646 } elseif (
$ilCtrl->getContextObjType() !=
"") {
652 $hidden_blocks[$block[
"type"] .
"_" .
$ilCtrl->getContextObjId()] =
$lng->txt(
'block_show_' . $block[
"type"]);
661 include_once(
"./Services/Block/classes/class.ilCustomBlock.php");
663 $hidden_blocks[$block[
"type"] .
"_" . $block[
"id"]] = sprintf(
$lng->txt(
'block_show_x'), $cblock->getTitle());
667 if (count($hidden_blocks) > 0) {
668 foreach ($hidden_blocks as
$id =>
$title) {
670 $this->action_menu->addItem(
$title,
'',
$ilCtrl->getLinkTarget($this,
'activateBlock'));
671 $ilCtrl->setParameter($this,
'block',
'');
677 $add_blocks = array();
679 if (is_array($this->custom_blocks[$this->
getColType()])) {
680 foreach ($this->custom_blocks[$this->
getColType()] as $block_class) {
681 include_once(
"./" . self::$locations[$block_class] .
"classes/" .
682 "class." . $block_class .
".php");
683 $block_gui =
new $block_class();
684 $block_type = $block_gui->getBlockType();
690 $add_blocks[$block_type] =
$lng->txt(
'block_create_' . $block_type);
696 if (count($add_blocks) > 0) {
698 $ilCtrl->setParameter($this,
'block_type',
$id);
699 $this->action_menu->addItem(
$title,
'',
$ilCtrl->getLinkTarget($this,
'addBlock'));
700 $ilCtrl->setParameter($this,
'block_type',
'');
717 $main_tpl = $DIC[
"tpl"];
720 include_once
'Services/jQuery/classes/class.iljQueryUtil.php';
724 if ($ilBrowser->isMobile() || $ilBrowser->isIpad()) {
725 $main_tpl->addJavaScript(
'./libs/bower/bower_components/jqueryui-touch-punch/jquery.ui.touch-punch.min.js');
727 $main_tpl->addJavaScript(
'./Services/Block/js/block_sorting.js');
732 $this->tpl->setVariable(
'BLOCK_SORTING_STORAGE_URL',
$ilCtrl->getLinkTarget($this,
'saveBlockSortingAsynch',
'',
true,
false));
733 $this->tpl->setVariable(
'BLOCK_COLUMNS', json_encode(array(
'il_left_col',
'il_right_col')));
734 $this->tpl->setVariable(
'BLOCK_COLUMNS_SELECTOR',
'#il_left_col,#il_right_col');
751 $sum_moveable = count($this->blocks[$this->
getSide()]);
753 foreach ($this->blocks[$this->
getSide()] as $block) {
754 include_once(
"./" . self::$locations[$block[
"class"]] .
"classes/" .
755 "class." . $block[
"class"] .
".php");
759 if (!$block[
"custom"] &&
$ilCtrl->getContextObjType() !=
"" &&
$ilCtrl->getContextObjType() !=
"user") {
760 $block[
"id"] =
$ilCtrl->getContextObjId();
765 if (
$_GET[
"block_id"] ==
"block_" . $block[
"type"] .
"_" . $block[
"id"]) {
766 $gui_class = $block[
"class"];
767 $block_class = substr($block[
"class"], 0, strlen($block[
"class"]) - 3);
769 $block_gui =
new $gui_class();
770 $block_gui->setProperties($this->block_property[$block[
"type"]]);
776 if ($block[
"custom"]) {
777 include_once(
"./" . self::$locations[$gui_class] .
"classes/" .
778 "class." . $block_class .
".php");
779 $app_block =
new $block_class($block[
"id"]);
780 $block_gui->setBlock($app_block);
781 $block_gui->setRefId($block[
"ref_id"]);
784 $ilCtrl->setParameter($this,
"block_type", $block[
"type"]);
790 if ($block[
"type"] !=
"pdsysmess" && $block[
"type"] !=
"pdfeedb" 791 && $block[
"type"] !=
"news") {
797 echo "Error: ilColumnGUI::updateBlock: Block '" .
798 $_GET[
"block_id"] .
"' unknown.";
810 if (
$_GET[
"block"] !=
"") {
811 $block = explode(
"_",
$_GET[
"block"]);
812 include_once(
"Services/Block/classes/class.ilBlockSetting.php");
816 $ilCtrl->returnToParent($this);
826 $class = array_search(
$_GET[
"block_type"], self::$block_types);
830 include_once(
"./" . self::$locations[$class] .
"classes/class." . $class .
".php");
831 $block_gui =
new $class();
832 $block_gui->setProperties($this->block_property[
$_GET[
"block_type"]]);
837 $ilCtrl->setParameter($this,
"block_type", $_GET[
"block_type"]);
839 $ilCtrl->setParameter($this,
"block_type",
"");
852 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
862 if (is_array($this->default_blocks[$this->
getColType()])) {
863 foreach ($this->default_blocks[$this->
getColType()] as $class => $def_side) {
864 $type = self::$block_types[$class];
874 if (
$type ==
"news") {
877 if (
$type ==
"cal") {
880 if (
$type ==
"pdsysmess") {
883 if (
$type ==
"pdfeedb") {
886 if (
$type ==
"clsfct") {
890 if (
$side ===
false) {
894 $this->blocks[
$side][] = array(
905 include_once(
"./Services/Block/classes/class.ilCustomBlock.php");
907 $custom_block->setContextObjId(
$ilCtrl->getContextObjId());
908 $custom_block->setContextObjType(
$ilCtrl->getContextObjType());
909 $c_blocks = $custom_block->queryBlocksForContext();
911 foreach ($c_blocks as $c_block) {
912 $type = $c_block[
"type"];
915 $class = array_search(
$type, self::$block_types);
921 if (
$side ===
false) {
925 $this->blocks[
$side][] = array(
929 "id" => $c_block[
"id"],
934 include_once(
"./Services/Block/classes/class.ilCustomBlock.php");
937 foreach ($this->rep_block_types as $block_type) {
939 if (!is_array($rep_items[$block_type])) {
942 foreach ($rep_items[$block_type] as $item) {
944 $costum_block->setContextObjId($item[
"obj_id"]);
945 $costum_block->setContextObjType($block_type);
946 $c_blocks = $costum_block->queryBlocksForContext();
947 $c_block = $c_blocks[0];
950 $class = array_search(
$type, self::$block_types);
956 if (
$side ===
false) {
960 $this->blocks[
$side][] = array(
964 "id" => $c_block[
"id"],
966 "ref_id" => $item[
"ref_id"]);
972 include_once(
"./Services/Block/classes/class.ilCustomBlock.php");
974 $custom_block->setContextObjId(
$ilCtrl->getContextObjId());
975 $custom_block->setContextObjType(
$ilCtrl->getContextObjType());
976 $c_blocks = $custom_block->queryBlocksForContext(
false);
978 foreach ($c_blocks as $c_block) {
979 $type = $c_block[
"type"];
980 $class = array_search(
$type, self::$block_types);
986 $this->blocks[
$side][] = array(
990 "id" => $c_block[
"id"],
1013 if (isset($this->check_global_activation[
$a_type]) && $this->check_global_activation[$a_type]) {
1014 if ($a_type ==
'pdbookm') {
1019 } elseif ($a_type ==
'pdnotes') {
1024 } elseif ($a_type ==
'pdportf') {
1027 if ($prfa_set->get(
"pd_block",
false)) {
1032 } elseif ($a_type ==
'news') {
1033 include_once
'Services/Container/classes/class.ilContainer.php';
1037 $GLOBALS[
'ilCtrl']->getContextObjId(),
1041 } elseif ($a_type ==
'pdsysmess') {
1042 require_once
'Services/Mail/classes/class.ilObjMail.php';
1044 } elseif (
$ilSetting->get(
"block_activated_" . $a_type)) {
1046 } elseif ($a_type ==
'cal') {
1047 include_once(
'./Services/Calendar/classes/class.ilCalendarSettings.php');
1049 } elseif ($a_type ==
'pdcal') {
1050 include_once(
'./Services/Calendar/classes/class.ilCalendarSettings.php');
1052 } elseif ($a_type ==
"tagcld") {
1054 return (
bool) $tags_active->get(
"enable",
false);
1055 } elseif ($a_type ==
"clsfct") {
1056 if (
$ilCtrl->getContextObjType() ==
"cat") {
1060 return (
bool) $tags_active->get(
"enable",
false);
1075 if ($this->check_nr_limit[
$a_type]) {
1077 include_once(
"./Services/Block/classes/class.ilCustomBlock.php");
1079 $costum_block->setContextObjId(
$ilCtrl->getContextObjId());
1080 $costum_block->setContextObjType(
$ilCtrl->getContextObjType());
1081 $costum_block->setType($a_type);
1082 $res = $costum_block->queryCntBlockForContext();
1083 $cnt = (int)
$res[0][
"cnt"];
1089 if (
$ilSetting->get(
"block_limit_" . $a_type) > $cnt) {
1101 public function saveBlockSortingAsynch()
1116 if (in_array($this->
getColType(), array(
'pd'))) {
1119 foreach (array(IL_COL_LEFT => (array)
$_POST[IL_COL_LEFT][
'sequence'], IL_COL_RIGHT => (array)
$_POST[IL_COL_RIGHT][
'sequence']) as
$side => $blocks) {
1121 foreach ($blocks as $block) {
1122 $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)
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.
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.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
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.