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;
55 $nc = $this->ctrl->getNextClass();
59 $cmd = $this->ctrl->getCmd(
"listTemplates");
60 if (in_array($cmd,
array(
"listTemplates",
"add",
"remove",
"saveTemplateSettings",
"addPageTemplateFromPageAction",
"removePageTemplateFromPageAction"))) {
73 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
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());
116 include_once(
"./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
120 $this->ctrl->redirect($this,
"listTemplates");
126 public function remove()
128 include_once(
"./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
131 if (is_array(
$_POST[
"id"])) {
138 $this->ctrl->redirect($this,
"listTemplates");
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();
158 $this->ctrl->redirect($this,
"listTemplates");
168 $page_id = (int)
$_GET[
"wpg_id"];
170 include_once(
"./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
176 $this->ctrl->redirect($this,
"listTemplates");
181 $page_id = (int)
$_GET[
"wpg_id"];
183 include_once(
"./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
185 $wpt->
save($page_id);
189 $this->ctrl->redirect($this,
"listTemplates");
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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.
listTemplates()
List templates.
Wiki page template gui class.
if(!array_key_exists('StateId', $_REQUEST)) $id
removePageTemplateFromPageAction()
add()
Add page as template page.
save($a_id, $a_new_pages=0, $a_add_to_page=0)
Add wiki page template.
saveTemplateSettings()
Save template settings.
static getAllWikiPages($a_wiki_id)
Get all pages of wiki.
Create styles array
The data for the language used.
__construct(ilObjWikiGUI $a_wiki_gui)
Constructor.
remove($a_id)
Remove template status of a page.
executeCommand()
Execute command.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
addPageTemplateFromPageAction()