/**
  * Configures the current widget.
  *
  * @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())
 {
     parent::configure($options, $attributes);
     $this->addRequiredOption('min');
     $this->addRequiredOption('max');
     $this->setOption('type', 'range');
 }
 protected function configure($options = array(), $attributes = array())
 {
     parent::configure($options, $attributes);
     $this->addOption('culture', $this->_current_language());
     $this->addOption('prepend');
     $this->addOption('append');
 }
 public function configure($options = array(), $attributes = array())
 {
     $this->addRequiredOption('url');
     $this->addOption('extraParams', '{}');
     $this->addOption('param', 'autocomplete');
     parent::configure($options, $attributes);
 }
  /**
   * Configures the current widget.
   *
   * @param array $options     An array of options
   * @param array $attributes  An array of default HTML attributes
   *
   * @see sfWidgetFormInput
   */
  protected function configure($options = array(), $attributes = array())
  {
    parent::configure($options, $attributes);

    $this->setOption('is_hidden', true);
    $this->setOption('type', 'hidden');
  }
 /**
  * Available options:
  *
  *  * max:                     The maximum date allowed (as a timestamp, DateTime or yyyy-mm-dd format)
  *  * min:                     The minimum date allowed (as a timestamp, DateTime or yyyy-mm-dd format)
  * 
  * @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())
 {
     parent::configure($options, $attributes);
     $this->addOption('min', null);
     $this->addOption('max', null);
     $this->setOption('type', 'date');
 }
 /**
  * Constructor.
  */
 protected function configure($options = array(), $attributes = array())
 {
     parent::configure($options, $attributes);
     $this->addOption('culture', sfPlop::get('sf_plop_default_culture'));
     $this->addOption('url', '@sf_plop_ws_repository');
     $this->addOption('query_string', array('folder=/assets', 'type=file'));
 }
 public function configure($options = array(), $attributes = array())
 {
     $this->setAttribute('autocomplete', 'off');
     $this->addOption('min', 0);
     $this->addOption('max', 99999);
     parent::configure($options, $attributes);
 }
  /**
   * Configures the current widget.
   *
   * @param array $options     An array of options
   * @param array $attributes  An array of default HTML attributes
   *
   * @see sfWidgetFormInput
   */
  protected function configure($options = array(), $attributes = array())
  {
    parent::configure($options, $attributes);

    $this->setOption('type', 'file');
    $this->setOption('needs_multipart', true);
  }
예제 #9
0
 /**
  * Configures the current widget.
  *
  * @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())
 {
     if (array_key_exists('size', $options)) {
         $this->attributes['size'] = $options['size'];
     }
     parent::configure($options, $attributes);
     $this->setOption('type', 'text');
 }
 public function configure($options = array(), $attributes = array())
 {
     $this->addRequiredOption('url');
     $this->addOption('appendTo', '');
     $this->addOption('param', 'autocomplete');
     $this->addOption('desc', false);
     parent::configure($options, $attributes);
 }
 /**
  * Configure widget
  * 
  * @param   array   $options    An array of options [optional]
  * @param   array   $attributes An array of default HTML attributes [optional]
  * @return  void
  */
 protected function configure($options = array(), $attributes = array())
 {
     $this->addRequiredOption('url');
     $this->addOption('value_callback');
     $this->addOption('config', '{ }');
     $this->addOption('choices');
     parent::configure($options, $attributes);
 }
 protected function configure($options = array(), $attributes = array())
 {
     parent::configure($options, $attributes);
     $this->addRequiredOption('url');
     $this->addOption('select2_options', array('minimumInputLength' => 3, 'placeholder' => 'Buscar...'));
     $this->addOption('cache_responses', false);
     $this->addOption('html_results', true);
 }
예제 #13
0
 protected function configure($options = array(), $attributes = array())
 {
     $this->addRequiredOption('url');
     $this->addRequiredOption('model_id');
     $this->addOption('confirm', null);
     $this->addOption('icon', null);
     parent::configure($options, $attributes);
 }
  /**
   * Configures the current widget.
   *
   * Available options:
   *
   *  * always_render_empty: true if you want the input value to be always empty when rendering (true by default)
   *
   * @param array $options     An array of options
   * @param array $attributes  An array of default HTML attributes
   *
   * @see sfWidgetFormInput
   */
  protected function configure($options = array(), $attributes = array())
  {
    parent::configure($options, $attributes);

    $this->addOption('always_render_empty', true);

    $this->setOption('type', 'password');
  }
 protected function configure($options = array(), $attributes = array())
 {
     parent::configure($options, $attributes);
     $this->setOption('type', 'checkbox');
     if (isset($attributes['value'])) {
         $this->setOption('value_attribute_value', $attributes['value']);
     }
 }
 /**
  * @param array $options     An array of options
  * @param array $attributes  An array of default HTML attributes
  *
  * @see sfWidgetFormInput
  */
 protected function configure($options = array(), $attributes = array())
 {
     $this->addOption('display_value', "<strong>%value%</strong>");
     $this->addOption('null_value', "<strong>N/A</strong>");
     $this->addOption('model');
     $this->addOption('input_hidden', true);
     parent::configure($options, $attributes);
     // $this->setOption('read_only', true);
 }
 /**
  * Configures the current widget.
  *
  * Available options:
  *
  *  * url:            The URL to call to get the choices to use (required)
  *  * config:         A JavaScript array that configures the JQuery autocompleter widget
  *  * value_callback: A callback that converts the value before it is displayed
  *
  * @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->addRequiredOption('url');
     $this->addOption('value_callback');
     $this->addOption('config', '{ }');
     // this is required as it can be used as a renderer class for sfWidgetFormChoice
     $this->addOption('choices');
     parent::configure($options, $attributes);
 }
 protected function configure($options = array(), $attributes = array())
 {
     $jq_path = '/sfDoctrineActAsTaggablePlugin/js/pkTagahead.js';
     sfContext::getInstance()->getResponse()->addJavascript($jq_path, 'first');
     foreach ($this->script_options as $key => $value) {
         $this->addOption($key, $value);
     }
     parent::configure($options, $attributes);
 }
 public function configure($options = array(), $attributes = array())
 {
     $this->addRequiredOption('url');
     $this->addOption('param', 'autocomplete');
     $this->addOption('min_chars', 2);
     $this->addOption('obj', null);
     $this->addOption('print', '');
     parent::configure($options, $attributes);
 }
 public function configure($options = array(), $attributes = array())
 {
     sfContext::getInstance()->getConfiguration()->loadHelpers(array('Asset', 'I18N'));
     parent::configure($options, $attributes);
     $this->addOption('locale', 'es');
     $this->addOption('config', '{}');
     $this->addOption('use_own_help', true);
     $this->addOption('own_help', __('Date format is "dd/mm/yyyy"'));
 }
 /**
  * Configure this widget.
  *
  * Available options are:
  *
  *   * url: REQUIRED. The URL to check for uniqueness. It will receive two parameters:
  *          'query' with the query string and 'id' with the optional 'id' option passed.
  *          It must reply with a JSON TRUE or FALSE value.
  *   * id:  OPTIONAL. The primary key of the object (if any) that's being edited. This
  *          can be then used to avoid false negatives.
  *   * success_message: OPTIONAL. A message to show when the response from 'url' is TRUE.
  *                      This will be automatically translated.
  *   * error_message: OPTIONAL. A message to show when the response from 'url' is FALSE.
  *                    This will be automatically translated.
  *   * event: OPTIONAL. DOM event that will trigger the check. Defaults to 'keyup'.
  *
  * @param array $options    Options for this widget.
  * @param array $attributes Attributes for this widget.
  */
 public function configure($options = array(), $attributes = array())
 {
     parent::configure($options, $attributes);
     $this->addRequiredOption('url');
     $this->addOption('id');
     $this->addOption('event', 'keyup');
     $this->addOption('success_message', 'This value is available.');
     $this->addOption('error_message', 'This value is already in use.');
 }
예제 #22
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', '\'/images/jquery-ui/datepicker_icon.gif\'');
     $this->addOption('config', '{}');
     $this->addOption('culture', '');
     parent::configure($options, $attributes);
     if ('en' == $this->getOption('culture')) {
         $this->setOption('culture', 'en');
     }
 }
예제 #23
0
 protected function configure($options = array(), $attributes = array())
 {
     $this->addRequiredOption('model');
     $this->addOption('method', '__toString');
     $this->addOption('object', null);
     $this->addOption('store_value', false);
     $this->addOption('content_tag', 'div');
     $this->addOption('additional_text', '');
     parent::configure($options, $attributes);
 }
 public function configure($options = array(), $attributes = array())
 {
     sfContext::getInstance()->getConfiguration()->loadHelpers(array('Asset', 'I18N'));
     parent::configure($options, $attributes);
     $this->addOption('locale', 'es');
     $this->addOption('use_own_help', true);
     $this->addOption('own_help', __('Date format is "dd/mm/yyyy"'));
     $this->addOption('change_year', false);
     $this->addOption('change_month', false);
     $this->addOption('year_range', date('Y') - 50 . ':' . (date('Y') + 1));
 }
 /**
  * Configures the current widget.
  *
  * Available options:
  *
  * @param string   culture           Sets culture for the widget
  * @param boolean  change_month      If date chooser attached to widget has month select dropdown, defaults to false
  * @param boolean  change_year       If date chooser attached to widget has year select dropdown, defaults to false
  * @param integer  number_of_months  Number of months visible in date chooser, defaults to 1
  * @param boolean  show_button_panel If date chooser shows panel with 'today' and 'done' buttons, defaults to false
  * @param string   theme             css theme for jquery ui interface, defaults to '/sfJQueryUIPlugin/css/ui-lightness/jquery-ui.css'
  *
  * @see sfWidgetForm
  */
 protected function configure($options = array(), $attributes = array())
 {
     if (sfContext::hasInstance()) {
         $this->addOption('culture', sfContext::getInstance()->getUser()->getCulture());
     } else {
         $this->addOption('culture', "en");
     }
     $this->addOption('change_month', false);
     $this->addOption('change_year', false);
     $this->addOption('number_of_months', 1);
     $this->addOption('show_button_panel', false);
     $this->addOption('theme', '/sfJQueryUIPlugin/css/ui-lightness/jquery-ui.css');
     parent::configure($options, $attributes);
 }
 /**
  * Configures the current widget.
  *
  * @param array $options     An array of options
  * @param array $attributes  An array of default HTML attributes
  *
  * @see sfWidgetFormInput
  */
 protected function configure($options = array(), $attributes = array())
 {
     parent::configure($options, $attributes);
     $this->setOption('type', 'file');
     $this->setOption('needs_multipart', true);
     $size = $this->getBytes(ini_get('post_max_size'));
     $uploadMaxFilesize = $this->getBytes(ini_get('upload_max_filesize'));
     if (0 < $uploadMaxFilesize) {
         $size = $uploadMaxFilesize;
     }
     foreach (array('bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB') as $unit) {
         // 0.9# if > 1000, ### if < 1000
         if (1000 > $size) {
             break;
         }
         $size /= 1024;
     }
     $this->addOption('help', 'The maximum size of file uploads is ' . round($size, 2) . ' ' . $unit . '.');
 }
    /**
     * Configures the current widget.
     *
     * Available options:
     *
     * @param string   culture           Sets culture for the widget
     * @param boolean  change_month      If datepicker attached to widget has month select dropdown, defaults to false
     * @param boolean  change_year       If datepicker attached to widget has year select dropdown, defaults to false
     * @param integer  number_of_months  Number of months visible in datepicker, defaults to 1
     * @param boolean  show_button_panel If date chooser shows panel with 'today' and 'done' buttons, defaults to false
     * @param string   theme             Css theme for jquery ui interface, can be either the name of a standard jQueryUI theme, or the path to a custom theme
     * @param string   altField          ID of a second formfield that will get populated with the picked date.
     * @param string   dateFormat        Format in which the date will be displayed. See jQueryUI documentation for options.
     *
     * @see sfWidgetFormInput
     */
    protected function configure($options = array(), $attributes = array()) {

        if (sfContext::hasInstance())
            $this->addOption('culture', sfContext::getInstance()->getUser()->getCulture());
        else
            $this->addOption('culture', "en");
        $this->addOption('change_month', false);
        $this->addOption('change_year', false);
        $this->addOption('number_of_months', 1);
        $this->addOption('show_button_panel', false);
        $this->addOption('theme', 'ui-lightness');
        $this->addOption('altField', 'false');
        $this->addOption('dateFormat', 'yy-mm-dd');
        $this->addOption('minDate', null);
        $this->addOption('maxDate', null);
        $this->addOption('defaultDate', null);


        parent::configure($options, $attributes);
    }
    /**
     * Configures the current widget.
     *
     * Available options:
     *
     *  * url:            The URL to call to get the choices to use (required)
     *  * config:         A JavaScript array that configures the JQuery autocompleter widget
     *  * value_callback: A callback that converts the value before it is displayed
     *
     * @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->addRequiredOption('url');
        $this->addRequiredOption('model');
        $this->addOption('value_callback', array($this, 'toString'));
        $this->addOption('method', '__toString');

        $this->addOption('culture', sfContext::getInstance()->getUser()->getCulture());
        $this->addOption('width', 'resolve');
        $this->addOption('minimumInputLength', 2);
        $this->addOption('placeholder', '');
        $this->addOption('allowClear', true);
        $this->addOption('formatSelection', 'defaultFormatResult');
        $this->addOption('formatResult', 'defaultFormatResult');
        $this->addOption('formatNoMatches', 'defaultFormatNoMatches');
        $this->addOption('formatInputTooShort', 'defaultFormatInputTooShort');
        $this->addOption('containerCss', '');
        $this->addOption('containerCssClass', '');
        $this->addOption('dropdownCss', '');
        $this->addOption('dropdownCssClass', '');

        parent::configure($options, $attributes);
    }
  /**
   * Configures the current widget.
   *
   * @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())
  {
    parent::configure($options, $attributes);

    $this->setOption('type', 'text');
  }
 public function configure($options = array(), $attributes = array())
 {
     $this->addRequiredOption('symbol');
     parent::configure($options, $attributes);
 }