Wiki page template gui class.
More...
Wiki page template gui class.
- Author
- Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
- Version
- $Id$
Definition at line 12 of file class.ilWikiPageTemplateGUI.php.
◆ __construct()
ilWikiPageTemplateGUI::__construct |
( |
ilObjWikiGUI |
$a_wiki_gui | ) |
|
Constructor.
- Parameters
-
Definition at line 33 of file class.ilWikiPageTemplateGUI.php.
References $DIC, $ilCtrl, $lng, and $tpl.
39 $ilToolbar = $DIC->toolbar();
40 $lng = $DIC->language();
42 $this->wiki_gui = $a_wiki_gui;
43 $this->wiki = $this->wiki_gui->object;
47 $this->toolbar = $ilToolbar;
◆ add()
ilWikiPageTemplateGUI::add |
( |
| ) |
|
Add page as template page.
Definition at line 114 of file class.ilWikiPageTemplateGUI.php.
References $_POST, and ilWikiPageTemplate\save().
116 include_once(
"./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
119 ilUtil::sendSuccess($this->lng->txt(
"wiki_template_added"),
true);
120 $this->ctrl->redirect($this,
"listTemplates");
save($a_id, $a_new_pages=0, $a_add_to_page=0)
Add wiki page template.
◆ addPageTemplateFromPageAction()
ilWikiPageTemplateGUI::addPageTemplateFromPageAction |
( |
| ) |
|
Definition at line 179 of file class.ilWikiPageTemplateGUI.php.
References $_GET, and ilWikiPageTemplate\save().
181 $page_id = (int)
$_GET[
"wpg_id"];
183 include_once(
"./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
185 $wpt->
save($page_id);
186 ilUtil::sendSuccess($this->lng->txt(
"wiki_template_added"),
true);
189 $this->ctrl->redirect($this,
"listTemplates");
save($a_id, $a_new_pages=0, $a_add_to_page=0)
Add wiki page template.
◆ executeCommand()
ilWikiPageTemplateGUI::executeCommand |
( |
| ) |
|
Execute command.
Definition at line 53 of file class.ilWikiPageTemplateGUI.php.
55 $nc = $this->ctrl->getNextClass();
59 $cmd = $this->ctrl->getCmd(
"listTemplates");
60 if (in_array($cmd, array(
"listTemplates",
"add",
"remove",
"saveTemplateSettings",
"addPageTemplateFromPageAction",
"removePageTemplateFromPageAction"))) {
◆ listTemplates()
ilWikiPageTemplateGUI::listTemplates |
( |
| ) |
|
List templates.
Definition at line 70 of file class.ilWikiPageTemplateGUI.php.
References PHPMailer\PHPMailer\$options, $si, $tab, ilWikiPage\getAllWikiPages(), ilCheckboxInputGUI\setChecked(), and ilUtil\shortenText().
73 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
75 $options = array(
"" => $this->lng->txt(
"please_select"));
76 foreach ($pages as $p) {
83 $this->toolbar->setFormAction($this->ctrl->getFormAction($this));
84 $this->toolbar->setOpenFormTag(
true);
85 $this->toolbar->setCloseFormTag(
false);
87 if (count($options) > 0) {
88 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
90 $si->setOptions($options);
91 $this->toolbar->addInputItem(
$si);
92 $this->toolbar->addFormButton($this->lng->txt(
"wiki_add_template"),
"add");
93 $this->toolbar->addSeparator();
97 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
98 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"wiki_empty_page_template"),
"empty_page_templ");
99 $cb->
setChecked($this->wiki->getEmptyPageTemplate());
100 $this->toolbar->addInputItem($cb,
true);
101 $this->toolbar->addFormButton($this->lng->txt(
"save"),
"saveTemplateSettings");
104 include_once(
"./Modules/Wiki/classes/class.ilWikiPageTemplatesTableGUI.php");
106 $tab->setOpenFormTag(
false);
107 $tab->setCloseFormTag(
true);
108 $this->tpl->setContent(
$tab->getHTML());
TableGUI class for wiki page templates.
static shortenText( $a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
static getAllWikiPages($a_wiki_id)
Get all pages of wiki.
◆ remove()
ilWikiPageTemplateGUI::remove |
( |
| ) |
|
Remove.
Definition at line 126 of file class.ilWikiPageTemplateGUI.php.
References $_POST, $id, and ilWikiPageTemplate\remove().
128 include_once(
"./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
131 if (is_array(
$_POST[
"id"])) {
135 ilUtil::sendSuccess($this->lng->txt(
"wiki_template_status_removed"),
true);
138 $this->ctrl->redirect($this,
"listTemplates");
if(!array_key_exists('StateId', $_REQUEST)) $id
remove($a_id)
Remove template status of a page.
◆ removePageTemplateFromPageAction()
ilWikiPageTemplateGUI::removePageTemplateFromPageAction |
( |
| ) |
|
Definition at line 166 of file class.ilWikiPageTemplateGUI.php.
References $_GET, and ilWikiPageTemplate\remove().
168 $page_id = (int)
$_GET[
"wpg_id"];
170 include_once(
"./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
173 ilUtil::sendSuccess($this->lng->txt(
"wiki_template_status_removed"),
true);
176 $this->ctrl->redirect($this,
"listTemplates");
remove($a_id)
Remove template status of a page.
◆ saveTemplateSettings()
ilWikiPageTemplateGUI::saveTemplateSettings |
( |
| ) |
|
Save template settings.
Definition at line 144 of file class.ilWikiPageTemplateGUI.php.
References $_POST, $id, and ilWikiPageTemplate\save().
146 if (is_array(
$_POST[
"all_ids"])) {
147 include_once(
"./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
150 $wpt->
save((
int) $id, (
int)
$_POST[
"new_pages"][$id], (
int)
$_POST[
"add_to_page"][$id]);
154 $this->wiki->setEmptyPageTemplate((
int)
$_POST[
"empty_page_templ"]);
155 $this->wiki->update();
157 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
158 $this->ctrl->redirect($this,
"listTemplates");
if(!array_key_exists('StateId', $_REQUEST)) $id
save($a_id, $a_new_pages=0, $a_add_to_page=0)
Add wiki page template.
◆ $ctrl
ilWikiPageTemplateGUI::$ctrl |
|
protected |
◆ $lng
ilWikiPageTemplateGUI::$lng |
|
protected |
◆ $toolbar
ilWikiPageTemplateGUI::$toolbar |
|
protected |
◆ $tpl
ilWikiPageTemplateGUI::$tpl |
|
protected |
◆ $wiki_gui
ilWikiPageTemplateGUI::$wiki_gui |
|
protected |
The documentation for this class was generated from the following file: