wiki:default is used as content for blank pages
git-svn-id: file:///home/shish/svn/shimmie2/trunk@139 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
241a048b38
commit
3be41b687a
@ -78,9 +78,9 @@ class Wiki extends Extension {
|
|||||||
$content = $this->get_page($title);
|
$content = $this->get_page($title);
|
||||||
if(isset($_GET['save']) && $_GET['save'] == "on") {
|
if(isset($_GET['save']) && $_GET['save'] == "on") {
|
||||||
$title = $_POST['title'];
|
$title = $_POST['title'];
|
||||||
$rev = $_POST['revision'];
|
$rev = int_escape($_POST['revision']);
|
||||||
$body = $_POST['body'];
|
$body = $_POST['body'];
|
||||||
$lock = $_POST['lock'];
|
$lock = isset($_POST['lock']) && ($_POST['lock'] == "on");
|
||||||
|
|
||||||
global $user;
|
global $user;
|
||||||
if($this->can_edit($user, $this->get_page($title))) {
|
if($this->can_edit($user, $this->get_page($title))) {
|
||||||
@ -106,9 +106,20 @@ class Wiki extends Extension {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(is_null($content)) {
|
else if(is_null($content)) {
|
||||||
|
$default = $this->get_page("wiki:default");
|
||||||
$blank = new WikiPage();
|
$blank = new WikiPage();
|
||||||
$blank->title = $title;
|
$blank->title = $title;
|
||||||
$page->add_main_block(new Block("Content", $this->create_edit_html($blank)));
|
if(!is_null($default) && !isset($_GET['edit'])) {
|
||||||
|
global $config;
|
||||||
|
$blank->body = $default->body;
|
||||||
|
$blank->owner_id = $config->get_int('anon_id');
|
||||||
|
$blank->date = $default->date;
|
||||||
|
$content = $this->create_display_html($blank);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$content = $this->create_edit_html($blank);
|
||||||
|
}
|
||||||
|
$page->add_main_block(new Block("Content", $content));
|
||||||
}
|
}
|
||||||
else if(isset($_GET['edit']) && $_GET['edit'] == "on") {
|
else if(isset($_GET['edit']) && $_GET['edit'] == "on") {
|
||||||
$page->add_main_block(new Block("Content", $this->create_edit_html($content)));
|
$page->add_main_block(new Block("Content", $this->create_edit_html($content)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user