/**
  * 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', $options["image"]);
     $this->addOption('config', $options["config"]);
     $this->addOption('culture', $options["culture"]);
     $this->addOption('years', $options["years"]);
     parent::configure($options, $attributes);
     if ('en' == $this->getOption('culture')) {
         $this->setOption('culture', 'en');
     }
 }
 /**
  * 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->addRequiredOption('culture', 'en');
     $this->addOption('format', '');
     parent::configure($options, $attributes);
     if ('en' == $this->getOption('culture')) {
         $this->setOption('culture', 'en');
     }
 }
예제 #3
0
 /**
  * @param  string $name        The element name
  * @param  string $value       The date displayed in this widget
  * @param  array  $attributes  An array of HTML attributes to be merged with the default HTML attributes
  * @param  array  $errors      An array of errors for the field
  *
  * @return string An HTML tag string
  *
  * @see sfWidgetForm
  */
 protected function configure($options = array(), $attributes = array())
 {
     $options['culture'] = isset($options['culture']) ? $options['culture'] : sfDoctrineRecord::getDefaultCulture();
     parent::configure($options, $attributes);
     $this->setOption('culture', $options['culture']);
 }
 /**
  * Configures the current widget
  *
  * @param array options
  *
  *        Available options:
  *        - culture >> the user culture
  *        - image   >> image file absolute web path to use as trigger
  *        - config  >> javascript object notation complain object with datepicker configuration
  *
  * @param array html attributes
  * @return void
  * @author Carlos Escribano <*****@*****.**>
  */
 protected function configure($options = array(), $attributes = array())
 {
     $this->addOption('image', false);
     $this->addOption('config', '{}');
     parent::configure($options, $attributes);
 }
예제 #5
0
 /**
  * @param  string $name        The element name
  * @param  string $value       The date displayed in this widget
  * @param  array  $attributes  An array of HTML attributes to be merged with the default HTML attributes
  * @param  array  $errors      An array of errors for the field
  *
  * @return string An HTML tag string
  *
  * @see sfWidgetForm
  */
 protected function configure($options = array(), $attributes = array())
 {
     $options['culture'] = isset($options['culture']) ? $options['culture'] : dm::getUser()->getCulture();
     parent::configure($options, $attributes);
     $this->setOption('culture', $options['culture']);
 }
예제 #6
0
 protected function configure($options = array(), $attributes = array())
 {
     parent::configure($options, $attributes);
     $this->setOption('can_be_empty', false);
 }