/** * _get_table_filters * @access protected * @return array */ protected function _get_table_filters() { $filters = array(); //todo we're currently using old functions here. We need to move things into the Events_Admin_Page() class as methods. EE_Registry::instance()->load_helper('Form_Fields'); $cur_date = isset($this->_req_data['month_range']) ? $this->_req_data['month_range'] : ''; $cur_category = isset($this->_req_data['EVT_CAT']) ? $this->_req_data['EVT_CAT'] : -1; $reg_status = isset($this->_req_data['_reg_status']) ? $this->_req_data['_reg_status'] : ''; $filters[] = EEH_Form_Fields::generate_registration_months_dropdown($cur_date, $reg_status, $cur_category); $filters[] = EEH_Form_Fields::generate_event_category_dropdown($cur_category); $status = array(); $status[] = array('id' => 0, 'text' => __('Select Status', 'event_espresso')); foreach ($this->_status as $key => $value) { $status[] = array('id' => $key, 'text' => $value); } if ($this->_view != 'incomplete') { $filters[] = EEH_Form_Fields::select_input('_reg_status', $status, isset($this->_req_data['_reg_status']) ? strtoupper(sanitize_key($this->_req_data['_reg_status'])) : ''); } if (isset($this->_req_data['event_id'])) { $filters[] = EEH_Form_Fields::hidden_input('event_id', $this->_req_data['event_id'], 'reg_event_id'); } return $filters; }
/** * display_add_new_state_micro_form * * @access public * @return string */ public static function display_add_new_state_micro_form($input_html, $question, $answer, $name, $id, $class, $system_ID) { // load JS add_action('wp_enqueue_scripts', array('EED_Add_New_State', 'wp_enqueue_scripts'), 10); $output = ''; // we're only doing this for state select inputs if ($system_ID == 'state') { // add hidden input to indicate that a new state is being added $output .= EEH_Form_Fields::hidden_input(str_replace('state', 'add_new_state', $name), 0, str_replace('state', 'add_new_state', $id)); $output .= '<a id="display-' . $id . '" class="ee-form-add-new-state-lnk display-the-hidden smaller-text hide-if-no-js" rel="' . $id . '">' . __('click here to add a new state/province', 'event_espresso') . '</a>'; $output .= '<div id="' . $id . '-dv" class="ee-form-add-new-state-dv" style="display: none;">'; $output .= '<h6>' . __('If your State/Province does not appear in the list above, you can easily add it by doing the following:', 'event_espresso') . '</h6>'; $output .= '<ul>'; $output .= sprintf(__('%1$sfirst select the Country that your State/Province belongs to%2$s%1$senter the name of your State/Province%2$s%1$senter a two to six letter abbreviation for the name of your State/Province%2$s%1$sclick the ADD button%2$s', 'event_espresso'), '<li>', '</li>'); $output .= '</ul>'; // NEW STATE COUNTRY $cntry_id = str_replace('state', 'new_state_country', $id); $cntry_input = str_replace('state', 'new_state_country', $name); $country = new EE_Question_Form_Input(EE_Question::new_instance(array('QST_display_text' => __('New State/Province Country', 'event_espresso'), 'QST_system' => 'admin-country', 'QST_type' => EEM_Question::QST_type_dropdown, 'QST_required' => FALSE)), EE_Answer::new_instance(array('ANS_value' => EE_Registry::instance()->REQ->is_set($cntry_input) ? EE_Registry::instance()->REQ->get($cntry_input) : '')), array('input_name' => $cntry_input, 'input_id' => $cntry_id, 'input_class' => $class, 'input_prefix' => '', 'append_qstn_id' => FALSE)); $output .= EEH_Form_Fields::generate_form_input($country); // NEW STATE NAME $state_id = str_replace('state', 'new_state_name', $id); $state_name = str_replace('state', 'new_state_name', $name); $new_state_name = new EE_Question_Form_Input(EE_Question::new_instance(array('QST_display_text' => __('New State/Province Name', 'event_espresso'), 'QST_system' => '', 'QST_type' => EEM_Question::QST_type_text, 'QST_required' => FALSE)), EE_Answer::new_instance(array('ANS_value' => EE_Registry::instance()->REQ->is_set($state_name) ? EE_Registry::instance()->REQ->get($state_name) : '')), array('input_name' => $state_name, 'input_id' => $state_id, 'input_class' => $class, 'input_prefix' => '', 'append_qstn_id' => FALSE)); $output .= EEH_Form_Fields::generate_form_input($new_state_name); // NEW STATE ABBREVIATION $abbrv_id = str_replace('state', 'new_state_abbrv', $id); $abbrv_name = str_replace('state', 'new_state_abbrv', $name); $new_state_abbrv = new EE_Question_Form_Input(EE_Question::new_instance(array('QST_display_text' => __('New State/Province Abbreviation', 'event_espresso'), 'QST_system' => '', 'QST_type' => EEM_Question::QST_type_text, 'QST_required' => FALSE)), EE_Answer::new_instance(array('ANS_value' => EE_Registry::instance()->REQ->is_set($abbrv_name) ? EE_Registry::instance()->REQ->get($abbrv_name) : '')), array('input_name' => $abbrv_name, 'input_id' => $abbrv_id, 'input_class' => $class, 'input_prefix' => '', 'append_qstn_id' => FALSE)); // add filters for reducing size of State Abbrv text input, and adding an "ADD" button, as well as a "cancel" button add_filter('FHEE__EEH_Form_Fields__additional_form_field_attributes', array('EED_Add_New_State', 'set_new_state_input_size')); add_filter('FHEE__EEH_Form_Fields__input_html', array('EED_Add_New_State', 'add_new_state_submit_button'), 1, 3); add_filter('FHEE__EEH_Form_Fields__input_html', array('EED_Add_New_State', 'cancel_new_state'), 2, 3); $output .= EEH_Form_Fields::generate_form_input($new_state_abbrv); // remove the filters from above so that they don't affect any other inputs remove_filter('FHEE__EEH_Form_Fields__additional_form_field_attributes', array('EED_Add_New_State', 'set_new_state_input_size')); remove_filter('FHEE__EEH_Form_Fields__input_html', array('EED_Add_New_State', 'add_new_state_submit_button'), 1, 3); remove_filter('FHEE__EEH_Form_Fields__input_html', array('EED_Add_New_State', 'cancel_new_state'), 2, 3); $output .= '</div>'; } return $input_html . $output; }
</td> <td class="option-desc-cell"> <input type="text" name="question_options[0][QSO_desc]" class="option-desc regular-text"> </td> <td> <?php echo EEH_Form_Fields::hidden_input("question_options_count", $count); ?> </td> </tr> <?php } ?> <tr style="display:none"> <td colspan="3"><?php echo EEH_Form_Fields::hidden_input("question_options_count", $count); ?> </td> </tr> </tbody> </table> <a id="new-question-option" class="button" style="margin:0 0 1em 3px;"> <?php _e('Add Another Answer Option', 'event_espresso'); ?> </a><br/> <p class="description"> <?php _e('Answer Options are the choices that you give people to select from for RADIO_BTN, CHECKBOX or DROPDOWN questions. The Value is a simple key that will be saved to the database and the description is optional. Note that values CANNOT contain any HTML, but descriptions can.', 'event_espresso');