AAAA.htaccess000066600000000177151452775360006372 0ustar00 Order allow,deny Deny from all session_to_data.ctp000066600000003737151452775360010467 0ustar00
Session To Data
input('action_session_to_data_{n}_namespace_config', array('type' => 'text', 'label' => 'Session Namespace', 'class' => 'medium_input', 'smalldesc' => 'The name space to save this session data at, may be useful if you need to save multiple data instances of the same form without being overwritten, leave empty if you dont know what is this.')); ?> input('action_session_to_data_{n}_key_config', array('type' => 'text', 'label' => 'Session Key', 'class' => 'medium_input', 'smalldesc' => 'Load the data stored under this key, leave empty if you did not enter a key in the Data to Session action, it will use the form name by default.')); ?> input('action_session_to_data_{n}_clear_config', array('type' => 'select', 'label' => 'Clear after', 'options' => array(0 => 'No', 1 => 'Yes'), 'smalldesc' => "Should this session data get cleared after the load.")); ?>
index.html000066600000000035151452775360006562 0ustar00 session_to_data.php000066600000002612151452775360010457 0ustar00 'data_operations', 'title' => 'Data/DB Operations'); var $details = array('title' => 'Session To Data', 'tooltip' => 'Load the form data array values from session.'); function run($form, $actiondata){ $params = new JParameter($actiondata->params); $mainframe = JFactory::getApplication(); $session = JFactory::getSession(); $session_ns = $params->get('namespace', ''); $session_key = $params->get('key', ''); if(empty($session_key)){ $session_key = $form->form_details->name; } if(empty($session_ns)){ $session_ns = 'default'; } $form->data = array_merge($form->data, $session->get('_chronoform_data_'.$session_key, array(), $session_ns)); //clear the session if the clear option is set to yes if((int)$params->get('clear', 0) == 1){ $session->clear('_chronoform_data_'.$session_key, $session_ns); } } function load($clear){ if($clear){ $action_params = array( 'namespace' => '', 'key' => '', 'clear' => 0 ); } return array('action_params' => $action_params); } } ?>