ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables 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

EditingGUIRequest $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 113 of file class.ilWikiPageTemplateGUI.php.

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

113  : void
114  {
115  $wpt = new ilWikiPageTemplate($this->wiki->getId());
116  $wpt->save($this->request->getPageTemplateId());
117  $this->tpl->setOnScreenMessage('success', $this->lng->txt("wiki_template_added"), true);
118  $this->ctrl->redirect($this, "listTemplates");
119  }
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 170 of file class.ilWikiPageTemplateGUI.php.

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

170  : void
171  {
172  $page_id = $this->request->getWikiPageId();
173  if ($page_id) {
174  $wpt = new ilWikiPageTemplate($this->wiki->getId());
175  $wpt->save($page_id);
176  $this->tpl->setOnScreenMessage('success', $this->lng->txt("wiki_template_added"), true);
177  }
178 
179  $this->ctrl->redirect($this, "listTemplates");
180  }
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 63 of file class.ilWikiPageTemplateGUI.php.

References ILIAS\Repository\ctrl().

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

◆ listTemplates()

ilWikiPageTemplateGUI::listTemplates ( )

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

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

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

◆ remove()

ilWikiPageTemplateGUI::remove ( )

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

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

121  : void
122  {
123  $wpt = new ilWikiPageTemplate($this->wiki->getId());
124 
125  $ids = $this->request->getIds();
126  if (count($ids) > 0) {
127  foreach ($ids as $id) {
128  $wpt->remove((int) $id);
129  }
130  $this->tpl->setOnScreenMessage('success', $this->lng->txt("wiki_template_status_removed"), true);
131  }
132 
133  $this->ctrl->redirect($this, "listTemplates");
134  }
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.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ removePageTemplateFromPageAction()

ilWikiPageTemplateGUI::removePageTemplateFromPageAction ( )

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

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

158  : void
159  {
160  $page_id = $this->request->getWikiPageId();
161  if ($page_id) {
162  $wpt = new ilWikiPageTemplate($this->wiki->getId());
163  $wpt->remove($page_id);
164  $this->tpl->setOnScreenMessage('success', $this->lng->txt("wiki_template_status_removed"), true);
165  }
166 
167  $this->ctrl->redirect($this, "listTemplates");
168  }
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 136 of file class.ilWikiPageTemplateGUI.php.

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

136  : void
137  {
138  $all_ids = $this->request->getAllIds();
139  $new_pages = $this->request->getNewPages();
140  $add_to_page = $this->request->getAddToPage();
141  foreach ($all_ids as $id) {
142  $wpt = new ilWikiPageTemplate($this->wiki->getId());
143  $wpt->save($id, $new_pages[$id] ?? 0, $add_to_page[$id] ?? 0);
144  }
145 
146  $this->wiki->setEmptyPageTemplate($this->request->getEmptyPageTemplate());
147  $this->wiki->update();
148 
149  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
150  $this->ctrl->redirect($this, "listTemplates");
151  }
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

EditingGUIRequest 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: