当前位置: 首页>>代码示例>>PHP>>正文


PHP EEH_Form_Fields::select方法代码示例

本文整理汇总了PHP中EEH_Form_Fields::select方法的典型用法代码示例。如果您正苦于以下问题:PHP EEH_Form_Fields::select方法的具体用法?PHP EEH_Form_Fields::select怎么用?PHP EEH_Form_Fields::select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EEH_Form_Fields的用法示例。


在下文中一共展示了EEH_Form_Fields::select方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: add_to_featured_image_meta_box

 /**
  * add_to_featured_image_meta_box
  * @param $event_meta
  */
 public function add_to_featured_image_meta_box($event_meta)
 {
     EE_Registry::instance()->load_helper('Form_Fields');
     $html = '<p>';
     $html .= EEH_Form_Fields::select(__('Add image to event calendar', 'event_espresso'), isset($event_meta['display_thumb_in_calendar']) ? $event_meta['display_thumb_in_calendar'] : '', array(array('id' => true, 'text' => __('Yes', 'event_espresso')), array('id' => false, 'text' => __('No', 'event_espresso'))), 'show_on_calendar', 'show_on_calendar');
     $html .= '</p>';
     echo $html;
 }
开发者ID:aaronfrey,项目名称:PepperLillie-GSP,代码行数:12,代码来源:EE_Calendar.class.php

示例2: form

    /**
     * Back-end widget form.
     *
     * @see WP_Widget::form()
     * @param array $instance Previously saved values from database.
     * @return string|void
     */
    public function form($instance)
    {
        EE_Registry::instance()->load_class('Question_Option', array(), FALSE, FALSE, TRUE);
        // Set up some default widget settings.
        $defaults = array('title' => __('Upcoming Events', 'event_espresso'), 'category_name' => '', 'show_expired' => FALSE, 'show_desc' => TRUE, 'show_dates' => TRUE, 'show_everywhere' => FALSE, 'date_limit' => 2, 'limit' => 10, 'date_range' => FALSE, 'image_size' => 'medium');
        $instance = wp_parse_args((array) $instance, $defaults);
        // don't add HTML labels for EE_Form_Fields generated inputs
        add_filter('FHEE__EEH_Form_Fields__label_html', '__return_empty_string');
        $yes_no_values = array(EE_Question_Option::new_instance(array('QSO_value' => FALSE, 'QSO_desc' => __('No', 'event_espresso'))), EE_Question_Option::new_instance(array('QSO_value' => TRUE, 'QSO_desc' => __('Yes', 'event_espresso'))));
        ?>

		<!-- Widget Title: Text Input -->

		<p>
			<label for="<?php 
        echo $this->get_field_id('title');
        ?>
">
				<?php 
        _e('Title:', 'event_espresso');
        ?>
			</label>
			<input id="<?php 
        echo $this->get_field_id('title');
        ?>
" class="widefat" name="<?php 
        echo $this->get_field_name('title');
        ?>
" value="<?php 
        echo esc_attr($instance['title']);
        ?>
" type="text" />
		</p>
		<p>
			<label for="<?php 
        echo $this->get_field_id('category_name');
        ?>
">
				<?php 
        _e('Event Category:', 'event_espresso');
        ?>
			</label>
			<?php 
        $event_categories = array();
        /** @type EEM_Term $EEM_Term */
        $EEM_Term = EE_Registry::instance()->load_model('Term');
        $categories = $EEM_Term->get_all_ee_categories(TRUE);
        if ($categories) {
            foreach ($categories as $category) {
                if ($category instanceof EE_Term) {
                    $event_categories[] = EE_Question_Option::new_instance(array('QSO_value' => $category->get('slug'), 'QSO_desc' => $category->get('name')));
                }
            }
        }
        array_unshift($event_categories, EE_Question_Option::new_instance(array('QSO_value' => '', 'QSO_desc' => __(' - display all - ', 'event_espresso'))));
        echo EEH_Form_Fields::select(__('Event Category:', 'event_espresso'), $instance['category_name'], $event_categories, $this->get_field_name('category_name'), $this->get_field_id('category_name'));
        ?>
		</p>
		<p>
			<label for="<?php 
        echo $this->get_field_id('limit');
        ?>
">
				<?php 
        _e('Number of Events to Display:', 'event_espresso');
        ?>
			</label>
			<input id="<?php 
        echo $this->get_field_id('limit');
        ?>
" name="<?php 
        echo $this->get_field_name('limit');
        ?>
" value="<?php 
        echo $instance['limit'];
        ?>
" size="3" type="text" />
		</p>
		<p>
			<label for="<?php 
        echo $this->get_field_id('show_expired');
        ?>
">
				<?php 
        _e('Show Expired Events:', 'event_espresso');
        ?>
			</label>
			<?php 
        echo EEH_Form_Fields::select(__('Show Expired Events:', 'event_espresso'), $instance['show_expired'], $yes_no_values, $this->get_field_name('show_expired'), $this->get_field_id('show_expired'));
        ?>
		</p>
		<p>
			<label for="<?php 
//.........这里部分代码省略.........
开发者ID:aaronfrey,项目名称:PepperLillie-GSP,代码行数:101,代码来源:EEW_Upcoming_Events.widget.php

示例3: _e

?>
 <?php 
echo EEH_Template::get_help_tab_link('display_expired_events_info');
?>
					</label>
				</th>
				<td>
					<?php 
echo EEH_Form_Fields::select('expired_events', $display_expired_events, $values, 'EED_Events_Archive_display_expired_events', 'EED_Events_Archive_display_expired_events');
?>
				</td>
			</tr>

		<tr>
			<th>
				<label for="EED_Events_Archive_reset_event_list_settings">
					<?php 
_e('Reset Event List Settings', 'event_espresso');
?>
				</label>
			</th>
			<td>
				<?php 
echo EEH_Form_Fields::select('reset_event_list_settings', 0, $values, 'EED_Events_Archive_reset_event_list_settings', 'EED_Events_Archive_reset_event_list_settings');
?>
			</td>
		</tr>

	</tbody>
</table>
开发者ID:kaffiemetsuker,项目名称:event-espresso-core,代码行数:30,代码来源:admin-event-list-settings.template.php

示例4: form

    /**
     * Back-end widget form.
     *
     * @see WP_Widget::form()
     *
     * @param array $instance Previously saved values from database.
     * @return string|void
     */
    public function form($instance)
    {
        EE_Registry::instance()->load_helper('Form_Fields');
        EE_Registry::instance()->load_class('Question_Option', array(), FALSE, FALSE, TRUE);
        // Set up some default widget settings.
        $defaults = array('title' => 'Calendar', 'show_expired' => FALSE, 'category_id' => '', 'calendar_page' => '');
        $instance = wp_parse_args((array) $instance, $defaults);
        add_filter('FHEE__EEH_Form_Fields__label_html', '__return_empty_string');
        $yes_no_values = array(EE_Question_Option::new_instance(array('QSO_value' => 0, 'QSO_desc' => __('No', 'event_espresso'))), EE_Question_Option::new_instance(array('QSO_value' => 1, 'QSO_desc' => __('Yes', 'event_espresso'))));
        ?>

		<p>
			<label for="<?php 
        echo $this->get_field_id('title');
        ?>
">
				<?php 
        _e('Title:', 'event_espresso');
        ?>
			</label>
			<input type="text" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" width="20" value="<?php 
        echo $instance['title'];
        ?>
" />
		</p>
		<p>
			<label for="<?php 
        echo $this->get_field_id('show_expired');
        ?>
">
				<?php 
        _e('Display Expired Events?', 'event_espresso');
        ?>
			</label>
			<?php 
        echo EEH_Form_Fields::select(__('Display Expired Events?', 'event_espresso'), $instance['show_expired'], $yes_no_values, $this->get_field_name('show_expired'), $this->get_field_id('show_expired'));
        ?>
		</p>
		<p>
			<label for="<?php 
        echo $this->get_field_id('category_id');
        ?>
">
				<?php 
        _e('Single Category Name (optional)', 'event_espresso');
        ?>
			</label>
			<input type="text" id="<?php 
        echo $this->get_field_id('category_id');
        ?>
" name="<?php 
        echo $this->get_field_name('category_id');
        ?>
" width="20" value="<?php 
        echo $instance['category_id'];
        ?>
" /><br/>
			<span class="small-text">
			<?php 
        printf(__('Enter the Category Slug from the %sEvent Categories%s page', 'event_espresso'), '<a href="' . admin_url('admin.php?page=espresso_events&action=category_list') . '" target="_blank">', '</a>');
        ?>
			</span>
		</p>

<?php 
    }
开发者ID:aaronfrey,项目名称:PepperLillie-GSP,代码行数:80,代码来源:EEW_Espresso_Calendar.widget.php

示例5: generate_form_input

 /**
  * generate_form_input
  *
  * @param EE_Question_Form_Input $QFI
  * @return string HTML
  */
 static function generate_form_input(EE_Question_Form_Input $QFI)
 {
     if (isset($QFI->QST_admin_only) && $QFI->QST_admin_only && !is_admin()) {
         return '';
     }
     $QFI = self::_load_system_dropdowns($QFI);
     $QFI = self::_load_specialized_dropdowns($QFI);
     //we also need to verify
     $display_text = $QFI->get('QST_display_text');
     $input_name = $QFI->get('QST_input_name');
     $answer = EE_Registry::instance()->REQ->is_set($input_name) ? EE_Registry::instance()->REQ->get($input_name) : $QFI->get('ANS_value');
     $input_id = $QFI->get('QST_input_id');
     $input_class = $QFI->get('QST_input_class');
     //		$disabled = $QFI->get('QST_disabled') ? ' disabled="disabled"' : '';
     $disabled = $QFI->get('QST_disabled') ? TRUE : FALSE;
     $required_label = apply_filters(' FHEE__EEH_Form_Fields__generate_form_input__required_label', '<em>*</em>');
     $QST_required = $QFI->get('QST_required');
     $required = $QST_required ? array('label' => $required_label, 'class' => 'required needs-value', 'title' => $QST_required) : array();
     $use_html_entities = $QFI->get_meta('htmlentities');
     $required_text = $QFI->get('QST_required_text') != '' ? $QFI->get('QST_required_text') : __('This field is required', 'event_espresso');
     $required_text = $QST_required ? "\n\t\t\t" . '<div class="required-text hidden">' . self::prep_answer($required_text, $use_html_entities) . '</div>' : '';
     $label_class = 'espresso-form-input-lbl';
     $QST_options = $QFI->options(true, $answer);
     $options = is_array($QST_options) ? self::prep_answer_options($QST_options) : array();
     $system_ID = $QFI->get('QST_system');
     $label_b4 = $QFI->get_meta('label_b4');
     $use_desc_4_label = $QFI->get_meta('use_desc_4_label');
     switch ($QFI->get('QST_type')) {
         case 'TEXTAREA':
             return EEH_Form_Fields::textarea($display_text, $answer, $input_name, $input_id, $input_class, array(), $required, $required_text, $label_class, $disabled, $system_ID, $use_html_entities);
             break;
         case 'DROPDOWN':
             return EEH_Form_Fields::select($display_text, $answer, $options, $input_name, $input_id, $input_class, $required, $required_text, $label_class, $disabled, $system_ID, $use_html_entities, TRUE);
             break;
         case 'RADIO_BTN':
             return EEH_Form_Fields::radio($display_text, $answer, $options, $input_name, $input_id, $input_class, $required, $required_text, $label_class, $disabled, $system_ID, $use_html_entities, $label_b4, $use_desc_4_label);
             break;
         case 'CHECKBOX':
             return EEH_Form_Fields::checkbox($display_text, $answer, $options, $input_name, $input_id, $input_class, $required, $required_text, $label_class, $disabled, $label_b4, $system_ID, $use_html_entities);
             break;
         case 'DATE':
             return EEH_Form_Fields::datepicker($display_text, $answer, $input_name, $input_id, $input_class, $required, $required_text, $label_class, $disabled, $system_ID, $use_html_entities);
             break;
         case 'TEXT':
         default:
             return EEH_Form_Fields::text($display_text, $answer, $input_name, $input_id, $input_class, $required, $required_text, $label_class, $disabled, $system_ID, $use_html_entities);
             break;
     }
 }
开发者ID:adrianjonmiller,项目名称:hearts-being-healed,代码行数:55,代码来源:EEH_Form_Fields.helper.php

示例6: _e

?>
</p>
				</td>
			</tr>

			<tr>
				<th>
					<label for="EED_Events_Single_use_sortable_display_order">
						<?php 
_e('Use Custom Display Order?', 'event_espresso');
?>
					</label>
				</th>
				<td>
					<?php 
echo EEH_Form_Fields::select('use_sortable_display_order', $use_sortable_display_order, $values, 'EED_Events_Single_use_sortable_display_order', 'EED_Events_Single_use_sortable_display_order');
?>
					<p class="description ">
						<?php 
echo sprintf(__('%1$sPlease Note:%2$s%3$sIf you are currently using filters to customize the display order for elements within the Event Single page display, then you do NOT activate this feature until those filters have been removed or disabled. If this feature is activated while still using such filters, duplicate event content such as the ticket selector, datetimes, or venue information could be displayed on the frontend of the site. Please verify that this is not the case after activating this feature.', 'event_espresso'), '<span class="important-notice">', '</span>', '<br />');
?>
					</p>
				</td>
			</tr>

			<tr>
				<th>
					<?php 
_e('Display Order', 'event_espresso');
echo EEH_Template::get_help_tab_link('display_addresses_in_reg_form_info');
?>
开发者ID:aaronfrey,项目名称:PepperLillie-GSP,代码行数:31,代码来源:admin-event-single-settings.template.php

示例7: form

    /**
     * Back-end widget form.
     *
     * @see WP_Widget::form()
     *
     * @param array $instance Previously saved values from database.
     * @return string|void
     */
    public function form($instance)
    {
        EE_Registry::instance()->load_helper('Form_Fields');
        EE_Registry::instance()->load_class('Question_Option', array(), FALSE, FALSE, TRUE);
        // Set up some default widget settings.
        $defaults = array('title' => 'New_Addon');
        $instance = wp_parse_args((array) $instance, $defaults);
        add_filter('FHEE__EEH_Form_Fields__label_html', '__return_empty_string');
        $yes_no_values = array(EE_Question_Option::new_instance(array('QSO_value' => 0, 'QSO_desc' => __('No', 'event_espresso'))), EE_Question_Option::new_instance(array('QSO_value' => 1, 'QSO_desc' => __('Yes', 'event_espresso'))));
        ?>

		<p>
			<label for="<?php 
        echo $this->get_field_id('title');
        ?>
">
				<?php 
        _e('Title:', 'event_espresso');
        ?>
			</label>
			<input type="text" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" width="20" value="<?php 
        echo $instance['title'];
        ?>
" />
		</p>
		<p>
			<label for="<?php 
        echo $this->get_field_id('yes_or_no_question');
        ?>
">
				<?php 
        _e('Yes or No?', 'event_espresso');
        ?>
			</label>
			<?php 
        echo EEH_Form_Fields::select(__('Yes or No?', 'event_espresso'), $instance['yes_or_no_question'], $yes_no_values, $this->get_field_name('yes_or_no_question'), $this->get_field_id('yes_or_no_question'));
        ?>
		</p>
<?php 
    }
开发者ID:DavidSteinbauer,项目名称:event-espresso-core,代码行数:54,代码来源:EEW_New_Addon.widget.php

示例8: _generate_billing_info_form_fields

 /**
  * 		generate s HTML for the billing info form during registration
  * 		@access 		protected
  * 		@param		array	$billing_inputs - array of input field details
  * 		@param		array	$section - what part of the billing info form, "address", "credit_card", or "other"
  * 		@return 		string
  */
 protected function _generate_billing_info_form_fields($billing_inputs = array(), $section = FALSE)
 {
     do_action('AHEE_log', __FILE__, __FUNCTION__, '');
     if (empty($billing_inputs) || !$section) {
         return;
     }
     global $wp_filter, $css_class;
     // fill out section name
     $section = '_billing_info_' . $section . '_fields';
     // if you don't behave - this is what you're gonna get !!!
     $output = '';
     // cycle thru billing inputs
     foreach ($billing_inputs as $input_key => $billing_input) {
         // is the billing input in the requested section	?
         if (in_array($input_key, $this->{$section})) {
             // required fields get a *
             $required = $billing_input['required'] ? EEH_Form_Fields::prep_required(array('class' => 'required', 'label' => '<em>*</em>')) : '';
             // answer
             $answer = EE_Registry::instance()->REQ->is_set($input_key) ? EE_Registry::instance()->REQ->get($input_key) : $billing_input['value'];
             if ($input_key == '_reg-page-billing-card-exp-date-mnth-' . $this->_gateway_name) {
                 // Credit Card MONTH
                 add_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'reg_form_billing_cc_month_input_wrap'), 10, 2);
                 remove_filter('FHEE__EEH_Form_Fields__label_html', array('EED_Single_Page_Checkout', 'reg_form_form_field_label_wrap'), 10, 2);
                 remove_filter('FHEE__EEH_Form_Fields__input_html', array('EED_Single_Page_Checkout', 'reg_form_form_field_input__wrap'), 10, 2);
                 $output .= EEH_Form_Fields::select(__('Expiry Date', 'event_espresso'), $answer, EEH_Form_Fields::two_digit_months_dropdown_options(), $input_key, $input_key, $css_class . ' ee-credit-card-month display-inline small-txt', $required, '', '', '', FALSE, TRUE, FALSE);
                 remove_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'reg_form_billing_cc_month_input_wrap'), 10, 2);
                 add_filter('FHEE__EEH_Form_Fields__label_html', array('EED_Single_Page_Checkout', 'reg_form_form_field_label_wrap'), 10, 2);
                 add_filter('FHEE__EEH_Form_Fields__input_html', array('EED_Single_Page_Checkout', 'reg_form_form_field_input__wrap'), 10, 2);
                 $output .= "\n\t\t\t" . '&nbsp;/&nbsp;';
             } elseif ($input_key == '_reg-page-billing-card-exp-date-year-' . $this->_gateway_name) {
                 // Credit Card YEAR
                 // remove label
                 add_filter('FHEE__EEH_Form_Fields__label_html', array('EEH_Form_Fields', 'remove_label_keep_required_msg'), 10, 2);
                 add_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'reg_form_billing_cc_year_input_wrap'), 10, 2);
                 remove_filter('FHEE__EEH_Form_Fields__label_html', array('EED_Single_Page_Checkout', 'reg_form_form_field_label_wrap'), 10, 2);
                 remove_filter('FHEE__EEH_Form_Fields__input_html', array('EED_Single_Page_Checkout', 'reg_form_form_field_input__wrap'), 10, 2);
                 $output .= EEH_Form_Fields::select(__('Year', 'event_espresso'), $answer, EEH_Form_Fields::next_decade_two_digit_year_dropdown_options(), $input_key, $input_key, $css_class . ' ee-credit-card-year display-inline small-txt', $required, '', '', '', FALSE, TRUE, FALSE);
                 // remove filter that removes label, or else no other inputs will have labels
                 remove_filter('FHEE__EEH_Form_Fields__label_html', array('EEH_Form_Fields', 'remove_label_keep_required_msg'), 10, 2);
                 remove_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'reg_form_billing_cc_year_input_wrap'), 10, 2);
                 add_filter('FHEE__EEH_Form_Fields__label_html', array('EED_Single_Page_Checkout', 'reg_form_form_field_label_wrap'), 10, 2);
                 add_filter('FHEE__EEH_Form_Fields__input_html', array('EED_Single_Page_Checkout', 'reg_form_form_field_input__wrap'), 10, 2);
                 $output .= "\n\t\t\t" . '<span class="small-text lt-grey-text">' . __('(mm/yy)', 'event_espresso') . '</span>';
             } else {
                 // create question form input
                 $QFI = new EE_Question_Form_Input(EE_Question::new_instance(array('QST_display_text' => $billing_input['label'], 'QST_system' => $billing_input['db-col'], 'QST_type' => $billing_input['input'], 'QST_required' => $billing_input['required'])), EE_Answer::new_instance(array('ANS_value' => $answer)), array('input_name' => $input_key, 'input_id' => $input_key, 'input_class' => $css_class, 'input_prefix' => '', 'append_qstn_id' => FALSE));
                 // add options
                 if (isset($billing_input['options'])) {
                     $options = is_array($billing_input['options']) ? $billing_input['options'] : explode(',', $billing_input['options']);
                     foreach ($options as $option) {
                         $QSO = EE_Question_Option::new_instance(array('QSO_value' => $option, 'QSO_desc' => $option));
                         $QFI->add_temp_option($QSO);
                     }
                 }
                 $output .= EEH_Form_Fields::generate_form_input($QFI);
             }
         }
         // end if ( in_array( $input_key, $this->$section ))
     }
     // end foreach( $billing_inputs as $input_key => $billing_input )
     return $output;
 }
开发者ID:antares-ff,项目名称:ANTARES-Test,代码行数:69,代码来源:EE_Onsite_Gateway.class.php

示例9: _e

	<h4>
		<?php 
_e('New Addon Settings', 'event_espresso');
?>
	</h4>
	<table class="form-table">
		<tbody>

			<tr>
				<th><?php 
_e("Reset New Addon Settings?", 'event_espresso');
?>
</th>
				<td>
					<?php 
echo EEH_Form_Fields::select(__('Reset New Addon Settings?', 'event_espresso'), 0, $yes_no_values, 'reset_new_addon', 'reset_new_addon');
?>
<br/>
					<span class="description">
						<?php 
_e('Set to \'Yes\' and then click \'Save\' to confirm reset all basic and advanced Event Espresso New Addon settings to their plugin defaults.', 'event_espresso');
?>
					</span>
				</td>
			</tr>

		</tbody>
	</table>

</div>
开发者ID:teemuoksanen,项目名称:event-espresso-core,代码行数:30,代码来源:new_addon_basic_settings.template.php


注:本文中的EEH_Form_Fields::select方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。