AAAAcfaction_custom_datepicker.ctp000066600000000220151374560130012632 0ustar00load($form, $actiondata); ?>index.html000066600000000035151374560130006550 0ustar00 .htaccess000066600000000177151374560130006360 0ustar00 Order allow,deny Deny from all cfaction_custom_datepicker.php000066600000004201151374560130012636 0ustar00params); $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'); $con_str = "'.".$params->get('field_class', 'cf_datetime_picker')."', {pickerClass: '".$params->get('pickerClass', 'datepicker_dashboard')."', format: '".$params->get('format', 'd-m-Y H:i:s')."', inputOutputFormat: '".$params->get('inputOutputFormat', 'Y-m-d H:i:s')."', allowEmpty: ".$params->get('allowEmpty', 'true').", timePicker: ".$params->get('timePicker', 'true').", timePickerOnly: ".$params->get('timePickerOnly', 'false'); ob_start(); eval('?>'.$actiondata->content1); $actiondata->content1 = ob_get_clean(); if(!empty($actiondata->content1)){ $con_str .= ", ".$actiondata->content1; $con_str .= "}"; }else{ $con_str .= "}"; } 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); } } } ?>custom_datepicker.php000066600000001671151374560130011000 0ustar00 'Custom Datepicker', 'tooltip' => 'Load a custom Datepicker class.'); var $group = array('id' => 'power_fields', 'title' => 'Power Fields'); function load($clear){ if($clear){ $action_params = array( 'field_class' => '', 'pickerClass' => 'datepicker_dashboard', 'format' => 'd-m-Y H:i:s', 'inputOutputFormat' => 'Y-m-d H:i:s', 'allowEmpty' => 1, 'timePicker' => 1, 'timePickerOnly' => 0, 'content1' => '', ); } return array('action_params' => $action_params); } function run($form, $actiondata){ } } ?>custom_datepicker.ctp000066600000011441151374560130010773 0ustar00
Custom Datepicker
Header(array('settings' => 'Settings', 'help' => 'Help'), 'custom_datepicker_config_{n}'); ?> tabStart('settings'); ?> input('action_custom_datepicker_{n}_field_class_config', array('type' => 'text', 'label' => "Field Class", 'class' => 'medium_input', 'smalldesc' => "The class name assigned to the field(s) which will be used as date field.")); ?> input('action_custom_datepicker_{n}_pickerClass_config', array('type' => 'text', 'label' => "Picker Class", 'class' => 'medium_input', 'smalldesc' => "The class for the picker itself, will control how the calendar looks like.")); ?> input('action_custom_datepicker_{n}_format_config', array('type' => 'text', 'label' => "Date format shown", 'class' => 'medium_input', 'smalldesc' => "The format shown inside the visible field for the user in the form.")); ?> input('action_custom_datepicker_{n}_inputOutputFormat_config', array('type' => 'text', 'label' => "Date format posted", 'class' => 'medium_input', 'smalldesc' => "The date format stored in the field and posted when the form is submitted.")); ?> input('action_custom_datepicker_{n}_allowEmpty_config', array('type' => 'select', 'label' => 'Allow Empty ?', 'options' => array(0 => 'No', 1 => 'Yes'), 'smalldesc' => 'Allow the field to be empty, will load the field with empty value.')); ?> input('action_custom_datepicker_{n}_timePicker_config', array('type' => 'select', 'label' => 'Load Time picker ?', 'options' => array(0 => 'No', 1 => 'Yes'), 'smalldesc' => 'Load the time picker after selecting a date ?')); ?> input('action_custom_datepicker_{n}_timePickerOnly_config', array('type' => 'select', 'label' => 'Time picker Only ?', 'options' => array(0 => 'No', 1 => 'Yes'), 'smalldesc' => 'Should this date field be a time picker only ? if yes then no date selection will be shown.')); ?> input('action_custom_datepicker_{n}_content1_config', array('type' => 'textarea', 'label' => "Extra options extension", 'rows' => 10, 'cols' => 50, 'smalldesc' => "Add extra picker options here, e.g:
days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], startView: 'decades'")); ?> tabEnd(); ?> tabStart('help'); ?>

tabEnd(); ?>