/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. * * @see fetch() * @since 11.1 */ function display($tpl = null) { // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode('<br />', $errors)); return false; } $app = JFactory::getApplication(); $params = $app->getParams(); $this->_formId = $params->get('form_id'); if ($this->_formId && JSNUniformHelper::checkStateForm($this->_formId)) { $this->_state = $this->get('State'); $this->_items = $this->get('Items'); $this->_pagination = $this->get('Pagination'); $this->_fieldsForm = $this->get('FieldsForm'); $this->_fieldView = $params->get('form_field'); if (!empty($this->_fieldView)) { $this->_fieldView = json_decode($this->_fieldView); } $this->_viewField = $this->getViewField(); //var_dump($this->_viewField); // Display the view parent::display($tpl); $this->addAssets(); } }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. * * @see fetch() * @since 11.1 */ public function display($tpl = null) { $this->_item = $this->get('Item'); if (JSNUniformHelper::checkStateForm($this->_item->form_id)) { $menu = JFactory::getApplication()->getMenu(); $this->_input = JFactory::getApplication()->input; $menuItem = $menu->getItem((int) $this->_input->get("Itemid")); $this->_params = json_decode($menuItem->params); $this->_infoForm = $this->get('InfoForm'); $dataContentForm = $this->get('FormPages'); $this->nextAndPreviousForm = $this->get('NextAndPreviousForm'); $this->_formPages = $dataContentForm; $this->_dataSubmission = $this->get('DataSubmission'); $this->_dataFields = $this->get('DataFields'); // Display the template parent::display($tpl); $this->addAssets(); } }
/** * Save data submission * * @return Html messages */ public function save() { // Check for request forgeries. if (@$_SERVER['CONTENT_LENGTH'] < (int) ini_get('post_max_size') * 1024 * 1024) { // JRequest::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $return = new stdClass(); $post = $_POST; $model = $this->getModel('form'); if (!empty($_POST['form_id']) && JSNUniformHelper::checkStateForm($_POST['form_id'])) { $return = $model->save($post); } if (isset($return->error)) { //echo json_encode(array('error' => $return->error)); echo '<input type="hidden" name="error" value=\'' . htmlentities(json_encode($return->error), ENT_QUOTES, "UTF-8") . '\'/>'; exit; } else { if (isset($return->actionForm) && $return->actionForm == 'message') { // echo json_encode(array('message' => $return->actionFormData)); echo '<input type="hidden" name="message" value=\'' . htmlentities($return->actionFormData, ENT_QUOTES, "UTF-8") . '\'/>'; exit; } elseif (isset($return->actionForm) && $return->actionForm == 'url') { //echo "<div class=\"src-redirect\">{$return->actionFormData}</div>"; echo '<input type="hidden" name="redirect" value=\'' . htmlentities($return->actionFormData, ENT_QUOTES, "UTF-8") . '\'/>'; exit; } else { exit; } } } else { $postMaxSize = (int) ini_get('post_max_size'); if ($postMaxSize > (int) ini_get('upload_max_filesize')) { $postMaxSize = (int) ini_get('upload_max_filesize'); } //echo json_encode(array('error' => array('max-upload' => JText::sprintf('JSN_UNIFORM_POST_MAX_SIZE', $postMaxSize)))); echo '<input type="hidden" name="error" value=\'' . htmlentities(json_encode(array('max-upload' => JText::sprintf('JSN_UNIFORM_POST_MAX_SIZE', $postMaxSize))), ENT_QUOTES, "UTF-8") . '\'/>'; exit; } }
<?php /** * @version $Id: default.php 19013 2012-11-28 04:48:47Z thailv $ * @package JSNUniform * @subpackage Form * @author JoomlaShine Team <*****@*****.**> * @copyright Copyright (C) 2012 JoomlaShine.com. All Rights Reserved. * @license GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html * * Websites: http://www.joomlashine.com * Technical Support: Feedback - http://www.joomlashine.com/contact-us/get-support.html */ defined('_JEXEC') or die('Restricted access'); $showTitle = false; $showDes = false; $app = JFactory::getApplication(); $params = $app->getParams(); $getShowTitle = $this->_input->get('show_form_title'); $getShowDes = $this->_input->get('show_form_description'); if (!empty($getShowTitle) && $getShowTitle == 1) { $showTitle = true; } if (!empty($getShowDes) && $getShowDes == 1) { $showDes = true; } if (JSNUniformHelper::checkStateForm($this->_formId)) { echo JSNUniformHelper::generateHTMLPages($this->_formId, $this->_formName, '', '', '', $showTitle, $showDes); }
<?php /** * @version $Id: default.php 19013 2012-11-28 04:48:47Z thailv $ * @package JSNUniform * @subpackage Modules * @author JoomlaShine Team <*****@*****.**> * @copyright Copyright (C) 2012 JoomlaShine.com. All Rights Reserved. * @license GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html * * Websites: http://www.joomlashine.com * Technical Support: Feedback - http://www.joomlashine.com/contact-us/get-support.html */ defined('_JEXEC') or die('Restricted access'); $formName = md5(date("Y-m-d H:i:s") . $module->id); $showTitle = false; $showDes = false; if ($params->get('show_form_title') == 1) { $showTitle = true; } if ($params->get('show_form_description') == 1) { $showDes = true; } if (JSNUniformHelper::checkStateForm($params->get('form_id'))) { echo JSNUniformHelper::generateHTMLPages($params->get('form_id'), $formName, '', $params->get('uniform_top_content'), $params->get('uniform_bottom_content'), $showTitle, $showDes); }