diff options
author | Antonio Gallo <tonicucoz@gmail.com> | 2012-07-02 05:43:53 +0000 |
---|---|---|
committer | Antonio Gallo <tonicucoz@gmail.com> | 2012-07-02 05:43:53 +0000 |
commit | 1c1e9c704c57feacaec4af8e1ab3d07bd9dd5adc (patch) | |
tree | 9caa2965b22abbe97f1e674a10cb7c27e769a13e /h-source/Application | |
parent | a935ddd2093fa73066ae409c35535daa33371b9c (diff) |
added preview in hardware talk pages - lammi87 issue
Diffstat (limited to 'h-source/Application')
-rw-r--r-- | h-source/Application/Controllers/GenericController.php | 12 | ||||
-rw-r--r-- | h-source/Application/Views/Desktop/talk.php | 13 |
2 files changed, 25 insertions, 0 deletions
diff --git a/h-source/Application/Controllers/GenericController.php b/h-source/Application/Controllers/GenericController.php index 0c140b3..656060d 100644 --- a/h-source/Application/Controllers/GenericController.php +++ b/h-source/Application/Controllers/GenericController.php @@ -850,6 +850,18 @@ class GenericController extends BaseController } } + //if preview + if (isset($_POST['previewAction'])) + { + if ($this->s['registered']->status['status'] === 'logged') + { + if (!$this->s['registered']->checkCsrf($clean['token'])) $this->redirect($this->controller.'/catalogue/'.$this->lang,2,'wrong token..'); + + $data['preview_message'] = $this->request->post('message','','sanitizeHtml'); + $this->m['TalkModel']->result = false; + } + } + $data['table'] = $this->m['TalkModel']->select()->where(array('id_hard'=>$clean['id_hard']))->orderBy('id_talk')->send(); $data['values'] = $this->m['TalkModel']->getFormValues('insert','sanitizeHtml'); diff --git a/h-source/Application/Views/Desktop/talk.php b/h-source/Application/Views/Desktop/talk.php index 4f1e1b2..ac02490 100644 --- a/h-source/Application/Views/Desktop/talk.php +++ b/h-source/Application/Views/Desktop/talk.php @@ -116,6 +116,18 @@ <?php echo $notice;?> + <!--preiview--> + <?php if (isset($preview_message)) { ?> + <div class="message_preview_notice"> + <?php echo gtext("preview of the message");?>: + </div> + <div class="issues_message_item_preview"> + <div class="message_view_description"> + <?php echo decodeWikiText($preview_message);?> + </div> + </div> + <?php } ?> + <div class="notebooks_insert_form"> <form action="<?php echo $this->baseUrl."/".$this->controller."/talk/$lang/$id_hard/$token".$this->viewStatus;?>#form" method="POST"> @@ -131,6 +143,7 @@ <?php echo Html_Form::textarea('message',$values['message'],'talk_textarea_entry','bb_code');?> </div> + <input type="submit" name="previewAction" value="<?php echo gtext("Preview");?>"> <input type="submit" name="insertAction" value="<?php echo gtext("Save");?>"> </div> |