コード例 #1
0
 /**
  * Configures the current widget.
  *
  * Available options:
  *
  *  * image:   The image path to represent the widget (false by default)
  *  * config:  A JavaScript array that configures the JQuery date widget
  *  * culture: The user culture
  *
  * @param array $options     An array of options
  * @param array $attributes  An array of default HTML attributes
  *
  * @see sfWidgetForm
  */
 protected function configure($options = array(), $attributes = array())
 {
     $this->addOption('image', false);
     $this->addOption('config', '{}');
     $this->addOption('culture', '');
     parent::configure($options, $attributes);
     if ('en' == $this->getOption('culture')) {
         $this->setOption('culture', 'en');
     }
 }
コード例 #2
0
 /**
  * Configures the current widget.
  *
  * Available options:
  *
  *  * image:   The image path to represent the widget (false by default)
  *  * config:  A JavaScript array that configures the JQuery date widget
  *  * culture: The user culture
  *
  * @param array $options     An array of options
  * @param array $attributes  An array of default HTML attributes
  *
  * @see sfWidgetForm
  */
 protected function configure($options = array(), $attributes = array())
 {
     $this->addOption('image', false);
     $this->addOption('config', "{ firstDay:1, monthNames:['Gener', 'Febrer', 'Març', 'Abril', 'Maig', 'Juny', 'Juliol', 'Agost', 'Setembre', 'Octubre', 'Novembre', 'Desembre'] , dayNamesMin:['Dg', 'Dll', 'Dm', 'Dc', 'Dj', 'Dv', 'Ds'] }");
     $this->addOption('culture', 'ca');
     parent::configure($options, $attributes);
     if ('en' == $this->getOption('culture')) {
         $this->setOption('culture', 'en');
     }
 }
コード例 #3
0
 /**
  * Constructor.
  *
  * Available options:
  *
  *  * culture:      The culture to use for internationalized strings (required)
  *  * month_format: The month format (name - default, short_name, number)
  *
  * @param array $options     An array of options
  * @param array $attributes  An array of default HTML attributes
  *
  * @see sfWidgetFormDate
  */
 protected function configure($options = array(), $attributes = array())
 {
     parent::configure($options, $attributes);
     $this->addRequiredOption('culture');
     $this->addOption('month_format');
     $culture = isset($options['culture']) ? $options['culture'] : 'en';
     $monthFormat = isset($options['month_format']) ? $options['month_format'] : 'name';
     // format
     $this->setOption('format', $this->getDateFormat($culture));
     // months
     $this->setOption('months', $this->getMonthFormat($culture, $monthFormat));
 }
コード例 #4
0
 /**
  * Configures the current widget.
  *
  * Available options:
  *
  *  * image:     The image path to represent the widget (false by default)
  *  * config:    A JavaScript array that configures the JQuery date widget
  *  * culture:   The user culture
  *  * with_time: Tells if the widget has to be used with our without time select boxes 
  *  * with_seconds: Tells if the widget has to be used with our without seconds select boxes 
  *
  * @param array $options     An array of options
  * @param array $attributes  An array of default HTML attributes
  *
  * @see sfWidgetForm
  */
 protected function configure($options = array(), $attributes = array())
 {
     $this->addOption('image', false);
     $this->addOption('config', '{}');
     $this->addOption('culture', '');
     $this->addOption('with_time', false);
     $this->addOption('with_seconds', true);
     $this->addOption('wrap_class', 'edition');
     parent::configure($options, $attributes);
     if ('' == $this->getOption('culture')) {
         $this->setOption('culture', 'en');
     }
 }
コード例 #5
0
 /**
  * Configures the current widget.
  *
  * Available options:
  *
  *  * image:   The image path to represent the widget (false by default)
  *  * config:  A JavaScript array that configures the JQuery date widget
  *  * culture: The user culture
  *
  * @param array $options     An array of options
  * @param array $attributes  An array of default HTML attributes
  *
  * @see sfWidgetForm
  */
 protected function configure($options = array(), $attributes = array())
 {
     $this->addOption('image', false);
     $this->addOption('config', '{}');
     $this->addOption('culture', '');
     parent::configure($options, $attributes);
     $classes = preg_split('/\\s+/', $this->getAttribute('class'));
     $classes[] = 'a-date-field';
     $this->setAttribute('class', implode(' ', $classes));
     if ('en' == $this->getOption('culture')) {
         $this->setOption('culture', 'en');
     }
 }
 /**
  * Configures the current widget.
  *
  * Available options:
  *
  *  * format:       The date format string (%month%/%day%/%year% by default)
  *  * years:        An array of years for the year select tag (optional)
  *                  Be careful that the keys must be the years, and the values what will be displayed to the user
  *  * months:       An array of months for the month select tag (optional)
  *  * days:         An array of days for the day select tag (optional)
  *  * can_be_empty: Whether the widget accept an empty value (true by default)
  *  * empty_values: An array of values to use for the empty value (empty string for year, month, and day by default)
  *
  * Available jQuery UI Date picker options:
  *  * ui_date_format:       Date formats, see: http://api.jqueryui.com/datepicker/#utility-formatDate, default is date format for current culture
  *  * ui_number_of_months:  Number of months to display, default is 1
  *  * ui_show_button_panel: Whether to show buttons Today and Done, default is true
  *  * ui_change_month:      Whether to show month drop-down, default is true
  *  * ui_change_year:       Whether to show year drop-down, default is true
  *  * theme:                Which CSS styles to use from themes in config, or default theme will be used set in config. You can set this to null in order not to load any CSS
  *  * ui_constrain_input:   Enable only to input characters defined in date format, default is true
  *
  * Additional options
  *
  *  * ui_button_open:       HTML code for open picker button
  *  * ui_button_clear:      HTML code for clear value button
  *
  * @param array $options     An array of options
  * @param array $attributes  An array of default HTML attributes
  *
  * @see sfWidgetFormDate
  */
 protected function configure($options = array(), $attributes = array())
 {
     parent::configure($options = array(), $attributes = array());
     $this->addOption('ui_date_format', dmContext::getInstance()->getServiceContainer()->getService('user')->getCulture());
     $this->addOption('ui_number_of_months', 1);
     $this->addOption('ui_show_button_panel', true);
     $this->addOption('ui_change_month', true);
     $this->addOption('ui_change_year', true);
     $this->addOption('ui_constrain_input', true);
     $this->addOption('theme', sfConfig::get('dm_dmDatePickerPlugin_default_theme'));
     $this->addOption('ui_button_open', '');
     $this->addOption('ui_button_clear', '');
     if (!isset($options['theme'])) {
         $options['theme'] = $this->getOption('theme');
     }
     sfWidgetFormDmDatePicker::parseThemeDefaultOptions($options, $this);
 }