/**
  *
  * @return string of html to display the field
  */
 function display()
 {
     // the actual input
     $input = '<input type="text" size="34" ';
     $input .= 'name="' . $this->_input->html_name() . '" ';
     $input .= $this->_input->html_class() != '' ? 'class="large-text ee_media_url ' . $this->_input->html_class() . '" ' : 'class="large-text ee_media_url" ';
     $input .= 'value="' . $this->_input->raw_value_in_form() . '" ';
     $input .= $this->_input->other_html_attributes() . '>';
     // image uploader
     $uploader = EEH_HTML::link('#', '<img src="' . admin_url('images/media-button-image.gif') . '" >', __('click to add an image', 'event_espresso'), '', 'ee_media_upload');
     //only attempt to show the image if it at least exists
     $image = $this->src_exists($this->_input->raw_value()) ? EEH_HTML::br(2) . EEH_HTML::img($this->_input->raw_value(), __('logo', 'event_espresso'), '', 'ee_media_image') : '';
     // html string
     return EEH_HTML::div($input . EEH_HTML::nbsp() . $uploader . $image, '', 'ee_media_uploader_area');
 }
 /**
  * 	_total_row
  *
  * @param EE_Line_Item $line_item
  * @param string       $text
  * @param array        $options
  * @return mixed
  */
 private function _total_row(EE_Line_Item $line_item, $text = '', $options = array())
 {
     // colspan
     $colspan = $options['show_desc'] ? ' colspan="2"' : '';
     // start of row
     $html = EEH_HTML::tr('', '', 'total_tr odd');
     // empty td
     $html .= EEH_HTML::td(EEH_HTML::nbsp(), '', '', '', $colspan);
     // total td
     $html .= EEH_HTML::td($text, '', 'total_currency total', '', $colspan);
     // total td
     $html .= EEH_HTML::td($line_item->total_no_code(), '', 'total');
     // end of row
     $html .= EEH_HTML::trx();
     return $html;
 }
 /**
  * _update_payment_method_button
  *
  * @access protected
  * @param \EE_Payment_Method $payment_method
  * @return \EE_Form_Section_HTML
  */
 protected function _update_payment_method_button(EE_Payment_Method $payment_method)
 {
     $update_button = new EE_Submit_Input(array('html_id' => 'save_' . $payment_method->slug() . '_settings', 'default' => sprintf(__('Update %s Payment Settings', 'event_espresso'), $payment_method->admin_name()), 'html_label' => EEH_HTML::nbsp()));
     return new EE_Form_Section_HTML(EEH_HTML::no_row(EEH_HTML::br(2)) . EEH_HTML::tr(EEH_HTML::th(__('Update Settings', 'event_espresso')) . EEH_HTML::td($update_button->get_html_for_input())));
 }
 /**
  *    _total_row
  *
  * @param EE_Line_Item $line_item
  * @param string $text
  * @return mixed
  */
 private function _total_tax_row(EE_Line_Item $line_item, $text = '')
 {
     $html = '';
     if ($line_item->total()) {
         // start of row
         $html = EEH_HTML::tr('', '', 'total_tr odd');
         // total td
         $html .= EEH_HTML::td($text, '', 'total_currency total jst-rght', '', ' colspan="2"');
         // empty td (price)
         $html .= EEH_HTML::td(EEH_HTML::nbsp());
         // total td
         $html .= EEH_HTML::td(EEH_Template::format_currency($line_item->total(), false, false), '', 'total jst-rght');
         // end of row
         $html .= EEH_HTML::trx();
     }
     return $html;
 }
 public static function display_add_new_state_micro_form(EE_Form_Section_Proper $question_group_reg_form)
 {
     // only add the 'new_state_micro_form' when displaying reg forms,
     // not during processing since we process the 'new_state_micro_form' in it's own AJAX request
     $action = EE_Registry::instance()->REQ->get('action', '');
     if ($action === 'process_reg_step' || $action === 'update_reg_step') {
         return $question_group_reg_form;
     }
     // is the "state" question in this form section?
     $input = $question_group_reg_form->get_subsection('state');
     // we're only doing this for state select inputs
     if ($input instanceof EE_State_Select_Input) {
         // load helpers
         EE_Registry::instance()->load_helper('HTML');
         // grab any set values from the request
         $country_name = str_replace('state', 'new_state_country', $input->html_name());
         $state_name = str_replace('state', 'new_state_name', $input->html_name());
         $abbrv_name = str_replace('state', 'new_state_abbrv', $input->html_name());
         $new_state_submit_id = str_replace('state', 'new_state', $input->html_id());
         $country_options = array();
         $countries = EEM_Country::instance()->get_all_countries();
         if (!empty($countries)) {
             foreach ($countries as $country) {
                 if ($country instanceof EE_Country) {
                     $country_options[$country->ID()] = $country->name();
                 }
             }
         }
         $new_state_micro_form = new EE_Form_Section_Proper(array('name' => 'new_state_micro_form', 'html_id' => 'new_state_micro_form', 'layout_strategy' => new EE_No_Layout(), 'subsections' => array('add_new_state' => new EE_Hidden_Input(array('html_name' => str_replace('state', 'add_new_state', $input->html_name()), 'html_id' => str_replace('state', 'add_new_state', $input->html_id()), 'default' => 0)), 'click_here_link' => new EE_Form_Section_HTML(apply_filters('FHEE__EED_Add_New_State__display_add_new_state_micro_form__click_here_link', EEH_HTML::link('', __('click here to add a new state/province', 'event_espresso'), '', 'display-' . $input->html_id(), 'ee-form-add-new-state-lnk display-the-hidden smaller-text hide-if-no-js', '', 'rel="' . $input->html_id() . '"'))), 'add_new_state_micro_form' => new EE_Form_Section_HTML(apply_filters('FHEE__EED_Add_New_State__display_add_new_state_micro_form__add_new_state_micro_form', EEH_HTML::div('', $input->html_id() . '-dv', 'ee-form-add-new-state-dv', 'display: none;') . EEH_HTML::h6(__('If your State/Province does not appear in the list above, you can easily add it by doing the following:', 'event_espresso')) . EEH_HTML::ul() . EEH_HTML::li(__('first select the Country that your State/Province belongs to', 'event_espresso')) . EEH_HTML::li(__('enter the name of your State/Province', 'event_espresso')) . EEH_HTML::li(__('enter a two to six letter abbreviation for the name of your State/Province', 'event_espresso')) . EEH_HTML::li(__('click the ADD button', 'event_espresso')) . EEH_HTML::ulx())), 'new_state_country' => new EE_Country_Select_Input($country_options, array('html_name' => $country_name, 'html_id' => str_replace('state', 'new_state_country', $input->html_id()), 'html_class' => $input->html_class() . ' new-state-country', 'html_label_text' => __('New State/Province Country', 'event_espresso'), 'default' => EE_Registry::instance()->REQ->get($country_name, ''), 'required' => false)), 'new_state_name' => new EE_Text_Input(array('html_name' => $state_name, 'html_id' => str_replace('state', 'new_state_name', $input->html_id()), 'html_class' => $input->html_class() . ' new-state-state', 'html_label_text' => __('New State/Province Name', 'event_espresso'), 'default' => EE_Registry::instance()->REQ->get($state_name, ''), 'required' => false)), 'spacer' => new EE_Form_Section_HTML(EEH_HTML::br()), 'new_state_abbrv' => new EE_Text_Input(array('html_name' => $abbrv_name, 'html_id' => str_replace('state', 'new_state_abbrv', $input->html_id()), 'html_class' => $input->html_class() . ' new-state-abbrv', 'html_label_text' => __('New State/Province Abbreviation', 'event_espresso'), 'html_other_attributes' => 'size="24"', 'default' => EE_Registry::instance()->REQ->get($abbrv_name, ''), 'required' => false)), 'add_new_state_submit_button' => new EE_Form_Section_HTML(apply_filters('FHEE__EED_Add_New_State__display_add_new_state_micro_form__add_new_state_submit_button', EEH_HTML::nbsp(3) . EEH_HTML::link('', __('ADD', 'event_espresso'), '', 'submit-' . $new_state_submit_id, 'ee-form-add-new-state-submit button button-secondary', '', 'rel="' . $new_state_submit_id . '"'))), 'add_new_state_extra' => new EE_Form_Section_HTML(apply_filters('FHEE__EED_Add_New_State__display_add_new_state_micro_form__add_new_state_extra', EEH_HTML::br(2) . EEH_HTML::div('', '', 'small-text') . EEH_HTML::strong(__('Don\'t know your State/Province Abbreviation?', 'event_espresso')) . EEH_HTML::br() . sprintf(__('You can look here: %s, for a list of Countries and links to their State/Province Abbreviations ("Subdivisions assigned codes" column).', 'event_espresso'), EEH_HTML::link('http://en.wikipedia.org/wiki/ISO_3166-2', 'http://en.wikipedia.org/wiki/ISO_3166-2', '', '', 'ee-form-add-new-state-wiki-lnk')) . EEH_HTML::divx() . EEH_HTML::br() . EEH_HTML::link('', __('cancel new state/province', 'event_espresso'), '', 'hide-' . $input->html_id(), 'ee-form-cancel-new-state-lnk smaller-text', '', 'rel="' . $input->html_id() . '"') . EEH_HTML::divx() . EEH_HTML::br())))));
         $question_group_reg_form->add_subsections(array('new_state_micro_form' => $new_state_micro_form), 'state', false);
     }
     return $question_group_reg_form;
 }
 /**
  * 	_tax_row
  *
  * @param EE_Line_Item $line_item
  * @return mixed
  */
 private function _tax_row(EE_Line_Item $line_item)
 {
     $this->_tax_count++;
     // start of row
     $html = EEH_HTML::tr('', '', 'event-cart-tax-row item sub-item tax-total');
     // name && desc
     $name_and_desc = $line_item->name();
     $name_and_desc .= '<span class="tiny-text" style="margin:0 0 0 2em;">' . __(' * taxable items', 'event_espresso') . '</span>';
     // name td
     $html .= EEH_HTML::td($name_and_desc, '', 'sub-item');
     // percent td
     $html .= EEH_HTML::td($line_item->percent() . '%', '', 'mini-cart-tbl-qty-td jst-rght');
     // empty td (price)
     $html .= EEH_HTML::td(EEH_HTML::nbsp());
     // total td
     $html .= EEH_HTML::td($line_item->total_no_code(), '', 'jst-rght');
     // end of row
     $html .= EEH_HTML::trx();
     return $html;
 }
 /**
  *    _total_row
  *
  * @param EE_Line_Item $line_item
  * @param string $text
  * @return mixed
  */
 private function _total_tax_row(EE_Line_Item $line_item, $text = '')
 {
     $html = '';
     if ($line_item->total()) {
         // start of row
         $html = EEH_HTML::tr('', 'event-cart-total-tax-row-' . $line_item->ID(), 'event-cart-total-tax-row total_tr');
         // total td
         $html .= EEH_HTML::td($text, '', 'total_currency total jst-rght');
         $html .= EEH_HTML::td('', '', 'total jst-cntr');
         // empty td (price)
         $html .= EEH_HTML::td(EEH_HTML::nbsp());
         // total td
         $html .= EEH_HTML::td($line_item->total_no_code(), '', 'total jst-rght');
         // end of row
         $html .= EEH_HTML::trx();
     }
     return $html;
 }