ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilWikiPageTemplateGUI Class Reference

Wiki page template gui class. More...

+ Collaboration diagram for ilWikiPageTemplateGUI:

Public Member Functions

 executeCommand ()
 
 listTemplates ()
 
 add ()
 
 remove ()
 
 saveTemplateSettings ()
 
 removePageTemplateFromPageAction ()
 
 addPageTemplateFromPageAction ()
 

Protected Attributes

WikiGUIRequest $request
 
ilObjWiki $wiki
 
ilToolbarGUI $toolbar
 
ilLanguage $lng
 
ilObjWikiGUI $wiki_gui
 
ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 

Detailed Description

Wiki page template gui class.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 26 of file class.ilWikiPageTemplateGUI.php.

Member Function Documentation

◆ add()

ilWikiPageTemplateGUI::add ( )

Definition at line 112 of file class.ilWikiPageTemplateGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilWikiPageTemplate\save().

112  : void
113  {
114  $wpt = new ilWikiPageTemplate($this->wiki->getId());
115  $wpt->save($this->request->getPageTemplateId());
116  $this->tpl->setOnScreenMessage('success', $this->lng->txt("wiki_template_added"), true);
117  $this->ctrl->redirect($this, "listTemplates");
118  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
save(int $a_id, int $a_new_pages=0, int $a_add_to_page=0)
Add wiki page template.
+ Here is the call graph for this function:

◆ addPageTemplateFromPageAction()

ilWikiPageTemplateGUI::addPageTemplateFromPageAction ( )

Definition at line 169 of file class.ilWikiPageTemplateGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilWikiPageTemplate\save().

169  : void
170  {
171  $page_id = $this->request->getWikiPageId();
172  if ($page_id) {
173  $wpt = new ilWikiPageTemplate($this->wiki->getId());
174  $wpt->save($page_id);
175  $this->tpl->setOnScreenMessage('success', $this->lng->txt("wiki_template_added"), true);
176  }
177 
178  $this->ctrl->redirect($this, "listTemplates");
179  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
save(int $a_id, int $a_new_pages=0, int $a_add_to_page=0)
Add wiki page template.
+ Here is the call graph for this function:

◆ executeCommand()

ilWikiPageTemplateGUI::executeCommand ( )

Definition at line 62 of file class.ilWikiPageTemplateGUI.php.

References ILIAS\Repository\ctrl().

62  : void
63  {
64  $nc = $this->ctrl->getNextClass();
65 
66  switch ($nc) {
67  default:
68  $cmd = $this->ctrl->getCmd("listTemplates");
69  if (in_array($cmd, array("listTemplates", "add", "remove", "saveTemplateSettings", "addPageTemplateFromPageAction", "removePageTemplateFromPageAction"))) {
70  $this->$cmd();
71  }
72  break;
73  }
74  }
+ Here is the call graph for this function:

◆ listTemplates()

ilWikiPageTemplateGUI::listTemplates ( )

Definition at line 76 of file class.ilWikiPageTemplateGUI.php.

References ILIAS\Repository\ctrl(), ilWikiPage\getAllWikiPages(), ILIAS\Repository\lng(), ilTable2GUI\setOpenFormTag(), ilSelectInputGUI\setOptions(), ilStr\shortenTextExtended(), and ILIAS\Repository\toolbar().

76  : void
77  {
78  // list pages
79  $pages = ilWikiPage::getAllWikiPages($this->wiki->getId(), "-");
80  $options = array("" => $this->lng->txt("please_select"));
81  foreach ($pages as $p) {
82  //if (!in_array($p["id"], $ipages_ids))
83  //{
84  $options[$p["id"]] = ilStr::shortenTextExtended($p["title"], 60, true);
85  //}
86  }
87 
88  $this->toolbar->setFormAction($this->ctrl->getFormAction($this));
89  $this->toolbar->setOpenFormTag(true);
90  $this->toolbar->setCloseFormTag(false);
91 
92  if (count($options) > 0) {
93  $si = new ilSelectInputGUI($this->lng->txt("wiki_pages"), "templ_page_id");
94  $si->setOptions($options);
95  $this->toolbar->addInputItem($si);
96  $this->toolbar->addFormButton($this->lng->txt("wiki_add_template"), "add");
97  $this->toolbar->addSeparator();
98  }
99 
100  // empty page as template?
101  $cb = new ilCheckboxInputGUI($this->lng->txt("wiki_empty_page_template"), "empty_page_templ");
102  $cb->setChecked($this->wiki->getEmptyPageTemplate());
103  $this->toolbar->addInputItem($cb, true);
104  $this->toolbar->addFormButton($this->lng->txt("save"), "saveTemplateSettings");
105 
106  $tab = new ilWikiPageTemplatesTableGUI($this, "listTemplates", $this->wiki->getId());
107  $tab->setOpenFormTag(false);
108  $tab->setCloseFormTag(true);
109  $this->tpl->setContent($tab->getHTML());
110  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a selection list property in a property form.
setOptions(array $a_options)
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
static getAllWikiPages(int $a_wiki_id, string $lang="-")
setOpenFormTag(bool $a_val)
+ Here is the call graph for this function:

◆ remove()

ilWikiPageTemplateGUI::remove ( )

Definition at line 120 of file class.ilWikiPageTemplateGUI.php.

References $id, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilWikiPageTemplate\remove().

120  : void
121  {
122  $wpt = new ilWikiPageTemplate($this->wiki->getId());
123 
124  $ids = $this->request->getIds();
125  if (count($ids) > 0) {
126  foreach ($ids as $id) {
127  $wpt->remove((int) $id);
128  }
129  $this->tpl->setOnScreenMessage('success', $this->lng->txt("wiki_template_status_removed"), true);
130  }
131 
132  $this->ctrl->redirect($this, "listTemplates");
133  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
remove(int $a_id)
Remove template status of a page.
+ Here is the call graph for this function:

◆ removePageTemplateFromPageAction()

ilWikiPageTemplateGUI::removePageTemplateFromPageAction ( )

Definition at line 157 of file class.ilWikiPageTemplateGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilWikiPageTemplate\remove().

157  : void
158  {
159  $page_id = $this->request->getWikiPageId();
160  if ($page_id) {
161  $wpt = new ilWikiPageTemplate($this->wiki->getId());
162  $wpt->remove($page_id);
163  $this->tpl->setOnScreenMessage('success', $this->lng->txt("wiki_template_status_removed"), true);
164  }
165 
166  $this->ctrl->redirect($this, "listTemplates");
167  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
remove(int $a_id)
Remove template status of a page.
+ Here is the call graph for this function:

◆ saveTemplateSettings()

ilWikiPageTemplateGUI::saveTemplateSettings ( )

Definition at line 135 of file class.ilWikiPageTemplateGUI.php.

References $id, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilWikiPageTemplate\save().

135  : void
136  {
137  $all_ids = $this->request->getAllIds();
138  $new_pages = $this->request->getNewPages();
139  $add_to_page = $this->request->getAddToPage();
140  foreach ($all_ids as $id) {
141  $wpt = new ilWikiPageTemplate($this->wiki->getId());
142  $wpt->save($id, $new_pages[$id] ?? 0, $add_to_page[$id] ?? 0);
143  }
144 
145  $this->wiki->setEmptyPageTemplate($this->request->getEmptyPageTemplate());
146  $this->wiki->update();
147 
148  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
149  $this->ctrl->redirect($this, "listTemplates");
150  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
save(int $a_id, int $a_new_pages=0, int $a_add_to_page=0)
Add wiki page template.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilWikiPageTemplateGUI::$ctrl
protected

Definition at line 33 of file class.ilWikiPageTemplateGUI.php.

◆ $lng

ilLanguage ilWikiPageTemplateGUI::$lng
protected

Definition at line 31 of file class.ilWikiPageTemplateGUI.php.

◆ $request

WikiGUIRequest ilWikiPageTemplateGUI::$request
protected

Definition at line 28 of file class.ilWikiPageTemplateGUI.php.

◆ $toolbar

ilToolbarGUI ilWikiPageTemplateGUI::$toolbar
protected

Definition at line 30 of file class.ilWikiPageTemplateGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilWikiPageTemplateGUI::$tpl
protected

Definition at line 34 of file class.ilWikiPageTemplateGUI.php.

◆ $wiki

ilObjWiki ilWikiPageTemplateGUI::$wiki
protected

Definition at line 29 of file class.ilWikiPageTemplateGUI.php.

◆ $wiki_gui

ilObjWikiGUI ilWikiPageTemplateGUI::$wiki_gui
protected

Definition at line 32 of file class.ilWikiPageTemplateGUI.php.


The documentation for this class was generated from the following file: