diff options
| author | Antonio Gallo <tonicucoz@gmail.com> | 2011-05-19 22:10:52 +0000 | 
|---|---|---|
| committer | Antonio Gallo <tonicucoz@gmail.com> | 2011-05-19 22:10:52 +0000 | 
| commit | 759f536ae8a94ec5cce173fd00855aa39f0dbf3a (patch) | |
| tree | 47757058638952d70185bbc5c0dcd153ed0212f8 /h-source/Application/Controllers/WikiController.php | |
| parent | c91e85da877b40c1857c0d900dff11257c3e436f (diff) | |
h-source:added preview button for the description entry and for the wiki pages
Diffstat (limited to 'h-source/Application/Controllers/WikiController.php')
| -rw-r--r-- | h-source/Application/Controllers/WikiController.php | 25 | 
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)  	{  | 
