Action: CreateNewPage
Current version: |
{{createnewpage}}
/actions/createnewpage.php
<?php
// Displays a form to create a new page
// It first validates the form, then opens new page in edit mode using the header() function;
//for function GetResourceValue to work properly u need to put
// "CreateButton"=>"Create", ("CreateButton"=>"Translationtoyourlanguage",)
// "NewPage"=>"<b>Your PageName: </b>", ("NewPage"=>"<b>Translation: </b>",)
//in /lang/wakka."yourlanguage".php file
$form = $this->FormOpen().
// "\n<input name=\"name\" value=\"".$this->GetUserName()."\" type=\"hidden\" /><br />".
"\n<input type=\"hidden\" name=\"page\" value=\"result\">".
"\n<hr />".$this->GetResourceValue("NewPage").
"<input name=\"newpage\" value=\"".$this->GetPageTag()."/".
$_POST["newpage"]."\" type=\"text\"/>".
"<input type=\"submit\" value=\"".$this->GetResourceValue("CreateButton")."\" <hr />".
$this->FormClose();
if ($_POST["page"]=="result") {
$page = $this->GetUserName();
$newpage = $_POST["newpage"];
if (!$newpage) {
// a valid name must be entered
echo "<p class=\"error\">GetResourceValue("InvalidNameError")</p>";
echo $form;
} else {
// here the script is not quite ready
header('Location: http://www.yourpage.de/wakka.php?wakka='.$newpage);
/* Redirect browser */
/* Make sure that code below does not get executed when we redirect. */
exit;
}
} else {
echo $form;
}
?>
<?php
echo '<br />';
$url=$this->config["base_url"].$this->GetResourceValue("CreateNewPage");
print "<a href=\"".$url."\" title=\"".$this->GetResourceValue("CreateNewPage")."\">
<img src=\"".$this->GetConfigValue("theme_url")."icons/newpage.gif\"".
"style=\"vertical-align: middle\""."\" target=\"_blank\">".
$this->GetResourceValue("NewPage")."</a>\n";
?>
for users available for copy and paste
put this at the end of your language file
/lang/wakka.en.php
pls. notice that this entry will not survive an Wacko upgrade, so you have to redo this
[xyz] proposed translations
[de] ...
[fr]
[ru]