/**
  * Lays out a row for the subsection
  * @param EE_Form_Section_Proper $form_section
  * @return string
  */
 public function layout_subsection($form_section)
 {
     $html = '';
     if ($form_section instanceof EE_Form_Section_HTML) {
         $html .= $form_section->get_html_and_js();
     } else {
         $html .= EEH_HTML::tr(EEH_HTML::td($form_section->get_html_and_js(), '', '', '', 'colspan="2"'));
     }
     return $html;
 }
 /**
  * Lays out the row for the input, including label and errors
  * @param EE_Form_Input_Base $input
  * @return string
  */
 public function layout_input($input)
 {
     if ($input->get_display_strategy() instanceof EE_Text_Area_Display_Strategy || $input->get_display_strategy() instanceof EE_Text_Input_Display_Strategy || $input->get_display_strategy() instanceof EE_Admin_File_Uploader_Display_Strategy) {
         $input->set_html_class($input->html_class() . ' large-text');
     }
     if ($input instanceof EE_Text_Area_Input) {
         $input->set_rows(4);
         $input->set_cols(60);
     }
     $input_html = $input->get_html_for_input();
     // maybe add errors and help text ?
     $input_html .= $input->get_html_for_errors() != '' ? EEH_HTML::nl() . $input->get_html_for_errors() : '';
     $input_html .= $input->get_html_for_help() != '' ? EEH_HTML::nl() . $input->get_html_for_help() : '';
     //overriding parent to add wp admin specific things.
     $html = '';
     if ($input instanceof EE_Hidden_Input) {
         $html .= EEH_HTML::no_row($input->get_html_for_input(), 2);
     } else {
         $html .= EEH_HTML::tr(EEH_HTML::th($input->get_html_for_label(), '', '', '', 'scope="row"') . EEH_HTML::td($input_html));
     }
     return $html;
 }
 /**
  * 	_separator_row
  *
  * @param array        $options
  * @return mixed
  */
 private function _separator_row($options = array())
 {
     // colspan
     $colspan = $options['show_desc'] ? ' colspan="5"' : ' colspan="4"';
     // start of row
     $html = EEH_HTML::tr(EEH_HTML::td('<hr>', '', '', '', $colspan));
     //		// separator td
     //		$html .= EEH_HTML::td( '<hr>', '',  '',  '',  $colspan );
     //		// end of row
     //		$html .= EEH_HTML::trx();
     return $html;
 }
 /**
  * _fine_print
  *
  * @access protected
  * @return \EE_Form_Section_HTML
  */
 protected function _fine_print()
 {
     return new EE_Form_Section_HTML(EEH_HTML::tr(EEH_HTML::th() . EEH_HTML::td(EEH_HTML::p(__('All fields marked with a * are required fields', 'event_espresso'), '', 'grey-text'))));
 }
 /**
  *    _payments_and_amount_owing_rows
  *
  * @param EE_Line_Item $line_item
  * @param array        $options
  * @return mixed
  */
 private function _payments_and_amount_owing_rows(EE_Line_Item $line_item, $options = array())
 {
     $html = '';
     $owing = $line_item->total();
     $transaction = EEM_Transaction::instance()->get_one_by_ID($line_item->TXN_ID());
     if ($transaction instanceof EE_Transaction) {
         $registration_payments = array();
         $registrations = !empty($options['registrations']) ? $options['registrations'] : $transaction->registrations();
         foreach ($registrations as $registration) {
             if ($registration instanceof EE_Registration && $registration->owes_monies_and_can_pay()) {
                 $registration_payments = $registration_payments + $registration->registration_payments();
             }
         }
         if (!empty($registration_payments)) {
             foreach ($registration_payments as $registration_payment) {
                 if ($registration_payment instanceof EE_Registration_Payment) {
                     $owing = $owing - $registration_payment->amount();
                     $payment = $registration_payment->payment();
                     if ($payment instanceof EE_Payment) {
                         $payment_desc = sprintf(__('Payment%1$s Received: %2$s', 'event_espresso'), $payment->txn_id_chq_nmbr() != '' ? ' <span class="small-text">(#' . $payment->txn_id_chq_nmbr() . ')</span> ' : '', $payment->timestamp());
                     } else {
                         $payment_desc = '';
                     }
                     // start of row
                     $html .= EEH_HTML::tr('', '', 'total_tr odd');
                     // payment desc
                     $html .= EEH_HTML::td($payment_desc, '', '', '', ' colspan="3"');
                     // total td
                     $html .= EEH_HTML::td(EEH_Template::format_currency($registration_payment->amount(), false, false), '', 'total jst-rght');
                     // end of row
                     $html .= EEH_HTML::trx();
                 }
             }
             if ($line_item->total()) {
                 // start of row
                 $html .= EEH_HTML::tr('', '', 'total_tr odd');
                 // total td
                 $html .= EEH_HTML::td(__('Amount Owing', 'event_espresso'), '', 'total_currency total jst-rght', '', ' colspan="3"');
                 // total td
                 $html .= EEH_HTML::td(EEH_Template::format_currency($owing, false, false), '', 'total jst-rght');
                 // end of row
                 $html .= EEH_HTML::trx();
             }
         }
     }
     $this->_grand_total = $owing;
     return $html;
 }
 /**
  * 	_sub_item_row
  *
  * @param EE_Line_Item $line_item
  * @param array        $options
  * @return mixed
  */
 private function _sub_item_row(EE_Line_Item $line_item, $options = array())
 {
     // start of row
     $html = EEH_HTML::tr('', 'item sub-item-row');
     // name && desc
     $name_and_desc = $line_item->name();
     $name_and_desc .= $options['show_desc'] ? '<span class="line-sub-item-desc-spn smaller-text">: ' . $line_item->desc() . '</span>' : '';
     // name td
     $html .= EEH_HTML::td($name_and_desc, '', 'item_l sub-item');
     // discount/surcharge td
     if ($line_item->is_percent()) {
         $html .= EEH_HTML::td($line_item->percent() . '%', '', 'item_c');
     } else {
         $html .= EEH_HTML::td($line_item->unit_price_no_code(), '', 'item_c jst-rght');
     }
     // total td
     $html .= EEH_HTML::td(EEH_Template::format_currency($line_item->total(), false, false), '', 'item_r jst-rght');
     // end of row
     $html .= EEH_HTML::trx();
     return $html;
 }
 /**
  *    _total_row
  *
  * @param EE_Line_Item $line_item
  * @param string $text
  * @param bool $tax_total
  * @return mixed
  */
 private function _total_row(EE_Line_Item $line_item, $text = '', $tax_total = false)
 {
     if ($tax_total && $this->_tax_count < 2) {
         return '';
     }
     //EE_Registry::instance()->load_helper('Money');
     //if ( )
     // start of row
     $html = EEH_HTML::tr('', 'event-cart-total-row', 'total_tr odd');
     // total td
     $html .= EEH_HTML::td(EEH_HTML::strong(EED_Multi_Event_Registration::$event_cart_name . ' ' . $line_item->desc() . ' ' . $text), '', 'total_currency total jst-rght', '', ' colspan="2"');
     // total qty
     $total_qty = $tax_total ? '' : EE_Registry::instance()->CART->all_ticket_quantity_count();
     $html .= EEH_HTML::td(EEH_HTML::strong($total_qty), '', 'mini-cart-tbl-qty-td total jst-cntr');
     // total td
     $html .= EEH_HTML::td(EEH_HTML::strong($line_item->total_no_code()), '', 'total jst-rght');
     // end of row
     $html .= EEH_HTML::trx();
     return $html;
 }
 /**
  *    _total_row
  *
  * @param EE_Line_Item $line_item
  * @param string       $text
  * @param int          $total_items
  * @return mixed
  */
 private function _total_row(EE_Line_Item $line_item, $text = '', $total_items = 0)
 {
     //EE_Registry::instance()->load_helper('Money');
     // start of row
     $html = EEH_HTML::tr('', 'event-cart-total-row-' . $line_item->ID(), 'event-cart-total-row-' . $line_item->type() . ' event-cart-total-row total_tr');
     // total td
     $html .= EEH_HTML::td(EEH_HTML::strong($text), '', 'total_currency total jst-rght', '', ' colspan="2"');
     // total qty
     $total_items = $total_items ? $total_items : '';
     $html .= EEH_HTML::td(EEH_HTML::strong('<span class="total">' . $total_items . '</span>'), '', 'total jst-cntr');
     // total td
     $html .= EEH_HTML::td(EEH_HTML::strong($line_item->total_no_code()), '', 'total jst-rght');
     // end of row
     $html .= EEH_HTML::trx();
     return $html;
 }
 /**
  * 	_separator_row
  *
  * @param array        $options
  * @return mixed
  */
 private function _separator_row($options = array())
 {
     // start of row
     $html = EEH_HTML::tr(EEH_HTML::td('<hr>', '', '', '', ' colspan="4"'));
     return $html;
 }
Exemplo n.º 10
0
 /**
  * no_row - for generating a "hidden" table row, good for embedding tables within tables
  * generates a new table row with one td cell that spans however many columns you set
  * removes all styles from the tr and td
  *
  * @param string $content
  * @param int    $colspan
  * @return string
  */
 public static function no_row($content = '', $colspan = 2)
 {
     return EEH_HTML::tr(EEH_HTML::td($content, '', '', 'padding:0; border:none;', 'colspan="' . $colspan . '"'), '', '', 'padding:0; border:none;');
 }
 /**
  * 	_total_row
  *
  * @param EE_Line_Item $line_item
  * @param array        $options
  * @return mixed
  */
 protected function _total_row(EE_Line_Item $line_item, $options = array())
 {
     $registration = isset($options['EE_Registration']) ? $options['EE_Registration'] : null;
     $registration_total = $registration instanceof EE_Registration ? $registration->pretty_final_price() : 0;
     //if no valid registration object then we're not going to show the approximate text.
     $total_match = $registration instanceof EE_Registration ? $registration->final_price() == $line_item->total() : true;
     // start of row
     $html = EEH_HTML::tr('', '', 'admin-primary-mbox-total-tr');
     // Total th label
     if ($total_match) {
         $total_label = sprintf(__('This registration\'s total %s:', 'event_espresso'), '(' . EE_Registry::instance()->CFG->currency->code . ')');
     } else {
         $total_label = sprintf(__('This registration\'s approximate total %s', 'event_espresso'), '(' . EE_Registry::instance()->CFG->currency->code . ')');
         $total_label .= '<br>';
         $total_label .= '<p class="ee-footnote-text">' . sprintf(__('The registrations\' share of the transaction total is approximate because it might not be possible to evenly divide the transaction total among each registration, and so some registrations may need to pay a penny more than others.  This registration\'s final share is actually %1$s%2$s%3$s.', 'event_espresso'), '<strong>', $registration_total, '</strong>') . '</p>';
     }
     $html .= EEH_HTML::th($total_label, '', 'jst-rght', '', ' colspan="3"');
     // total th
     $html .= EEH_HTML::th(EEH_Template::format_currency($line_item->total(), false, false), '', 'jst-rght');
     // end of row
     $html .= EEH_HTML::trx();
     return $html;
 }
 /**
  * 	_total_row
  *
  * @param EE_Line_Item $line_item
  * @param array        $options
  * @return mixed
  */
 protected function _total_row(EE_Line_Item $line_item, $options = array())
 {
     // start of row
     $html = EEH_HTML::tr('', '', 'admin-primary-mbox-total-tr');
     // Total th label
     $total_label = sprintf(__('Transaction Total %s', 'event_espresso'), '(' . EE_Registry::instance()->CFG->currency->code . ')');
     $html .= EEH_HTML::th($total_label, '', 'jst-rght', '', ' colspan="4"');
     // total th
     $html .= EEH_HTML::th(EEH_Template::format_currency($line_item->total(), false, false), '', 'jst-rght');
     // end of row
     $html .= EEH_HTML::trx();
     return $html;
 }
 /**
  * 	_payments_and_amount_owing_rows
  *
  * @param EE_Line_Item $line_item
  * @return mixed
  */
 private function _payments_and_amount_owing_rows(EE_Line_Item $line_item)
 {
     $html = '';
     $transaction = EEM_Transaction::instance()->get_one_by_ID($line_item->TXN_ID());
     if ($transaction instanceof EE_Transaction) {
         $payments = $transaction->approved_payments();
         if (!empty($payments)) {
             foreach ($payments as $payment) {
                 if ($payment instanceof EE_Payment) {
                     //$owing = $owing - $payment->amount();
                     $payment_desc = sprintf(__('Payment%1$s Received: %2$s', 'event_espresso'), $payment->txn_id_chq_nmbr() != '' ? ' <span class="small-text">(#' . $payment->txn_id_chq_nmbr() . ')</span> ' : '', $payment->timestamp());
                     // start of row
                     $html .= EEH_HTML::tr('', '', 'total_tr odd');
                     // payment desc
                     $html .= EEH_HTML::td($payment_desc, '', '', '', ' colspan="3"');
                     // total td
                     $html .= EEH_HTML::td(EEH_Template::format_currency($payment->amount(), false, false), '', 'total jst-rght');
                     // end of row
                     $html .= EEH_HTML::trx();
                 }
             }
             //if ( $line_item->total() ) {
             //	// start of row
             //	$html .= EEH_HTML::tr( '', '', 'total_tr odd' );
             //	// total td
             //	$html .= EEH_HTML::td( __('Amount Owing', 'event_espresso'), '',  'total_currency total jst-rght',  '',  ' colspan="3"' );
             //	// total td
             //	$html .= EEH_HTML::td( EEH_Template::format_currency( $this->grand_total(), false, false ), '',  'total jst-rght' );
             //	// end of row
             //	$html .= EEH_HTML::trx();
             //}
         }
     }
     return $html;
 }