@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 4 | 4 | exit('NO direct script access allowed'); |
| 5 | 5 | |
| 6 | 6 | /** |
@@ -57,39 +57,39 @@ discard block |
||
| 57 | 57 | * @param string $shortcode the shortcode to be parsed. |
| 58 | 58 | * @return string parsed shortcode |
| 59 | 59 | */ |
| 60 | - protected function _parser( $shortcode ) { |
|
| 60 | + protected function _parser($shortcode) { |
|
| 61 | 61 | |
| 62 | - if ( ! $this->_data instanceof EE_Answer || ! isset( $this->_extra_data['data'] ) || ! $this->_extra_data['data'] instanceof EE_Messages_Addressee ) { |
|
| 62 | + if ( ! $this->_data instanceof EE_Answer || ! isset($this->_extra_data['data']) || ! $this->_extra_data['data'] instanceof EE_Messages_Addressee) { |
|
| 63 | 63 | return ''; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - switch ( $shortcode ) { |
|
| 66 | + switch ($shortcode) { |
|
| 67 | 67 | |
| 68 | 68 | case '[QUESTION]' : |
| 69 | - $question = isset( $this->_extra_data['data']->questions[$this->_data->ID()] ) ? $this->_extra_data['data']->questions[$this->_data->ID()] : $this->_data->question(); |
|
| 70 | - if ( ! $question instanceof EE_Question ) { |
|
| 69 | + $question = isset($this->_extra_data['data']->questions[$this->_data->ID()]) ? $this->_extra_data['data']->questions[$this->_data->ID()] : $this->_data->question(); |
|
| 70 | + if ( ! $question instanceof EE_Question) { |
|
| 71 | 71 | return ''; //get out because we can't figure out what the question is. |
| 72 | 72 | } |
| 73 | - return $question->get_pretty( 'QST_display_text', 'no_wpautop' ); |
|
| 73 | + return $question->get_pretty('QST_display_text', 'no_wpautop'); |
|
| 74 | 74 | break; |
| 75 | 75 | |
| 76 | 76 | case '[ANSWER]' : |
| 77 | 77 | //need to get the question to determine the type of question (some questions require translation of the answer). |
| 78 | - $question = isset( $this->_extra_data['data']->questions[$this->_data->ID()] ) ? $this->_extra_data['data']->questions[$this->_data->ID()] : $this->_data->question(); |
|
| 79 | - if ( ! $question instanceof EE_Question ) { |
|
| 78 | + $question = isset($this->_extra_data['data']->questions[$this->_data->ID()]) ? $this->_extra_data['data']->questions[$this->_data->ID()] : $this->_data->question(); |
|
| 79 | + if ( ! $question instanceof EE_Question) { |
|
| 80 | 80 | return ''; //get out cause we can't figure out what the question type is! |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | //what we show for the answer depends on the question type! |
| 84 | - switch ( $question->get( 'QST_type' ) ) { |
|
| 84 | + switch ($question->get('QST_type')) { |
|
| 85 | 85 | |
| 86 | 86 | case 'STATE' : |
| 87 | - $state = EEM_State::instance()->get_one_by_ID( $this->_data->get('ANS_value') ); |
|
| 87 | + $state = EEM_State::instance()->get_one_by_ID($this->_data->get('ANS_value')); |
|
| 88 | 88 | $answer = $state instanceof EE_State ? $state->name() : ''; |
| 89 | 89 | break; |
| 90 | 90 | |
| 91 | 91 | case 'COUNTRY' : |
| 92 | - $country = EEM_Country::instance()->get_one_by_ID( $this->_data->get( 'ANS_value') ); |
|
| 92 | + $country = EEM_Country::instance()->get_one_by_ID($this->_data->get('ANS_value')); |
|
| 93 | 93 | $answer = $country instanceof EE_Country ? $country->name() : ''; |
| 94 | 94 | break; |
| 95 | 95 | |
@@ -1,6 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | +} |
|
| 4 | 5 | |
| 5 | 6 | /** |
| 6 | 7 | * Event Espresso |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * @return EED_Event_Single_Caff |
| 30 | 30 | */ |
| 31 | 31 | public static function instance() { |
| 32 | - return parent::get_instance( __CLASS__ ); |
|
| 32 | + return parent::get_instance(__CLASS__); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | * @return void |
| 51 | 51 | */ |
| 52 | 52 | public static function set_hooks_admin() { |
| 53 | - define( 'EVENT_SINGLE_CAFF_TEMPLATES_PATH', plugin_dir_path( __FILE__ ) . 'templates' . DS ); |
|
| 54 | - add_action( 'AHEE__template_settings__template__before_settings_form', array( 'EED_Event_Single_Caff', 'template_settings_form' ), 10 ); |
|
| 55 | - add_filter( 'FHEE__General_Settings_Admin_Page__update_template_settings__data', array( 'EED_Event_Single_Caff', 'update_template_settings' ), 10, 2 ); |
|
| 53 | + define('EVENT_SINGLE_CAFF_TEMPLATES_PATH', plugin_dir_path(__FILE__).'templates'.DS); |
|
| 54 | + add_action('AHEE__template_settings__template__before_settings_form', array('EED_Event_Single_Caff', 'template_settings_form'), 10); |
|
| 55 | + add_filter('FHEE__General_Settings_Admin_Page__update_template_settings__data', array('EED_Event_Single_Caff', 'update_template_settings'), 10, 2); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |
@@ -69,9 +69,9 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public static function template_settings_form() { |
| 71 | 71 | $EE = EE_Registry::instance(); |
| 72 | - $EE->CFG->template_settings->EED_Event_Single = isset( $EE->CFG->template_settings->EED_Event_Single ) ? $EE->CFG->template_settings->EED_Event_Single : new EE_Event_Single_Config(); |
|
| 73 | - $EE->CFG->template_settings->EED_Event_Single = apply_filters( 'FHEE__EED_Event_Single__template_settings_form__event_list_config', $EE->CFG->template_settings->EED_Event_Single ); |
|
| 74 | - EEH_Template::display_template( EVENT_SINGLE_CAFF_TEMPLATES_PATH . 'admin-event-single-settings.template.php', $EE->CFG->template_settings->EED_Event_Single ); |
|
| 72 | + $EE->CFG->template_settings->EED_Event_Single = isset($EE->CFG->template_settings->EED_Event_Single) ? $EE->CFG->template_settings->EED_Event_Single : new EE_Event_Single_Config(); |
|
| 73 | + $EE->CFG->template_settings->EED_Event_Single = apply_filters('FHEE__EED_Event_Single__template_settings_form__event_list_config', $EE->CFG->template_settings->EED_Event_Single); |
|
| 74 | + EEH_Template::display_template(EVENT_SINGLE_CAFF_TEMPLATES_PATH.'admin-event-single-settings.template.php', $EE->CFG->template_settings->EED_Event_Single); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | |
@@ -84,10 +84,10 @@ discard block |
||
| 84 | 84 | * @param $REQ |
| 85 | 85 | * @return void |
| 86 | 86 | */ |
| 87 | - public static function update_template_settings( $CFG, $REQ ) { |
|
| 87 | + public static function update_template_settings($CFG, $REQ) { |
|
| 88 | 88 | $CFG->EED_Event_Single = new EE_Event_Single_Config(); |
| 89 | - $CFG->EED_Event_Single->display_status_banner_single = !empty( $REQ['display_status_banner_single'] ) && $REQ['display_status_banner_single'] ? TRUE : FALSE; |
|
| 90 | - $CFG->EED_Event_Single->display_venue = !empty( $REQ['display_venue'] ) && $REQ['display_venue'] ? TRUE : FALSE; |
|
| 89 | + $CFG->EED_Event_Single->display_status_banner_single = ! empty($REQ['display_status_banner_single']) && $REQ['display_status_banner_single'] ? TRUE : FALSE; |
|
| 90 | + $CFG->EED_Event_Single->display_venue = ! empty($REQ['display_venue']) && $REQ['display_venue'] ? TRUE : FALSE; |
|
| 91 | 91 | return $CFG; |
| 92 | 92 | } |
| 93 | 93 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | * @param WP $WP |
| 101 | 101 | * @return void |
| 102 | 102 | */ |
| 103 | - public function run( $WP ) { |
|
| 103 | + public function run($WP) { |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | |
@@ -1,4 +1,6 @@ |
||
| 1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
| 1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | +} |
|
| 2 | 4 | /** |
| 3 | 5 | * Event Espresso |
| 4 | 6 | * |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | </label> |
| 20 | 20 | </th> |
| 21 | 21 | <td> |
| 22 | - <?php echo EEH_Form_Fields::select_input( 'display_status_banner_single', $values, $display_status_banner_single, 'id="display_status_banner_single"' ); ?> |
|
| 22 | + <?php echo EEH_Form_Fields::select_input('display_status_banner_single', $values, $display_status_banner_single, 'id="display_status_banner_single"'); ?> |
|
| 23 | 23 | <p class="description"><?php _e('Selecting "Yes" will inject an Event Status banner with the title whenever Events are displaying on the single event page.', 'event_espresso'); ?></p> |
| 24 | 24 | </td> |
| 25 | 25 | </tr> |
@@ -27,11 +27,11 @@ discard block |
||
| 27 | 27 | <tr> |
| 28 | 28 | <th> |
| 29 | 29 | <label for="display_venue"> |
| 30 | - <?php _e('Display Venue Details', 'event_espresso'); ?><?php echo EEH_Template::get_help_tab_link('display_addresses_in_reg_form_info');?> |
|
| 30 | + <?php _e('Display Venue Details', 'event_espresso'); ?><?php echo EEH_Template::get_help_tab_link('display_addresses_in_reg_form_info'); ?> |
|
| 31 | 31 | </label> |
| 32 | 32 | </th> |
| 33 | 33 | <td> |
| 34 | - <?php echo EEH_Form_Fields::select_input( 'display_venue', $values, $display_venue, 'id="display_venue"' ); ?> |
|
| 34 | + <?php echo EEH_Form_Fields::select_input('display_venue', $values, $display_venue, 'id="display_venue"'); ?> |
|
| 35 | 35 | <p class="description"><?php _e('Do not use this if you are using the venue shortcodes in your event description.', 'event_espresso'); ?></p> |
| 36 | 36 | </td> |
| 37 | 37 | </tr> |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
| 3 | - exit( 'No direct script access allowed' ); |
|
| 2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 3 | + exit('No direct script access allowed'); |
|
| 4 | 4 | } |
| 5 | 5 | |
| 6 | 6 | /** |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | * @author Mike Nelson |
| 20 | 20 | * |
| 21 | 21 | */ |
| 22 | -class EED_Mijireh_Payment_Checker extends EED_Module{ |
|
| 22 | +class EED_Mijireh_Payment_Checker extends EED_Module { |
|
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * set_hooks - for hooking into EE Core, other modules, etc |
@@ -40,18 +40,18 @@ discard block |
||
| 40 | 40 | * @return void |
| 41 | 41 | */ |
| 42 | 42 | public static function set_hooks_admin() { |
| 43 | - add_action( 'AHEE__Transactions_Admin_Page__transaction_details__start', array( 'EED_Mijireh_Payment_Checker', 'check_for_payment_update_on_transaction' ), 10, 1 ); |
|
| 43 | + add_action('AHEE__Transactions_Admin_Page__transaction_details__start', array('EED_Mijireh_Payment_Checker', 'check_for_payment_update_on_transaction'), 10, 1); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - public static function check_for_payment_update_on_transaction( $transaction ) { |
|
| 47 | - if( $transaction instanceof EE_Transaction ) { |
|
| 46 | + public static function check_for_payment_update_on_transaction($transaction) { |
|
| 47 | + if ($transaction instanceof EE_Transaction) { |
|
| 48 | 48 | $last_payment = $transaction->last_payment(); |
| 49 | 49 | //if this payment is from Mijireh and so far unapproved |
| 50 | - if( $last_payment instanceof EE_Payment && |
|
| 50 | + if ($last_payment instanceof EE_Payment && |
|
| 51 | 51 | $last_payment->payment_method() && |
| 52 | 52 | $last_payment->payment_method()->type_obj() instanceof EE_PMT_Mijireh && |
| 53 | - $last_payment->status() != EEM_Payment::status_id_approved ) { |
|
| 54 | - $updated_payment = $last_payment->payment_method()->type_obj()->handle_ipn( NULL, $transaction ); |
|
| 53 | + $last_payment->status() != EEM_Payment::status_id_approved) { |
|
| 54 | + $updated_payment = $last_payment->payment_method()->type_obj()->handle_ipn(NULL, $transaction); |
|
| 55 | 55 | $updated_payment->save(); |
| 56 | 56 | } |
| 57 | 57 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | * @access public |
| 63 | 63 | * @return void |
| 64 | 64 | */ |
| 65 | - public function run( $WP ) { |
|
| 65 | + public function run($WP) { |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | |
@@ -110,10 +110,10 @@ discard block |
||
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | /** |
| 113 | - * Return true if the current page is the mijireh checkout page, otherwise return false. |
|
| 114 | - * |
|
| 115 | - * @return boolean |
|
| 116 | - */ |
|
| 113 | + * Return true if the current page is the mijireh checkout page, otherwise return false. |
|
| 114 | + * |
|
| 115 | + * @return boolean |
|
| 116 | + */ |
|
| 117 | 117 | public static function is_slurp_page() { |
| 118 | 118 | global $post; |
| 119 | 119 | $isSlurp = false; |
@@ -130,9 +130,9 @@ discard block |
||
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | /** |
| 133 | - * adds the callback to adding the slurp page metabox, which shoudl only appear on a page with the {{mj-checkout-form}} "shortcode" |
|
| 134 | - * @return void |
|
| 135 | - */ |
|
| 133 | + * adds the callback to adding the slurp page metabox, which shoudl only appear on a page with the {{mj-checkout-form}} "shortcode" |
|
| 134 | + * @return void |
|
| 135 | + */ |
|
| 136 | 136 | public static function add_slurp_page_metabox() { |
| 137 | 137 | if(self::is_slurp_page() && EEM_Payment_Method::instance()->get_one_active( EEM_Payment_Method::scope_cart, array( array( 'PMD_type' => 'Mijireh' ) ) ) ){ |
| 138 | 138 | add_meta_box( |
@@ -147,10 +147,10 @@ discard block |
||
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | /** |
| 150 | - * outputs HTML for displaying the slurping metabox |
|
| 151 | - * @param WP_Post $post |
|
| 152 | - * @return void echoes out html |
|
| 153 | - */ |
|
| 150 | + * outputs HTML for displaying the slurping metabox |
|
| 151 | + * @param WP_Post $post |
|
| 152 | + * @return void echoes out html |
|
| 153 | + */ |
|
| 154 | 154 | public static function slurp_page_metabox($post) { |
| 155 | 155 | global $wp; |
| 156 | 156 | $mijireh_payment_method = EEM_Payment_Method::instance()->get_one_of_type( 'Mijireh' ); |
@@ -168,10 +168,10 @@ discard block |
||
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | /** |
| 171 | - * decides whether to slurp the post indicated by the $post global or not, based entirely |
|
| 172 | - * on a special arg being in the querystring |
|
| 173 | - * @return void |
|
| 174 | - */ |
|
| 171 | + * decides whether to slurp the post indicated by the $post global or not, based entirely |
|
| 172 | + * on a special arg being in the querystring |
|
| 173 | + * @return void |
|
| 174 | + */ |
|
| 175 | 175 | public static function slurp_or_not(){ |
| 176 | 176 | //check if this page has the right mijire 'shortcode' and if they've specified to slurp it |
| 177 | 177 | if(isset($_GET['mijireh_slurp_now']) && $_GET['mijireh_slurp_now'] == 'true' && EED_Mijireh_Slurper::is_slurp_page()){ |
@@ -180,9 +180,9 @@ discard block |
||
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | /** |
| 183 | - * Sends a request to mijireh to slurp the current $post, and then redirects the user back to the current page without the |
|
| 184 | - * special querystring arg indicating to slurp. Also, should temporarily make the current post published, then revert it to its previous status |
|
| 185 | - */ |
|
| 183 | + * Sends a request to mijireh to slurp the current $post, and then redirects the user back to the current page without the |
|
| 184 | + * special querystring arg indicating to slurp. Also, should temporarily make the current post published, then revert it to its previous status |
|
| 185 | + */ |
|
| 186 | 186 | public static function slurp_now(){ |
| 187 | 187 | global $post; |
| 188 | 188 | if ( $post->post_status != 'publish' ) { |
@@ -49,19 +49,19 @@ discard block |
||
| 49 | 49 | * @return void |
| 50 | 50 | */ |
| 51 | 51 | public static function set_hooks_admin() { |
| 52 | - define('EED_MIJIREH_SLURPER_PATH',EE_CAFF_PATH.'modules'.DS.'mijireh_slurper'.DS); |
|
| 53 | - add_action('load-post.php',array('EED_Mijireh_Slurper','set_edit_post_page_hooks')); |
|
| 54 | - add_action('load-admin.php',array('EED_Mijireh_Slurper','check_for_edit_slurp_page')); |
|
| 55 | - add_action('AHEE__EE_Mijireh__settings_end',array('EED_Mijireh_Slurper','add_slurp_link_to_gateway')); |
|
| 52 | + define('EED_MIJIREH_SLURPER_PATH', EE_CAFF_PATH.'modules'.DS.'mijireh_slurper'.DS); |
|
| 53 | + add_action('load-post.php', array('EED_Mijireh_Slurper', 'set_edit_post_page_hooks')); |
|
| 54 | + add_action('load-admin.php', array('EED_Mijireh_Slurper', 'check_for_edit_slurp_page')); |
|
| 55 | + add_action('AHEE__EE_Mijireh__settings_end', array('EED_Mijireh_Slurper', 'add_slurp_link_to_gateway')); |
|
| 56 | 56 | } |
| 57 | 57 | /** |
| 58 | 58 | * Merely used to avoid even bothering to add these hooks on pages besides admin's post.php |
| 59 | 59 | */ |
| 60 | - public static function set_edit_post_page_hooks(){ |
|
| 61 | - add_action('add_meta_boxes',array('EED_Mijireh_Slurper','add_slurp_page_metabox')); |
|
| 62 | - add_action('posts_selection',array('EED_Mijireh_Slurper','slurp_or_not')); |
|
| 63 | - if(get_transient(EED_Mijireh_Slurper::slurp_started_transient_name)){ |
|
| 64 | - add_action( 'admin_notices', array('EED_Mijireh_Slurper', 'slurping_in_progress_notice') ); |
|
| 60 | + public static function set_edit_post_page_hooks() { |
|
| 61 | + add_action('add_meta_boxes', array('EED_Mijireh_Slurper', 'add_slurp_page_metabox')); |
|
| 62 | + add_action('posts_selection', array('EED_Mijireh_Slurper', 'slurp_or_not')); |
|
| 63 | + if (get_transient(EED_Mijireh_Slurper::slurp_started_transient_name)) { |
|
| 64 | + add_action('admin_notices', array('EED_Mijireh_Slurper', 'slurping_in_progress_notice')); |
|
| 65 | 65 | delete_transient(EED_Mijireh_Slurper::slurp_started_transient_name); |
| 66 | 66 | } |
| 67 | 67 | } |
@@ -70,11 +70,11 @@ discard block |
||
| 70 | 70 | * Adds the slurping content to the gateway's settings page, because I thought this was best suited to remain in the module's code (because |
| 71 | 71 | * the gateway works fine independent of this module) |
| 72 | 72 | */ |
| 73 | - public static function add_slurp_link_to_gateway($existing_content){ |
|
| 74 | - echo EEH_Template::display_template( EED_MIJIREH_SLURPER_PATH.'templates/additional_content_on_gateway.template.php', array(),true ) . $existing_content; |
|
| 73 | + public static function add_slurp_link_to_gateway($existing_content) { |
|
| 74 | + echo EEH_Template::display_template(EED_MIJIREH_SLURPER_PATH.'templates/additional_content_on_gateway.template.php', array(), true).$existing_content; |
|
| 75 | 75 | } |
| 76 | - public static function slurping_in_progress_notice(){ |
|
| 77 | - EEH_Template::display_template( EED_MIJIREH_SLURPER_PATH.'templates/slurping_in_progress_notice.template.php', array() ); |
|
| 76 | + public static function slurping_in_progress_notice() { |
|
| 77 | + EEH_Template::display_template(EED_MIJIREH_SLURPER_PATH.'templates/slurping_in_progress_notice.template.php', array()); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /** |
@@ -83,10 +83,10 @@ discard block |
||
| 83 | 83 | * need to first make it). If the special arg is present, redirects the user to the slurp page's edit page |
| 84 | 84 | * @return void |
| 85 | 85 | */ |
| 86 | - public static function check_for_edit_slurp_page(){ |
|
| 87 | - if(isset($_GET['mijireh_edit_slurp_page']) && $_GET['mijireh_edit_slurp_page'] == 'true'){ |
|
| 86 | + public static function check_for_edit_slurp_page() { |
|
| 87 | + if (isset($_GET['mijireh_edit_slurp_page']) && $_GET['mijireh_edit_slurp_page'] == 'true') { |
|
| 88 | 88 | //check if we already have a slurping page |
| 89 | - if( ! $slurp_page_id = self::find_slurp_page() ){ |
|
| 89 | + if ( ! $slurp_page_id = self::find_slurp_page()) { |
|
| 90 | 90 | //if no slurp page yet, make one |
| 91 | 91 | $slurp_page_id = wp_insert_post( |
| 92 | 92 | array( |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | ) |
| 97 | 97 | ); |
| 98 | 98 | } |
| 99 | - wp_redirect(add_query_arg(array('post'=>$slurp_page_id,'action'=>'edit'),admin_url('post.php'))); |
|
| 99 | + wp_redirect(add_query_arg(array('post'=>$slurp_page_id, 'action'=>'edit'), admin_url('post.php'))); |
|
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | * Gets the post id which has the {{mj-checkout-form}} "shortcode" in it, otherwise null |
| 105 | 105 | * @return int |
| 106 | 106 | */ |
| 107 | - public static function find_slurp_page(){ |
|
| 107 | + public static function find_slurp_page() { |
|
| 108 | 108 | global $wpdb; |
| 109 | 109 | return $wpdb->get_var("SELECT id FROM {$wpdb->posts} WHERE post_content LIKE '%".EED_Mijireh_Slurper::mijireh_slurper_shortcode."%'"); |
| 110 | 110 | } |
@@ -117,9 +117,9 @@ discard block |
||
| 117 | 117 | public static function is_slurp_page() { |
| 118 | 118 | global $post; |
| 119 | 119 | $isSlurp = false; |
| 120 | - if(isset($post) && is_object($post)) { |
|
| 120 | + if (isset($post) && is_object($post)) { |
|
| 121 | 121 | $content = $post->post_content; |
| 122 | - if( strpos($content, EED_Mijireh_Slurper::mijireh_slurper_shortcode ) !== false ) { |
|
| 122 | + if (strpos($content, EED_Mijireh_Slurper::mijireh_slurper_shortcode) !== false) { |
|
| 123 | 123 | $isSlurp = true; |
| 124 | 124 | } |
| 125 | 125 | } |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | * @return void |
| 135 | 135 | */ |
| 136 | 136 | public static function add_slurp_page_metabox() { |
| 137 | - if(self::is_slurp_page() && EEM_Payment_Method::instance()->get_one_active( EEM_Payment_Method::scope_cart, array( array( 'PMD_type' => 'Mijireh' ) ) ) ){ |
|
| 137 | + if (self::is_slurp_page() && EEM_Payment_Method::instance()->get_one_active(EEM_Payment_Method::scope_cart, array(array('PMD_type' => 'Mijireh')))) { |
|
| 138 | 138 | add_meta_box( |
| 139 | 139 | 'slurp_meta_box', // $id |
| 140 | 140 | 'Mijireh Page Slurp', // $title |
@@ -153,15 +153,15 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | public static function slurp_page_metabox($post) { |
| 155 | 155 | global $wp; |
| 156 | - $mijireh_payment_method = EEM_Payment_Method::instance()->get_one_of_type( 'Mijireh' ); |
|
| 157 | - if( $mijireh_payment_method ){ |
|
| 158 | - $access_key = $mijireh_payment_method->get_extra_meta( 'access_key', TRUE ); |
|
| 156 | + $mijireh_payment_method = EEM_Payment_Method::instance()->get_one_of_type('Mijireh'); |
|
| 157 | + if ($mijireh_payment_method) { |
|
| 158 | + $access_key = $mijireh_payment_method->get_extra_meta('access_key', TRUE); |
|
| 159 | 159 | EEH_Template::display_template( |
| 160 | 160 | EED_MIJIREH_SLURPER_PATH.'templates/mijireh_slurp_page_metabox.template.php', |
| 161 | 161 | array( |
| 162 | 162 | 'mijireh_image_url'=> $mijireh_payment_method->button_url(), |
| 163 | 163 | 'access_key'=>$access_key, |
| 164 | - 'slurp_action_link'=> esc_url_raw( add_query_arg('mijireh_slurp_now','true', add_query_arg( $wp->query_string, '', '?'.$_SERVER['QUERY_STRING'] ))) |
|
| 164 | + 'slurp_action_link'=> esc_url_raw(add_query_arg('mijireh_slurp_now', 'true', add_query_arg($wp->query_string, '', '?'.$_SERVER['QUERY_STRING']))) |
|
| 165 | 165 | ) |
| 166 | 166 | ); |
| 167 | 167 | } |
@@ -172,9 +172,9 @@ discard block |
||
| 172 | 172 | * on a special arg being in the querystring |
| 173 | 173 | * @return void |
| 174 | 174 | */ |
| 175 | - public static function slurp_or_not(){ |
|
| 175 | + public static function slurp_or_not() { |
|
| 176 | 176 | //check if this page has the right mijire 'shortcode' and if they've specified to slurp it |
| 177 | - if(isset($_GET['mijireh_slurp_now']) && $_GET['mijireh_slurp_now'] == 'true' && EED_Mijireh_Slurper::is_slurp_page()){ |
|
| 177 | + if (isset($_GET['mijireh_slurp_now']) && $_GET['mijireh_slurp_now'] == 'true' && EED_Mijireh_Slurper::is_slurp_page()) { |
|
| 178 | 178 | EED_Mijireh_Slurper::slurp_now(); |
| 179 | 179 | } |
| 180 | 180 | } |
@@ -183,22 +183,22 @@ discard block |
||
| 183 | 183 | * Sends a request to mijireh to slurp the current $post, and then redirects the user back to the current page without the |
| 184 | 184 | * special querystring arg indicating to slurp. Also, should temporarily make the current post published, then revert it to its previous status |
| 185 | 185 | */ |
| 186 | - public static function slurp_now(){ |
|
| 186 | + public static function slurp_now() { |
|
| 187 | 187 | global $post; |
| 188 | - if ( $post->post_status != 'publish' ) { |
|
| 188 | + if ($post->post_status != 'publish') { |
|
| 189 | 189 | //make sure the post is published at least while slurping |
| 190 | 190 | $post->post_status = 'publish'; |
| 191 | 191 | wp_update_post($post); |
| 192 | 192 | } |
| 193 | - $mijireh_gateway = EEM_Payment_Method::instance()->get_one_of_type( 'Mijireh' ); |
|
| 194 | - $access_key = $mijireh_gateway->get_extra_meta( 'access_key', TRUE ); |
|
| 193 | + $mijireh_gateway = EEM_Payment_Method::instance()->get_one_of_type('Mijireh'); |
|
| 194 | + $access_key = $mijireh_gateway->get_extra_meta('access_key', TRUE); |
|
| 195 | 195 | // 'slurp_url'=>get_permalink($post), |
| 196 | 196 | // 'page_id'=>$post->ID, |
| 197 | 197 | // 'return_url'=>$return_url |
| 198 | 198 | $url = 'https://secure.mijireh.com/api/1/slurps'; |
| 199 | 199 | $args = array( |
| 200 | 200 | 'headers' => array( |
| 201 | - 'Authorization' => 'Basic ' . base64_encode( $access_key . ':' ), |
|
| 201 | + 'Authorization' => 'Basic '.base64_encode($access_key.':'), |
|
| 202 | 202 | 'Accept'=>'application/json' |
| 203 | 203 | ), |
| 204 | 204 | 'body'=>json_encode( |
@@ -209,12 +209,12 @@ discard block |
||
| 209 | 209 | ) |
| 210 | 210 | ) |
| 211 | 211 | ); |
| 212 | - $response = wp_remote_post($url,$args); |
|
| 212 | + $response = wp_remote_post($url, $args); |
|
| 213 | 213 | //now redirect the user back to the same page |
| 214 | 214 | $redirect_args = $_GET; |
| 215 | 215 | unset($redirect_args['mijireh_slurp_now']); |
| 216 | - $url = add_query_arg($redirect_args,admin_url('post.php')); |
|
| 217 | - set_transient(EED_Mijireh_Slurper::slurp_started_transient_name,true); |
|
| 216 | + $url = add_query_arg($redirect_args, admin_url('post.php')); |
|
| 217 | + set_transient(EED_Mijireh_Slurper::slurp_started_transient_name, true); |
|
| 218 | 218 | // echo "redirect to $url"; |
| 219 | 219 | wp_redirect($url); |
| 220 | 220 | } |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | * @access public |
| 226 | 226 | * @return void |
| 227 | 227 | */ |
| 228 | - public function run( $WP ) { |
|
| 228 | + public function run($WP) { |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | } |
@@ -1,4 +1,6 @@ discard block |
||
| 1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
| 1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 2 | + exit('No direct script access allowed'); |
|
| 3 | +} |
|
| 2 | 4 | /** |
| 3 | 5 | * Event Espresso |
| 4 | 6 | * |
@@ -122,8 +124,7 @@ discard block |
||
| 122 | 124 | if( strpos($content, EED_Mijireh_Slurper::mijireh_slurper_shortcode ) !== false ) { |
| 123 | 125 | $isSlurp = true; |
| 124 | 126 | } |
| 125 | - } |
|
| 126 | - else { |
|
| 127 | + } else { |
|
| 127 | 128 | // echo '[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Check Slurp Page Failed: " . print_r($post, 1); |
| 128 | 129 | } |
| 129 | 130 | return $isSlurp; |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <tr> |
| 2 | - <th><?php _e("Mijireh Checkout Page Design", 'event_espresso');?><?php echo EEH_Template::get_help_tab_link( 'ee_mijireh_help_tab' ); ?></th> |
|
| 2 | + <th><?php _e("Mijireh Checkout Page Design", 'event_espresso'); ?><?php echo EEH_Template::get_help_tab_link('ee_mijireh_help_tab'); ?></th> |
|
| 3 | 3 | <td> |
| 4 | - <a href="?mijireh_edit_slurp_page=true"><?php _e("Edit Slurp Page", 'event_espresso');?></a> |
|
| 4 | + <a href="?mijireh_edit_slurp_page=true"><?php _e("Edit Slurp Page", 'event_espresso'); ?></a> |
|
| 5 | 5 | </td> |
| 6 | 6 | </tr> |
| 7 | 7 | \ No newline at end of file |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <div id='mijireh_notice' class='mijireh-info alert-message info' data-alert='alert'> |
| 2 | - <div class='mijireh-logo'><img src='<?php echo $mijireh_image_url;?>' alt='<?php printf( esc_attr__( '%s Checkout Logo', 'event_espresso' ), 'Mijereh' ); ?>'></div> |
|
| 2 | + <div class='mijireh-logo'><img src='<?php echo $mijireh_image_url; ?>' alt='<?php printf(esc_attr__('%s Checkout Logo', 'event_espresso'), 'Mijereh'); ?>'></div> |
|
| 3 | 3 | <div class='mijireh-blurb'> |
| 4 | - <h2><?php _e("Slurp Into Mijireh", 'event_espresso');?></h2> |
|
| 5 | - <p><?php printf(__("Design the page how you want, and be sure to include the special text {{mj-checkout-form}} to indicate where to place Mijireh's Checkout Form. You may want to read %s Mijireh's instructions on slurping%s.", 'event_espresso'),"<a href='http://www.mijireh.com/docs/what-is-page-slurp/'>","</a>");?> |
|
| 4 | + <h2><?php _e("Slurp Into Mijireh", 'event_espresso'); ?></h2> |
|
| 5 | + <p><?php printf(__("Design the page how you want, and be sure to include the special text {{mj-checkout-form}} to indicate where to place Mijireh's Checkout Form. You may want to read %s Mijireh's instructions on slurping%s.", 'event_espresso'), "<a href='http://www.mijireh.com/docs/what-is-page-slurp/'>", "</a>"); ?> |
|
| 6 | 6 | |
| 7 | 7 | <p class='aligncenter'><a href='<?php echo $slurp_action_link?>' id='page_slurp' class='button-primary'>Slurp This Page!</a></p> |
| 8 | 8 | <p class="aligncenter"><a class="nobold" href="https://secure.mijireh.com/checkout/<?php echo $access_key?>" id="view_slurp" target="_new">Preview Checkout Page</a></p> |
@@ -1,3 +1,3 @@ |
||
| 1 | 1 | <div class="updated"> |
| 2 | - <p><?php _e( "Mijireh is currently slurping your content. This will usually take a few minutes. Please login to Mijireh to see the slurp's progress", 'event_espresso' ); ?></p> |
|
| 2 | + <p><?php _e("Mijireh is currently slurping your content. This will usually take a few minutes. Please login to Mijireh to see the slurp's progress", 'event_espresso'); ?></p> |
|
| 3 | 3 | </div> |
| 4 | 4 | \ No newline at end of file |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 4 | 4 | exit('No direct script access allowed'); |
| 5 | 5 | |
| 6 | 6 | /** |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * |
| 26 | 26 | * ------------------------------------------------------------------------ |
| 27 | 27 | */ |
| 28 | -class EE_PMT_Aim extends EE_PMT_Base{ |
|
| 28 | +class EE_PMT_Aim extends EE_PMT_Base { |
|
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | require_once($this->file_folder().'EEG_Aim.gateway.php'); |
| 38 | 38 | $this->_gateway = new EEG_AIM(); |
| 39 | 39 | $this->_pretty_name = __("Authorize.net AIM", 'event_espresso'); |
| 40 | - $this->_default_description = __( 'Please provide the following billing information.', 'event_espresso' ); |
|
| 40 | + $this->_default_description = __('Please provide the following billing information.', 'event_espresso'); |
|
| 41 | 41 | $this->_requires_https = true; |
| 42 | 42 | parent::__construct($pm_instance); |
| 43 | 43 | } |
@@ -47,26 +47,26 @@ discard block |
||
| 47 | 47 | * @param \EE_Transaction $transaction |
| 48 | 48 | * @return EE_Billing_Info_Form |
| 49 | 49 | */ |
| 50 | - public function generate_new_billing_form( EE_Transaction $transaction = NULL ) { |
|
| 51 | - $billing_form = new EE_Billing_Attendee_Info_Form($this->_pm_instance,array( |
|
| 50 | + public function generate_new_billing_form(EE_Transaction $transaction = NULL) { |
|
| 51 | + $billing_form = new EE_Billing_Attendee_Info_Form($this->_pm_instance, array( |
|
| 52 | 52 | 'name'=>'AIM_Form', |
| 53 | 53 | 'subsections'=>array( |
| 54 | 54 | 'credit_card'=>new EE_Credit_Card_Input(array( |
| 55 | 55 | 'required'=>true, |
| 56 | - 'html_label_text' => __( 'Card Number', 'event_espresso' ) |
|
| 56 | + 'html_label_text' => __('Card Number', 'event_espresso') |
|
| 57 | 57 | )), |
| 58 | 58 | 'exp_month'=>new EE_Credit_Card_Month_Input(true, array( |
| 59 | 59 | 'required'=>true, |
| 60 | - 'html_label_text' => __( 'Expiry Month', 'event_espresso' ) |
|
| 60 | + 'html_label_text' => __('Expiry Month', 'event_espresso') |
|
| 61 | 61 | )), |
| 62 | - 'exp_year'=>new EE_Credit_Card_Year_Input( array( ' |
|
| 62 | + 'exp_year'=>new EE_Credit_Card_Year_Input(array(' |
|
| 63 | 63 | required'=> true, |
| 64 | - 'html_label_text' => __( 'Expiry Year', 'event_espresso' ) ) ), |
|
| 65 | - 'cvv'=>new EE_CVV_Input( array( |
|
| 66 | - 'html_label_text' => __( 'CVV', 'event_espresso' ) ) ), |
|
| 64 | + 'html_label_text' => __('Expiry Year', 'event_espresso'))), |
|
| 65 | + 'cvv'=>new EE_CVV_Input(array( |
|
| 66 | + 'html_label_text' => __('CVV', 'event_espresso') )), |
|
| 67 | 67 | ) |
| 68 | 68 | )); |
| 69 | - return $this->apply_billing_form_debug_settings( $billing_form ); |
|
| 69 | + return $this->apply_billing_form_debug_settings($billing_form); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | |
@@ -78,17 +78,17 @@ discard block |
||
| 78 | 78 | * @param \EE_Billing_Info_Form $billing_form |
| 79 | 79 | * @return \EE_Billing_Info_Form |
| 80 | 80 | */ |
| 81 | - public function apply_billing_form_debug_settings( EE_Billing_Info_Form $billing_form ) { |
|
| 82 | - if ( $this->_pm_instance->debug_mode() || $this->_pm_instance->get_extra_meta( 'test_transactions', TRUE, FALSE )) { |
|
| 83 | - $billing_form->get_input( 'credit_card' )->set_default( '4007000000027' ); |
|
| 84 | - $billing_form->get_input( 'exp_year' )->set_default( '2020' ); |
|
| 85 | - $billing_form->get_input( 'cvv' )->set_default(( '123' )); |
|
| 81 | + public function apply_billing_form_debug_settings(EE_Billing_Info_Form $billing_form) { |
|
| 82 | + if ($this->_pm_instance->debug_mode() || $this->_pm_instance->get_extra_meta('test_transactions', TRUE, FALSE)) { |
|
| 83 | + $billing_form->get_input('credit_card')->set_default('4007000000027'); |
|
| 84 | + $billing_form->get_input('exp_year')->set_default('2020'); |
|
| 85 | + $billing_form->get_input('cvv')->set_default(('123')); |
|
| 86 | 86 | $billing_form->add_subsections( |
| 87 | - array( 'fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html() ), |
|
| 87 | + array('fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html()), |
|
| 88 | 88 | 'credit_card' |
| 89 | 89 | ); |
| 90 | 90 | $billing_form->add_subsections( |
| 91 | - array( 'debug_content' => new EE_Form_Section_HTML_From_Template( dirname(__FILE__).DS.'templates'.DS.'authorize_net_aim_debug_info.template.php' )), |
|
| 91 | + array('debug_content' => new EE_Form_Section_HTML_From_Template(dirname(__FILE__).DS.'templates'.DS.'authorize_net_aim_debug_info.template.php')), |
|
| 92 | 92 | 'first_name' |
| 93 | 93 | ); |
| 94 | 94 | } |
@@ -107,17 +107,17 @@ discard block |
||
| 107 | 107 | 'extra_meta_inputs'=>array( |
| 108 | 108 | 'login_id'=>new EE_Text_Input( |
| 109 | 109 | array( |
| 110 | - 'html_label_text'=> sprintf( __("Authorize.net API Login ID %s", "event_espresso"), $this->get_help_tab_link() ), |
|
| 110 | + 'html_label_text'=> sprintf(__("Authorize.net API Login ID %s", "event_espresso"), $this->get_help_tab_link()), |
|
| 111 | 111 | 'required' => true ) |
| 112 | 112 | ), |
| 113 | 113 | 'transaction_key'=>new EE_Text_Input( |
| 114 | 114 | array( |
| 115 | - 'html_label_text'=> sprintf( __("Authorize.net Transaction Key %s", "event_espresso"), $this->get_help_tab_link() ), |
|
| 115 | + 'html_label_text'=> sprintf(__("Authorize.net Transaction Key %s", "event_espresso"), $this->get_help_tab_link()), |
|
| 116 | 116 | 'required' => true ) |
| 117 | 117 | ), |
| 118 | 118 | 'test_transactions'=>new EE_Yes_No_Input( |
| 119 | 119 | array( |
| 120 | - 'html_label_text'=> sprintf( __("Send test transactions? %s", 'event_espresso'), $this->get_help_tab_link() ), |
|
| 120 | + 'html_label_text'=> sprintf(__("Send test transactions? %s", 'event_espresso'), $this->get_help_tab_link()), |
|
| 121 | 121 | 'html_help_text'=> __("Send test transactions, even to live server", 'event_espresso'), |
| 122 | 122 | 'required' => true |
| 123 | 123 | ) |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | * @see EE_PMT_Base::help_tabs_config() |
| 135 | 135 | * @return array |
| 136 | 136 | */ |
| 137 | - public function help_tabs_config(){ |
|
| 137 | + public function help_tabs_config() { |
|
| 138 | 138 | return array( |
| 139 | 139 | $this->get_help_tab_name() => array( |
| 140 | 140 | 'title' => __('Authorize.net AIM Settings', 'event_espresso'), |
@@ -1,7 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | +if (!defined('EVENT_ESPRESSO_VERSION')) { |
|
| 4 | 4 | exit('No direct script access allowed'); |
| 5 | +} |
|
| 5 | 6 | |
| 6 | 7 | /** |
| 7 | 8 | * Event Espresso |