AAAAPK¼ B\Ù½®‚‚ show_html.phpnuW+A„¶ 'Show HTML (Display Form)', 'tooltip' => 'Eval and show the form content.'); function load($clear){ if($clear){ $action_params = array( 'data_republish' => 1, 'display_errors' => 1, 'load_token' => 1, 'keep_alive' => 0, 'curly_replacer' => 1, 'submit_event' => 'submit', 'form_container' => '', 'page_number' => '1' ); } return array('action_params' => $action_params); } function run($form, $actiondata){ $params = new JParameter($actiondata->params); } } ?>PK¼ B\d ¶q{{cfaction_show_html.ctpnuW+A„¶loadAction($form, $actiondata); ?>PK¼ B\ž ÙÜ index.htmlnuW+A„¶ PK¼ B\sÒ// show_html.ctpnuW+A„¶
Show html
Header(array('general' => 'General', 'multi_page' => 'Advanced (Multi Page)'), 'cfaction_show_html_element_config_{n}'); ?> tabStart('general'); ?> input('action_show_html_{n}_data_republish_config', array('type' => 'select', 'label' => 'Republish form data', 'options' => array(0 => 'No', 1 => 'Yes (recommended)'), 'smalldesc' => 'Try to republish the form data in case the form has been reloaded because of some error.')); ?> input('action_show_html_{n}_display_errors_config', array('type' => 'select', 'label' => 'Display Fields Errors', 'options' => array(0 => 'No', 1 => 'Yes (recommended)'), 'smalldesc' => 'Display server side errors below fields, for this to work you need to have this code in the place you want the error to appear at:
<div id="error-message-FIELD_NAME_HERE"></div>

*This is added automatically when using the wizard.')); ?> input('action_show_html_{n}_load_token_config', array('type' => 'select', 'label' => 'Load Security Token', 'options' => array(0 => 'No', 1 => 'Yes (recommended)'), 'smalldesc' => 'Do you want to load the security token ? this is used to verify that form code has not been changed by the user before submission, you need to have the "Check Token" action to check it.')); ?> input('action_show_html_{n}_keep_alive_config', array('type' => 'select', 'label' => 'Load Keep Alive', 'options' => array(0 => 'No', 1 => 'Yes'), 'smalldesc' => 'Load the keep alive element ? this will ensure that the user session does not expire while having the form opened.')); ?> input('action_show_html_{n}_curly_replacer_config', array('type' => 'select', 'label' => 'Curly brackets replacer', 'options' => array(0 => 'No', 1 => 'Yes'), 'smalldesc' => 'Replace any fields names inside curly brackets, this will work only if you have some data in the $form->data array.')); ?> tabEnd(); ?> tabStart('multi_page'); ?>

input('action_show_html_{n}_submit_event_config', array('type' => 'select', 'label' => 'Submission Event', 'options' => array('_self' => 'Self', 'load' => 'load', 'submit' => 'submit'), 'smalldesc' => 'Choose the event which will be executed when the form is submitted.')); ?> input('action_show_html_{n}_page_number_config', array('type' => 'text', 'label' => 'Page Number', 'smalldesc' => 'Enter the page number to show in case you have more than 1 page in your form or leave it as its (1).')); ?> input('action_show_html_{n}_form_container_config', array('type' => 'text', 'label' => 'Div container id', 'smalldesc' => 'Enter an id and it will be assigned to a div element wrapping the form element in the page.')); ?> tabEnd(); ?>
PK¼ B\÷ƲÎ8U8Ucfaction_show_html.phpnuW+A„¶params); $output = ''; $mainframe = JFactory::getApplication(); $uri = JFactory::getURI(); $document = JFactory::getDocument(); //set form's HTML name and ID $form->html_form_name = isset($form->html_form_name) ? $form->html_form_name : $form->form_params->get('html_form_name', $form->form_name); $form->html_form_id = isset($form->html_form_id) ? $form->html_form_id : $form->form_params->get('html_form_id', 'chronoform_'.$form->form_name); //check the assets files to be loaded if((int)$form->form_params->get('load_files', 1) > 0){ //load form css files if((bool)$form->form_params->get('tight_layout', 0) === false){ $document->addStyleSheet($uri->root().'components/com_chronoforms/css/frontforms.css'); }else{ $document->addStyleSheet($uri->root().'components/com_chronoforms/css/frontforms_tight.css'); } } if(($form->form_params->get('enable_jsvalidation', 1) || (strpos($form->form_details->content, 'validate[') !== false && $form->form_params->get('auto_detect_settings', 1))) && (int)$form->form_params->get('load_files', 1) > 0){ //load js validation code $this->_loadValidationScripts($form); } $datetime_picker_selector = $form->form_params->get('datepicker_config', ''); if((!empty($datetime_picker_selector) || strpos($form->form_details->content, 'cf_date_picker') !== false || strpos($form->form_details->content, 'cf_time_picker') !== false || strpos($form->form_details->content, 'cf_datetime_picker') !== false) && (int)$form->form_params->get('load_files', 1) > 0){ //load js for the date time picker $jversion = new JVersion(); if(($jversion->RELEASE > 1.5) && $form->form_params->get('datepicker_type', 0) == 1){ $this->_loadDatePickerScripts_moo($form); }else{ $this->_loadDatePickerScripts($form); } } if((strpos($form->form_details->content, 'tooltipimg') !== false) && (int)$form->form_params->get('load_files', 1) > 0){ //load the tooltips files $this->_loadToolTip($form); } if(!empty($form->validation_errors) && (int)$form->form_params->get('load_files', 1) > 0){ //add the validation style $this->_loadSSValidation($form); } //check if form tags should be added or not if($form->form_params->get('add_form_tags', 1)){ $output .= "
form_params->get('action_url', ''))){ $form_tag_array[] = 'action="'.$form->form_params->get('action_url', '').'"'; }else{ $action_url = 'index.php?option=com_chronoforms&chronoform='.$form->form_name; if($form->form_params->get('relative_url', 1) == 1){ $action_url = $this->selfURL(); if((bool)$form->disguised === true){ //disguise mode, the event will be used as a task for the parent app preg_match_all('/(&*)task=([^&]+)/is', $action_url, $chronoform_matches); $action_url = str_replace($chronoform_matches[0], '', $action_url); $separator = $this->_getURLSeparator($action_url); if(isset($form->data['task']) && !empty($form->data['task']) && strpos($action_url, $form->data['task']) !== false){ //this is propably a SEF URL $action_url = str_replace($form->data['task'], $form->form_params->get('action_task', $params->get('submit_event', 'submit')), $action_url); }else{ $action_url .= $separator.'task='.$form->form_params->get('action_task', $params->get('submit_event', 'submit')); } }else{ preg_match_all('/(&*)event=([^&]+)/is', $action_url, $event_matches); $action_url = str_replace($event_matches[0], '', $action_url); //strip the form name if exists and add own form name preg_match_all('/(&*)chronoform=([^&]+)/is', $action_url, $chronoform_matches); $action_url = str_replace($chronoform_matches[0], '', $action_url); $separator = $this->_getURLSeparator($action_url); $action_url .= $separator.'chronoform='.$form->form_name; } } if((bool)$form->disguised === false){ $separator = $this->_getURLSeparator($action_url); $action_url .= $separator.'event='.$params->get('submit_event', 'submit'); } //check if we are submitting to _self if($params->get('submit_event', 'submit') == '_self'){ preg_match_all('/((&|&|\?)*)(event|task)=([^&]+)/is', $action_url, $event_matches); $action_url = str_replace($event_matches[0], '', $action_url); } //attach the itemid if exists $item_id = JRequest::getVar('Itemid', ''); if(!empty($item_id) && stripos($this->selfURL(), 'Itemid') !== false && strpos($action_url, 'Itemid') === false){ $separator = $this->_getURLSeparator($action_url); $action_url .= $separator.'Itemid='.$item_id; } //attach the session id if it exists in the data array $session_key_param = $form->form_params->get('session_key_param', 'cf_sid'); //if(isset($form->data[$session_key_param]) && !empty($form->data[$session_key_param])){ if(isset($form->session_token) && !empty($form->session_token)){ preg_match_all('/(&*)'.$session_key_param.'=([^&]+)/is', $action_url, $session_key_param_matches); $action_url = str_replace($session_key_param_matches[0], '', $action_url); $separator = $this->_getURLSeparator($action_url); $action_url .= $separator.$session_key_param.'='.$form->session_token; } //fix the ampersand $action_url = str_replace('&', '&', $action_url); $action_url = str_replace('&&', '&', $action_url); $action_url = str_replace('&', '&', $action_url); //add the action URL to the form tag pieces array $form_tag_array[] = 'action="'.$action_url.'"'; } $form_tag_array[] = 'name="'.$form->html_form_name.'"'; $form_tag_array[] = 'id="'.$form->html_form_id.'"'; $enctype = ''; $method = $form->form_params->get('form_method', 'post'); if($method == 'file' || ($form->form_params->get('auto_detect_settings', 1) && (stripos($form->form_details->content, 'type="file"') !== false || stripos($form->form_details->content, "type='file'") !== false))){ $method = 'post'; $enctype = 'enctype="multipart/form-data"'; } //add the form method $form_tag_array[] = 'method="'.$method.'"'; //add the enctype if exists $form_tag_array[] = $enctype; //add the form class $form_tag_array[] = 'class="Chronoform'.$form->form_params->get('html_form_class', '').'"'; //add any attachments if(trim($form->form_params->get('form_tag_attach', ''))){ $form_tag_array[] = $form->form_params->get('form_tag_attach', ''); } //build the form tag $output .= implode(" ", array_filter($form_tag_array)).'>'; } //show error messages $this->_showErrors($form); //echo $output; ob_start(); eval('?>'.$form->form_details->content); $temp_output = ob_get_clean(); //check the page to view if(preg_match("//i", $temp_output)){ $form_pages = explode("", $temp_output); $active_page_index = (int)$params->get('page_number', 1) - 1; $output .= $form_pages[$active_page_index]; }else{ $output .= $temp_output; } //add any extra content $output .= $form->extra_content; //Load any form data if((int)$params->get('data_republish', 1) == 1){ include_once(JPATH_SITE.DS.'components'.DS.'com_chronoforms'.DS.'libraries'.DS.'includes'.DS.'data_republish.php'); $HTMLFormPostDataLoad = new HTMLFormPostDataLoad(); //$HTMLFormPostDataLoad->validation_errors = $form->validation_errors; if(isset($form->data['chrono_verification']) && !empty($form->data['chrono_verification'])){ $form->data['chrono_verification'] = ''; } $output = $HTMLFormPostDataLoad->load($output, $form->data); } //Display any form errors if((int)$params->get('display_errors', 1) == 1){ include_once(JPATH_SITE.DS.'components'.DS.'com_chronoforms'.DS.'libraries'.DS.'includes'.DS.'display_errors.php'); $HTMLFormPostDisplayErrors = new HTMLFormPostDisplayErrors(); $HTMLFormPostDisplayErrors->validation_errors = $form->validation_errors; $output = $HTMLFormPostDisplayErrors->load($output, $form->data); } //Replace curly fields names if((int)$params->get('curly_replacer', 1) == 1){ $output = $form->curly_replacer($output, $form->data, '.', true); } //load token if enabled if((int)$params->get('load_token', 1) == 1){ $output .= JHTML::_('form.token'); } //load keep alive if enabled if((int)$params->get('keep_alive', 0) == 1){ JHTML::_('behavior.keepalive'); } //check if form tags should be added or not if($form->form_params->get('add_form_tags', 1)){ $output .= "
"; } //check if the form should be inside a div container ? if(strlen(trim($params->get('form_container', ''))) > 0){ $output = '
'.$output.'
'; } echo $output; } function _getURLSeparator($url = ''){ $separator = ''; $action_url = $url; if(strpos($action_url, '?') !== false && substr($action_url, -1) != '?'){ $separator = '&'; } if(strpos($action_url, '?') === false){ $separator = '?'; } return $separator; } function _showErrors($form){ if(!empty($form->validation_errors) && $form->form_params->get('show_top_errors', 1)){ $mainframe = JFactory::getApplication(); $uri = JFactory::getURI(); $document = JFactory::getDocument(); $document->addStyleSheet($uri->root().'components/com_chronoforms/css/error.css'); echo '
  1. '.implode('
  2. ', $this->_normalize($form->validation_errors)).'
'; } } function _normalize($array = array()){ $return = array(); foreach($array as $k => $v){ if(is_array($v)){ $return = array_merge($this->_normalize($v), $return); }else{ $return[] = $v; } } return $return; } function _loadValidationScripts($form){ if($form->loaded_validation === false){ $document = JFactory::getDocument(); JHTML::_('behavior.mootools'); $mainframe = JFactory::getApplication(); $uri = JFactory::getURI(); $form->html_form_name = isset($form->html_form_name) ? $form->html_form_name : $form->form_name; $form->html_form_id = isset($form->html_form_id) ? $form->html_form_id : 'chronoform_'.$form->form_name; $document->addStyleSheet($uri->root().'components/com_chronoforms/css/formcheck/theme/'.$form->form_params->get('jsvalidation_theme', 'classic').'/formcheck.css'); $document->addStyleSheet($uri->root().'components/com_chronoforms/css/formcheck_fix.css'); $document->addScript($uri->root().'components/com_chronoforms/js/formcheck/formcheck-yui.js'); $document->addScript($uri->root().'components/com_chronoforms/js/formcheck/formcheck-max.js'); $validationClass = "FormCheck"; //check for JPanes existance if(strpos($form->form_details->content, 'jimport("joomla.html.pane");') !== false){ //load jpanes validation fix $document->addScript($uri->root().'components/com_chronoforms/js/formcheck/formcheck-jpane.js'); $validationClass = "FormCheckJPane"; } if(((bool)$form->form_params->get('jsvalidation_errors', 1) === true) && ($validationClass == "FormCheck")){ $validationClass = "FormCheckMax"; } if(1){ $lang = JFactory::getLanguage(); $lang_tag = $lang->getTag(); $lang_pcs = explode('-', $lang_tag); $lang_tag = file_exists(str_replace('/', DS, JPATH_SITE.DS.'components/com_chronoforms/js/formcheck/lang/'.$lang_pcs[0].'.js')) ? $lang_pcs[0] : $form->form_params->get('jsvalidation_lang', 'en'); } $document->addScript($uri->root().'components/com_chronoforms/js/formcheck/lang/'.$lang_tag.'.js'); ob_start(); ?> window.addEvent('domready', function() { document.id('html_form_id; ?>').addClass('hasValidation'); formCheck_html_form_name); ?> = new ('html_form_id; ?>', { onValidateSuccess: form_params->get('jsvalidation_onValidateSuccess', "\$empty"); ?>, display : { showErrors : form_params->get('jsvalidation_showErrors', 0); ?>, errorsLocation: form_params->get('jsvalidation_errorsLocation', 1); ?> } }); }); form_params->get('dynamic_files', 0) === false){ $document->addScriptDeclaration("//"); }else{ //load the action class $form->loadActionHelper('load_js'); $CfactionLoadJsHelper = new CfactionLoadJsHelper(); $JSactiondata = new stdClass(); $JSactiondata->content1 = $script; $JSParams = new JParameter(''); $JSParams->set('dynamic_file', $form->form_params->get('dynamic_files', 0)); $JSactiondata->params = $JSParams->toString(); $CfactionLoadJsHelper->load($form, $JSactiondata); } //set validation loaded $form->loaded_validation = true; } } function _loadDatePickerScripts($form){ $document = JFactory::getDocument(); JHTML::_('behavior.mootools'); $mainframe = JFactory::getApplication(); $uri = JFactory::getURI(); $document->addStyleSheet($uri->root().'components/com_chronoforms/css/datepicker/datepicker_dashboard.css'); $document->addScript($uri->root().'components/com_chronoforms/js/datepicker/datepicker.js'); $settings = array( "'.cf_date_picker', {pickerClass: 'datepicker_dashboard', format: 'Y-m-d', inputOutputFormat: 'Y-m-d', allowEmpty: true", "'.cf_datetime_picker', {pickerClass: 'datepicker_dashboard', inputOutputFormat: 'Y-m-d H:i:s', timePicker: true, allowEmpty: true, format: 'd-m-Y H:i:s'", "'.cf_time_picker', {pickerClass: 'datepicker_dashboard', inputOutputFormat: 'H:i:s', timePickerOnly: true, allowEmpty: true, format: 'H:i:s'" ); //$selector = 'dateTimePicker'; $datepicker_ext = $form->form_params->get('datepicker_config', ''); ob_start(); ?> window.addEvent('load', function() { new DatePicker(); }); form_params->get('dynamic_files', 0) === false){ $document->addScriptDeclaration("//"); }else{ //load the action class $form->loadActionHelper('load_js'); $CfactionLoadJsHelper = new CfactionLoadJsHelper(); $JSactiondata = new stdClass(); $JSactiondata->content1 = $script; $JSParams = new JParameter(''); $JSParams->set('dynamic_file', $form->form_params->get('dynamic_files', 0)); $JSactiondata->params = $JSParams->toString(); $CfactionLoadJsHelper->load($form, $JSactiondata); } } function _loadDatePickerScripts_moo($form){ $document = JFactory::getDocument(); JHTML::_('behavior.mootools'); $mainframe = JFactory::getApplication(); $uri = JFactory::getURI(); $cf_url = $uri->root();//($mainframe->isSite()) ? JURI::Base() : $uri->root(); $cf_url .= 'components/com_chronoforms/js/datepicker_moo/'; // you can change the uncommented line here to change the style $datepicker_style = $form->form_params->get('datepicker_moo_style', 'datepicker_dashboard'); //$datepicker_style = 'datepicker_jqui'; //$datepicker_style = 'datepicker_vista'; $document->addStyleSheet($cf_url.$datepicker_style.'/'.$datepicker_style.'.css'); if(1){ $lang = JFactory::getLanguage(); $lang_tag = $lang->getTag(); $lang_tag = file_exists(str_replace('/', DS, JPATH_SITE.DS.'components/com_chronoforms/js/datepicker_moo/Locale.'.$lang_tag.'.DatePicker.js')) ? $lang_tag : 'en-US'; if($lang_tag != 'en-US'){ $document->addScriptDeclaration('Locale.use("'.$lang_tag.'");'); } } $document->addScript($cf_url.'Locale.'.$lang_tag.'.DatePicker.js'); $document->addScript($cf_url.'Picker.js'); $document->addScript($cf_url.'Picker.Attach.js'); $document->addScript($cf_url.'Picker.Date.js'); $settings = array(); // Settings for standard date picker $settings[1]['class'] = '.cf_date_picker'; $settings[1]['options'] = array( "pickerClass: '{$datepicker_style}'", "format: '%Y-%m-%d'", "allowEmpty: true", "useFadeInOut: !Browser.ie" ); // Settings for standard date + time picker $settings[2]['class'] = '.cf_datetime_picker'; $settings[2]['options'] = array( "pickerClass: '{$datepicker_style}'", "format: '%d-%m-%Y %H:%M:%S'", "timePicker: true", "allowEmpty: true", "useFadeInOut: !Browser.ie" ); // Settings for standard time picker $settings[3]['class'] = '.cf_time_picker'; $settings[3]['options'] = array( "pickerClass: '{$datepicker_style}'", "format: '%H:%M:%S'", "pickOnly: 'time'", "allowEmpty: true", "useFadeInOut: !Browser.ie" ); $datepicker_ext = $form->form_params->get('datepicker_config', ''); $script = ""; foreach($settings as $s){ $options = implode(', ', $s['options']); if($datepicker_ext){ $options .= ', '.$datepicker_ext; } $script .= " new Picker.Date($$('{$s['class']}'), { {$options} }); "; } $script = " window.addEvent('load', function() { {$script} }); "; if((bool)$form->form_params->get('dynamic_files', 0) === false){ $document->addScriptDeclaration($script); }else{ //load the action class $form->loadActionHelper('load_js'); $CfactionLoadJsHelper = new CfactionLoadJsHelper(); $JSactiondata = new stdClass(); $JSactiondata->content1 = $script; $JSParams = new JParameter(''); $JSParams->set('dynamic_file', $form->form_params->get('dynamic_files', 0)); $JSactiondata->params = $JSParams->toString(); $CfactionLoadJsHelper->load($form, $JSactiondata); } } function _loadSSValidation($form){ $document = JFactory::getDocument(); JHTML::_('behavior.mootools'); ob_start(); ?> window.addEvent('domready', function() { $$('.error-message').each(function(element){ if($chk(element.getParent('.ccms_form_element'))){ element.getParent('.ccms_form_element').addClass('form-error'); } }); }); form_params->get('dynamic_files', 0) === false){ $document->addScriptDeclaration("//"); }else{ //load the action class $form->loadActionHelper('load_js'); $CfactionLoadJsHelper = new CfactionLoadJsHelper(); $JSactiondata = new stdClass(); $JSactiondata->content1 = $script; $JSParams = new JParameter(''); $JSParams->set('dynamic_file', $form->form_params->get('dynamic_files', 0)); $JSactiondata->params = $JSParams->toString(); $CfactionLoadJsHelper->load($form, $JSactiondata); } } function _loadToolTip($form){ $mainframe = JFactory::getApplication(); $uri = JFactory::getURI(); $document = JFactory::getDocument(); $cf_url = $uri->root(); $cf_url .= 'components/com_chronoforms/css/'; JHTML::_('behavior.mootools'); $document->addStyleSheet($cf_url.'/tooltip.css'); //echo ''; //JHTML::_('behavior.tooltip', '.tooltipimg'); ob_start(); ?> window.addEvent('domready', function(){ //create the tooltips var tipz = new Tips($$('div.tooltipimg'),{ className: 'tooltipbox', fixed: true, hideDelay: 0, showDelay: 0 }); }); form_params->get('dynamic_files', 0) === false){ $document->addScriptDeclaration("//"); }else{ //load the action class $form->loadActionHelper('load_js'); $CfactionLoadJsHelper = new CfactionLoadJsHelper(); $JSactiondata = new stdClass(); $JSactiondata->content1 = $script; $JSParams = new JParameter(''); $JSParams->set('dynamic_file', $form->form_params->get('dynamic_files', 0)); $JSactiondata->params = $JSParams->toString(); $CfactionLoadJsHelper->load($form, $JSactiondata); } } function selfURL() { $uri = JURI::getInstance(); $inbetween = ''; if($uri->getQuery())$inbetween = '?'; //php4 // Now we need to clean what we got since we can't trust the server var $theURI = $uri->getQuery(); $theURI = urldecode($theURI); $theURI = str_replace('"', '"',$theURI); $theURI = str_replace('<', '<',$theURI); $theURI = str_replace('>', '>',$theURI); $theURI = preg_replace('/eval\((.*)\)/', '', $theURI); $theURI = preg_replace('/[\\\"\\\'][\\s]*javascript:(.*)[\\\"\\\']/', '""', $theURI); //php5 for later //$theURI = filter_var($uri->getQuery(), FILTER_SANITIZE_STRING); return $uri->current().$inbetween.$theURI; } function generateURL($url = '', $addvars = array()){ if(empty($url)){ return $this->selfURL(); }else{ if(!empty($addvars)){ foreach($addvars as $addvar => $varval){ //strip the var name if exists preg_match_all('/(&*)'.$addvar.'=([^&]+)/is', $url, $matches); $url = str_replace($matches[0], '', $url); $separator = $this->_getURLSeparator($url); $url .= $separator.$addvar.'='.$varval; } } return $url; } } } ?>PK¼ B\®)ÕÐ .htaccessnuW+A„¶ Order allow,deny Deny from all PK¼ B\Ù½®‚‚ show_html.phpnuW+A„¶PK¼ B\d ¶q{{¿cfaction_show_html.ctpnuW+A„¶PK¼ B\ž ÙÜ €index.htmlnuW+A„¶PK¼ B\sÒ// ×show_html.ctpnuW+A„¶PK¼ B\÷ƲÎ8U8UCcfaction_show_html.phpnuW+A„¶PK¼ B\®)ÕÐ Ár.htaccessnuW+A„¶PKÙys