aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Controllers/WikiController.php
diff options
context:
space:
mode:
Diffstat (limited to 'h-source/Application/Controllers/WikiController.php')
-rw-r--r--h-source/Application/Controllers/WikiController.php25
1 files changed, 18 insertions, 7 deletions
diff --git a/h-source/Application/Controllers/WikiController.php b/h-source/Application/Controllers/WikiController.php
index 0e05ffd..9815055 100644
--- a/h-source/Application/Controllers/WikiController.php
+++ b/h-source/Application/Controllers/WikiController.php
@@ -40,6 +40,8 @@ class WikiController extends BaseController
public function insert($lang = 'en')
{
$this->shift(1);
+
+ $data['pagePreview'] = null;
$data['title'] = 'insert a wiki page - '.Website::$generalName;
@@ -64,6 +66,8 @@ class WikiController extends BaseController
die();
}
}
+
+ $data['pagePreview'] = $this->getPreview();
$data['notice'] = $this->m['WikiModel']->notice;
@@ -87,6 +91,8 @@ class WikiController extends BaseController
{
$this->shift(1);
+ $data['pagePreview'] = null;
+
$data['title'] = 'update a wiki page - '.Website::$generalName;
$this->m['WikiModel']->setFields('title,page','sanitizeAll');
@@ -125,6 +131,8 @@ class WikiController extends BaseController
}
}
+ $data['pagePreview'] = $this->getPreview();
+
$data['notice'] = $this->m['WikiModel']->notice;
$data['id_wiki'] = $clean['id_wiki'];
@@ -151,13 +159,16 @@ class WikiController extends BaseController
}
}
-// protected function viewRedirect($titleClean)
-// {
-// if ($this->m['WikiModel']->queryResult)
-// {
-// $this->redirect($this->controller.'/page/'.$this->lang.'/'.$titleClean);
-// }
-// }
+ //get the preview of the description entry
+ protected function getPreview()
+ {
+ if (isset($_POST['previewAction']))
+ {
+ $this->m['WikiModel']->result = false;
+ return $this->request->post('page','','sanitizeHtml');
+ }
+ return null;
+ }
public function page($lang = 'en', $title_clean = null)
{