@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <h3><?php _e('Transaction Details', 'event_espresso'); ?></h3> |
| 2 | -<?php do_action( 'AHEE__thank_you_page_transaction_details_template__after_heading' ); ?> |
|
| 2 | +<?php do_action('AHEE__thank_you_page_transaction_details_template__after_heading'); ?> |
|
| 3 | 3 | |
| 4 | 4 | <div id="espresso-thank-you-page-transaction-details-dv"> |
| 5 | 5 | <table class='ee-table'> |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | <label><?php _e('Total Cost: ', 'event_espresso'); ?></label> |
| 10 | 10 | </td> |
| 11 | 11 | <td> |
| 12 | - <?php echo EEH_Template::format_currency( $transaction->total() ); ?> |
|
| 12 | + <?php echo EEH_Template::format_currency($transaction->total()); ?> |
|
| 13 | 13 | </td> |
| 14 | 14 | </tr> |
| 15 | 15 | <tr> |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | <label><?php _e('Amount Owing: ', 'event_espresso'); ?></label> |
| 18 | 18 | </td> |
| 19 | 19 | <td class="<?php echo ($transaction->paid() == $transaction->total()) ? 'ee-transaction-paid' : 'ee-transaction-unpaid' ?>"> |
| 20 | - <?php echo EEH_Template::format_currency( $transaction->remaining() ); ?> |
|
| 20 | + <?php echo EEH_Template::format_currency($transaction->remaining()); ?> |
|
| 21 | 21 | </td> |
| 22 | 22 | </tr> |
| 23 | 23 | <tr> |
@@ -25,8 +25,8 @@ discard block |
||
| 25 | 25 | <label><?php _e('Transaction Status: ', 'event_espresso'); ?></label> |
| 26 | 26 | </td> |
| 27 | 27 | <td> |
| 28 | - <?php $transaction->e_pretty_status( TRUE ); |
|
| 29 | - if ( $show_try_pay_again_link && ! $transaction->is_completed() ) { ?> |
|
| 28 | + <?php $transaction->e_pretty_status(TRUE); |
|
| 29 | + if ($show_try_pay_again_link && ! $transaction->is_completed()) { ?> |
|
| 30 | 30 | <span class="small-text"><a href='<?php echo $SPCO_payment_options_url?>'><?php _e('View Payment Options', 'event_espresso'); ?></a></span> |
| 31 | 31 | <?php } ?> |
| 32 | 32 | </td> |
@@ -39,11 +39,11 @@ discard block |
||
| 39 | 39 | <?php echo $primary_registrant_name; ?> |
| 40 | 40 | </td> |
| 41 | 41 | </tr> |
| 42 | - <?php do_action( 'AHEE__thank_you_page_transaction_details_template__after_transaction_table_row', $transaction ); ?> |
|
| 42 | + <?php do_action('AHEE__thank_you_page_transaction_details_template__after_transaction_table_row', $transaction); ?> |
|
| 43 | 43 | </tbody> |
| 44 | 44 | </table> |
| 45 | 45 | |
| 46 | -<?php if ( $show_try_pay_again_link && ! $transaction->is_completed() ) { ?> |
|
| 46 | +<?php if ($show_try_pay_again_link && ! $transaction->is_completed()) { ?> |
|
| 47 | 47 | <p class="small-text jst-rght"> |
| 48 | 48 | <a href='<?php echo $SPCO_payment_options_url?>'><?php _e("Click here to view Payment Options", 'event_espresso'); ?></a> |
| 49 | 49 | </p> |
@@ -52,6 +52,6 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | <?php }?> |
| 54 | 54 | |
| 55 | - <?php do_action( 'AHEE__thank_you_page_transaction_details_template__after_transaction_details' ); ?> |
|
| 55 | + <?php do_action('AHEE__thank_you_page_transaction_details_template__after_transaction_details'); ?> |
|
| 56 | 56 | |
| 57 | 57 | </div> |
@@ -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 | * |
@@ -89,7 +91,7 @@ discard block |
||
| 89 | 91 | $payment_method_slug = EE_Registry::instance()->REQ->get( 'ee_payment_method', NULL ); |
| 90 | 92 | if( $payment_method_slug ) { |
| 91 | 93 | $payment_method = EEM_Payment_Method::instance()->get_one_by_slug( $payment_method_slug ); |
| 92 | - }else{ |
|
| 94 | + } else{ |
|
| 93 | 95 | $payment_method = null; |
| 94 | 96 | } |
| 95 | 97 | /** @type EE_Payment_Processor $payment_processor */ |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | * @return void |
| 43 | 43 | */ |
| 44 | 44 | public static function set_hooks() { |
| 45 | - add_action( 'wp_loaded', array( 'EES_Espresso_Txn_Page', 'set_definitions' ), 2 ); |
|
| 45 | + add_action('wp_loaded', array('EES_Espresso_Txn_Page', 'set_definitions'), 2); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
@@ -63,8 +63,8 @@ discard block |
||
| 63 | 63 | * @return void |
| 64 | 64 | */ |
| 65 | 65 | public static function set_definitions() { |
| 66 | - define( 'TXN_PAGE_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS ); |
|
| 67 | - define( 'TXN_PAGE_TEMPLATES_PATH', str_replace( '\\', DS, plugin_dir_path( __FILE__ )) . 'templates' . DS ); |
|
| 66 | + define('TXN_PAGE_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS); |
|
| 67 | + define('TXN_PAGE_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
@@ -77,24 +77,24 @@ discard block |
||
| 77 | 77 | * @param WP $WP |
| 78 | 78 | * @return void |
| 79 | 79 | */ |
| 80 | - public function run( WP $WP ) { |
|
| 81 | - if ( EE_Registry::instance()->REQ->is_set('e_reg_url_link' )){ |
|
| 82 | - $this->_current_txn = EE_Registry::instance()->load_model( 'Transaction' )->get_transaction_from_reg_url_link(); |
|
| 80 | + public function run(WP $WP) { |
|
| 81 | + if (EE_Registry::instance()->REQ->is_set('e_reg_url_link')) { |
|
| 82 | + $this->_current_txn = EE_Registry::instance()->load_model('Transaction')->get_transaction_from_reg_url_link(); |
|
| 83 | 83 | } else { |
| 84 | 84 | $this->_current_txn = null; |
| 85 | 85 | } |
| 86 | - if ( $this->_current_txn instanceof EE_Transaction ) { |
|
| 87 | - $payment_method_slug = EE_Registry::instance()->REQ->get( 'ee_payment_method', NULL ); |
|
| 88 | - if( $payment_method_slug ) { |
|
| 89 | - $payment_method = EEM_Payment_Method::instance()->get_one_by_slug( $payment_method_slug ); |
|
| 90 | - }else{ |
|
| 86 | + if ($this->_current_txn instanceof EE_Transaction) { |
|
| 87 | + $payment_method_slug = EE_Registry::instance()->REQ->get('ee_payment_method', NULL); |
|
| 88 | + if ($payment_method_slug) { |
|
| 89 | + $payment_method = EEM_Payment_Method::instance()->get_one_by_slug($payment_method_slug); |
|
| 90 | + } else { |
|
| 91 | 91 | $payment_method = null; |
| 92 | 92 | } |
| 93 | 93 | /** @type EE_Payment_Processor $payment_processor */ |
| 94 | 94 | $payment_processor = EE_Registry::instance()->load_core('Payment_Processor'); |
| 95 | - $payment_processor->process_ipn( $_REQUEST, $this->_current_txn, $payment_method ); |
|
| 95 | + $payment_processor->process_ipn($_REQUEST, $this->_current_txn, $payment_method); |
|
| 96 | 96 | //allow gateways to add a filter to stop rendering the page |
| 97 | - if( apply_filters( 'FHEE__EES_Espresso_Txn_Page__run__exit', FALSE ) ){ |
|
| 97 | + if (apply_filters('FHEE__EES_Espresso_Txn_Page__run__exit', FALSE)) { |
|
| 98 | 98 | exit; |
| 99 | 99 | } |
| 100 | 100 | } |
@@ -111,8 +111,8 @@ discard block |
||
| 111 | 111 | * @param array $attributes |
| 112 | 112 | * @return string |
| 113 | 113 | */ |
| 114 | - public function process_shortcode( $attributes = array() ) { |
|
| 115 | - return __( 'This is the Event Espresso Transactions page. This page receives instant payment notification (IPN) requests and should have a status of published, but should not be easily accessible by site visitors. Do not add it to your website\'s navigation menu or link to it from another page. Also, do not delete it or change its status to private.', 'event_espresso' ); |
|
| 114 | + public function process_shortcode($attributes = array()) { |
|
| 115 | + return __('This is the Event Espresso Transactions page. This page receives instant payment notification (IPN) requests and should have a status of published, but should not be easily accessible by site visitors. Do not add it to your website\'s navigation menu or link to it from another page. Also, do not delete it or change its status to private.', 'event_espresso'); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | |
@@ -192,14 +192,14 @@ discard block |
||
| 192 | 192 | <?php _e('Show on all Pages:', 'event_espresso'); ?> |
| 193 | 193 | </label> |
| 194 | 194 | <?php |
| 195 | - echo EEH_Form_Fields::select( |
|
| 196 | - __('Show on all Pages:', 'event_espresso'), |
|
| 197 | - $instance['show_everywhere'], |
|
| 198 | - $yes_no_values, |
|
| 199 | - $this->get_field_name('show_everywhere'), |
|
| 200 | - $this->get_field_id('show_everywhere') |
|
| 201 | - ); |
|
| 202 | - ?> |
|
| 195 | + echo EEH_Form_Fields::select( |
|
| 196 | + __('Show on all Pages:', 'event_espresso'), |
|
| 197 | + $instance['show_everywhere'], |
|
| 198 | + $yes_no_values, |
|
| 199 | + $this->get_field_name('show_everywhere'), |
|
| 200 | + $this->get_field_id('show_everywhere') |
|
| 201 | + ); |
|
| 202 | + ?> |
|
| 203 | 203 | </p> |
| 204 | 204 | <p> |
| 205 | 205 | <label for="<?php echo $this->get_field_id('date_limit'); ?>"> |
@@ -282,13 +282,13 @@ discard block |
||
| 282 | 282 | extract($args); |
| 283 | 283 | |
| 284 | 284 | // add function to make the title a link |
| 285 | - add_filter('widget_title', array($this, 'make_the_title_a_link'), 15); |
|
| 285 | + add_filter('widget_title', array($this, 'make_the_title_a_link'), 15); |
|
| 286 | 286 | |
| 287 | 287 | // filter the title |
| 288 | 288 | $title = apply_filters('widget_title', $instance['title']); |
| 289 | 289 | |
| 290 | 290 | // remove the function from the filter, so it does not affect other widgets |
| 291 | - remove_filter('widget_title', array($this, 'make_the_title_a_link'), 15); |
|
| 291 | + remove_filter('widget_title', array($this, 'make_the_title_a_link'), 15); |
|
| 292 | 292 | |
| 293 | 293 | // Before widget (defined by themes). |
| 294 | 294 | echo $before_widget; |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | * @return string |
| 386 | 386 | */ |
| 387 | 387 | public function make_the_title_a_link($title) { |
| 388 | - return '<a href="' . EEH_Event_View::event_archive_url() . '">' . $title . '</a>'; |
|
| 388 | + return '<a href="' . EEH_Event_View::event_archive_url() . '">' . $title . '</a>'; |
|
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | } |
@@ -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 | * |
@@ -357,7 +359,7 @@ discard block |
||
| 357 | 359 | $single_time_format = apply_filters( 'FHEE__espresso_event_date_range__single_time_format', get_option( 'time_format' )); |
| 358 | 360 | if ( $date_range == TRUE ) { |
| 359 | 361 | echo espresso_event_date_range( $date_format, $time_format, $single_date_format, $single_time_format, $event->ID() ); |
| 360 | - }else{ |
|
| 362 | + } else{ |
|
| 361 | 363 | echo espresso_list_of_event_dates( $event->ID(), $date_format, $time_format, FALSE, NULL, TRUE, TRUE, $date_limit ); |
| 362 | 364 | } |
| 363 | 365 | } |
@@ -30,8 +30,8 @@ discard block |
||
| 30 | 30 | function __construct() { |
| 31 | 31 | parent::__construct( |
| 32 | 32 | 'ee-upcoming-events-widget', |
| 33 | - __( 'Event Espresso Upcoming Events', 'event_espresso' ), |
|
| 34 | - array( 'description' => __( 'A widget to display your upcoming events.', 'event_espresso' )), |
|
| 33 | + __('Event Espresso Upcoming Events', 'event_espresso'), |
|
| 34 | + array('description' => __('A widget to display your upcoming events.', 'event_espresso')), |
|
| 35 | 35 | array( |
| 36 | 36 | 'width' => 300, |
| 37 | 37 | 'height' => 350, |
@@ -49,10 +49,10 @@ discard block |
||
| 49 | 49 | * @param array $instance Previously saved values from database. |
| 50 | 50 | * @return string|void |
| 51 | 51 | */ |
| 52 | - public function form( $instance ) { |
|
| 52 | + public function form($instance) { |
|
| 53 | 53 | |
| 54 | - EE_Registry::instance()->load_helper( 'Form_Fields' ); |
|
| 55 | - EE_Registry::instance()->load_class( 'Question_Option', array(), FALSE, FALSE, TRUE ); |
|
| 54 | + EE_Registry::instance()->load_helper('Form_Fields'); |
|
| 55 | + EE_Registry::instance()->load_class('Question_Option', array(), FALSE, FALSE, TRUE); |
|
| 56 | 56 | // Set up some default widget settings. |
| 57 | 57 | $defaults = array( |
| 58 | 58 | 'title' => __('Upcoming Events', 'event_espresso'), |
@@ -67,12 +67,12 @@ discard block |
||
| 67 | 67 | 'image_size' => 'medium' |
| 68 | 68 | ); |
| 69 | 69 | |
| 70 | - $instance = wp_parse_args( (array) $instance, $defaults ); |
|
| 70 | + $instance = wp_parse_args((array) $instance, $defaults); |
|
| 71 | 71 | // don't add HTML labels for EE_Form_Fields generated inputs |
| 72 | - add_filter( 'FHEE__EEH_Form_Fields__label_html', '__return_empty_string' ); |
|
| 72 | + add_filter('FHEE__EEH_Form_Fields__label_html', '__return_empty_string'); |
|
| 73 | 73 | $yes_no_values = array( |
| 74 | - EE_Question_Option::new_instance( array( 'QSO_value' => FALSE, 'QSO_desc' => __('No', 'event_espresso'))), |
|
| 75 | - EE_Question_Option::new_instance( array( 'QSO_value' => TRUE, 'QSO_desc' => __('Yes', 'event_espresso'))) |
|
| 74 | + EE_Question_Option::new_instance(array('QSO_value' => FALSE, 'QSO_desc' => __('No', 'event_espresso'))), |
|
| 75 | + EE_Question_Option::new_instance(array('QSO_value' => TRUE, 'QSO_desc' => __('Yes', 'event_espresso'))) |
|
| 76 | 76 | ); |
| 77 | 77 | |
| 78 | 78 | ?> |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | <label for="<?php echo $this->get_field_id('title'); ?>"> |
| 84 | 84 | <?php _e('Title:', 'event_espresso'); ?> |
| 85 | 85 | </label> |
| 86 | - <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" /> |
|
| 86 | + <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" /> |
|
| 87 | 87 | </p> |
| 88 | 88 | <p> |
| 89 | 89 | <label for="<?php echo $this->get_field_id('category_name'); ?>"> |
@@ -92,16 +92,16 @@ discard block |
||
| 92 | 92 | <?php |
| 93 | 93 | $event_categories = array(); |
| 94 | 94 | /** @type EEM_Term $EEM_Term */ |
| 95 | - $EEM_Term = EE_Registry::instance()->load_model( 'Term' ); |
|
| 96 | - $categories = $EEM_Term->get_all_ee_categories( TRUE ); |
|
| 97 | - if ( $categories ) { |
|
| 98 | - foreach ( $categories as $category ) { |
|
| 99 | - if ( $category instanceof EE_Term ) { |
|
| 100 | - $event_categories[] = EE_Question_Option::new_instance( array( 'QSO_value' => $category->get( 'slug' ), 'QSO_desc' => $category->get( 'name' ))); |
|
| 95 | + $EEM_Term = EE_Registry::instance()->load_model('Term'); |
|
| 96 | + $categories = $EEM_Term->get_all_ee_categories(TRUE); |
|
| 97 | + if ($categories) { |
|
| 98 | + foreach ($categories as $category) { |
|
| 99 | + if ($category instanceof EE_Term) { |
|
| 100 | + $event_categories[] = EE_Question_Option::new_instance(array('QSO_value' => $category->get('slug'), 'QSO_desc' => $category->get('name'))); |
|
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | - array_unshift( $event_categories, EE_Question_Option::new_instance( array( 'QSO_value' => '', 'QSO_desc' => __(' - display all - ', 'event_espresso')))); |
|
| 104 | + array_unshift($event_categories, EE_Question_Option::new_instance(array('QSO_value' => '', 'QSO_desc' => __(' - display all - ', 'event_espresso')))); |
|
| 105 | 105 | echo EEH_Form_Fields::select( |
| 106 | 106 | __('Event Category:', 'event_espresso'), |
| 107 | 107 | $instance['category_name'], |
@@ -138,16 +138,16 @@ discard block |
||
| 138 | 138 | <?php |
| 139 | 139 | $image_sizes = array(); |
| 140 | 140 | $sizes = get_intermediate_image_sizes(); |
| 141 | - if ( $sizes ) { |
|
| 141 | + if ($sizes) { |
|
| 142 | 142 | // loop thru images and create option objects out of them |
| 143 | - foreach ( $sizes as $image_size ) { |
|
| 144 | - $image_size = trim( $image_size ); |
|
| 143 | + foreach ($sizes as $image_size) { |
|
| 144 | + $image_size = trim($image_size); |
|
| 145 | 145 | // no big images plz |
| 146 | - if ( ! in_array( $image_size, array( 'large', 'post-thumbnail' ))) { |
|
| 147 | - $image_sizes[] = EE_Question_Option::new_instance( array( 'QSO_value' => $image_size, 'QSO_desc' => $image_size )); |
|
| 146 | + if ( ! in_array($image_size, array('large', 'post-thumbnail'))) { |
|
| 147 | + $image_sizes[] = EE_Question_Option::new_instance(array('QSO_value' => $image_size, 'QSO_desc' => $image_size)); |
|
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | - $image_sizes[] = EE_Question_Option::new_instance( array( 'QSO_value' => 'none', 'QSO_desc' => __('don\'t show images', 'event_espresso') )); |
|
| 150 | + $image_sizes[] = EE_Question_Option::new_instance(array('QSO_value' => 'none', 'QSO_desc' => __('don\'t show images', 'event_espresso'))); |
|
| 151 | 151 | } |
| 152 | 152 | echo EEH_Form_Fields::select( |
| 153 | 153 | __('Image Size:', 'event_espresso'), |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | <label for="<?php echo $this->get_field_id('date_limit'); ?>"> |
| 206 | 206 | <?php _e('Number of Dates to Display:', 'event_espresso'); ?> |
| 207 | 207 | </label> |
| 208 | - <input id="<?php echo $this->get_field_id('date_limit'); ?>" name="<?php echo $this->get_field_name('date_limit'); ?>" value="<?php echo esc_attr( $instance['date_limit'] ); ?>" size="3" type="text" /> |
|
| 208 | + <input id="<?php echo $this->get_field_id('date_limit'); ?>" name="<?php echo $this->get_field_name('date_limit'); ?>" value="<?php echo esc_attr($instance['date_limit']); ?>" size="3" type="text" /> |
|
| 209 | 209 | </p> |
| 210 | 210 | <p> |
| 211 | 211 | <label for="<?php echo $this->get_field_id('date_range'); ?>"> |
@@ -237,9 +237,9 @@ discard block |
||
| 237 | 237 | * |
| 238 | 238 | * @return array Updated safe values to be saved. |
| 239 | 239 | */ |
| 240 | - public function update( $new_instance, $old_instance ) { |
|
| 240 | + public function update($new_instance, $old_instance) { |
|
| 241 | 241 | $instance = $old_instance; |
| 242 | - $instance['title'] = ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; |
|
| 242 | + $instance['title'] = ! empty($new_instance['title']) ? strip_tags($new_instance['title']) : ''; |
|
| 243 | 243 | $instance['category_name'] = $new_instance['category_name']; |
| 244 | 244 | $instance['show_expired'] = $new_instance['show_expired']; |
| 245 | 245 | $instance['limit'] = $new_instance['limit']; |
@@ -262,20 +262,20 @@ discard block |
||
| 262 | 262 | * @param array $args Widget arguments. |
| 263 | 263 | * @param array $instance Saved values from database. |
| 264 | 264 | */ |
| 265 | - public function widget( $args, $instance ) { |
|
| 265 | + public function widget($args, $instance) { |
|
| 266 | 266 | |
| 267 | 267 | global $post; |
| 268 | 268 | // make sure there is some kinda post object |
| 269 | - if ( $post instanceof WP_Post ) { |
|
| 269 | + if ($post instanceof WP_Post) { |
|
| 270 | 270 | $before_widget = ''; |
| 271 | 271 | $before_title = ''; |
| 272 | 272 | $after_title = ''; |
| 273 | 273 | $after_widget = ''; |
| 274 | 274 | // but NOT an events archives page, cuz that would be like two event lists on the same page |
| 275 | - $show_everywhere = isset( $instance['show_everywhere'] ) ? (bool) absint( $instance['show_everywhere'] ) : TRUE; |
|
| 276 | - if ( $show_everywhere || ! ( $post->post_type == 'espresso_events' && is_archive() )) { |
|
| 275 | + $show_everywhere = isset($instance['show_everywhere']) ? (bool) absint($instance['show_everywhere']) : TRUE; |
|
| 276 | + if ($show_everywhere || ! ($post->post_type == 'espresso_events' && is_archive())) { |
|
| 277 | 277 | // let's use some of the event helper functions' |
| 278 | - EE_Registry::instance()->load_helper( 'Event_View' ); |
|
| 278 | + EE_Registry::instance()->load_helper('Event_View'); |
|
| 279 | 279 | // make separate vars out of attributes |
| 280 | 280 | |
| 281 | 281 | |
@@ -293,76 +293,76 @@ discard block |
||
| 293 | 293 | // Before widget (defined by themes). |
| 294 | 294 | echo $before_widget; |
| 295 | 295 | // Display the widget title if one was input (before and after defined by themes). |
| 296 | - if ( ! empty( $title )) { |
|
| 297 | - echo $before_title . $title . $after_title; |
|
| 296 | + if ( ! empty($title)) { |
|
| 297 | + echo $before_title.$title.$after_title; |
|
| 298 | 298 | } |
| 299 | 299 | // grab widget settings |
| 300 | - $category = isset( $instance['category_name'] ) && ! empty( $instance['category_name'] ) ? $instance['category_name'] : FALSE; |
|
| 301 | - $show_expired = isset( $instance['show_expired'] ) ? (bool) absint( $instance['show_expired'] ) : FALSE; |
|
| 302 | - $image_size = isset( $instance['image_size'] ) && ! empty( $instance['image_size'] ) ? $instance['image_size'] : 'medium'; |
|
| 303 | - $show_desc = isset( $instance['show_desc'] ) ? (bool) absint( $instance['show_desc'] ) : TRUE; |
|
| 304 | - $show_dates = isset( $instance['show_dates'] ) ? (bool) absint( $instance['show_dates'] ) : TRUE; |
|
| 305 | - $date_limit = isset( $instance['date_limit'] ) && ! empty( $instance['date_limit'] ) ? $instance['date_limit'] : NULL; |
|
| 306 | - $date_range = isset( $instance['date_range'] ) && ! empty( $instance['date_range'] ) ? $instance['date_range'] : FALSE; |
|
| 300 | + $category = isset($instance['category_name']) && ! empty($instance['category_name']) ? $instance['category_name'] : FALSE; |
|
| 301 | + $show_expired = isset($instance['show_expired']) ? (bool) absint($instance['show_expired']) : FALSE; |
|
| 302 | + $image_size = isset($instance['image_size']) && ! empty($instance['image_size']) ? $instance['image_size'] : 'medium'; |
|
| 303 | + $show_desc = isset($instance['show_desc']) ? (bool) absint($instance['show_desc']) : TRUE; |
|
| 304 | + $show_dates = isset($instance['show_dates']) ? (bool) absint($instance['show_dates']) : TRUE; |
|
| 305 | + $date_limit = isset($instance['date_limit']) && ! empty($instance['date_limit']) ? $instance['date_limit'] : NULL; |
|
| 306 | + $date_range = isset($instance['date_range']) && ! empty($instance['date_range']) ? $instance['date_range'] : FALSE; |
|
| 307 | 307 | // start to build our where clause |
| 308 | 308 | $where = array( |
| 309 | 309 | // 'Datetime.DTT_is_primary' => 1, |
| 310 | 310 | 'status' => 'publish' |
| 311 | 311 | ); |
| 312 | 312 | // add category |
| 313 | - if ( $category ) { |
|
| 313 | + if ($category) { |
|
| 314 | 314 | $where['Term_Taxonomy.taxonomy'] = 'espresso_event_categories'; |
| 315 | 315 | $where['Term_Taxonomy.Term.slug'] = $category; |
| 316 | 316 | } |
| 317 | 317 | // if NOT expired then we want events that start today or in the future |
| 318 | - if ( ! $show_expired ) { |
|
| 319 | - $where['Datetime.DTT_EVT_end'] = array( '>=', current_time( 'mysql' )); |
|
| 318 | + if ( ! $show_expired) { |
|
| 319 | + $where['Datetime.DTT_EVT_end'] = array('>=', current_time('mysql')); |
|
| 320 | 320 | } |
| 321 | 321 | // run the query |
| 322 | - $events = EE_Registry::instance()->load_model( 'Event' )->get_all( array( |
|
| 322 | + $events = EE_Registry::instance()->load_model('Event')->get_all(array( |
|
| 323 | 323 | $where, |
| 324 | - 'limit' => $instance['limit'] > 0 ? '0,' . $instance['limit'] : '0,10', |
|
| 324 | + 'limit' => $instance['limit'] > 0 ? '0,'.$instance['limit'] : '0,10', |
|
| 325 | 325 | 'order_by' => 'Datetime.DTT_EVT_start', |
| 326 | 326 | 'order' => 'ASC', |
| 327 | 327 | 'group_by' => 'EVT_ID' |
| 328 | 328 | )); |
| 329 | 329 | |
| 330 | - if ( ! empty( $events )) { |
|
| 330 | + if ( ! empty($events)) { |
|
| 331 | 331 | echo '<ul class="ee-upcoming-events-widget-ul">'; |
| 332 | - foreach ( $events as $event ) { |
|
| 333 | - if ( $event instanceof EE_Event && ( !is_single() || $post->ID != $event->ID() ) ) { |
|
| 332 | + foreach ($events as $event) { |
|
| 333 | + if ($event instanceof EE_Event && ( ! is_single() || $post->ID != $event->ID())) { |
|
| 334 | 334 | //printr( $event, '$event <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
| 335 | - echo '<li id="ee-upcoming-events-widget-li-' . $event->ID() . '" class="ee-upcoming-events-widget-li">'; |
|
| 335 | + echo '<li id="ee-upcoming-events-widget-li-'.$event->ID().'" class="ee-upcoming-events-widget-li">'; |
|
| 336 | 336 | // how big is the event name ? |
| 337 | - $name_length = strlen( $event->name() ); |
|
| 338 | - switch( $name_length ) { |
|
| 337 | + $name_length = strlen($event->name()); |
|
| 338 | + switch ($name_length) { |
|
| 339 | 339 | case $name_length > 70 : |
| 340 | - $len_class = ' three-line'; |
|
| 340 | + $len_class = ' three-line'; |
|
| 341 | 341 | break; |
| 342 | 342 | case $name_length > 35 : |
| 343 | - $len_class = ' two-line'; |
|
| 343 | + $len_class = ' two-line'; |
|
| 344 | 344 | break; |
| 345 | 345 | default : |
| 346 | - $len_class = ' one-line'; |
|
| 346 | + $len_class = ' one-line'; |
|
| 347 | 347 | } |
| 348 | - echo '<h5 class="ee-upcoming-events-widget-title-h5"><a class="ee-widget-event-name-a' . $len_class . '" href="' . get_permalink( $event->ID() ) . '">' . $event->name() . '</a></h5>'; |
|
| 349 | - if ( has_post_thumbnail( $event->ID() ) && $image_size != 'none' ) { |
|
| 350 | - echo '<div class="ee-upcoming-events-widget-img-dv"><a class="ee-upcoming-events-widget-img" href="' . get_permalink( $event->ID() ) . '">' . get_the_post_thumbnail( $event->ID(), $image_size ) . '</a></div>'; |
|
| 348 | + echo '<h5 class="ee-upcoming-events-widget-title-h5"><a class="ee-widget-event-name-a'.$len_class.'" href="'.get_permalink($event->ID()).'">'.$event->name().'</a></h5>'; |
|
| 349 | + if (has_post_thumbnail($event->ID()) && $image_size != 'none') { |
|
| 350 | + echo '<div class="ee-upcoming-events-widget-img-dv"><a class="ee-upcoming-events-widget-img" href="'.get_permalink($event->ID()).'">'.get_the_post_thumbnail($event->ID(), $image_size).'</a></div>'; |
|
| 351 | 351 | } |
| 352 | - $desc = $event->short_description( 25 ); |
|
| 353 | - if ( $show_dates ) { |
|
| 354 | - $date_format = apply_filters( 'FHEE__espresso_event_date_range__date_format', get_option( 'date_format' )); |
|
| 355 | - $time_format = apply_filters( 'FHEE__espresso_event_date_range__time_format', get_option( 'time_format' )); |
|
| 356 | - $single_date_format = apply_filters( 'FHEE__espresso_event_date_range__single_date_format', get_option( 'date_format' )); |
|
| 357 | - $single_time_format = apply_filters( 'FHEE__espresso_event_date_range__single_time_format', get_option( 'time_format' )); |
|
| 358 | - if ( $date_range == TRUE ) { |
|
| 359 | - echo espresso_event_date_range( $date_format, $time_format, $single_date_format, $single_time_format, $event->ID() ); |
|
| 360 | - }else{ |
|
| 361 | - echo espresso_list_of_event_dates( $event->ID(), $date_format, $time_format, FALSE, NULL, TRUE, TRUE, $date_limit ); |
|
| 352 | + $desc = $event->short_description(25); |
|
| 353 | + if ($show_dates) { |
|
| 354 | + $date_format = apply_filters('FHEE__espresso_event_date_range__date_format', get_option('date_format')); |
|
| 355 | + $time_format = apply_filters('FHEE__espresso_event_date_range__time_format', get_option('time_format')); |
|
| 356 | + $single_date_format = apply_filters('FHEE__espresso_event_date_range__single_date_format', get_option('date_format')); |
|
| 357 | + $single_time_format = apply_filters('FHEE__espresso_event_date_range__single_time_format', get_option('time_format')); |
|
| 358 | + if ($date_range == TRUE) { |
|
| 359 | + echo espresso_event_date_range($date_format, $time_format, $single_date_format, $single_time_format, $event->ID()); |
|
| 360 | + } else { |
|
| 361 | + echo espresso_list_of_event_dates($event->ID(), $date_format, $time_format, FALSE, NULL, TRUE, TRUE, $date_limit); |
|
| 362 | 362 | } |
| 363 | 363 | } |
| 364 | - if ( $show_desc && $desc ) { |
|
| 365 | - echo '<p style="margin-top: .5em">' . $desc . '</p>'; |
|
| 364 | + if ($show_desc && $desc) { |
|
| 365 | + echo '<p style="margin-top: .5em">'.$desc.'</p>'; |
|
| 366 | 366 | } |
| 367 | 367 | echo '</li>'; |
| 368 | 368 | } |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | * @return string |
| 386 | 386 | */ |
| 387 | 387 | public function make_the_title_a_link($title) { |
| 388 | - return '<a href="' . EEH_Event_View::event_archive_url() . '">' . $title . '</a>'; |
|
| 388 | + return '<a href="'.EEH_Event_View::event_archive_url().'">'.$title.'</a>'; |
|
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | } |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | * @param string $path url path to recaptcha server. |
| 89 | 89 | * @param array $data array of parameters to be sent. |
| 90 | 90 | * |
| 91 | - * @return array response |
|
| 91 | + * @return string response |
|
| 92 | 92 | */ |
| 93 | 93 | private function _submitHTTPGet($path, $data) |
| 94 | 94 | { |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | /** |
| 34 | 34 | * A ReCaptchaResponse is returned from checkAnswer(). |
| 35 | 35 | */ |
| 36 | -if ( ! class_exists( 'ReCaptchaResponse' )) { |
|
| 36 | +if ( ! class_exists('ReCaptchaResponse')) { |
|
| 37 | 37 | class ReCaptchaResponse |
| 38 | 38 | { |
| 39 | 39 | public $success; |
@@ -58,9 +58,9 @@ discard block |
||
| 58 | 58 | { |
| 59 | 59 | if ($secret == null || $secret == "") { |
| 60 | 60 | die("To use reCAPTCHA you must get an API key from <a href='" |
| 61 | - . self::$_signupUrl . "'>" . self::$_signupUrl . "</a>"); |
|
| 61 | + . self::$_signupUrl."'>".self::$_signupUrl."</a>"); |
|
| 62 | 62 | } |
| 63 | - $this->_secret=$secret; |
|
| 63 | + $this->_secret = $secret; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -74,11 +74,11 @@ discard block |
||
| 74 | 74 | { |
| 75 | 75 | $req = ""; |
| 76 | 76 | foreach ($data as $key => $value) { |
| 77 | - $req .= $key . '=' . urlencode(stripslashes($value)) . '&'; |
|
| 77 | + $req .= $key.'='.urlencode(stripslashes($value)).'&'; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | // Cut the last '&' |
| 81 | - $req=substr($req, 0, strlen($req)-1); |
|
| 81 | + $req = substr($req, 0, strlen($req) - 1); |
|
| 82 | 82 | return $req; |
| 83 | 83 | } |
| 84 | 84 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | private function _submitHTTPGet($path, $data) |
| 94 | 94 | { |
| 95 | 95 | $req = $this->_encodeQS($data); |
| 96 | - $response = file_get_contents($path . $req); |
|
| 96 | + $response = file_get_contents($path.$req); |
|
| 97 | 97 | return $response; |
| 98 | 98 | } |
| 99 | 99 | |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | |
| 119 | 119 | $getResponse = $this->_submitHttpGet( |
| 120 | 120 | self::$_siteVerifyUrl, |
| 121 | - array ( |
|
| 121 | + array( |
|
| 122 | 122 | 'secret' => $this->_secret, |
| 123 | 123 | 'remoteip' => $remoteIp, |
| 124 | 124 | 'v' => self::$_version, |
@@ -675,7 +675,6 @@ |
||
| 675 | 675 | * Utility method for child classes to get the contents of a template file and return |
| 676 | 676 | * |
| 677 | 677 | * We're assuming the child messenger class has already setup template args! |
| 678 | - * @param string $template url for template |
|
| 679 | 678 | * @param bool $preview if true we use the preview wrapper otherwise we use main wrapper. |
| 680 | 679 | * @return string |
| 681 | 680 | */ |
@@ -1,5 +1,5 @@ discard block |
||
| 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 | /** |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | * @return void |
| 290 | 290 | */ |
| 291 | 291 | public function enqueue_scripts_styles() { |
| 292 | - do_action( 'AHEE__EE_messenger__enqueue_scripts_styles'); |
|
| 292 | + do_action('AHEE__EE_messenger__enqueue_scripts_styles'); |
|
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | |
| 326 | 326 | $this->_supports_labels->template_variation_description = __('These are different styles to choose from for the selected template structure. Usually these affect things like font style, color, borders etc. In some cases the styles will also make minor layout changes.'); |
| 327 | 327 | |
| 328 | - $this->_supports_labels = apply_filters( 'FHEE__EE_messenger___set_supports_labels_defaults___supports_labels', $this->_supports_labels, $this ); |
|
| 328 | + $this->_supports_labels = apply_filters('FHEE__EE_messenger___set_supports_labels_defaults___supports_labels', $this->_supports_labels, $this); |
|
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | |
@@ -340,10 +340,10 @@ discard block |
||
| 340 | 340 | * @return stdClass |
| 341 | 341 | */ |
| 342 | 342 | public function get_supports_labels() { |
| 343 | - if ( empty( $this->_supports_labels->template_pack ) || empty( $this->_supports_labels->template_variation) ) { |
|
| 343 | + if (empty($this->_supports_labels->template_pack) || empty($this->_supports_labels->template_variation)) { |
|
| 344 | 344 | $this->_set_supports_labels_defaults(); |
| 345 | 345 | } |
| 346 | - return apply_filters( 'FHEE__EE_messenger__get_supports_labels', $this->_supports_labels, $this ); |
|
| 346 | + return apply_filters('FHEE__EE_messenger__get_supports_labels', $this->_supports_labels, $this); |
|
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | |
@@ -363,10 +363,10 @@ discard block |
||
| 363 | 363 | * |
| 364 | 364 | * @return string path or url for the requested variation. |
| 365 | 365 | */ |
| 366 | - public function get_variation( EE_Messages_Template_Pack $pack, $message_type_name, $url = FALSE, $type = 'main', $variation = 'default', $skip_filters = FALSE ) { |
|
| 366 | + public function get_variation(EE_Messages_Template_Pack $pack, $message_type_name, $url = FALSE, $type = 'main', $variation = 'default', $skip_filters = FALSE) { |
|
| 367 | 367 | $this->_tmp_pack = $pack; |
| 368 | - $variation_path = apply_filters( 'EE_messenger__get_variation__variation', false, $pack, $this->name, $message_type_name, $url, $type, $variation, $skip_filters ); |
|
| 369 | - $variation_path = empty( $variation_path ) ? $this->_tmp_pack->get_variation( $this->name, $message_type_name, $type, $variation, $url, '.css', $skip_filters ) : $variation_path; |
|
| 368 | + $variation_path = apply_filters('EE_messenger__get_variation__variation', false, $pack, $this->name, $message_type_name, $url, $type, $variation, $skip_filters); |
|
| 369 | + $variation_path = empty($variation_path) ? $this->_tmp_pack->get_variation($this->name, $message_type_name, $type, $variation, $url, '.css', $skip_filters) : $variation_path; |
|
| 370 | 370 | return $variation_path; |
| 371 | 371 | |
| 372 | 372 | } |
@@ -384,13 +384,13 @@ discard block |
||
| 384 | 384 | * @return array |
| 385 | 385 | */ |
| 386 | 386 | public function get_default_message_types() { |
| 387 | - $class = get_class( $this ); |
|
| 387 | + $class = get_class($this); |
|
| 388 | 388 | |
| 389 | 389 | //messenger specific filter |
| 390 | - $default_types = apply_filters( 'FHEE__' . $class . '__get_default_message_types__default_types', $this->_default_message_types, $this ); |
|
| 390 | + $default_types = apply_filters('FHEE__'.$class.'__get_default_message_types__default_types', $this->_default_message_types, $this); |
|
| 391 | 391 | |
| 392 | 392 | //all messengers filter |
| 393 | - $default_types = apply_filters( 'FHEE__EE_messenger__get_default_message_types__default_types', $default_types, $this ); |
|
| 393 | + $default_types = apply_filters('FHEE__EE_messenger__get_default_message_types__default_types', $default_types, $this); |
|
| 394 | 394 | return $default_types; |
| 395 | 395 | } |
| 396 | 396 | |
@@ -405,14 +405,14 @@ discard block |
||
| 405 | 405 | * @return array |
| 406 | 406 | */ |
| 407 | 407 | public function get_valid_message_types() { |
| 408 | - $class = get_class( $this ); |
|
| 408 | + $class = get_class($this); |
|
| 409 | 409 | |
| 410 | 410 | //messenger specific filter |
| 411 | 411 | //messenger specific filter |
| 412 | - $valid_types = apply_filters( 'FHEE__' . $class . '__get_valid_message_types__valid_types', $this->_valid_message_types, $this ); |
|
| 412 | + $valid_types = apply_filters('FHEE__'.$class.'__get_valid_message_types__valid_types', $this->_valid_message_types, $this); |
|
| 413 | 413 | |
| 414 | 414 | //all messengers filter |
| 415 | - $valid_types = apply_filters( 'FHEE__EE_messenger__get_valid_message_types__valid_types', $valid_types, $this ); |
|
| 415 | + $valid_types = apply_filters('FHEE__EE_messenger__get_valid_message_types__valid_types', $valid_types, $this); |
|
| 416 | 416 | return $valid_types; |
| 417 | 417 | } |
| 418 | 418 | |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | * @access public |
| 427 | 427 | * @param array $new_config Whatever is put in here will reset the _validator_config property |
| 428 | 428 | */ |
| 429 | - public function set_validator_config( $new_config ) { |
|
| 429 | + public function set_validator_config($new_config) { |
|
| 430 | 430 | $this->_validator_config = $new_config; |
| 431 | 431 | } |
| 432 | 432 | |
@@ -442,8 +442,8 @@ discard block |
||
| 442 | 442 | public function get_validator_config() { |
| 443 | 443 | $class = get_class($this); |
| 444 | 444 | |
| 445 | - $config = apply_filters( 'FHEE__' . $class . '__get_validator_config', $this->_validator_config, $this ); |
|
| 446 | - $config = apply_filters( 'FHEE__EE_messenger__get_validator_config', $config, $this ); |
|
| 445 | + $config = apply_filters('FHEE__'.$class.'__get_validator_config', $this->_validator_config, $this); |
|
| 446 | + $config = apply_filters('FHEE__EE_messenger__get_validator_config', $config, $this); |
|
| 447 | 447 | return $config; |
| 448 | 448 | } |
| 449 | 449 | |
@@ -460,8 +460,8 @@ discard block |
||
| 460 | 460 | * @access public |
| 461 | 461 | * @return string content for page |
| 462 | 462 | */ |
| 463 | - public function get_messenger_admin_page_content( $page, $action = null, $extra = array(), $message_types = array() ) { |
|
| 464 | - return $this->_get_admin_page_content( $page, $action, $extra, $message_types ); |
|
| 463 | + public function get_messenger_admin_page_content($page, $action = null, $extra = array(), $message_types = array()) { |
|
| 464 | + return $this->_get_admin_page_content($page, $action, $extra, $message_types); |
|
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | |
@@ -470,76 +470,76 @@ discard block |
||
| 470 | 470 | |
| 471 | 471 | |
| 472 | 472 | |
| 473 | - protected function _get_admin_content_events_edit( $message_types, $extra ) { |
|
| 473 | + protected function _get_admin_content_events_edit($message_types, $extra) { |
|
| 474 | 474 | //defaults |
| 475 | 475 | $template_args = array(); |
| 476 | 476 | $custom_templates = array(); |
| 477 | 477 | $selector_rows = ''; |
| 478 | 478 | |
| 479 | 479 | //we don't need message types here so we're just going to ignore. we do, however, expect the event id here. The event id is needed to provide a link to setup a custom template for this event. |
| 480 | - $event_id = isset( $extra['event'] ) ? $extra['event'] : NULL; |
|
| 480 | + $event_id = isset($extra['event']) ? $extra['event'] : NULL; |
|
| 481 | 481 | |
| 482 | - $template_wrapper_path = EE_LIBRARIES . 'messages/messenger/admin_templates/event_switcher_wrapper.template.php'; |
|
| 483 | - $template_row_path = EE_LIBRARIES . 'messages/messenger/admin_templates/event_switcher_row.template.php'; |
|
| 482 | + $template_wrapper_path = EE_LIBRARIES.'messages/messenger/admin_templates/event_switcher_wrapper.template.php'; |
|
| 483 | + $template_row_path = EE_LIBRARIES.'messages/messenger/admin_templates/event_switcher_row.template.php'; |
|
| 484 | 484 | |
| 485 | 485 | //array of template objects for global and custom (non-trashed) (but remember just for this messenger!) |
| 486 | - $global_templates = EEM_Message_Template_Group::instance()->get_all( array( array('MTP_messenger' => $this->name, 'MTP_is_global' => TRUE, 'MTP_is_active' => TRUE ) ) ); |
|
| 487 | - $templates_for_event = EEM_Message_Template_Group::instance()->get_all_custom_templates_by_event( $event_id, array( 'MTP_messenger' => $this->name, 'MTP_is_active' => TRUE ) ); |
|
| 488 | - $templates_for_event = !empty( $templates_for_event ) ? $templates_for_event : array(); |
|
| 486 | + $global_templates = EEM_Message_Template_Group::instance()->get_all(array(array('MTP_messenger' => $this->name, 'MTP_is_global' => TRUE, 'MTP_is_active' => TRUE))); |
|
| 487 | + $templates_for_event = EEM_Message_Template_Group::instance()->get_all_custom_templates_by_event($event_id, array('MTP_messenger' => $this->name, 'MTP_is_active' => TRUE)); |
|
| 488 | + $templates_for_event = ! empty($templates_for_event) ? $templates_for_event : array(); |
|
| 489 | 489 | |
| 490 | 490 | //so we need to setup the rows for the selectors and we use the global mtpgs (cause those will the active message template groups) |
| 491 | - foreach ( $global_templates as $mtpgID => $mtpg ) { |
|
| 491 | + foreach ($global_templates as $mtpgID => $mtpg) { |
|
| 492 | 492 | //verify this message type is supposed to show on this page |
| 493 | 493 | $mtp_obj = $mtpg->message_type_obj(); |
| 494 | - if ( ! $mtp_obj instanceof EE_message_type ) { |
|
| 494 | + if ( ! $mtp_obj instanceof EE_message_type) { |
|
| 495 | 495 | continue; |
| 496 | 496 | } |
| 497 | 497 | $mtp_obj->admin_registered_pages = (array) $mtp_obj->admin_registered_pages; |
| 498 | - if ( ! in_array( 'events_edit', $mtp_obj->admin_registered_pages ) ) |
|
| 498 | + if ( ! in_array('events_edit', $mtp_obj->admin_registered_pages)) |
|
| 499 | 499 | continue; |
| 500 | 500 | $stargs = array(); |
| 501 | 501 | $default_value = ''; |
| 502 | 502 | $select_values = array(); |
| 503 | 503 | $select_values[$mtpgID] = __('Global', 'event_espresso'); |
| 504 | - $default_value = array_key_exists( $mtpgID, $templates_for_event ) && ! $mtpg->get('MTP_is_override' ) ? $mtpgID : NULL; |
|
| 504 | + $default_value = array_key_exists($mtpgID, $templates_for_event) && ! $mtpg->get('MTP_is_override') ? $mtpgID : NULL; |
|
| 505 | 505 | |
| 506 | 506 | //if the override has been set for the global template, then that means even if there are custom templates already created we ignore them because of the set override. |
| 507 | 507 | |
| 508 | - if ( ! $mtpg->get('MTP_is_override' ) ) { |
|
| 508 | + if ( ! $mtpg->get('MTP_is_override')) { |
|
| 509 | 509 | //any custom templates for this message type? |
| 510 | - $custom_templates = EEM_Message_Template_Group::instance()->get_custom_message_template_by_m_and_mt( $this->name, $mtpg->message_type() ); |
|
| 510 | + $custom_templates = EEM_Message_Template_Group::instance()->get_custom_message_template_by_m_and_mt($this->name, $mtpg->message_type()); |
|
| 511 | 511 | |
| 512 | - foreach( $custom_templates as $cmtpgID => $cmtpg ) { |
|
| 512 | + foreach ($custom_templates as $cmtpgID => $cmtpg) { |
|
| 513 | 513 | $select_values[$cmtpgID] = $cmtpg->name(); |
| 514 | - $default_value = array_key_exists( $cmtpgID, $templates_for_event ) ? $cmtpgID : $default_value; |
|
| 514 | + $default_value = array_key_exists($cmtpgID, $templates_for_event) ? $cmtpgID : $default_value; |
|
| 515 | 515 | } |
| 516 | 516 | } |
| 517 | 517 | |
| 518 | 518 | //if there is no $default_value then we set it as the global |
| 519 | - $default_value = empty( $default_value ) ? $mtpgID : $default_value; |
|
| 519 | + $default_value = empty($default_value) ? $mtpgID : $default_value; |
|
| 520 | 520 | |
| 521 | - $edit_url = EEH_URL::add_query_args_and_nonce( array('page' => 'espresso_messages', 'action' => 'edit_message_template', 'id' => $default_value), admin_url('admin.php') ); |
|
| 522 | - $create_url = EEH_URL::add_query_args_and_nonce( array('page' => 'espresso_messages', 'action' => 'add_new_message_template', 'GRP_ID' => $default_value ), admin_url( 'admin.php' ) ); |
|
| 521 | + $edit_url = EEH_URL::add_query_args_and_nonce(array('page' => 'espresso_messages', 'action' => 'edit_message_template', 'id' => $default_value), admin_url('admin.php')); |
|
| 522 | + $create_url = EEH_URL::add_query_args_and_nonce(array('page' => 'espresso_messages', 'action' => 'add_new_message_template', 'GRP_ID' => $default_value), admin_url('admin.php')); |
|
| 523 | 523 | |
| 524 | - $st_args['mt_name'] = ucwords( $mtp_obj->label['singular'] ); |
|
| 524 | + $st_args['mt_name'] = ucwords($mtp_obj->label['singular']); |
|
| 525 | 525 | $st_args['mt_slug'] = $mtpg->message_type(); |
| 526 | 526 | $st_args['messenger_slug'] = $this->name; |
| 527 | - $st_args['selector'] = EEH_Form_Fields::select_input( 'event_message_templates_relation[' . $mtpgID . ']', $select_values, $default_value, 'data-messenger="' . $this->name . '" data-messagetype="' . $mtpg->message_type() . '"', 'message-template-selector' ); |
|
| 527 | + $st_args['selector'] = EEH_Form_Fields::select_input('event_message_templates_relation['.$mtpgID.']', $select_values, $default_value, 'data-messenger="'.$this->name.'" data-messagetype="'.$mtpg->message_type().'"', 'message-template-selector'); |
|
| 528 | 528 | |
| 529 | 529 | //note that message template group that has override_all_custom set will remove the ability to set a custom message template based off of the global (and that also in turn overrides any other custom templates). |
| 530 | - $st_args['create_button'] = $mtpg->get('MTP_is_override') ? '' : '<a data-messenger="' . $this->name . '" data-messagetype="' . $mtpg->message_type() . '" data-grpid="' . $default_value . '" target="_blank" href="' . $create_url . '" class="button button-small create-mtpg-button">' . __('Create New Custom', 'event_espresso') . '</a>'; |
|
| 531 | - $st_args['create_button'] = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_messages', 'espresso_messsages_add_new_message_template' ) ? $st_args['create_button'] : ''; |
|
| 532 | - $st_args['edit_button'] = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_message', 'espresso_messages_edit_message_template', $mtpgID ) ? '<a data-messagetype="' . $mtpg->message_type() . '" data-grpid="' . $default_value . '" target="_blank" href="' . $edit_url . '" class="button button-small edit-mtpg-button">' . __('Edit', 'event_espresso') . '</a>' : ''; |
|
| 533 | - $selector_rows .= EEH_Template::display_template( $template_row_path, $st_args, TRUE ); |
|
| 530 | + $st_args['create_button'] = $mtpg->get('MTP_is_override') ? '' : '<a data-messenger="'.$this->name.'" data-messagetype="'.$mtpg->message_type().'" data-grpid="'.$default_value.'" target="_blank" href="'.$create_url.'" class="button button-small create-mtpg-button">'.__('Create New Custom', 'event_espresso').'</a>'; |
|
| 531 | + $st_args['create_button'] = EE_Registry::instance()->CAP->current_user_can('ee_edit_messages', 'espresso_messsages_add_new_message_template') ? $st_args['create_button'] : ''; |
|
| 532 | + $st_args['edit_button'] = EE_Registry::instance()->CAP->current_user_can('ee_edit_message', 'espresso_messages_edit_message_template', $mtpgID) ? '<a data-messagetype="'.$mtpg->message_type().'" data-grpid="'.$default_value.'" target="_blank" href="'.$edit_url.'" class="button button-small edit-mtpg-button">'.__('Edit', 'event_espresso').'</a>' : ''; |
|
| 533 | + $selector_rows .= EEH_Template::display_template($template_row_path, $st_args, TRUE); |
|
| 534 | 534 | } |
| 535 | 535 | |
| 536 | 536 | //if no selectors present then get out. |
| 537 | - if ( empty( $selector_rows ) ) { |
|
| 537 | + if (empty($selector_rows)) { |
|
| 538 | 538 | return ''; |
| 539 | 539 | } |
| 540 | 540 | |
| 541 | 541 | $template_args['selector_rows'] = $selector_rows; |
| 542 | - return EEH_Template::display_template( $template_wrapper_path, $template_args, TRUE ); |
|
| 542 | + return EEH_Template::display_template($template_wrapper_path, $template_args, TRUE); |
|
| 543 | 543 | } |
| 544 | 544 | |
| 545 | 545 | |
@@ -554,8 +554,8 @@ discard block |
||
| 554 | 554 | * @return array $this->_template_fields |
| 555 | 555 | */ |
| 556 | 556 | public function get_template_fields() { |
| 557 | - $template_fields = apply_filters( 'FHEE__' . get_class($this) . '__get_template_fields', $this->_template_fields, $this ); |
|
| 558 | - $template_fields = apply_filters( 'FHEE__EE_messenger__get_template_fields', $template_fields, $this ); |
|
| 557 | + $template_fields = apply_filters('FHEE__'.get_class($this).'__get_template_fields', $this->_template_fields, $this); |
|
| 558 | + $template_fields = apply_filters('FHEE__EE_messenger__get_template_fields', $template_fields, $this); |
|
| 559 | 559 | return $template_fields; |
| 560 | 560 | } |
| 561 | 561 | |
@@ -568,9 +568,9 @@ discard block |
||
| 568 | 568 | * The following method doesn't NEED to be used by child classes but might be modified by the specific messenger |
| 569 | 569 | */ |
| 570 | 570 | protected function _set_template_value($item, $value) { |
| 571 | - if ( array_key_exists($item, $this->_template_fields) ) { |
|
| 572 | - $prop = '_' . $item; |
|
| 573 | - $this->$prop= $value; |
|
| 571 | + if (array_key_exists($item, $this->_template_fields)) { |
|
| 572 | + $prop = '_'.$item; |
|
| 573 | + $this->$prop = $value; |
|
| 574 | 574 | } |
| 575 | 575 | } |
| 576 | 576 | |
@@ -580,8 +580,8 @@ discard block |
||
| 580 | 580 | * @param EE_message_type $message_type The message type object used in combination with this messenger to generate the provided message. |
| 581 | 581 | * @return bool | WP_Error |
| 582 | 582 | */ |
| 583 | - public function send_message( $message, EE_message_type $message_type ) { |
|
| 584 | - $this->_validate_and_setup( $message ); |
|
| 583 | + public function send_message($message, EE_message_type $message_type) { |
|
| 584 | + $this->_validate_and_setup($message); |
|
| 585 | 585 | $this->_incoming_message_type = $message_type; |
| 586 | 586 | return $this->_send_message(); |
| 587 | 587 | } |
@@ -595,26 +595,26 @@ discard block |
||
| 595 | 595 | * @param bool $send true we will actually use the _send method (for test sends). FALSE we just return preview |
| 596 | 596 | * @return string return the message html content |
| 597 | 597 | */ |
| 598 | - public function get_preview( $message, EE_message_type $message_type, $send = FALSE ) { |
|
| 599 | - $this->_validate_and_setup( $message ); |
|
| 598 | + public function get_preview($message, EE_message_type $message_type, $send = FALSE) { |
|
| 599 | + $this->_validate_and_setup($message); |
|
| 600 | 600 | |
| 601 | 601 | $this->_incoming_message_type = $message_type; |
| 602 | 602 | |
| 603 | - if ( $send ) { |
|
| 603 | + if ($send) { |
|
| 604 | 604 | //are we overriding any existing template fields? |
| 605 | 605 | $settings = $this->get_existing_test_settings(); |
| 606 | - if ( !empty( $settings ) ) { |
|
| 607 | - foreach( $settings as $field => $value ) { |
|
| 608 | - $this->_set_template_value( $field, $value ); |
|
| 606 | + if ( ! empty($settings)) { |
|
| 607 | + foreach ($settings as $field => $value) { |
|
| 608 | + $this->_set_template_value($field, $value); |
|
| 609 | 609 | } |
| 610 | 610 | } |
| 611 | 611 | } |
| 612 | 612 | |
| 613 | 613 | //enqueue preview js so that any links/buttons on the page are disabled. |
| 614 | - if ( ! $send ) { |
|
| 614 | + if ( ! $send) { |
|
| 615 | 615 | //the below may seem liks duplication. However, typically if a messenger enqueues scripts/styles, it deregisters all existing wp scripts and styles first. So the second hook ensures our previewer still gets setup. |
| 616 | - add_action( 'wp_enqueue_scripts', array( $this, 'add_preview_script' ), 10 ); |
|
| 617 | - add_action( 'AHEE__EE_messenger__enqueue_scripts_styles', array( $this, 'add_preview_script' ), 10 ); |
|
| 616 | + add_action('wp_enqueue_scripts', array($this, 'add_preview_script'), 10); |
|
| 617 | + add_action('AHEE__EE_messenger__enqueue_scripts_styles', array($this, 'add_preview_script'), 10); |
|
| 618 | 618 | } |
| 619 | 619 | |
| 620 | 620 | return $send ? $this->_send_message() : $this->_preview(); |
@@ -631,12 +631,12 @@ discard block |
||
| 631 | 631 | * @return void |
| 632 | 632 | */ |
| 633 | 633 | public function add_preview_script() { |
| 634 | - wp_register_script( 'ee-messages-preview-js', EE_LIBRARIES_URL . 'messages/messenger/assets/js/ee-messages-preview.js', array( 'jquery' ), EVENT_ESPRESSO_VERSION, true ); |
|
| 634 | + wp_register_script('ee-messages-preview-js', EE_LIBRARIES_URL.'messages/messenger/assets/js/ee-messages-preview.js', array('jquery'), EVENT_ESPRESSO_VERSION, true); |
|
| 635 | 635 | |
| 636 | 636 | //error message |
| 637 | 637 | EE_Registry::$i18n_js_strings['links_disabled'] = __('All the links on this page have been disabled because this is a generated preview message for the purpose of ensuring layout, style, and content setup. To test generated links, you must trigger an actual message notification.', 'event_espresso'); |
| 638 | - wp_localize_script( 'ee-messages-preview-js', 'eei18n', EE_Registry::$i18n_js_strings ); |
|
| 639 | - wp_enqueue_script( 'ee-messages-preview-js' ); |
|
| 638 | + wp_localize_script('ee-messages-preview-js', 'eei18n', EE_Registry::$i18n_js_strings); |
|
| 639 | + wp_enqueue_script('ee-messages-preview-js'); |
|
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | |
@@ -647,23 +647,23 @@ discard block |
||
| 647 | 647 | * @param object $message message object |
| 648 | 648 | * @return void |
| 649 | 649 | */ |
| 650 | - protected function _validate_and_setup( $message ) { |
|
| 651 | - if ( !is_object( $message ) ) |
|
| 652 | - throw new EE_Error( __('Incoming "$message" must be an object', 'event_espresso' ) ); |
|
| 650 | + protected function _validate_and_setup($message) { |
|
| 651 | + if ( ! is_object($message)) |
|
| 652 | + throw new EE_Error(__('Incoming "$message" must be an object', 'event_espresso')); |
|
| 653 | 653 | |
| 654 | 654 | //verify we have the required template pack value on the $message object. |
| 655 | - if ( empty( $message->template_pack ) || ! $message->template_pack instanceof EE_Messages_Template_Pack ) { |
|
| 656 | - throw new EE_Error( __('Incoming $message object must have a EE_Messages_Template_Pack object assigned to the template_pack property', 'event_espresso' ) ); |
|
| 655 | + if (empty($message->template_pack) || ! $message->template_pack instanceof EE_Messages_Template_Pack) { |
|
| 656 | + throw new EE_Error(__('Incoming $message object must have a EE_Messages_Template_Pack object assigned to the template_pack property', 'event_espresso')); |
|
| 657 | 657 | } |
| 658 | 658 | |
| 659 | 659 | $this->_tmp_pack = $message->template_pack; |
| 660 | 660 | |
| 661 | - $this->_variation = !empty ( $message->variation ) ? $message->variation : 'default'; |
|
| 661 | + $this->_variation = ! empty ($message->variation) ? $message->variation : 'default'; |
|
| 662 | 662 | |
| 663 | 663 | $template_fields = $this->get_template_fields(); |
| 664 | 664 | |
| 665 | - foreach ( $template_fields as $template => $value ) { |
|
| 666 | - if ( $template !== 'extra' ) |
|
| 665 | + foreach ($template_fields as $template => $value) { |
|
| 666 | + if ($template !== 'extra') |
|
| 667 | 667 | $this->_set_template_value($template, $message->$template); |
| 668 | 668 | } |
| 669 | 669 | } |
@@ -679,21 +679,21 @@ discard block |
||
| 679 | 679 | * @param bool $preview if true we use the preview wrapper otherwise we use main wrapper. |
| 680 | 680 | * @return string |
| 681 | 681 | */ |
| 682 | - protected function _get_main_template( $preview = FALSE ) { |
|
| 682 | + protected function _get_main_template($preview = FALSE) { |
|
| 683 | 683 | $type = $preview ? 'preview' : 'main'; |
| 684 | 684 | |
| 685 | 685 | //first get inline css (will be empty if the messenger doesn't use it) |
| 686 | - $this->_template_args['inline_style'] = file_get_contents( $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, FALSE, $type, $this->_variation ), TRUE ); |
|
| 686 | + $this->_template_args['inline_style'] = file_get_contents($this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, FALSE, $type, $this->_variation), TRUE); |
|
| 687 | 687 | |
| 688 | - $wrapper_template = $this->_tmp_pack->get_wrapper( $this->name, $type ); |
|
| 688 | + $wrapper_template = $this->_tmp_pack->get_wrapper($this->name, $type); |
|
| 689 | 689 | |
| 690 | 690 | //check file exists and is readable |
| 691 | - if ( !is_readable( $wrapper_template ) ) |
|
| 692 | - throw new EE_Error( sprintf( __('Unable to access the template file for the %s messenger main content wrapper. The location being attempted is %s.', 'event_espresso' ), ucwords($this->label['singular']) , $wrapper_template ) ); |
|
| 691 | + if ( ! is_readable($wrapper_template)) |
|
| 692 | + throw new EE_Error(sprintf(__('Unable to access the template file for the %s messenger main content wrapper. The location being attempted is %s.', 'event_espresso'), ucwords($this->label['singular']), $wrapper_template)); |
|
| 693 | 693 | |
| 694 | 694 | //require template helper |
| 695 | - EE_Registry::instance()->load_helper( 'Template' ); |
|
| 696 | - return EEH_Template::display_template( $wrapper_template, $this->_template_args, TRUE ); |
|
| 695 | + EE_Registry::instance()->load_helper('Template'); |
|
| 696 | + return EEH_Template::display_template($wrapper_template, $this->_template_args, TRUE); |
|
| 697 | 697 | } |
| 698 | 698 | |
| 699 | 699 | |
@@ -729,7 +729,7 @@ discard block |
||
| 729 | 729 | */ |
| 730 | 730 | public function get_existing_test_settings() { |
| 731 | 731 | $settings = EEH_MSG_Template::get_active_messengers_in_db(); |
| 732 | - return isset( $settings[$this->name]['test_settings'] ) ? $settings[$this->name]['test_settings'] : array(); |
|
| 732 | + return isset($settings[$this->name]['test_settings']) ? $settings[$this->name]['test_settings'] : array(); |
|
| 733 | 733 | } |
| 734 | 734 | |
| 735 | 735 | |
@@ -740,10 +740,10 @@ discard block |
||
| 740 | 740 | * @access public |
| 741 | 741 | * @return bool success/fail |
| 742 | 742 | */ |
| 743 | - public function set_existing_test_settings( $settings ) { |
|
| 743 | + public function set_existing_test_settings($settings) { |
|
| 744 | 744 | $existing = EEH_MSG_Template::get_active_messengers_in_db(); |
| 745 | 745 | $existing[$this->name]['test_settings'] = $settings; |
| 746 | - return EEH_MSG_Template::update_active_messengers_in_db( $existing ); |
|
| 746 | + return EEH_MSG_Template::update_active_messengers_in_db($existing); |
|
| 747 | 747 | } |
| 748 | 748 | |
| 749 | 749 | |
@@ -756,21 +756,21 @@ discard block |
||
| 756 | 756 | * @param string $field The field to retrieve the label for |
| 757 | 757 | * @return string The label |
| 758 | 758 | */ |
| 759 | - public function get_field_label( $field ) { |
|
| 759 | + public function get_field_label($field) { |
|
| 760 | 760 | //first let's see if the field requests is in the top level array. |
| 761 | - if ( isset( $this->_template_fields[$field] ) && !empty( $this->_template_fields[$field]['label'] ) ) |
|
| 761 | + if (isset($this->_template_fields[$field]) && ! empty($this->_template_fields[$field]['label'])) |
|
| 762 | 762 | return $this->_template[$field]['label']; |
| 763 | 763 | |
| 764 | 764 | //nope so let's look in the extra array to see if it's there HOWEVER if the field exists as a top level index in the extra array then we know the label is in the 'main' index. |
| 765 | - if ( isset( $this->_template_fields['extra'] ) && !empty( $this->_template_fields['extra'][$field] ) && !empty( $this->_template_fields['extra'][$field]['main']['label'] ) ) |
|
| 765 | + if (isset($this->_template_fields['extra']) && ! empty($this->_template_fields['extra'][$field]) && ! empty($this->_template_fields['extra'][$field]['main']['label'])) |
|
| 766 | 766 | return $this->_template_fields['extra'][$field]['main']['label']; |
| 767 | 767 | |
| 768 | 768 | //now it's possible this field may just be existing in any of the extra array items. |
| 769 | - if ( !empty( $this->_template_fields['extra'] ) && is_array( $this->_template_fields['extra'] ) ) { |
|
| 770 | - foreach ( $this->_template_fields['extra'] as $main_field => $subfields ) { |
|
| 771 | - if ( !is_array( $subfields ) ) |
|
| 769 | + if ( ! empty($this->_template_fields['extra']) && is_array($this->_template_fields['extra'])) { |
|
| 770 | + foreach ($this->_template_fields['extra'] as $main_field => $subfields) { |
|
| 771 | + if ( ! is_array($subfields)) |
|
| 772 | 772 | continue; |
| 773 | - if ( isset( $subfields[$field] ) && !empty( $subfields[$field]['label'] ) ) |
|
| 773 | + if (isset($subfields[$field]) && ! empty($subfields[$field]['label'])) |
|
| 774 | 774 | return $subfields[$field]['label']; |
| 775 | 775 | } |
| 776 | 776 | } |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | * |
| 792 | 792 | * @return void |
| 793 | 793 | */ |
| 794 | - public function do_secondary_messenger_hooks( $sending_messenger_name ) { |
|
| 794 | + public function do_secondary_messenger_hooks($sending_messenger_name) { |
|
| 795 | 795 | return; |
| 796 | 796 | } |
| 797 | 797 | |
@@ -1,6 +1,7 @@ discard block |
||
| 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 |
@@ -495,8 +496,9 @@ discard block |
||
| 495 | 496 | continue; |
| 496 | 497 | } |
| 497 | 498 | $mtp_obj->admin_registered_pages = (array) $mtp_obj->admin_registered_pages; |
| 498 | - if ( ! in_array( 'events_edit', $mtp_obj->admin_registered_pages ) ) |
|
| 499 | - continue; |
|
| 499 | + if ( ! in_array( 'events_edit', $mtp_obj->admin_registered_pages ) ) { |
|
| 500 | + continue; |
|
| 501 | + } |
|
| 500 | 502 | $stargs = array(); |
| 501 | 503 | $default_value = ''; |
| 502 | 504 | $select_values = array(); |
@@ -648,8 +650,9 @@ discard block |
||
| 648 | 650 | * @return void |
| 649 | 651 | */ |
| 650 | 652 | protected function _validate_and_setup( $message ) { |
| 651 | - if ( !is_object( $message ) ) |
|
| 652 | - throw new EE_Error( __('Incoming "$message" must be an object', 'event_espresso' ) ); |
|
| 653 | + if ( !is_object( $message ) ) { |
|
| 654 | + throw new EE_Error( __('Incoming "$message" must be an object', 'event_espresso' ) ); |
|
| 655 | + } |
|
| 653 | 656 | |
| 654 | 657 | //verify we have the required template pack value on the $message object. |
| 655 | 658 | if ( empty( $message->template_pack ) || ! $message->template_pack instanceof EE_Messages_Template_Pack ) { |
@@ -663,8 +666,9 @@ discard block |
||
| 663 | 666 | $template_fields = $this->get_template_fields(); |
| 664 | 667 | |
| 665 | 668 | foreach ( $template_fields as $template => $value ) { |
| 666 | - if ( $template !== 'extra' ) |
|
| 667 | - $this->_set_template_value($template, $message->$template); |
|
| 669 | + if ( $template !== 'extra' ) { |
|
| 670 | + $this->_set_template_value($template, $message->$template); |
|
| 671 | + } |
|
| 668 | 672 | } |
| 669 | 673 | } |
| 670 | 674 | |
@@ -688,8 +692,9 @@ discard block |
||
| 688 | 692 | $wrapper_template = $this->_tmp_pack->get_wrapper( $this->name, $type ); |
| 689 | 693 | |
| 690 | 694 | //check file exists and is readable |
| 691 | - if ( !is_readable( $wrapper_template ) ) |
|
| 692 | - throw new EE_Error( sprintf( __('Unable to access the template file for the %s messenger main content wrapper. The location being attempted is %s.', 'event_espresso' ), ucwords($this->label['singular']) , $wrapper_template ) ); |
|
| 695 | + if ( !is_readable( $wrapper_template ) ) { |
|
| 696 | + throw new EE_Error( sprintf( __('Unable to access the template file for the %s messenger main content wrapper. The location being attempted is %s.', 'event_espresso' ), ucwords($this->label['singular']) , $wrapper_template ) ); |
|
| 697 | + } |
|
| 693 | 698 | |
| 694 | 699 | //require template helper |
| 695 | 700 | EE_Registry::instance()->load_helper( 'Template' ); |
@@ -758,20 +763,24 @@ discard block |
||
| 758 | 763 | */ |
| 759 | 764 | public function get_field_label( $field ) { |
| 760 | 765 | //first let's see if the field requests is in the top level array. |
| 761 | - if ( isset( $this->_template_fields[$field] ) && !empty( $this->_template_fields[$field]['label'] ) ) |
|
| 762 | - return $this->_template[$field]['label']; |
|
| 766 | + if ( isset( $this->_template_fields[$field] ) && !empty( $this->_template_fields[$field]['label'] ) ) { |
|
| 767 | + return $this->_template[$field]['label']; |
|
| 768 | + } |
|
| 763 | 769 | |
| 764 | 770 | //nope so let's look in the extra array to see if it's there HOWEVER if the field exists as a top level index in the extra array then we know the label is in the 'main' index. |
| 765 | - if ( isset( $this->_template_fields['extra'] ) && !empty( $this->_template_fields['extra'][$field] ) && !empty( $this->_template_fields['extra'][$field]['main']['label'] ) ) |
|
| 766 | - return $this->_template_fields['extra'][$field]['main']['label']; |
|
| 771 | + if ( isset( $this->_template_fields['extra'] ) && !empty( $this->_template_fields['extra'][$field] ) && !empty( $this->_template_fields['extra'][$field]['main']['label'] ) ) { |
|
| 772 | + return $this->_template_fields['extra'][$field]['main']['label']; |
|
| 773 | + } |
|
| 767 | 774 | |
| 768 | 775 | //now it's possible this field may just be existing in any of the extra array items. |
| 769 | 776 | if ( !empty( $this->_template_fields['extra'] ) && is_array( $this->_template_fields['extra'] ) ) { |
| 770 | 777 | foreach ( $this->_template_fields['extra'] as $main_field => $subfields ) { |
| 771 | - if ( !is_array( $subfields ) ) |
|
| 772 | - continue; |
|
| 773 | - if ( isset( $subfields[$field] ) && !empty( $subfields[$field]['label'] ) ) |
|
| 774 | - return $subfields[$field]['label']; |
|
| 778 | + if ( !is_array( $subfields ) ) { |
|
| 779 | + continue; |
|
| 780 | + } |
|
| 781 | + if ( isset( $subfields[$field] ) && !empty( $subfields[$field]['label'] ) ) { |
|
| 782 | + return $subfields[$field]['label']; |
|
| 783 | + } |
|
| 775 | 784 | } |
| 776 | 785 | } |
| 777 | 786 | |
@@ -89,7 +89,6 @@ |
||
| 89 | 89 | * callback for FHEE__EE_Capabilities__init_caps_map__caps filter. |
| 90 | 90 | * Takes care of registering additional capabilities to the caps map. Note, that this also on the initial registration ensures that new capabilities are added to existing roles. |
| 91 | 91 | * |
| 92 | - * @param array $caps_and_cap_map The original caps map. |
|
| 93 | 92 | * |
| 94 | 93 | * @return array merged in new caps. |
| 95 | 94 | */ |
@@ -40,39 +40,39 @@ discard block |
||
| 40 | 40 | * |
| 41 | 41 | * @return void |
| 42 | 42 | */ |
| 43 | - public static function register( $cap_reference = NULL, $setup_args = array() ) { |
|
| 43 | + public static function register($cap_reference = NULL, $setup_args = array()) { |
|
| 44 | 44 | //required fields MUST be present, so let's make sure they are. |
| 45 | - if ( ! isset( $cap_reference ) || ! is_array( $setup_args ) || empty( $setup_args['capabilities'] ) ) { |
|
| 45 | + if ( ! isset($cap_reference) || ! is_array($setup_args) || empty($setup_args['capabilities'])) { |
|
| 46 | 46 | throw new EE_Error( |
| 47 | - __( 'In order to register capabilities with EE_Register_Capabilities::register, you must include a unique name to reference the capabilities being registered, plus an array containing the following keys: "capabilities".', 'event_espresso' ) |
|
| 47 | + __('In order to register capabilities with EE_Register_Capabilities::register, you must include a unique name to reference the capabilities being registered, plus an array containing the following keys: "capabilities".', 'event_espresso') |
|
| 48 | 48 | ); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | //make sure we don't register twice |
| 52 | - if( isset( self::$_registry[ $cap_reference ] ) ){ |
|
| 52 | + if (isset(self::$_registry[$cap_reference])) { |
|
| 53 | 53 | return; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | //make sure this is not registered too late or too early. |
| 57 | - if ( ! did_action( 'AHEE__EE_System__load_espresso_addons' ) || did_action( 'AHEE__EE_System___detect_if_activation_or_upgrade__begin' ) ) { |
|
| 58 | - EE_Error::doing_it_wrong( __METHOD__, sprintf( __('%s has been registered too late. Please ensure that EE_Register_Capabilities::register has been called at some point before the "AHEE__EE_System___detect_if_activation_or_upgrade__begin" action hook has been called.', 'event_espresso'), $cap_reference ), '4.5.0' ); |
|
| 57 | + if ( ! did_action('AHEE__EE_System__load_espresso_addons') || did_action('AHEE__EE_System___detect_if_activation_or_upgrade__begin')) { |
|
| 58 | + EE_Error::doing_it_wrong(__METHOD__, sprintf(__('%s has been registered too late. Please ensure that EE_Register_Capabilities::register has been called at some point before the "AHEE__EE_System___detect_if_activation_or_upgrade__begin" action hook has been called.', 'event_espresso'), $cap_reference), '4.5.0'); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | //some preliminary sanitization and setting to the $_registry property |
| 62 | 62 | self::$_registry[$cap_reference] = array( |
| 63 | - 'caps' => isset( $setup_args['capabilities'] ) && is_array( $setup_args['capabilities'] ) ? $setup_args['capabilities'] : array(), |
|
| 64 | - 'cap_maps' => isset( $setup_args['capability_maps'] ) ? $setup_args['capability_maps'] : array() |
|
| 63 | + 'caps' => isset($setup_args['capabilities']) && is_array($setup_args['capabilities']) ? $setup_args['capabilities'] : array(), |
|
| 64 | + 'cap_maps' => isset($setup_args['capability_maps']) ? $setup_args['capability_maps'] : array() |
|
| 65 | 65 | ); |
| 66 | 66 | |
| 67 | 67 | |
| 68 | 68 | //set initial caps (note that EE_Capabilities takes care of making sure that the caps get added donly once) |
| 69 | - add_filter( 'FHEE__EE_Capabilities__init_caps_map__caps', array( 'EE_Register_Capabilities', 'register_capabilities' ), 10 ); |
|
| 69 | + add_filter('FHEE__EE_Capabilities__init_caps_map__caps', array('EE_Register_Capabilities', 'register_capabilities'), 10); |
|
| 70 | 70 | |
| 71 | 71 | //add filter for cap maps |
| 72 | - add_filter( 'FHEE__EE_Capabilities___set_meta_caps__meta_caps', array( 'EE_Register_Capabilities', 'register_cap_maps' ), 10 ); |
|
| 72 | + add_filter('FHEE__EE_Capabilities___set_meta_caps__meta_caps', array('EE_Register_Capabilities', 'register_cap_maps'), 10); |
|
| 73 | 73 | |
| 74 | 74 | //init_role_caps to register new capabilities |
| 75 | - if ( is_admin() ) { |
|
| 75 | + if (is_admin()) { |
|
| 76 | 76 | EE_Registry::instance()->load('Capabilities'); |
| 77 | 77 | EE_Capabilities::instance()->init_caps(); |
| 78 | 78 | } |
@@ -88,9 +88,9 @@ discard block |
||
| 88 | 88 | * |
| 89 | 89 | * @return array merged in new caps. |
| 90 | 90 | */ |
| 91 | - public static function register_capabilities( $incoming_caps ) { |
|
| 92 | - foreach ( self::$_registry as $ref => $caps_and_cap_map ) { |
|
| 93 | - $incoming_caps = array_merge_recursive( $incoming_caps, $caps_and_cap_map[ 'caps' ] ); |
|
| 91 | + public static function register_capabilities($incoming_caps) { |
|
| 92 | + foreach (self::$_registry as $ref => $caps_and_cap_map) { |
|
| 93 | + $incoming_caps = array_merge_recursive($incoming_caps, $caps_and_cap_map['caps']); |
|
| 94 | 94 | } |
| 95 | 95 | return $incoming_caps; |
| 96 | 96 | } |
@@ -106,22 +106,22 @@ discard block |
||
| 106 | 106 | * |
| 107 | 107 | * @return EE_Meta_Capability_Map[] |
| 108 | 108 | */ |
| 109 | - public static function register_cap_maps( $cap_maps ) { |
|
| 109 | + public static function register_cap_maps($cap_maps) { |
|
| 110 | 110 | //loop through and instantiate cap maps. |
| 111 | - foreach ( self::$_registry as $cap_reference => $setup ) { |
|
| 112 | - if ( ! isset( $setup['cap_maps'] ) ) { |
|
| 111 | + foreach (self::$_registry as $cap_reference => $setup) { |
|
| 112 | + if ( ! isset($setup['cap_maps'])) { |
|
| 113 | 113 | continue; |
| 114 | 114 | } |
| 115 | - foreach ( $setup['cap_maps'] as $cap_class => $args ) { |
|
| 116 | - if ( ! class_exists( $cap_class ) ) { |
|
| 117 | - throw new EE_Error( sprintf( __( 'An addon (%s) has tried to register a capability map improperly. Capability map arrays must be indexed by capability map classname, and an array for the class arguments', 'event_espresso' ), $cap_reference ) ); |
|
| 115 | + foreach ($setup['cap_maps'] as $cap_class => $args) { |
|
| 116 | + if ( ! class_exists($cap_class)) { |
|
| 117 | + throw new EE_Error(sprintf(__('An addon (%s) has tried to register a capability map improperly. Capability map arrays must be indexed by capability map classname, and an array for the class arguments', 'event_espresso'), $cap_reference)); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - if ( count( $args ) !== 2 ) { |
|
| 121 | - throw new EE_Error( sprintf( __('An addon (%s) has tried to register a capability map improperly. Capability map arrays must be indexed by capability map classname, and an array for the class arguments. The array should have two values the first being a string and the second an array.', 'event_espresso' ), $cap_reference ) ); |
|
| 120 | + if (count($args) !== 2) { |
|
| 121 | + throw new EE_Error(sprintf(__('An addon (%s) has tried to register a capability map improperly. Capability map arrays must be indexed by capability map classname, and an array for the class arguments. The array should have two values the first being a string and the second an array.', 'event_espresso'), $cap_reference)); |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - $cap_maps[] = new $cap_class( $args[0], $args[1] ); |
|
| 124 | + $cap_maps[] = new $cap_class($args[0], $args[1]); |
|
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | return $cap_maps; |
@@ -130,8 +130,8 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | |
| 132 | 132 | |
| 133 | - public static function deregister( $cap_reference = NULL ) { |
|
| 134 | - if ( !empty( self::$_registry[$cap_reference] ) ) |
|
| 135 | - unset( self::$_registry[$cap_reference] ); |
|
| 133 | + public static function deregister($cap_reference = NULL) { |
|
| 134 | + if ( ! empty(self::$_registry[$cap_reference])) |
|
| 135 | + unset(self::$_registry[$cap_reference]); |
|
| 136 | 136 | } |
| 137 | 137 | } |
@@ -132,6 +132,6 @@ |
||
| 132 | 132 | |
| 133 | 133 | public static function deregister( $cap_reference = NULL ) { |
| 134 | 134 | if ( !empty( self::$_registry[$cap_reference] ) ) |
| 135 | - unset( self::$_registry[$cap_reference] ); |
|
| 135 | + unset( self::$_registry[$cap_reference] ); |
|
| 136 | 136 | } |
| 137 | 137 | } |
@@ -5,7 +5,9 @@ discard block |
||
| 5 | 5 | * @subpackage plugin api, capabilities |
| 6 | 6 | * @since 4.5.0 |
| 7 | 7 | */ |
| 8 | -if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
| 8 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 9 | + exit('No direct script access allowed'); |
|
| 10 | +} |
|
| 9 | 11 | |
| 10 | 12 | /** |
| 11 | 13 | * Use this to register new capabilities for the EE capabilities system. |
@@ -131,7 +133,8 @@ discard block |
||
| 131 | 133 | |
| 132 | 134 | |
| 133 | 135 | public static function deregister( $cap_reference = NULL ) { |
| 134 | - if ( !empty( self::$_registry[$cap_reference] ) ) |
|
| 135 | - unset( self::$_registry[$cap_reference] ); |
|
| 136 | + if ( !empty( self::$_registry[$cap_reference] ) ) { |
|
| 137 | + unset( self::$_registry[$cap_reference] ); |
|
| 138 | + } |
|
| 136 | 139 | } |
| 137 | 140 | } |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | <ul class="wp-people-group" id="ee-people-group-owners"> |
| 4 | 4 | <li class="wp-person" id="ee-person-sshoultes"> |
| 5 | 5 | <a href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
| 6 | - <?php echo esp_gravatar_image( '[email protected]', 'Seth Shoultes' ); ?> |
|
| 6 | + <?php echo esp_gravatar_image('[email protected]', 'Seth Shoultes'); ?> |
|
| 7 | 7 | </a> |
| 8 | 8 | <a class="web" href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
| 9 | 9 | Seth Shoultes |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | </li> |
| 13 | 13 | <li class="wp-person" id="ee-person-gkoyle"> |
| 14 | 14 | <a href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
| 15 | - <?php echo esp_gravatar_image( '[email protected]', 'Garth Koyle' ); ?> |
|
| 15 | + <?php echo esp_gravatar_image('[email protected]', 'Garth Koyle'); ?> |
|
| 16 | 16 | </a> |
| 17 | 17 | <a class="web" href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
| 18 | 18 | Garth Koyle |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | <ul class="wp-people-group" id="ee-people-group-core-developers"> |
| 25 | 25 | <li class="wp-person" id="ee-person-bchristensen"> |
| 26 | 26 | <a href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
| 27 | - <?php echo esp_gravatar_image( '[email protected]', 'Brent Christensen' ); ?> |
|
| 27 | + <?php echo esp_gravatar_image('[email protected]', 'Brent Christensen'); ?> |
|
| 28 | 28 | </a> |
| 29 | 29 | <a class="web" href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
| 30 | 30 | Brent Christensen |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | </li> |
| 34 | 34 | <li class="wp-person" id="ee-person-dethier"> |
| 35 | 35 | <a href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
| 36 | - <?php echo esp_gravatar_image( '[email protected]', 'Darren Ethier' ); ?> |
|
| 36 | + <?php echo esp_gravatar_image('[email protected]', 'Darren Ethier'); ?> |
|
| 37 | 37 | </a> |
| 38 | 38 | <a class="web" href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
| 39 | 39 | Darren Ethier |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | </li> |
| 43 | 43 | <li class="wp-person" id="ee-person-mnelson"> |
| 44 | 44 | <a href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
| 45 | - <?php echo esp_gravatar_image( '[email protected]', 'Michael Nelson' ); ?> |
|
| 45 | + <?php echo esp_gravatar_image('[email protected]', 'Michael Nelson'); ?> |
|
| 46 | 46 | </a> |
| 47 | 47 | <a class="web" href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
| 48 | 48 | Michael Nelson |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | <ul class="wp-people-group" id="ee-people-group-support-staff"> |
| 55 | 55 | <li class="wp-person" id="ee-person-jfeck"> |
| 56 | 56 | <a href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
| 57 | - <?php echo esp_gravatar_image( '[email protected]', 'Josh Feck' ); ?> |
|
| 57 | + <?php echo esp_gravatar_image('[email protected]', 'Josh Feck'); ?> |
|
| 58 | 58 | </a> |
| 59 | 59 | <a class="web" href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
| 60 | 60 | Josh Feck |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | </li> |
| 63 | 63 | <li class="wp-person" id="ee-person-drobinson"> |
| 64 | 64 | <a href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
| 65 | - <?php echo esp_gravatar_image( '[email protected]', 'Dean Robinson' ); ?> |
|
| 65 | + <?php echo esp_gravatar_image('[email protected]', 'Dean Robinson'); ?> |
|
| 66 | 66 | </a> |
| 67 | 67 | <a class="web" href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
| 68 | 68 | Dean Robinson |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | </li> |
| 71 | 71 | <li class="wp-person" id="ee-person-jwilson"> |
| 72 | 72 | <a href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
| 73 | - <?php echo esp_gravatar_image( '[email protected]', 'Jonathan Wilson' ); ?> |
|
| 73 | + <?php echo esp_gravatar_image('[email protected]', 'Jonathan Wilson'); ?> |
|
| 74 | 74 | </a> |
| 75 | 75 | <a class="web" href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
| 76 | 76 | Jonathan Wilson |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | </li> |
| 79 | 79 | <li class="wp-person" id="ee-person-sharrel"> |
| 80 | 80 | <a href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
| 81 | - <?php echo esp_gravatar_image( '[email protected]', 'Sidney Harrell' ); ?> |
|
| 81 | + <?php echo esp_gravatar_image('[email protected]', 'Sidney Harrell'); ?> |
|
| 82 | 82 | </a> |
| 83 | 83 | <a class="web" href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
| 84 | 84 | Sidney Harrel |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | </li> |
| 87 | 87 | <li class="wp-person" id="ee-person-twarwick"> |
| 88 | 88 | <a href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
| 89 | - <?php echo esp_gravatar_image( '[email protected]', 'Tony Warwick' ); ?> |
|
| 89 | + <?php echo esp_gravatar_image('[email protected]', 'Tony Warwick'); ?> |
|
| 90 | 90 | </a> |
| 91 | 91 | <a class="web" href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
| 92 | 92 | Tony Warwick |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | </li> |
| 95 | 95 | <li class="wp-person" id="ee-person-lcaum"> |
| 96 | 96 | <a href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
| 97 | - <?php echo esp_gravatar_image( '[email protected]', 'Lorenzo Caum' ); ?> |
|
| 97 | + <?php echo esp_gravatar_image('[email protected]', 'Lorenzo Caum'); ?> |
|
| 98 | 98 | </a> |
| 99 | 99 | <a class="web" href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
| 100 | 100 | Lorenzo Caum |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | </ul> |
| 105 | 105 | <h4 class="wp-people-group"><?php _e('Contributor Recognition', 'event_espresso'); ?></h4> |
| 106 | 106 | <p class="description"> |
| 107 | - <?php printf( __('For every major release we want to recognize the people who contributed to the release via a Github pull request. Want to see your name listed here? %sApply for access to our github repo.%s When you submit a pull request that gets included in a major release, we\'ll add your name here linked to your Github profile.', 'event_espresso'), '<a href="http://eventespresso.com/developers/request-repo-access/">', '</a>' ); ?> |
|
| 107 | + <?php printf(__('For every major release we want to recognize the people who contributed to the release via a Github pull request. Want to see your name listed here? %sApply for access to our github repo.%s When you submit a pull request that gets included in a major release, we\'ll add your name here linked to your Github profile.', 'event_espresso'), '<a href="http://eventespresso.com/developers/request-repo-access/">', '</a>'); ?> |
|
| 108 | 108 | </p> |
| 109 | 109 | <p class="wp-credits-list"> |
| 110 | 110 | <ul> |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | </p> |
| 116 | 116 | <h4 class="wp-people-group"><?php _e('External Libraries', 'event_espresso'); ?></h4> |
| 117 | 117 | <p class="description"> |
| 118 | - <?php printf( __('Along with the libraries %sincluded with WordPress%s, Event Espresso utilizes the following third party libraries:', 'event_espresso'), '<a href="credits.php">', '</a>' ); ?> |
|
| 118 | + <?php printf(__('Along with the libraries %sincluded with WordPress%s, Event Espresso utilizes the following third party libraries:', 'event_espresso'), '<a href="credits.php">', '</a>'); ?> |
|
| 119 | 119 | </p> |
| 120 | 120 | <p class="wp-credits-list"> |
| 121 | 121 | <a href="http://josscrowcroft.github.io/accounting.js/"><?php _e('accounting.js', 'event_espresso'); ?></a>, |
@@ -131,10 +131,10 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | <?php |
| 133 | 133 | function esp_gravatar_profile($email) { |
| 134 | - echo 'http://www.gravatar.com/' . md5($email); |
|
| 134 | + echo 'http://www.gravatar.com/'.md5($email); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | function esp_gravatar_image($email, $name) { |
| 138 | - echo '<img src="http://0.gravatar.com/avatar/' . md5($email) . '?s=60" class="gravatar" alt="' . $name . '"/>'; |
|
| 138 | + echo '<img src="http://0.gravatar.com/avatar/'.md5($email).'?s=60" class="gravatar" alt="'.$name.'"/>'; |
|
| 139 | 139 | } |
| 140 | 140 | ?> |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | <h3><?php _e('Turn your blog into a complete event registration and management system', 'event_espresso'); ?></h3> |
| 63 | 63 | <p><?php _e('Create a beautiful event page with ticket selection, venue details, and an integrated single page checkout system. With WordPress, Event Espresso, and Espresso Arabica 2014 (based on the "Twenty Fourteen" theme by WordPress), your events will certainly sell out faster than ever!', 'event_espresso'); ?></p> |
| 64 | 64 | <p><?php _e('With a striking design that does not compromise the simplicity of WordPress and Event Espresso 4, Espresso Arabica 2014 will be the best event theme on the market.', 'event_espresso'); ?></p> |
| 65 | - <p><?php echo sprintf( __('%sLearn more >>%s', 'event_espresso'), '<a href="http://eventespresso.com/wiki/setup-event-espresso-arabica-theme/">', '</a>' ); ?></p> |
|
| 65 | + <p><?php echo sprintf(__('%sLearn more >>%s', 'event_espresso'), '<a href="http://eventespresso.com/wiki/setup-event-espresso-arabica-theme/">', '</a>'); ?></p> |
|
| 66 | 66 | </div> |
| 67 | 67 | </div> |
| 68 | 68 | <img src="<?php echo EE_GLOBAL_ASSETS_URL; ?>images/screenshots/single-event-page.jpg"> |
@@ -1,16 +1,16 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -$values = EEH_Form_Fields::prep_answer_options( array( |
|
| 3 | - array( 'id' => 1, 'text' => __('Yes', 'event_espresso')), |
|
| 4 | - array( 'id' => 0, 'text' => __('No', 'event_espresso')) |
|
| 2 | +$values = EEH_Form_Fields::prep_answer_options(array( |
|
| 3 | + array('id' => 1, 'text' => __('Yes', 'event_espresso')), |
|
| 4 | + array('id' => 0, 'text' => __('No', 'event_espresso')) |
|
| 5 | 5 | )); |
| 6 | 6 | |
| 7 | -$description = EEH_Form_Fields::prep_answer_options( array( |
|
| 8 | - array( 'id' => 0, 'text' => __('none', 'event_espresso')), |
|
| 9 | - array( 'id' => 1, 'text' => __('excerpt (short desc)', 'event_espresso')), |
|
| 10 | - array( 'id' => 2, 'text' => __('full description', 'event_espresso')) |
|
| 7 | +$description = EEH_Form_Fields::prep_answer_options(array( |
|
| 8 | + array('id' => 0, 'text' => __('none', 'event_espresso')), |
|
| 9 | + array('id' => 1, 'text' => __('excerpt (short desc)', 'event_espresso')), |
|
| 10 | + array('id' => 2, 'text' => __('full description', 'event_espresso')) |
|
| 11 | 11 | )); |
| 12 | 12 | |
| 13 | -add_filter( 'FHEE__EEH_Form_Fields__label_html', '__return_empty_string' ); |
|
| 13 | +add_filter('FHEE__EEH_Form_Fields__label_html', '__return_empty_string'); |
|
| 14 | 14 | ?> |
| 15 | 15 | |
| 16 | 16 | |
@@ -24,11 +24,11 @@ discard block |
||
| 24 | 24 | <tr> |
| 25 | 25 | <th> |
| 26 | 26 | <label for="event_listings_url"> |
| 27 | - <?php _e('Event Listings URL', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('event_listings_url_info');?> |
|
| 27 | + <?php _e('Event Listings URL', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('event_listings_url_info'); ?> |
|
| 28 | 28 | </label> |
| 29 | 29 | </th> |
| 30 | 30 | <td> |
| 31 | - <a id="event_listings_url" class="ee-admin-settings-hdr-lnk small-text" href="<?php echo home_url('/') . __('events', 'event_espresso'); ?>"><?php echo home_url('/') . __('events', 'event_espresso'); ?></a> |
|
| 31 | + <a id="event_listings_url" class="ee-admin-settings-hdr-lnk small-text" href="<?php echo home_url('/').__('events', 'event_espresso'); ?>"><?php echo home_url('/').__('events', 'event_espresso'); ?></a> |
|
| 32 | 32 | </td> |
| 33 | 33 | </tr> |
| 34 | 34 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | </label> |
| 40 | 40 | </th> |
| 41 | 41 | <td> |
| 42 | - <?php echo EEH_Form_Fields::select( 'display_status_banner', $display_status_banner, $values, 'EED_Events_Archive_display_status_banner', 'EED_Events_Archive_display_status_banner' );?> |
|
| 42 | + <?php echo EEH_Form_Fields::select('display_status_banner', $display_status_banner, $values, 'EED_Events_Archive_display_status_banner', 'EED_Events_Archive_display_status_banner'); ?> |
|
| 43 | 43 | <p class="description"><?php _e('Selecting "Yes" will inject an Event Status banner with the title whenever Events are displaying on the events archive page.', 'event_espresso'); ?></p> |
| 44 | 44 | </td> |
| 45 | 45 | </tr> |
@@ -47,55 +47,55 @@ discard block |
||
| 47 | 47 | <tr> |
| 48 | 48 | <th> |
| 49 | 49 | <label for="EED_Events_Archive_display_description"> |
| 50 | - <?php _e('Display Description', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('display_description_info');?> |
|
| 50 | + <?php _e('Display Description', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('display_description_info'); ?> |
|
| 51 | 51 | </label> |
| 52 | 52 | </th> |
| 53 | 53 | <td> |
| 54 | - <?php echo EEH_Form_Fields::select( 'description', $display_description, $description, 'EED_Events_Archive_display_description', 'EED_Events_Archive_display_description' );?> |
|
| 54 | + <?php echo EEH_Form_Fields::select('description', $display_description, $description, 'EED_Events_Archive_display_description', 'EED_Events_Archive_display_description'); ?> |
|
| 55 | 55 | </td> |
| 56 | 56 | </tr> |
| 57 | 57 | |
| 58 | 58 | <tr> |
| 59 | 59 | <th> |
| 60 | 60 | <label for="EED_Events_Archive_display_ticket_selector"> |
| 61 | - <?php _e('Display Ticket Selector', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('display_ticket_selector_info');?> |
|
| 61 | + <?php _e('Display Ticket Selector', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('display_ticket_selector_info'); ?> |
|
| 62 | 62 | </label> |
| 63 | 63 | </th> |
| 64 | 64 | <td> |
| 65 | - <?php echo EEH_Form_Fields::select( 'ticket_selector', $display_ticket_selector, $values, 'EED_Events_Archive_display_ticket_selector', 'EED_Events_Archive_display_ticket_selector' );?> |
|
| 65 | + <?php echo EEH_Form_Fields::select('ticket_selector', $display_ticket_selector, $values, 'EED_Events_Archive_display_ticket_selector', 'EED_Events_Archive_display_ticket_selector'); ?> |
|
| 66 | 66 | </td> |
| 67 | 67 | </tr> |
| 68 | 68 | |
| 69 | 69 | <tr> |
| 70 | 70 | <th> |
| 71 | 71 | <label for="EED_Events_Archive_display_datetimes"> |
| 72 | - <?php _e('Display Datetimes', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('display_datetimes_info');?> |
|
| 72 | + <?php _e('Display Datetimes', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('display_datetimes_info'); ?> |
|
| 73 | 73 | </label> |
| 74 | 74 | </th> |
| 75 | 75 | <td> |
| 76 | - <?php echo EEH_Form_Fields::select( 'venue_details', $display_datetimes, $values, 'EED_Events_Archive_display_datetimes', 'EED_Events_Archive_display_datetimes' );?> |
|
| 76 | + <?php echo EEH_Form_Fields::select('venue_details', $display_datetimes, $values, 'EED_Events_Archive_display_datetimes', 'EED_Events_Archive_display_datetimes'); ?> |
|
| 77 | 77 | </td> |
| 78 | 78 | </tr> |
| 79 | 79 | |
| 80 | 80 | <tr> |
| 81 | 81 | <th> |
| 82 | 82 | <label for="EED_Events_Archive_display_venue"> |
| 83 | - <?php _e('Display Venue Details', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('display_venue_details_info');?> |
|
| 83 | + <?php _e('Display Venue Details', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('display_venue_details_info'); ?> |
|
| 84 | 84 | </label> |
| 85 | 85 | </th> |
| 86 | 86 | <td> |
| 87 | - <?php echo EEH_Form_Fields::select( 'display_venue', $display_venue, $values, 'EED_Events_Archive_display_venue', 'EED_Events_Archive_display_venue' );?> |
|
| 87 | + <?php echo EEH_Form_Fields::select('display_venue', $display_venue, $values, 'EED_Events_Archive_display_venue', 'EED_Events_Archive_display_venue'); ?> |
|
| 88 | 88 | </td> |
| 89 | 89 | </tr> |
| 90 | 90 | |
| 91 | 91 | <tr> |
| 92 | 92 | <th> |
| 93 | 93 | <label for="EED_Events_Archive_display_expired_events"> |
| 94 | - <?php _e('Display Expired Events', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('display_expired_events_info');?> |
|
| 94 | + <?php _e('Display Expired Events', 'event_espresso'); ?> <?php echo EEH_Template::get_help_tab_link('display_expired_events_info'); ?> |
|
| 95 | 95 | </label> |
| 96 | 96 | </th> |
| 97 | 97 | <td> |
| 98 | - <?php echo EEH_Form_Fields::select( 'expired_events', $display_expired_events, $values, 'EED_Events_Archive_display_expired_events', 'EED_Events_Archive_display_expired_events' );?> |
|
| 98 | + <?php echo EEH_Form_Fields::select('expired_events', $display_expired_events, $values, 'EED_Events_Archive_display_expired_events', 'EED_Events_Archive_display_expired_events'); ?> |
|
| 99 | 99 | </td> |
| 100 | 100 | </tr> |
| 101 | 101 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | </label> |
| 107 | 107 | </th> |
| 108 | 108 | <td> |
| 109 | - <?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' );?> |
|
| 109 | + <?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'); ?> |
|
| 110 | 110 | </td> |
| 111 | 111 | </tr> |
| 112 | 112 | |