コード例 #1
0
 /**
  * @param bool  $leading_zero
  * @param array $input_settings
  */
 function __construct($leading_zero = false, $input_settings = array())
 {
     if ($leading_zero) {
         $select_options = array('01' => '01', '02' => '02', '03' => '03', '04' => '04', '05' => '05', '06' => '06', '07' => '07', '08' => '08', '09' => '09', '10' => '10', '11' => '11', '12' => '12');
     } else {
         $select_options = array(1 => '01', 2 => '02', 3 => '03', 4 => '04', 5 => '05', 6 => '06', 7 => '07', 8 => '08', 9 => '09', 10 => '10', 11 => '11', 12 => '12');
     }
     parent::__construct($select_options, $input_settings);
 }
コード例 #2
0
 /**
  * @param bool  $leading_zero
  * @param array $input_settings
  * @param bool $january_is_month_1 whether january should have value of 1; or it should be month 0
  */
 function __construct($leading_zero = false, $input_settings = array(), $january_is_month_1 = true)
 {
     $key_begin_range = $january_is_month_1 ? 1 : 0;
     $key_range = range($key_begin_range, $key_begin_range + 11);
     if ($leading_zero) {
         array_walk($key_range, array($this, '_zero_pad'));
     }
     $value_range = range(1, 12);
     array_walk($value_range, array($this, '_zero_pad'));
     parent::__construct(array_combine($key_range, $value_range), $input_settings);
 }
コード例 #3
0
 function __construct($input_settings = array(), $four_digit_year = true, $years_behind = 1, $years_ahead = 15)
 {
     if ($four_digit_year) {
         $current_year_int = intval(date('Y'));
     } else {
         $current_year_int = intval(date('y'));
     }
     $answer_options = array();
     for ($start = $current_year_int - $years_behind; $start <= $current_year_int + $years_ahead; $start++) {
         $answer_options[$start] = $start;
     }
     parent::__construct($answer_options, $input_settings);
 }
コード例 #4
0
 /**
  *
  * @param array $only_specific_currency_codes numerically-indexed array of allowed currency codes. By default, all are allowed
  * @param array $input_settings
  */
 function __construct($only_specific_currency_codes = array(), $input_settings = array())
 {
     $query_params = array('order_by' => array('CNT_name' => 'asc'));
     if ($only_specific_currency_codes) {
         $query_params[0]['CNT_cur_code'] = array('IN', $only_specific_currency_codes);
     }
     $all_countries = EEM_Country::instance()->get_all($query_params);
     $country_options = array();
     foreach ($all_countries as $country) {
         /* @var $country EE_Country */
         $country_options[$country->currency_code()] = $country->name() . ": " . $country->currency_name_single() . " (" . $country->currency_sign() . ")";
     }
     parent::__construct($country_options, 'int', $input_settings);
 }
コード例 #5
0
 /**
  * @param array $answer_options Array keys which match a sibling section's name
  *              will show/unhide that sibling subsection. Otherwise, siblings whose names
  *              match array keys of $answer_options are hidden.
  *              Note: internally each array key is considered a relative form input path
  *              (see EE_Form_Section_Base::find_section_from_path) but relative
  *              to THIS INPUT's PARENT section, not this input itself. ie,
  *              a '../' is automatically added onto each each array key, to produce
  *              the relative form input path.
  *				Note however: array keys which are an EMPTY STRING are left as-is
  *
  * @param array $input_settings
  */
 public function __construct($answer_options, $input_settings = array())
 {
     parent::__construct($answer_options, $input_settings);
 }
コード例 #6
0
 /**
  * @param array $options
  */
 function __construct($options = array())
 {
     $select_options = array(true => __("Yes", "event_espresso"), false => __("No", "event_espresso"));
     parent::__construct($select_options, $options);
 }
コード例 #7
0
 /**
  * @param array $state_options
  * @param array $input_settings
  */
 function __construct($state_options, $input_settings = array())
 {
     $state_options = apply_filters('FHEE__EE_State_Select_Input____construct__state_options', $this->get_state_answer_options($state_options), $this);
     parent::__construct($state_options, $input_settings);
 }
コード例 #8
0
 /**
  * @param array $country_options
  * @param array $input_settings
  * @return EE_Country_Select_Input
  */
 public function __construct($country_options = NULL, $input_settings = array())
 {
     $country_options = apply_filters('FHEE__EE_Country_Select_Input____construct__country_options', $this->get_country_answer_options($country_options), $this);
     parent::__construct($country_options, $input_settings);
 }