/**
  * 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->addOption('image', false);
     $this->addOption('date_widget', new sfWidgetFormDate());
     $this->addOption('time_widget', new sfWidgetFormTime());
 }
예제 #2
0
 public function configure($options = array(), $attributes = array())
 {
     parent::configure($options, $attributes);
     /* Options used to create the embedded form */
     $this->addRequiredOption('form_creation_method');
     $this->addRequiredOption('edit_form_creation_method');
     $this->addRequiredOption('child_form_name');
     $this->addOption('child_form_title_method', '');
     $this->addOption('title', '');
     $this->addOption('form_creation_method_params', array());
     $this->addOption('form_formatter', 'table');
     $this->addOption('renderer_class', 'mtWidgetFormEmbedRenderer');
     /* Options used to update the parent form */
     $this->addRequiredOption('parent_form');
     /* Initial object */
     $this->addRequiredOption('objects');
     /* Format options */
     $this->addOption('toolbar-add', true);
     $this->addOption('toolbar-add-image', '/dcFormExtraPlugin/images/plus.png');
     $this->addOption('toolbar-add-text', 'add');
     $this->addOption('toolbar-clean', true);
     $this->addOption('toolbar-clean-text', 'clean');
     $this->addOption('toolbar-clean-image', '/dcFormExtraPlugin/images/clean.png');
     $this->addOption('toolbar-reset', true);
     $this->addOption('toolbar-reset-text', 'reset');
     $this->addOption('toolbar-reset-image', '/dcFormExtraPlugin/images/update.png');
     $this->addOption('delete-button-image', '/dcFormExtraPlugin/images/close-action.png');
     $this->addOption('delete-button-text', 'delete');
 }
 protected function configure($options = array(), $attributes = array())
 {
     parent::configure($options, $attributes);
     $this->addOption('from_date');
     $this->addOption('to_date');
     if (LeavePeriodService::getLeavePeriodStatus() == LeavePeriodService::LEAVE_PERIOD_STATUS_FORCED) {
         $this->addOption('choices', null);
         $this->addOption('from_label', '');
         $this->addOption('to_label', '');
         $this->addOption('leave_period', '');
         $this->addOption('from_label_template', "");
         $this->addOption('to_label_template', "");
         $this->addOption('template', '%leave_period% %from_date%  %to_date%');
         $this->setOption('from_date', new sfWidgetFormInputHidden(array(), array('id' => 'date_from')));
         $this->setOption('to_date', new sfWidgetFormInputHidden(array(), array('id' => 'date_to')));
         $this->setOption('leave_period', new sfWidgetFormChoice(array('choices' => array()), array('id' => 'period')));
     } else {
         $this->addOption('from_label', '');
         $this->addOption('to_label', 'to');
         $this->addOption('from_label_template', "<label for='%from_id%' class='date_range_label'>%from_label%</label>");
         $this->addOption('to_label_template', "<label for='%to_id%' class='date_range_label'>%to_label%</label>");
         $this->addOption('template', '%from_label% %from_date% %to_label% %to_date%');
         $this->setOption('from_date', new ohrmWidgetDatePicker(array(), array('id' => 'date_from')));
         $this->setOption('to_date', new ohrmWidgetDatePicker(array(), array('id' => 'date_to')));
     }
 }
 /**
  * options:
  *    * form: Required sfForm instance rendered by this widget
  *    * archiver: provide an archiver to sanitize results into a specific format (XML, YAML, etc).  Default is array.
  *    * global_attributes: if specified, attributes are passed as if to a widget.  Apply to ALL widgets
  *
  * @param string $options 
  * @param string $attributes 
  * @return null
  * @author Brent Shaffer
  */
 public function configure($options = array(), $attributes = array())
 {
     $this->addRequiredOption('form');
     $this->addOption('archiver');
     $this->addOption('global_attributes', true);
     return parent::configure($options, $attributes);
 }
	protected function configure($options = array(), $attributes = array()) {
		$this->addOption('image', false);
		$this->addOption('include_time', false);
		$this->addOption('date_widget', new sfWidgetFormInput());

		parent::configure($options, $attributes);
	}
 /**
  * Constructor.
  *
  * Available options:
  *
  *  * public_key:        Your reCAPTCHA public key (app_recaptcha_private_key by default)
  *  * error:             A reCAPTCHA error code
  *  * use_ssl:           Use a secure connection (false by default)
  *
  * @param array  $options An array of options
  * @param array  $messages An array of error messages
  *
  * @see sfWidgetForm
  */
 public function __construct($options = array(), $attributes = array())
 {
     $this->addOption('public_key', sfConfig::get('app_recaptcha_public_key'));
     $this->addOption('error', null);
     $this->addOption('use_ssl', false);
     parent::__construct($options, $attributes);
 }
예제 #7
0
 public function __construct($options = array(), $attributes = array())
 {
     $this->addOption('empty_value', '&nbsp;');
     $this->addOption('value_callback', null);
     $this->addOption('plain', true);
     parent::__construct($options, $attributes);
 }
예제 #8
0
 public function configure($options = array(), $attributes = array())
 {
     parent::configure($options, $attributes);
     $this->addOption('prefix_widget', new sfWidgetFormInput(array(), array('class' => 'mtWidgetFormCuilPrefix')));
     $this->addOption('middle_widget', new sfWidgetFormInput(array(), array('class' => 'mtWidgetFormCuilMiddle')));
     $this->addOption('suffix_widget', new sfWidgetFormInput(array(), array('class' => 'mtWidgetFormCuilSuffix')));
     $this->addOption('separator', '-');
 }
 /**
  * Constructor.
  *
  * Available options:
  *
  *  * format:                 The time format string (%hour%:%minute%)
  *  * hours:                  An array of hours for the hour select tag (optional)
  *  * minutes:                An array of minutes for the minute select tag (optional)
  *  * can_be_empty:           Whether the widget accept an empty value (true by default)
  *  * empty_value:            String to use as empty value
  *
  * @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('format', '%hour%:%minute%');
     $this->addOption('hours', parent::generateTwoCharsRange(0, 23));
     $this->addOption('minutes', array('00', '15', '30', '45'));
     $this->addOption('can_be_empty', true);
     $this->addOption('empty_value', '');
 }
예제 #10
0
 /**
  * @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('partial');
     $this->addOption('buttons', array('add_file' => 'Add files...', 'upload' => 'Start upload', 'cancel' => 'Cancel upload'));
     $this->addOption('module_partial', false);
     $this->addOption('include_js', false);
 }
예제 #11
0
 public function setOption($name, $value)
 {
     if ($this->hasOption($name)) {
         parent::setOption($name, $value);
     } elseif (is_object($this->getOption('content')) && method_exists($this->getOption('content'), 'setOption')) {
         $this->getOption('content')->setOption($name, $value);
     }
 }
 /**
  * Merge stylesheets for each selectable widget
  *
  * @return array
  */
 public function getStylesheets()
 {
     $ret = array_merge(parent::getStylesheets(), array('/dcReloadedFormExtraPlugin/css/cr_widget_form_selectable_widget.css' => 'all'));
     foreach ($this->widgets as $k => $w) {
         $ret = array_merge($ret, $w->getStylesheets());
     }
     return $ret;
 }
 /**
  * Configures the current widget.
  *
  * The attributes are passed to both the date and the time widget.
  *
  * If you want to pass HTML attributes to one of the two widget, pass an
  * attributes option to the date or time option (see below).
  *
  * Available options:
  *
  *  * format_date: The format string in js and php for date. (see http://docs.jquery.com/UI/Datepicker/formatDate) (see http://www.php.net/date)
  *  * date:      Options for the date widget (see sfWidgetFormDate)
  *  * hours:     Options for the hours widget (see sfWidgetFormChoice)
  *  * minutes:   Options for the minutes widget (see sfWidgetFormChoice)
  *  * period:    Options for the period widget (see sfWidgetFormChoice)
  *  * format:    The format string for the datetime widget (default to %date% %hours% %minutes% %period%)
  *
  * @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('format_date', array('js' => 'ISO_8601', 'php' => 'Y-m-d H:i:s'));
     $this->addOption('date', array());
     $this->addOption('hours', array('choices' => parent::generateTwoCharsRange(1, 12)));
     $this->addOption('minutes', array('choices' => parent::generateTwoCharsRange(0, 59)));
     $this->addOption('period', array('choices' => array('AM' => 'AM', 'noon' => 'Noon', 'PM' => 'PM', 'midnight' => 'Midnight')));
     $this->addOption('format', '%date% %hours% %minutes% %period%');
 }
 /**
  * @param array $options     An array of options
  * @param array $attributes  An array of default HTML attributes
  *
  * @see sfWidgetFormInput
  *
  *
  * In reality builds an array of two controls using the [] form field
  * name syntax
  */
 protected function configure($options = array(), $attributes = array())
 {
     parent::configure($options, $attributes);
     $this->addOption('type', 'file');
     $this->addOption('existing-html', false);
     $this->addOption('image-preview', null);
     $this->addOption('default-preview', null);
     $this->setOption('needs_multipart', true);
 }
 protected function configure($options = array(), $attributes = array())
 {
     $attributes['size'] = "5";
     $attributes['maxlength'] = "5";
     $this->addOption('time_widget', new sfWidgetFormInput(array(), $attributes));
     $this->addOption('start_stop', false);
     $this->addOption('interval', false);
     parent::configure($options, $attributes);
 }
 public function configure($options = array(), $attributes = array())
 {
     $this->addRequiredOption('choice_widget');
     $this->addRequiredOption('update');
     $this->addRequiredOption('url');
     $this->addOption('on_empty');
     $this->addOption('update_on_load', true);
     parent::configure($options, $attributes);
 }
 /**
  * Constructor.
  * 
  * @param array $options     An array of options
  * @param array $attributes  An array of default HTML attributes
  *
  * @see sfWidgetForm
  */
 public function __construct($options = array(), $attributes = array())
 {
     $this->addRequiredOption('widget');
     $this->addOption('is_edit_public_flag', false);
     $this->addOption('public_flag_default', 1);
     $this->addOption('template', '%input%<br>%public_flag%');
     parent::__construct($options, $attributes);
     $this->setLabel($this->getOption('widget')->getLabel());
 }
 /**
  * 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)
  *  * 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 date by default)
  *
  * @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('format', '%month%/%day%/%year%');
     $this->addOption('days', parent::generateTwoCharsRange(1, 31));
     $this->addOption('months', parent::generateTwoCharsRange(1, 12));
     $years = range(date('Y') - 5, date('Y') + 5);
     $this->addOption('years', array_combine($years, $years));
     $this->addOption('can_be_empty', true);
     $this->addOption('empty_values', array('year' => '', 'month' => '', 'day' => ''));
 }
 public function __construct($options = array(), $attributes = array())
 {
     $this->addOption('object', null);
     $this->addOption('method', null);
     $this->addOption('method_args', null);
     $this->addOption('add_hidden_input', false);
     $this->addOption('true_string', 'Yes');
     $this->addOption('false_string', 'No');
     parent::__construct($options, $attributes);
 }
예제 #20
0
 /**
  * Constructor.
  *
  * Available options:
  *
  *  * format:                 The time format string (%hour%:%minute%:%second%)
  *  * format_without_seconds: The time format string without seconds (%hour%:%minute%)
  *  * with_seconds:           Whether to include a select for seconds (false by default)
  *  * hours:                  An array of hours for the hour select tag (optional)
  *  * minutes:                An array of minutes for the minute select tag (optional)
  *  * seconds:                An array of seconds for the second 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 hours, minutes, and seconds by default)
  *
  * @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('format', '%hour%:%minute%:%second%');
     $this->addOption('format_without_seconds', '%hour%:%minute%');
     $this->addOption('with_seconds', false);
     $this->addOption('hours', parent::generateTwoCharsRange(0, 23));
     $this->addOption('minutes', parent::generateTwoCharsRange(0, 59));
     $this->addOption('seconds', parent::generateTwoCharsRange(0, 59));
     $this->addOption('can_be_empty', true);
     $this->addOption('empty_values', array('hour' => '', 'minute' => '', 'second' => ''));
 }
예제 #21
0
 public function __construct($options = array(), $attributes = array())
 {
     $this->addOption('object');
     $this->addOption('method', '__toString');
     $this->addOption('method_args', null);
     $this->addOption('use_retrieved_value', true);
     $this->addOption('empty_value', '&nbsp;');
     $this->addOption('add_hidden_input', false);
     $this->addOption('value_callback', null);
     parent::__construct($options, $attributes);
 }
 /**
  * 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
  *  * date_widget: The date widget instance to use as a "base" class
  *
  * @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('date_widget', new sfWidgetFormDate());
     parent::configure($options, $attributes);
     if ('en' == $this->getOption('culture')) {
         $this->setOption('culture', 'en');
     }
 }
 public function configure($options = array(), $attributes = array())
 {
     $this->addOption('end_date', null);
     $this->addOption('start_date', date('Y-m-d'));
     $this->addOption('starts_on', 'Sunday');
     $this->addOption('ends_on', 'Saturday');
     $this->addOption('index_format', 'Y-m-d');
     $this->addOption('display_format', 'F jS');
     $this->addOption('display_end', false);
     $this->addOption('add_empty', true);
     parent::configure($options, $attributes);
 }
 /**
  * 
  * @param array $options     An array of options
  * @param array $attributes  An array of default HTML attributes
  * @see sfWidgetFormInput
  * *
  * In reality builds an array of two controls using the [] form field
  * name syntax
  */
 protected function configure($options = array(), $attributes = array())
 {
     parent::configure($options, $attributes);
     $this->addOption('type', 'file');
     $this->addOption('existing-html', false);
     // Provides an inline preview. You can also call getPreviewUrl() to get the
     // current preview URL for the image if there is one, which allows you to
     // preview outside the widget
     $this->addOption('image-preview', null);
     $this->addOption('default-preview', null);
     $this->setOption('needs_multipart', true);
 }
 /**
  * Configures the current widget.
  *
  * Available options:
  *
  * @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('format', '%day%/%month%/%year%');
     if (isset($options['years'])) {
         $years = $options['years'];
     } else {
         $years = range(date('Y') - 15, date('Y') + 5);
     }
     $this->addOption('years', array_combine($years, $years));
     $this->addOption('date_widget', new sfWidgetFormDate(array('format' => $this->getOption('format'), 'years' => $this->getOption('years'))));
     parent::configure($options, $attributes);
 }
 /**
  * Configures the current widget.
  *
  * Available options details in 
  * http://www.symfony-project.org/plugins/sfDependentSelectPlugin
  *
  * @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('depends', '');
     $this->addOption('add_empty', true);
     // ajax
     $this->addOption('ajax', false);
     $this->addOption('cache', true);
     $this->addOption('params', array());
     $this->addOption('url', sfContext::getInstance()->getController()->genUrl('sfDependentSelectAuto/_ajax'));
     // source
     $this->addRequiredOption('source_class', '');
     $this->addOption('source_params', array());
     parent::configure($options, $attributes);
 }
 /**
  * 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);
 }
 public function __construct($options = array(), $attributes = array())
 {
     $this->addOption('object', null);
     $this->addOption('method', null);
     $this->addOption('empty_value', '&nbsp;');
     $this->addOption('collapse', false);
     $this->addOption('restrict_size', false);
     $this->addOption('restricted_size', 125);
     $this->addOption('add_hidden_input', false);
     $this->addOption('hidden_input_value', null);
     $this->addOption('value_callback', null);
     $this->addOption('to_string_method', '__toString');
     parent::__construct($options, $attributes);
 }
 /**
  * Constructor.
  *
  * Available options:
  *
  *  * format:                 The time format string (%hour%:%minute%:%second%)
  *  * format_without_seconds: The time format string without seconds (%hour%:%minute%)
  *  * with_seconds:           Whether to include a select for seconds (false by default)
  *  * hours:                  An array of hours for the hour select tag (optional)
  *  * minutes:                An array of minutes for the minute select tag (optional)
  *  * seconds:                An array of seconds for the second 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 hours, minutes, and seconds by default)
  *
  * @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())
 {
     $with_meridiem = isset($options['with_meridiem']) && $options['with_meridiem'];
     $this->addOption('format', '%hour%:%minute%:%second%' . ($with_meridiem ? ' %meridiem%' : ''));
     $this->addOption('format_without_seconds', '%hour%:%minute%' . ($with_meridiem ? ' %meridiem%' : ''));
     $this->addOption('with_seconds', false);
     $this->addOption('with_meridiem', false);
     $this->addOption('hours', $with_meridiem ? parent::generateTwoCharsRange(1, 12) : parent::generateTwoCharsRange(0, 23));
     $this->addOption('minutes', parent::generateTwoCharsRange(0, 59));
     $this->addOption('seconds', parent::generateTwoCharsRange(0, 59));
     $this->addOption('meridiem', array('am' => 'AM', 'pm' => 'PM'));
     $this->addOption('can_be_empty', true);
     $this->addOption('empty_values', array('hour' => '', 'minute' => '', 'second' => '', 'meridiem' => ''));
 }
 protected function configure($options = array(), $attributes = array())
 {
     sfContext::getInstance()->getConfiguration()->loadHelpers(array('Asset', 'Tag', 'Javascript', 'Url'));
     parent::configure($options, $attributes);
     $this->addRequiredOption('title');
     $this->addOption('criteria', new Criteria());
     $this->addOption('update_container');
     $this->addOption('fixed_values', array());
     $this->addOption('associated');
     $this->addOption('associated_container');
     $this->addOption('associated_name');
     $this->addOption('associated_student_url', url_for('csWidgetFormStudentMany/associatedStudents'));
     $this->addOption('associate_label', 'Add');
 }