19declare(strict_types=1);
23define(
"IL_COL_LEFT",
"left");
24define(
"IL_COL_RIGHT",
"right");
25define(
"IL_COL_CENTER",
"center");
27define(
"IL_SCREEN_SIDE",
"");
28define(
"IL_SCREEN_CENTER",
"center");
29define(
"IL_SCREEN_FULL",
"full");
44 protected \ILIAS\Block\StandardGUIRequest
$request;
74 "ilNewsForContextBlockGUI" =>
"Services/News/",
75 "ilCalendarBlockGUI" =>
"Services/Calendar/",
76 "ilPDCalendarBlockGUI" =>
"Services/Calendar/",
77 "ilConsultationHoursCalendarBlockGUI" =>
"Services/Calendar/",
78 "ilPDTasksBlockGUI" =>
"Services/Tasks/",
79 "ilPDMailBlockGUI" =>
"Services/Mail/",
80 "ilPDSelectedItemsBlockGUI" =>
"Services/Dashboard/ItemsBlock/",
81 "ilPDNewsBlockGUI" =>
"Services/News/",
82 'ilPollBlockGUI' =>
'Modules/Poll/',
83 'ilClassificationBlockGUI' =>
'Services/Classification/',
84 "ilPDStudyProgrammeSimpleListGUI" =>
"Modules/StudyProgramme/",
85 "ilPDStudyProgrammeExpandableListGUI" =>
"Modules/StudyProgramme/",
89 "ilPDMailBlockGUI" =>
"pdmail",
90 "ilPDTasksBlockGUI" =>
"pdtasks",
91 "ilPDNewsBlockGUI" =>
"pdnews",
92 "ilNewsForContextBlockGUI" =>
"news",
93 "ilCalendarBlockGUI" =>
"cal",
94 "ilPDCalendarBlockGUI" =>
"pdcal",
95 "ilConsultationHoursCalendarBlockGUI" =>
"chcal",
96 "ilPDSelectedItemsBlockGUI" =>
"pditems",
97 'ilPollBlockGUI' =>
'poll',
98 'ilClassificationBlockGUI' =>
'clsfct',
99 "ilPDStudyProgrammeSimpleListGUI" =>
"prgsimplelist",
100 "ilPDStudyProgrammeExpandableListGUI" =>
"prgexpandablelist",
121 "frm" => array(
"ilNewsForContextBlockGUI" =>
IL_COL_RIGHT),
152 array(
"news" =>
true,
164 array(
"pdfeed" =>
true);
167 string $a_col_type =
"",
169 bool $use_std_context =
false
173 $this->
ctrl = $DIC->ctrl();
174 $this->
lng = $DIC->language();
175 $this->
user = $DIC->user();
176 $this->browser =
$DIC->http()->agent();
182 $this->request = $block_service->internal()
208 self::$block_types[$className] = $identifier;
219 $request = $block_service->internal()
222 return $request->getColSide();
230 $this->coltype = $a_coltype;
235 return $this->coltype;
243 $this->side = $a_side;
253 $this->enableedit = $a_enableedit;
258 return $this->enableedit;
262 bool $a_repositorymode
264 $this->repositorymode = $a_repositorymode;
269 return $this->repositorymode;
274 $this->admincommands = $a_admincommands;
279 return $this->admincommands;
286 $ilCtrl =
$DIC->ctrl();
289 $request = $block_service->internal()
293 if ($ilCtrl->getCmdClass() ==
"ilcolumngui") {
294 switch ($ilCtrl->getCmd()) {
300 $cur_block_type = $request->getBlockType();
302 if ($class = array_search($cur_block_type, self::$block_types)) {
303 return call_user_func(array($class,
'getScreenMode'));
314 string $a_block_type,
318 $this->block_property[$a_block_type][$a_property] = $a_value;
324 return $this->block_property[$a_block_type];
328 array $a_block_properties
330 $this->block_property = $a_block_properties;
334 array $a_repositoryitems
336 $this->repositoryitems = $a_repositoryitems;
341 return $this->repositoryitems;
346 $ilCtrl = $this->ctrl;
348 $ilCtrl->setParameter($this,
"col_side", $this->getSide());
350 $next_class = $ilCtrl->getNextClass();
351 $cmd = $ilCtrl->getCmd(
"getHTML");
353 $cur_block_type = $this->request->getBlockType();
355 if ($next_class !=
"") {
357 if ($gui_class = array_search($cur_block_type, self::$block_types)) {
358 $ilCtrl->setParameter($this,
"block_type", $cur_block_type);
359 $block_gui =
new $gui_class();
360 $block_gui->setProperties($this->block_property[$cur_block_type] ?? []);
361 $block_gui->setRepositoryMode($this->getRepositoryMode());
362 $block_gui->setEnableEdit($this->getEnableEdit());
363 $block_gui->setAdminCommands($this->getAdminCommands());
365 if (in_array($gui_class, $this->custom_blocks[$this->getColType()]) ||
366 in_array($cur_block_type, $this->rep_block_types)) {
367 $block_class = substr($gui_class, 0, strlen($gui_class) - 3);
368 $app_block =
new $block_class($this->request->getBlockId());
369 $block_gui->setBlock($app_block);
371 $html = $ilCtrl->forwardCommand($block_gui);
372 $ilCtrl->setParameter($this,
"block_type",
"");
377 return (
string) $this->$cmd();
384 $ilCtrl = $this->ctrl;
386 $ilCtrl->setParameter($this,
"col_side", $this->getSide());
388 $this->tpl =
new ilTemplate(
"tpl.column.html",
true,
true,
"Services/Block");
389 $this->determineBlocks();
391 return $this->tpl->get();
396 $ilCtrl = $this->ctrl;
400 $sum_moveable = count($this->blocks[$this->getSide()]);
402 foreach ($this->blocks[$this->getSide()] as $block) {
403 $gui_class = $block[
"class"] ??
null;
404 if (!is_string($gui_class)) {
407 $block_class = substr($gui_class, 0, strlen($gui_class) - 3);
410 $block_gui =
new $gui_class();
411 if (isset($this->block_property[$block[
"type"]])) {
412 $block_gui->setProperties($this->block_property[$block[
"type"]]);
414 $block_gui->setRepositoryMode($this->getRepositoryMode());
415 $block_gui->setEnableEdit($this->getEnableEdit());
416 $block_gui->setAdminCommands($this->getAdminCommands());
419 if ($block[
"custom"]) {
420 $path =
"./" . self::$locations[$gui_class] .
"classes/" .
421 "class." . $block_class .
".php";
422 if (file_exists(
$path)) {
423 $app_block =
new $block_class((
int) $block[
"id"]);
428 $block_gui->setBlock($app_block);
429 if (isset($block[
"ref_id"])) {
430 $block_gui->setRefId((
int) $block[
"ref_id"]);
434 $ilCtrl->setParameter($this,
"block_type", $block_gui->getBlockType());
435 $this->tpl->setCurrentBlock(
"col_block");
437 $html = $ilCtrl->getHTML($block_gui);
441 $this->tpl->setVariable(
"BLOCK", $html);
442 $this->tpl->parseCurrentBlock();
443 $ilCtrl->setParameter($this,
"block_type",
"");
454 $ilCtrl = $this->ctrl;
456 $this->determineBlocks();
458 $sum_moveable = count($this->blocks[$this->getSide()]);
460 foreach ($this->blocks[$this->getSide()] as $block) {
464 if (!$block[
"custom"] && $ilCtrl->getContextObjType() !=
"" && $ilCtrl->getContextObjType() !=
"user") {
465 $block[
"id"] = $ilCtrl->getContextObjId();
468 if ($this->request->getBlockId() ==
"block_" . $block[
"type"] .
"_" . $block[
"id"]) {
469 $gui_class = $block[
"class"];
470 $block_class = substr($block[
"class"], 0, strlen($block[
"class"]) - 3);
472 $block_gui =
new $gui_class();
473 $block_gui->setProperties($this->block_property[$block[
"type"]]);
474 $block_gui->setRepositoryMode($this->getRepositoryMode());
475 $block_gui->setEnableEdit($this->getEnableEdit());
476 $block_gui->setAdminCommands($this->getAdminCommands());
479 if ($block[
"custom"]) {
480 $app_block =
new $block_class($block[
"id"]);
481 $block_gui->setBlock($app_block);
482 $block_gui->setRefId($block[
"ref_id"]);
485 $ilCtrl->setParameter($this,
"block_type", $block[
"type"]);
486 echo $ilCtrl->getHTML($block_gui);
491 if ($block[
"type"] !=
"pdfeedb"
492 && $block[
"type"] !=
"news") {
498 echo
"Error: ilColumnGUI::updateBlock: Block '" .
499 $this->request->getBlockId() .
"' unknown.";
509 $ilCtrl = $this->ctrl;
511 if ($this->request->getBlock() !=
"") {
512 $block = explode(
"_", $this->request->getBlock());
516 $ilCtrl->returnToParent($this);
524 $ilCtrl = $this->ctrl;
526 $class = array_search($this->request->getBlockType(), self::$block_types);
528 $ilCtrl->setCmdClass($class);
529 $ilCtrl->setCmd(
"create");
530 $block_gui =
new $class();
531 $block_gui->setProperties($this->block_property[$this->request->getBlockType()]);
532 $block_gui->setRepositoryMode($this->getRepositoryMode());
533 $block_gui->setEnableEdit($this->getEnableEdit());
534 $block_gui->setAdminCommands($this->getAdminCommands());
536 $ilCtrl->setParameter($this,
"block_type", $this->request->getBlockType());
537 $html = $ilCtrl->forwardCommand($block_gui);
538 $ilCtrl->setParameter($this,
"block_type",
"");
548 $ilCtrl = $this->ctrl;
554 $user_id = ($this->getColType() ===
"pd")
559 if (isset($this->default_blocks[$this->getColType()])) {
560 foreach ($this->default_blocks[$this->getColType()] as $class => $def_side) {
561 $type = self::$block_types[$class];
562 if ($this->isGloballyActivated(
$type)) {
566 if (
$type ==
"news") {
569 if (
$type ==
"cal") {
572 if (
$type ==
"chcal") {
575 if (
$type ==
"pdfeedb") {
578 if (
$type ==
"clsfct") {
582 if (is_null($side) || $side ===
"") {
588 $this->blocks[$side][] = array(
598 if (!$this->getRepositoryMode()) {
600 $custom_block->setContextObjId($ilCtrl->getContextObjId());
601 $custom_block->setContextObjType($ilCtrl->getContextObjType());
602 $c_blocks = $custom_block->queryBlocksForContext();
604 foreach ($c_blocks as $c_block) {
605 $type = $c_block[
"type"];
607 if ($this->isGloballyActivated(
$type)) {
608 $class = array_search(
$type, self::$block_types);
611 if (is_null($side)) {
615 $this->blocks[$side][] = array(
619 "id" => $c_block[
"id"],
624 $rep_items = $this->getRepositoryItems();
625 foreach ($this->rep_block_types as $block_type) {
626 if ($this->isGloballyActivated($block_type)) {
627 if (!isset($rep_items[$block_type]) || !is_array($rep_items[$block_type])) {
630 foreach ($rep_items[$block_type] as $item) {
632 $costum_block->setContextObjId((
int) $item[
"obj_id"]);
633 $costum_block->setContextObjType($block_type);
634 $c_blocks = $costum_block->queryBlocksForContext();
635 $c_block = $c_blocks[0];
638 $class = array_search(
$type, self::$block_types);
641 if ($side ==
false) {
645 $this->blocks[$side][] = array(
649 "id" => $c_block[
"id"],
651 "ref_id" => $item[
"ref_id"]);
658 $custom_block->setContextObjId($ilCtrl->getContextObjId());
659 $custom_block->setContextObjType($ilCtrl->getContextObjType());
660 $c_blocks = $custom_block->queryBlocksForContext(
false);
661 foreach ($c_blocks as $c_block) {
662 $type = $c_block[
"type"];
663 $class = array_search(
$type, self::$block_types);
669 $this->blocks[$side][] = array(
673 "id" => $c_block[
"id"],
694 $ilCtrl = $this->ctrl;
696 if ($a_type ==
'pdfeed') {
700 if (isset($this->check_global_activation[$a_type]) && $this->check_global_activation[$a_type]) {
701 if ($a_type ==
'pdnews') {
702 return ($this->dash_side_panel_settings->isEnabled($this->dash_side_panel_settings::NEWS) &&
704 } elseif ($a_type ==
'pdmail') {
705 return $this->dash_side_panel_settings->isEnabled($this->dash_side_panel_settings::MAIL);
706 } elseif ($a_type ==
'pdtasks') {
707 return $this->dash_side_panel_settings->isEnabled($this->dash_side_panel_settings::TASKS);
708 } elseif ($a_type ==
'news') {
712 (!in_array($ilCtrl->getContextObjType(), [
"grp",
"crs"]) ||
714 $GLOBALS[
'ilCtrl']->getContextObjId(),
719 $GLOBALS[
'ilCtrl']->getContextObjId(),
723 } elseif (
$ilSetting->get(
"block_activated_" . $a_type)) {
725 } elseif ($a_type ==
'cal' || $a_type ==
'chcal') {
727 } elseif ($a_type ==
'pdcal') {
728 if (!$this->dash_side_panel_settings->isEnabled($this->dash_side_panel_settings::CALENDAR)) {
732 } elseif ($a_type ==
"tagcld") {
734 return (
bool) $tags_active->get(
"enable",
"0");
735 } elseif ($a_type ==
"clsfct") {
736 if ($ilCtrl->getContextObjType() ==
"cat") {
740 return (
bool) $tags_active->get(
"enable",
"0");
754 $ilCtrl = $this->ctrl;
756 if ($this->check_nr_limit[$a_type]) {
757 if (!$this->getRepositoryMode()) {
759 $costum_block->setContextObjId($ilCtrl->getContextObjId());
760 $costum_block->setContextObjType($ilCtrl->getContextObjType());
761 $costum_block->setType($a_type);
762 $res = $costum_block->queryCntBlockForContext();
769 if (
$ilSetting->get(
"block_limit_" . $a_type) > $cnt) {
781 $this->action_menu = $action_menu;
786 return $this->action_menu;
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
This library is borrowed from the phpGroupWare API http://www.phpgroupware.org/api Modifications made...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
static _lookupSide(string $a_type, int $a_user=0, int $a_block_id=0)
Lookup side.
static _writeDetailLevel(string $a_type, string $a_value, int $a_user=0, int $a_block_id=0)
static lookupCalendarContentPresentationEnabled(int $obj_id)
Column user interface class.
updateBlock()
Update Block (asynchronous)
static addCustomBlockLocation(string $className, string $path)
Adds location information of the custom block gui.
AgentDetermination $browser
setColType(string $a_coltype)
static array $block_types
setAdminCommands(bool $a_admincommands)
setRepositoryItems(array $a_repositoryitems)
determineBlocks()
Determine which blocks to show.
setAllBlockProperties(array $a_block_properties)
setEnableEdit(bool $a_enableedit)
ILIAS Block StandardGUIRequest $request
isGloballyActivated(string $a_type)
Check whether a block type is globally activated.
exceededLimit(string $a_type)
Check whether limit is not exceeded.
static addCustomBlockType(string $className, string $identifier)
Adds the block type of the custom block gui.
getBlockProperties(string $a_block_type)
setActionMenu(ilAdvancedSelectionListGUI $action_menu)
array $check_global_activation
ilDashboardSidePanelSettingsRepository $dash_side_panel_settings
setRepositoryMode(bool $a_repositorymode)
activateBlock()
Activate hidden block.
__construct(string $a_col_type="", string $a_side="", bool $use_std_context=false)
static getCmdSide()
Get Column Side of Current Command.
ilAdvancedSelectionListGUI $action_menu
setBlockProperty(string $a_block_type, string $a_property, string $a_value)
This function is supposed to be used for block type specific properties, that should be passed to ilB...
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)
Class ilCtrl provides processing control methods.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
return['3gp', '7z', 'ai', 'aif', 'aifc', 'aiff', 'au', 'arw', 'avi', 'backup', 'bak', 'bas', 'bpmn', 'bpmn2', 'bmp', 'bib', 'bibtex', 'bz', 'bz2', 'c', 'c++', 'cc', 'cct', 'cdf', 'cer', 'class', 'cls', 'conf', 'cpp', 'crt', 'crs', 'crw', 'cr2', 'css', 'cst', 'csv', 'cur', 'db', 'dcr', 'des', 'dng', 'doc', 'docx', 'dot', 'dotx', 'dtd', 'dvi', 'el', 'eps', 'epub', 'f', 'f77', 'f90', 'flv', 'for', 'g3', 'gif', 'gl', 'gan', 'ggb', 'gsd', 'gsm', 'gtar', 'gz', 'gzip', 'h', 'hpp', 'htm', 'html', 'htmls', 'ibooks', 'ico', 'ics', 'ini', 'ipynb', 'java', 'jbf', 'jpeg', 'jpg', 'js', 'jsf', 'jso', 'json', 'latex', 'lang', 'less', 'log', 'lsp', 'ltx', 'm1v', 'm2a', 'm2v', 'm3u', 'm4a', 'm4v', 'markdown', 'm', 'mat', 'md', 'mdl', 'mdown', 'mid', 'min', 'midi', 'mobi', 'mod', 'mov', 'movie', 'mp2', 'mp3', 'mp4', 'mpa', 'mpeg', 'mpg', 'mph', 'mpga', 'mpp', 'mpt', 'mpv', 'mpx', 'mv', 'mw', 'mv4', 'nb', 'nbp', 'nef', 'nif', 'niff', 'obj', 'obm', 'odt', 'ods', 'odp', 'odg', 'odf', 'oga', 'ogg', 'ogv', 'old', 'p', 'pas', 'pbm', 'pcl', 'pct', 'pcx', 'pdf', 'pgm', 'pic', 'pict', 'png', 'por', 'pov', 'project', 'properties', 'ppa', 'ppm', 'pps', 'ppsx', 'ppt', 'pptx', 'ppz', 'ps', 'psd', 'pwz', 'qt', 'qtc', 'qti', 'qtif', 'r', 'ra', 'ram', 'rar', 'rast', 'rda', 'rev', 'rexx', 'ris', 'rf', 'rgb', 'rm', 'rmd', 'rmi', 'rmm', 'rmp', 'rt', 'rtf', 'rtx', 'rv', 's', 's3m', 'sav', 'sbs', 'sec', 'sdml', 'sgm', 'sgml', 'smi', 'smil', 'srt', 'sps', 'spv', 'stl', 'svg', 'swa', 'swf', 'swz', 'tar', 'tex', 'texi', 'texinfo', 'text', 'tgz', 'tif', 'tiff', 'ttf', 'txt', 'tmp', 'uvproj', 'vdf', 'vimeo', 'viv', 'vivo', 'vrml', 'vsdx', 'wav', 'webm', 'wmv', 'wmx', 'wmz', 'woff', 'wwd', 'xhtml', 'xif', 'xls', 'xlsx', 'xmind', 'xml', 'xsl', 'xsd', 'zip']