/** * Test action * * @return void */ public function testAction() { $str = "test -------- test"; $str = preg_replace("/\\s*[-\\s]+\\s*/", "_", $str); echo "<pre>"; print_r($str); echo "</pre>"; exit; // html_entity_decode(); // $convert = Digitalus_Convert::removeAccent("Bùi Văn Tiến Đức"); // $objhtmlEntities = new Zend_Filter_HtmlEntities(); $v = new Digitalus_Convert(); $str = '<img align="left" style="" width="" height="" class="border_img" src="/media/image/images_2.jpeg" alt="" />'; // <p><img height=\"150\" width=\"100\" src=\"/media/image/images_2.jpeg\" alt=\"\" /></p> // <p><img height=\"150\" width=\"100\" src=\"/media/image/images_2.jpeg\" alt=\"\" /></p> // <img align="left" style="" width="" height="" class="border_img" src="/media/image/images_2.jpeg" alt="" /> $ss = "<p><img height=\\"150\\" width=\\"100\\" src=\\"/media/image/images_2.jpeg\\" alt=\\"\\" /></p>"; // Nguyen goc print_r($str); // Luu vao database $str_1 = $v->scriptToData($str, 'editor'); print_r($str_1); // Outputs: A 'quote' is <b>bold</b> // $str = htmlentities($str); // $str = $objhtmlEntities->filter($str); // Outputs: A 'quote' is <b>bold</b> // echo htmlentities($str, ENT_QUOTES); // Script View print_r($v->dataToScriptView($str_1)); echo "<br><br><br><br><br><br><br><br><br><br><br><br><br><br>"; print_r($v->dataToScriptEdit($ss, 'editor')); exit; if ($this->_request->isPost()) { $upload = new Digitalus_Resource_Image(); $ext = Digitalus_Filesystem_File::getFileExtension($_FILES['file_field']['name']); $upload->uploadImage('file_field', time() . ".{$ext}", 'tam_tru'); echo "<pre>"; print_r($upload->fullPath); echo "</pre>"; echo "<pre>"; print_r($_FILES); echo "</pre>"; exit; } }
public function viewDetailAction() { $this->_helper->layout()->disableLayout(); // Disable for this action $this->_helper->viewRenderer->setNoRender(); $id = $this->_request->getParam('id'); $rowContent = $this->_objContents->find($id)->current(); // Tra ve html chuan $html = Digitalus_Convert::changeDataToScriptEdit($rowContent->html, 'editor'); $this->getResponse()->setBody($html); }
/** * strips the tags from each key in the text array * protected $_text = array('text_1','text_2'); */ private function _validateText() { // $filter = new Zend_Filter_StripTags(); $convert = new Digitalus_Convert(); if (isset($this->_text)) { foreach ($this->_text as $t) { if (isset($this->_data[$t])) { // $this->_data[$t] = $filter->filter($this->_data[$t]); $this->_data[$t] = $convert->scriptToData($this->_data[$t]); } } } }