ILIAS  trunk Revision v11.0_alpha-1753-gb21ca8c4367
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilDashboardPageGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
26 {
27  public function __construct(string $lang)
28  {
29  if ($lang === '') {
30  throw new ilCOPageException('No language provided for Dashboard page');
31  }
32  $page = new ilDashboardPage();
33  if (!ilPageObject::_exists($page->getParentType(), $page->getParentId(), $lang)) {
34  $page->setId($page->getParentId());
35  $page->setLanguage($lang);
36  $page->create();
37  }
38  parent::__construct($page->getParentType(), $page->getParentId(), 0, false, $lang);
39  }
40 
41 
42  public function afterConstructor(): void
43  {
44  $this->ctrl->setParameter($this, $this->getPageObject()->getParentType() . '_lang', $this->getLanguage());
46  }
47 
48  public function finishEditing(): void
49  {
50  $this->ctrl->redirectByClass(ilObjDashboardSettingsGUI::class, 'view');
51  }
52 
53  public function executeCommand(): string
54  {
55  if ($this->ctrl->getCmd() === 'delete') {
56  $this->getPageObject()->delete();
57  $this->finishEditing();
58  }
59  return parent::executeCommand();
60  }
61 
62  public function getAdditionalPageActions(): array
63  {
64  $this->ctrl->setParameterByClass(ilObjDashboardSettingsGUI::class, $this->getParentType() . '_lang', $this->getLanguage());
65  return [$this->ui->factory()->link()->standard(
66  $this->lng->txt("obj_sty"),
67  $this->ctrl->getLinkTargetByClass([
68  ilObjDashboardSettingsGUI::class,
69  ilObjectContentStyleSettingsGUI::class
70  ], "")
71  )];
72  }
73 
74  public static function isLanguageAvailable(string $lang): bool
75  {
76  $page = new ilDashboardPage();
77  return ilPageObject::_existsAndNotEmpty($page->getParentType(), $page->getParentId(), $lang);
78  }
79 }
ilDashboardPageGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMDEditorGUI ilDashboardPageGUI: ilAdminis...
Class ilPageObjectGUI.
static _existsAndNotEmpty(string $a_parent_type, int $a_id, string $a_lang="-")
Checks whether page exists and is not empty (may return true on some empty pages) ...
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
$lang
Definition: xapiexit.php:25
__construct(Container $dic, ilPlugin $plugin)
static lookupObjectStyle(int $a_obj_id)
Lookup object style.
static isLanguageAvailable(string $lang)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...