aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Controllers/GenericController.php
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-05-19 22:10:52 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-05-19 22:10:52 +0000
commit759f536ae8a94ec5cce173fd00855aa39f0dbf3a (patch)
tree47757058638952d70185bbc5c0dcd153ed0212f8 /h-source/Application/Controllers/GenericController.php
parentc91e85da877b40c1857c0d900dff11257c3e436f (diff)
h-source:added preview button for the description entry and for the wiki pages
Diffstat (limited to 'h-source/Application/Controllers/GenericController.php')
-rw-r--r--h-source/Application/Controllers/GenericController.php23
1 files changed, 21 insertions, 2 deletions
diff --git a/h-source/Application/Controllers/GenericController.php b/h-source/Application/Controllers/GenericController.php
index 31271b9..9cbaeee 100644
--- a/h-source/Application/Controllers/GenericController.php
+++ b/h-source/Application/Controllers/GenericController.php
@@ -63,6 +63,8 @@ class GenericController extends BaseController
$this->shift(2);
$clean['token'] = sanitizeAlphanum($token);
+
+ $data['descriptionPreview'] = null; //contains the HTML of the preview of the description entry
$data['notice'] = null;
$data['submission_response'] = 'error';
@@ -114,7 +116,9 @@ class GenericController extends BaseController
}
}
}
-
+
+ $data['descriptionPreview'] = $this->getPreview();
+
$data['notice'] = $this->m['HardwareModel']->notice;
$data['submitName'] = "insertAction";
@@ -143,7 +147,7 @@ class GenericController extends BaseController
$this->redirect("users/login/".$this->lang."?redirect=".$this->controller."/catalogue/".$this->lang,0);
}
}
-
+
public function del($lang = 'en', $token = '')
{
header('Content-type: text/html; charset=UTF-8');
@@ -210,6 +214,8 @@ class GenericController extends BaseController
$this->shift(2);
$clean['token'] = sanitizeAlphanum($token);
+
+ $data['descriptionPreview'] = null; //contains the HTML of the preview of the description entry
$data['notice'] = null;
$data['submission_response'] = 'error';
@@ -264,6 +270,8 @@ class GenericController extends BaseController
}
}
}
+
+ $data['descriptionPreview'] = $this->getPreview();
$data['notice'] = $this->m['HardwareModel']->notice;
@@ -306,6 +314,17 @@ class GenericController extends BaseController
}
}
+ //get the preview of the description entry
+ protected function getPreview()
+ {
+ if (isset($_POST['previewAction']))
+ {
+ $this->m['HardwareModel']->result = false;
+ return $this->request->post('description','','sanitizeHtml');
+ }
+ return null;
+ }
+
protected function checkVendorId($interface)
{
if (strcmp($this->m['HardwareModel']->type,'notebook') === 0) return true;