@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | * @param array $arguments |
40 | 40 | * @return \EE_CPT_Attendee_Strategy |
41 | 41 | */ |
42 | - public function __construct( $arguments = array() ) { |
|
43 | - $this->CPT = isset( $arguments['CPT'] ) ? $arguments['CPT'] : NULL; |
|
44 | - $WP_Query = isset( $arguments['WP_Query'] ) ? $arguments['WP_Query'] : NULL; |
|
42 | + public function __construct($arguments = array()) { |
|
43 | + $this->CPT = isset($arguments['CPT']) ? $arguments['CPT'] : NULL; |
|
44 | + $WP_Query = isset($arguments['WP_Query']) ? $arguments['WP_Query'] : NULL; |
|
45 | 45 | // add_filter( 'the_posts', array( $this, 'the_posts' ), 1, 2 ); |
46 | 46 | } |
47 | 47 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * @param WP_Query $wp_query |
56 | 56 | * @return void |
57 | 57 | */ |
58 | - public function the_posts( $posts, WP_Query $wp_query) { |
|
58 | + public function the_posts($posts, WP_Query $wp_query) { |
|
59 | 59 | //$EVT = EE_Registry::instance()->load_model( 'Event' ); |
60 | 60 | // EEH_Debug_Tools::printr( $EVT, '$EVT <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
61 | 61 | // $EVT_IDs = array(); |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * Class EE_Base_Class_Repository |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | * @param array $arguments arrays of arguments that will be passed to the object's save method |
40 | 40 | * @return bool | int |
41 | 41 | */ |
42 | - public function save( $arguments = array() ) { |
|
43 | - return $this->persist( 'save', $arguments ); |
|
42 | + public function save($arguments = array()) { |
|
43 | + return $this->persist('save', $arguments); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * @return bool | int |
55 | 55 | */ |
56 | 56 | public function save_all() { |
57 | - return $this->persist_all( 'save' ); |
|
57 | + return $this->persist_all('save'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | * @return bool |
69 | 69 | */ |
70 | 70 | public function delete() { |
71 | - $success = $this->_call_user_func_array_on_current( 'delete' ); |
|
72 | - $this->remove( $this->current() ); |
|
71 | + $success = $this->_call_user_func_array_on_current('delete'); |
|
72 | + $this->remove($this->current()); |
|
73 | 73 | return $success; |
74 | 74 | } |
75 | 75 | |
@@ -86,16 +86,16 @@ discard block |
||
86 | 86 | public function delete_all() { |
87 | 87 | $success = true; |
88 | 88 | $this->rewind(); |
89 | - while ( $this->valid() ) { |
|
89 | + while ($this->valid()) { |
|
90 | 90 | // any db error will result in false being returned |
91 | - $success = $this->_call_user_func_array_on_current( 'delete' ) !== false ? $success : false; |
|
91 | + $success = $this->_call_user_func_array_on_current('delete') !== false ? $success : false; |
|
92 | 92 | // can't remove current object because valid() requires it |
93 | 93 | // so just capture current object temporarily |
94 | 94 | $object = $this->current(); |
95 | 95 | // advance the pointer |
96 | 96 | $this->next(); |
97 | 97 | // THEN remove the object from the repository |
98 | - $this->remove( $object ); |
|
98 | + $this->remove($object); |
|
99 | 99 | } |
100 | 100 | return $success; |
101 | 101 | } |
@@ -113,8 +113,8 @@ discard block |
||
113 | 113 | * @param string $previous_value |
114 | 114 | * @return bool | int |
115 | 115 | */ |
116 | - public function update_extra_meta( $meta_key, $meta_value, $previous_value = null ) { |
|
117 | - return $this->_call_user_func_array_on_current( 'update_extra_meta', array( $meta_key, $meta_value, $previous_value ) ); |
|
116 | + public function update_extra_meta($meta_key, $meta_value, $previous_value = null) { |
|
117 | + return $this->_call_user_func_array_on_current('update_extra_meta', array($meta_key, $meta_value, $previous_value)); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function &instance() { |
56 | 56 | // check if class object is instantiated |
57 | - if ( self::$_instance === NULL or ! is_object( self::$_instance ) or ! ( self::$_instance instanceof EE_Data_Mapper )) { |
|
57 | + if (self::$_instance === NULL or ! is_object(self::$_instance) or ! (self::$_instance instanceof EE_Data_Mapper)) { |
|
58 | 58 | self::$_instance = new self(); |
59 | 59 | } |
60 | 60 | return self::$_instance; |
@@ -71,10 +71,10 @@ discard block |
||
71 | 71 | * @ return void |
72 | 72 | */ |
73 | 73 | final function __destruct() {} |
74 | - final function __call($a,$b) {} |
|
75 | - public static function __callStatic($a,$b) {} |
|
74 | + final function __call($a, $b) {} |
|
75 | + public static function __callStatic($a, $b) {} |
|
76 | 76 | final function __get($a) {} |
77 | - final function __set($a,$b) {} |
|
77 | + final function __set($a, $b) {} |
|
78 | 78 | final function __isset($a) {} |
79 | 79 | final function __unset($a) {} |
80 | 80 | final function __sleep() { |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | |
29 | 29 | |
30 | 30 | /** |
31 | - * instance of the EE_Data_Mapper Object |
|
32 | - * @private _instance |
|
33 | - */ |
|
31 | + * instance of the EE_Data_Mapper Object |
|
32 | + * @private _instance |
|
33 | + */ |
|
34 | 34 | private static $_instance = NULL; |
35 | 35 | |
36 | 36 | |
@@ -82,8 +82,8 @@ discard block |
||
82 | 82 | } |
83 | 83 | final function __wakeup() {} |
84 | 84 | final function __toString() { |
85 | - return ''; |
|
86 | - } |
|
85 | + return ''; |
|
86 | + } |
|
87 | 87 | final function __invoke() {} |
88 | 88 | final static function __set_state() {} |
89 | 89 | final function __clone() {} |
@@ -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 | * |
@@ -60,12 +62,14 @@ discard block |
||
60 | 62 | */ |
61 | 63 | private static function _maybe_get_langfile() { |
62 | 64 | self::$_lang = get_locale(); |
63 | - if ( $has_check = get_option( 'ee_lang_check_' . self::$_lang . '_' . EVENT_ESPRESSO_VERSION ) || empty( self::$_lang ) ) |
|
64 | - return; |
|
65 | + if ( $has_check = get_option( 'ee_lang_check_' . self::$_lang . '_' . EVENT_ESPRESSO_VERSION ) || empty( self::$_lang ) ) { |
|
66 | + return; |
|
67 | + } |
|
65 | 68 | |
66 | 69 | //if lang is en_US or empty then lets just get out. (Event Espresso core is en_US) |
67 | - if ( empty( self::$_lang ) || self::$_lang == 'en_US' ) |
|
68 | - return; |
|
70 | + if ( empty( self::$_lang ) || self::$_lang == 'en_US' ) { |
|
71 | + return; |
|
72 | + } |
|
69 | 73 | |
70 | 74 | //made it here so let's get the file from the github repo |
71 | 75 | $sideloader_args = array( |
@@ -39,12 +39,12 @@ discard block |
||
39 | 39 | public static function load_textdomain() { |
40 | 40 | self::_maybe_get_langfile(); |
41 | 41 | //now load the textdomain |
42 | - if ( ! empty( self::$_lang ) && is_readable( EE_LANGUAGES_SAFE_DIR . 'event_espresso-' . self::$_lang . '.mo' ) ) { |
|
42 | + if ( ! empty(self::$_lang) && is_readable(EE_LANGUAGES_SAFE_DIR.'event_espresso-'.self::$_lang.'.mo')) { |
|
43 | 43 | load_plugin_textdomain('event_espresso', FALSE, EE_LANGUAGES_SAFE_LOC); |
44 | - } else if ( ! empty( self::$_lang ) && is_readable( EE_LANGUAGES_SAFE_DIR . 'event-espresso-4-' . self::$_lang . '.mo' ) ) { |
|
45 | - load_textdomain( 'event_espresso', EE_LANGUAGES_SAFE_DIR . 'event-espresso-4-' . self::$_lang . '.mo' ); |
|
44 | + } else if ( ! empty(self::$_lang) && is_readable(EE_LANGUAGES_SAFE_DIR.'event-espresso-4-'.self::$_lang.'.mo')) { |
|
45 | + load_textdomain('event_espresso', EE_LANGUAGES_SAFE_DIR.'event-espresso-4-'.self::$_lang.'.mo'); |
|
46 | 46 | } else { |
47 | - load_plugin_textdomain( 'event_espresso', FALSE, dirname( EE_PLUGIN_BASENAME ) . '/languages/'); |
|
47 | + load_plugin_textdomain('event_espresso', FALSE, dirname(EE_PLUGIN_BASENAME).'/languages/'); |
|
48 | 48 | } |
49 | 49 | } |
50 | 50 | |
@@ -59,24 +59,24 @@ discard block |
||
59 | 59 | */ |
60 | 60 | private static function _maybe_get_langfile() { |
61 | 61 | self::$_lang = get_locale(); |
62 | - if ( $has_check = get_option( 'ee_lang_check_' . self::$_lang . '_' . EVENT_ESPRESSO_VERSION ) || empty( self::$_lang ) ) |
|
62 | + if ($has_check = get_option('ee_lang_check_'.self::$_lang.'_'.EVENT_ESPRESSO_VERSION) || empty(self::$_lang)) |
|
63 | 63 | return; |
64 | 64 | |
65 | 65 | //if lang is en_US or empty then lets just get out. (Event Espresso core is en_US) |
66 | - if ( empty( self::$_lang ) || self::$_lang == 'en_US' ) |
|
66 | + if (empty(self::$_lang) || self::$_lang == 'en_US') |
|
67 | 67 | return; |
68 | 68 | |
69 | 69 | //made it here so let's get the file from the github repo |
70 | 70 | $sideloader_args = array( |
71 | - '_upload_to' => EE_PLUGIN_DIR_PATH . 'languages/', |
|
72 | - '_upload_from' => 'https://github.com/eventespresso/languages-ee4/blob/master/event_espresso-' . self::$_lang . '.mo?raw=true', |
|
73 | - '_new_file_name' => 'event_espresso-' . self::$_lang . '.mo' |
|
71 | + '_upload_to' => EE_PLUGIN_DIR_PATH.'languages/', |
|
72 | + '_upload_from' => 'https://github.com/eventespresso/languages-ee4/blob/master/event_espresso-'.self::$_lang.'.mo?raw=true', |
|
73 | + '_new_file_name' => 'event_espresso-'.self::$_lang.'.mo' |
|
74 | 74 | ); |
75 | 75 | |
76 | 76 | |
77 | - $sideloader = EE_Registry::instance()->load_helper('Sideloader', $sideloader_args, FALSE ); |
|
77 | + $sideloader = EE_Registry::instance()->load_helper('Sideloader', $sideloader_args, FALSE); |
|
78 | 78 | |
79 | 79 | $sideloader->sideload(); |
80 | - update_option( 'ee_lang_check_' . self::$_lang . '_' . EVENT_ESPRESSO_VERSION, 1 ); |
|
80 | + update_option('ee_lang_check_'.self::$_lang.'_'.EVENT_ESPRESSO_VERSION, 1); |
|
81 | 81 | } |
82 | 82 | } //end EE_Load_Textdomain |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if (!defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if (!defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * |
4 | 6 | * Class EE_Log |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php if (!defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
2 | 2 | /** |
3 | 3 | * |
4 | 4 | * Class EE_Log |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * @return EE_Log |
63 | 63 | */ |
64 | 64 | public static function instance() { |
65 | - if ( ! self::$_instance instanceof EE_Log ) { |
|
65 | + if ( ! self::$_instance instanceof EE_Log) { |
|
66 | 66 | self::$_instance = new self(); |
67 | 67 | } |
68 | 68 | return self::$_instance; |
@@ -74,11 +74,11 @@ discard block |
||
74 | 74 | */ |
75 | 75 | private function __construct() { |
76 | 76 | |
77 | - if ( ! EE_Registry::instance()->CFG->admin->use_full_logging && ! EE_Registry::instance()->CFG->admin->use_remote_logging ) { |
|
77 | + if ( ! EE_Registry::instance()->CFG->admin->use_full_logging && ! EE_Registry::instance()->CFG->admin->use_remote_logging) { |
|
78 | 78 | return; |
79 | 79 | } |
80 | 80 | |
81 | - $this->_logs_folder = EVENT_ESPRESSO_UPLOAD_DIR . 'logs' . DS; |
|
81 | + $this->_logs_folder = EVENT_ESPRESSO_UPLOAD_DIR.'logs'.DS; |
|
82 | 82 | $this->_log_file = EE_Registry::instance()->CFG->admin->log_file_name(); |
83 | 83 | $this->_log = ''; |
84 | 84 | $this->_debug_file = EE_Registry::instance()->CFG->admin->debug_file_name(); |
@@ -86,15 +86,15 @@ discard block |
||
86 | 86 | $this->_remote_logging_url = EE_Registry::instance()->CFG->admin->remote_logging_url; |
87 | 87 | $this->_remote_log = ''; |
88 | 88 | |
89 | - add_action( 'admin_init', array( $this, 'verify_filesystem' ), -10 ); |
|
90 | - add_action( 'AHEE_log', array( $this, 'log' ), 10, 4 ); |
|
91 | - if ( EE_Registry::instance()->CFG->admin->use_full_logging ) { |
|
92 | - add_action( 'shutdown', array( $this, 'write_log' ), 9999 ); |
|
89 | + add_action('admin_init', array($this, 'verify_filesystem'), -10); |
|
90 | + add_action('AHEE_log', array($this, 'log'), 10, 4); |
|
91 | + if (EE_Registry::instance()->CFG->admin->use_full_logging) { |
|
92 | + add_action('shutdown', array($this, 'write_log'), 9999); |
|
93 | 93 | // if WP_DEBUG |
94 | - add_action( 'shutdown', array( $this, 'write_debug' ), 9999 ); |
|
94 | + add_action('shutdown', array($this, 'write_debug'), 9999); |
|
95 | 95 | } |
96 | - if ( EE_Registry::instance()->CFG->admin->use_remote_logging ) { |
|
97 | - add_action( 'shutdown', array( $this, 'send_log' ), 9999 ); |
|
96 | + if (EE_Registry::instance()->CFG->admin->use_remote_logging) { |
|
97 | + add_action('shutdown', array($this, 'send_log'), 9999); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | } |
@@ -108,11 +108,11 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function verify_filesystem() { |
110 | 110 | try { |
111 | - EEH_File::ensure_file_exists_and_is_writable( $this->_logs_folder . $this->_log_file ); |
|
112 | - EEH_File::ensure_file_exists_and_is_writable( $this->_logs_folder . $this->_debug_file ); |
|
113 | - EEH_File::add_htaccess_deny_from_all( $this->_logs_folder ); |
|
114 | - } catch( EE_Error $e ){ |
|
115 | - EE_Error::add_error( sprintf( __( 'Event Espresso logging could not be setup because: %s', 'event_espresso' ), ' ' . $e->getMessage() ), __FILE__, __FUNCTION__, __LINE__ ); |
|
111 | + EEH_File::ensure_file_exists_and_is_writable($this->_logs_folder.$this->_log_file); |
|
112 | + EEH_File::ensure_file_exists_and_is_writable($this->_logs_folder.$this->_debug_file); |
|
113 | + EEH_File::add_htaccess_deny_from_all($this->_logs_folder); |
|
114 | + } catch (EE_Error $e) { |
|
115 | + EE_Error::add_error(sprintf(__('Event Espresso logging could not be setup because: %s', 'event_espresso'), ' '.$e->getMessage()), __FILE__, __FUNCTION__, __LINE__); |
|
116 | 116 | return; |
117 | 117 | } |
118 | 118 | } |
@@ -129,15 +129,15 @@ discard block |
||
129 | 129 | * @param string $type |
130 | 130 | * @return string |
131 | 131 | */ |
132 | - private function _format_message( $file = '', $function = '', $message = '', $type = '' ) { |
|
133 | - $msg = '----------------------------------------------------------------------------------------' . PHP_EOL; |
|
134 | - $msg .= '[' . current_time( 'mysql' ) . '] '; |
|
135 | - $msg .= ! empty( $file ) ? basename( $file ) : ''; |
|
136 | - $msg .= ! empty( $file ) && ! empty( $function ) ? ' -> ' : ''; |
|
137 | - $msg .= ! empty( $function ) ? $function . '()' : ''; |
|
132 | + private function _format_message($file = '', $function = '', $message = '', $type = '') { |
|
133 | + $msg = '----------------------------------------------------------------------------------------'.PHP_EOL; |
|
134 | + $msg .= '['.current_time('mysql').'] '; |
|
135 | + $msg .= ! empty($file) ? basename($file) : ''; |
|
136 | + $msg .= ! empty($file) && ! empty($function) ? ' -> ' : ''; |
|
137 | + $msg .= ! empty($function) ? $function.'()' : ''; |
|
138 | 138 | $msg .= PHP_EOL; |
139 | - $type = ! empty( $type ) ? $type : 'log message'; |
|
140 | - $msg .= ! empty( $message ) ? "\t" . '[' . $type . '] ' . $message . PHP_EOL : ''; |
|
139 | + $type = ! empty($type) ? $type : 'log message'; |
|
140 | + $msg .= ! empty($message) ? "\t".'['.$type.'] '.$message.PHP_EOL : ''; |
|
141 | 141 | return $msg; |
142 | 142 | } |
143 | 143 | |
@@ -152,8 +152,8 @@ discard block |
||
152 | 152 | * @param string $message |
153 | 153 | * @param string $type |
154 | 154 | */ |
155 | - public function log( $file = '', $function = '', $message = '', $type = '' ) { |
|
156 | - $this->_log .= $this->_format_message( $file, $function, $message, $type ); |
|
155 | + public function log($file = '', $function = '', $message = '', $type = '') { |
|
156 | + $this->_log .= $this->_format_message($file, $function, $message, $type); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | |
@@ -165,10 +165,10 @@ discard block |
||
165 | 165 | public function write_log() { |
166 | 166 | try { |
167 | 167 | //get existing log file and append new log info |
168 | - $this->_log = EEH_File::get_file_contents( $this->_logs_folder . $this->_log_file ) . $this->_log; |
|
169 | - EEH_File::write_to_file( $this->_logs_folder . $this->_log_file, $this->_log, 'Event Espresso Log' ); |
|
170 | - } catch( EE_Error $e ){ |
|
171 | - EE_Error::add_error( sprintf( __( 'Could not write to the Event Espresso log file because: %s', 'event_espresso' ), ' ' . $e->getMessage() ), __FILE__, __FUNCTION__, __LINE__ ); |
|
168 | + $this->_log = EEH_File::get_file_contents($this->_logs_folder.$this->_log_file).$this->_log; |
|
169 | + EEH_File::write_to_file($this->_logs_folder.$this->_log_file, $this->_log, 'Event Espresso Log'); |
|
170 | + } catch (EE_Error $e) { |
|
171 | + EE_Error::add_error(sprintf(__('Could not write to the Event Espresso log file because: %s', 'event_espresso'), ' '.$e->getMessage()), __FILE__, __FUNCTION__, __LINE__); |
|
172 | 172 | return; |
173 | 173 | } |
174 | 174 | } |
@@ -181,31 +181,31 @@ discard block |
||
181 | 181 | */ |
182 | 182 | public function send_log() { |
183 | 183 | |
184 | - if ( empty( $this->_remote_logging_url )) { |
|
184 | + if (empty($this->_remote_logging_url)) { |
|
185 | 185 | return; |
186 | 186 | } |
187 | 187 | |
188 | - $data = 'domain=' . $_SERVER['HTTP_HOST']; |
|
189 | - $data .= '&ip=' . $_SERVER['SERVER_ADDR']; |
|
190 | - $data .= '&server_type=' . $_SERVER['SERVER_SOFTWARE']; |
|
191 | - $data .= '&time=' . time(); |
|
192 | - $data .= '&remote_log=' . $this->_log; |
|
193 | - $data .= '&request_array=' . json_encode( $_REQUEST ); |
|
188 | + $data = 'domain='.$_SERVER['HTTP_HOST']; |
|
189 | + $data .= '&ip='.$_SERVER['SERVER_ADDR']; |
|
190 | + $data .= '&server_type='.$_SERVER['SERVER_SOFTWARE']; |
|
191 | + $data .= '&time='.time(); |
|
192 | + $data .= '&remote_log='.$this->_log; |
|
193 | + $data .= '&request_array='.json_encode($_REQUEST); |
|
194 | 194 | $data .= '&action=save'; |
195 | 195 | |
196 | - if ( defined( 'EELOGGING_PASS' )) { |
|
197 | - $data .= '&pass=' . EELOGGING_PASS; |
|
196 | + if (defined('EELOGGING_PASS')) { |
|
197 | + $data .= '&pass='.EELOGGING_PASS; |
|
198 | 198 | } |
199 | - if ( defined( 'EELOGGING_KEY' )) { |
|
200 | - $data .= '&key=' . EELOGGING_KEY; |
|
199 | + if (defined('EELOGGING_KEY')) { |
|
200 | + $data .= '&key='.EELOGGING_KEY; |
|
201 | 201 | } |
202 | 202 | |
203 | - $c = curl_init( $this->_remote_logging_url ); |
|
204 | - curl_setopt( $c, CURLOPT_POST, TRUE ); |
|
205 | - curl_setopt( $c, CURLOPT_POSTFIELDS, $data ); |
|
206 | - curl_setopt( $c, CURLOPT_RETURNTRANSFER, TRUE ); |
|
207 | - curl_exec( $c ); |
|
208 | - curl_close( $c ); |
|
203 | + $c = curl_init($this->_remote_logging_url); |
|
204 | + curl_setopt($c, CURLOPT_POST, TRUE); |
|
205 | + curl_setopt($c, CURLOPT_POSTFIELDS, $data); |
|
206 | + curl_setopt($c, CURLOPT_RETURNTRANSFER, TRUE); |
|
207 | + curl_exec($c); |
|
208 | + curl_close($c); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | |
@@ -216,18 +216,18 @@ discard block |
||
216 | 216 | * previous entries are overwritten |
217 | 217 | */ |
218 | 218 | public function write_debug() { |
219 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
219 | + if (defined('WP_DEBUG') && WP_DEBUG) { |
|
220 | 220 | $this->_debug_log = ''; |
221 | - foreach ( $_GET as $key => $value ) { |
|
222 | - $this->_debug_log .= '$_GET["' . $key . '"] = "' . serialize($value) . '"' . PHP_EOL; |
|
221 | + foreach ($_GET as $key => $value) { |
|
222 | + $this->_debug_log .= '$_GET["'.$key.'"] = "'.serialize($value).'"'.PHP_EOL; |
|
223 | 223 | } |
224 | - foreach ( $_POST as $key => $value ) { |
|
225 | - $this->_debug_log .= '$_POST["' . $key . '"] = "' . serialize($value) . '"' . PHP_EOL; |
|
224 | + foreach ($_POST as $key => $value) { |
|
225 | + $this->_debug_log .= '$_POST["'.$key.'"] = "'.serialize($value).'"'.PHP_EOL; |
|
226 | 226 | } |
227 | 227 | try { |
228 | - EEH_File::write_to_file( $this->_logs_folder . $this->_debug_file, $this->_debug_log, 'Event Espresso Debug Log' ); |
|
229 | - } catch( EE_Error $e ){ |
|
230 | - EE_Error::add_error( sprintf( __( 'Could not write to the Event Espresso debug log file because: %s', 'event_espresso' ), ' ' . $e->getMessage() ), __FILE__, __FUNCTION__, __LINE__ ); |
|
228 | + EEH_File::write_to_file($this->_logs_folder.$this->_debug_file, $this->_debug_log, 'Event Espresso Debug Log'); |
|
229 | + } catch (EE_Error $e) { |
|
230 | + EE_Error::add_error(sprintf(__('Could not write to the Event Espresso debug log file because: %s', 'event_espresso'), ' '.$e->getMessage()), __FILE__, __FUNCTION__, __LINE__); |
|
231 | 231 | return; |
232 | 232 | } |
233 | 233 | } |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | * __clone |
240 | 240 | */ |
241 | 241 | public function __clone() { |
242 | - trigger_error( __( 'Clone is not allowed.', 'event_espresso' ), E_USER_ERROR ); |
|
242 | + trigger_error(__('Clone is not allowed.', 'event_espresso'), E_USER_ERROR); |
|
243 | 243 | } |
244 | 244 | |
245 | 245 |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * Class EE_Object_Repository |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | * @param array $arguments arrays of arguments that will be passed to the object's callback method |
39 | 39 | * @return bool | int |
40 | 40 | */ |
41 | - protected function _call_user_func_array_on_current( $callback = '', $arguments = array() ) { |
|
42 | - if ( $callback !== '' && method_exists( $this->current(), $callback ) ) { |
|
43 | - return call_user_func_array( array( $this->current(), $callback ), $arguments ); |
|
41 | + protected function _call_user_func_array_on_current($callback = '', $arguments = array()) { |
|
42 | + if ($callback !== '' && method_exists($this->current(), $callback)) { |
|
43 | + return call_user_func_array(array($this->current(), $callback), $arguments); |
|
44 | 44 | } |
45 | 45 | return false; |
46 | 46 | } |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | * @param string $callback name of method found on repository objects to be called |
57 | 57 | * @return bool | int |
58 | 58 | */ |
59 | - protected function _call_user_func_on_all( $callback = '' ) { |
|
59 | + protected function _call_user_func_on_all($callback = '') { |
|
60 | 60 | $success = true; |
61 | - if ( $this->valid() ) { |
|
61 | + if ($this->valid()) { |
|
62 | 62 | $this->rewind(); |
63 | - while ( $this->valid() ) { |
|
63 | + while ($this->valid()) { |
|
64 | 64 | // any negative result will toggle success to false |
65 | - $success = $this->_call_user_func_array_on_current( $callback ) ? $success : false; |
|
65 | + $success = $this->_call_user_func_array_on_current($callback) ? $success : false; |
|
66 | 66 | $this->next(); |
67 | 67 | } |
68 | 68 | $this->rewind(); |
@@ -86,9 +86,9 @@ discard block |
||
86 | 86 | * @param array $persistence_arguments arrays of arguments that will be passed to the object's persistence method |
87 | 87 | * @return bool | int |
88 | 88 | */ |
89 | - public function persist( $persistence_callback = '', $persistence_arguments = array() ) { |
|
90 | - $persistence_callback = ! empty( $persistence_callback ) ? $persistence_callback : $this->persist_method; |
|
91 | - return $this->_call_user_func_array_on_current( $persistence_callback, $persistence_arguments ); |
|
89 | + public function persist($persistence_callback = '', $persistence_arguments = array()) { |
|
90 | + $persistence_callback = ! empty($persistence_callback) ? $persistence_callback : $this->persist_method; |
|
91 | + return $this->_call_user_func_array_on_current($persistence_callback, $persistence_arguments); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | |
@@ -102,9 +102,9 @@ discard block |
||
102 | 102 | * @param string $persistence_callback name of method found on object that can be used for persisting the object |
103 | 103 | * @return bool | int |
104 | 104 | */ |
105 | - public function persist_all( $persistence_callback = '' ) { |
|
106 | - $persistence_callback = ! empty( $persistence_callback ) ? $persistence_callback : $this->persist_method; |
|
107 | - return $this->_call_user_func_on_all( $persistence_callback ); |
|
105 | + public function persist_all($persistence_callback = '') { |
|
106 | + $persistence_callback = ! empty($persistence_callback) ? $persistence_callback : $this->persist_method; |
|
107 | + return $this->_call_user_func_on_all($persistence_callback); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * @package Event Espresso |
16 | 16 | * @subpackage admin |
17 | 17 | */ |
18 | -abstract class EE_Admin_Page_Menu_Map { |
|
18 | +abstract class EE_Admin_Page_Menu_Map { |
|
19 | 19 | |
20 | 20 | |
21 | 21 | /** |
@@ -155,28 +155,28 @@ discard block |
||
155 | 155 | * are present. |
156 | 156 | * @return void |
157 | 157 | */ |
158 | - public function __construct( $menu_args, $required ) { |
|
158 | + public function __construct($menu_args, $required) { |
|
159 | 159 | //filter all args before processing so plugins can manipulate various settings for menus. |
160 | - $menu_args = apply_filters( 'FHEE__EE_Admin_Page_Menu_Map__construct__menu_args', $menu_args, $required, get_class( $this ) ); |
|
160 | + $menu_args = apply_filters('FHEE__EE_Admin_Page_Menu_Map__construct__menu_args', $menu_args, $required, get_class($this)); |
|
161 | 161 | |
162 | 162 | |
163 | 163 | //verify that required keys are present in the incoming array. |
164 | - $missing = array_diff( (array) $required, array_keys( (array) $menu_args ) ); |
|
164 | + $missing = array_diff((array) $required, array_keys((array) $menu_args)); |
|
165 | 165 | |
166 | - if ( !empty( $missing ) ) { |
|
167 | - throw new EE_Error( sprintf( __('%s is missing some expected keys in the argument array. The following keys are missing: %s', 'event_espresso'), get_class( $this ), implode(', ', $missing ) ) ); |
|
166 | + if ( ! empty($missing)) { |
|
167 | + throw new EE_Error(sprintf(__('%s is missing some expected keys in the argument array. The following keys are missing: %s', 'event_espresso'), get_class($this), implode(', ', $missing))); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | //made it here okay, so let's set the properties! |
171 | - foreach ( $menu_args as $prop => $value ) { |
|
171 | + foreach ($menu_args as $prop => $value) { |
|
172 | 172 | |
173 | - switch ( $prop ) { |
|
173 | + switch ($prop) { |
|
174 | 174 | case 'show_on_menu' : |
175 | 175 | $value = (int) $value; |
176 | 176 | break; |
177 | 177 | case 'admin_init_page' : |
178 | - if ( in_array( 'admin_init_page', $required ) && ! $value instanceof EE_Admin_Page_Init ) { |
|
179 | - throw new EE_Error( sprintf( __('The value for the "admin_init_page" argument must be an instance of an EE_Admin_Page_Init object. Instead %s was given as the value.', 'event_espresso'), print_r($value, TRUE) ) ); |
|
178 | + if (in_array('admin_init_page', $required) && ! $value instanceof EE_Admin_Page_Init) { |
|
179 | + throw new EE_Error(sprintf(__('The value for the "admin_init_page" argument must be an instance of an EE_Admin_Page_Init object. Instead %s was given as the value.', 'event_espresso'), print_r($value, TRUE))); |
|
180 | 180 | } |
181 | 181 | break; |
182 | 182 | case 'menu_callback' : |
@@ -187,24 +187,24 @@ discard block |
||
187 | 187 | break; |
188 | 188 | |
189 | 189 | } |
190 | - if ( ! EEH_Class_Tools::has_property( $this, $prop ) ) |
|
191 | - throw new EE_Error( sprintf( __('The $menu_args coming into %s has a index key (%s) representing a property that is not defined by the class. Perhaps there is a typo?', 'event_espresso'), get_class( $this ), $prop ) ); |
|
190 | + if ( ! EEH_Class_Tools::has_property($this, $prop)) |
|
191 | + throw new EE_Error(sprintf(__('The $menu_args coming into %s has a index key (%s) representing a property that is not defined by the class. Perhaps there is a typo?', 'event_espresso'), get_class($this), $prop)); |
|
192 | 192 | $this->{$prop} = $value; |
193 | 193 | |
194 | 194 | } |
195 | 195 | |
196 | 196 | //filter capabilities (both static and dynamic) |
197 | - $this->capability = apply_filters( 'FHEE_management_capability', $this->capability, NULL ); |
|
198 | - $this->capability = apply_filters( 'FHEE_' . $this->menu_slug . '_capability', $this->capability, NULL ); |
|
197 | + $this->capability = apply_filters('FHEE_management_capability', $this->capability, NULL); |
|
198 | + $this->capability = apply_filters('FHEE_'.$this->menu_slug.'_capability', $this->capability, NULL); |
|
199 | 199 | |
200 | 200 | //Might need to change parent slug depending on maintenance mode. |
201 | - if ( ! empty( $this->maintenance_mode_parent ) && EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance ) { |
|
201 | + if ( ! empty($this->maintenance_mode_parent) && EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance) { |
|
202 | 202 | $this->parent_slug = $this->maintenance_mode_parent; |
203 | 203 | } |
204 | 204 | |
205 | 205 | //if empty menu_callback let's set default (but only if we have admin page init object) |
206 | - if ( empty( $this->menu_callback ) && $this->admin_init_page instanceof EE_Admin_Page_Init ) |
|
207 | - $this->menu_callback = array( $this->admin_init_page, 'initialize_admin_page' ); |
|
206 | + if (empty($this->menu_callback) && $this->admin_init_page instanceof EE_Admin_Page_Init) |
|
207 | + $this->menu_callback = array($this->admin_init_page, 'initialize_admin_page'); |
|
208 | 208 | |
209 | 209 | } |
210 | 210 | |
@@ -226,21 +226,21 @@ discard block |
||
226 | 226 | * @param boolean $network_admin whether this is being added to the network admin page or not |
227 | 227 | * @since 4.4.0 |
228 | 228 | */ |
229 | - public function add_menu_page( $network_admin = FALSE ) { |
|
229 | + public function add_menu_page($network_admin = FALSE) { |
|
230 | 230 | |
231 | 231 | $show_on_menu_int = (int) $this->show_on_menu; |
232 | - if( ( $network_admin && in_array( $show_on_menu_int, array( self::BLOG_AND_NETWORK_ADMIN, self::NETWORK_ADMIN_ONLY ), TRUE ) ) |
|
232 | + if (($network_admin && in_array($show_on_menu_int, array(self::BLOG_AND_NETWORK_ADMIN, self::NETWORK_ADMIN_ONLY), TRUE)) |
|
233 | 233 | || |
234 | - ( ! $network_admin && in_array( $show_on_menu_int, array( self::BLOG_AND_NETWORK_ADMIN, self::BLOG_ADMIN_ONLY ), TRUE )) ){ |
|
234 | + ( ! $network_admin && in_array($show_on_menu_int, array(self::BLOG_AND_NETWORK_ADMIN, self::BLOG_ADMIN_ONLY), TRUE))) { |
|
235 | 235 | $wp_page_slug = $this->_add_menu_page(); |
236 | - }else{ |
|
236 | + } else { |
|
237 | 237 | $wp_page_slug = ''; |
238 | 238 | } |
239 | 239 | |
240 | - if ( !empty( $wp_page_slug ) && $this->admin_init_page instanceof EE_Admin_Page_Init ) { |
|
240 | + if ( ! empty($wp_page_slug) && $this->admin_init_page instanceof EE_Admin_Page_Init) { |
|
241 | 241 | try { |
242 | - $this->admin_init_page->set_page_dependencies( $wp_page_slug ); |
|
243 | - } catch( EE_Error $e ) { |
|
242 | + $this->admin_init_page->set_page_dependencies($wp_page_slug); |
|
243 | + } catch (EE_Error $e) { |
|
244 | 244 | $e->get_error(); |
245 | 245 | } |
246 | 246 | } |
@@ -293,12 +293,12 @@ discard block |
||
293 | 293 | public $position; |
294 | 294 | |
295 | 295 | |
296 | - public function __construct( $menu_args ) { |
|
297 | - $required = array( 'menu_label', 'parent_slug', 'menu_slug', 'menu_group', 'menu_order', 'admin_init_page'); |
|
296 | + public function __construct($menu_args) { |
|
297 | + $required = array('menu_label', 'parent_slug', 'menu_slug', 'menu_group', 'menu_order', 'admin_init_page'); |
|
298 | 298 | |
299 | - parent::__construct( $menu_args, $required ); |
|
299 | + parent::__construct($menu_args, $required); |
|
300 | 300 | |
301 | - $this->position = ! empty( $this->position ) ? (int) $this->position : $this->position; |
|
301 | + $this->position = ! empty($this->position) ? (int) $this->position : $this->position; |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | |
@@ -306,9 +306,9 @@ discard block |
||
306 | 306 | * Uses the proper WP utility for registering a menu page for the main WP pages. |
307 | 307 | */ |
308 | 308 | protected function _add_menu_page() { |
309 | - $main = add_menu_page( $this->title, $this->menu_label, $this->capability, $this->parent_slug, $this->menu_callback, $this->icon_url, $this->position ); |
|
310 | - if ( ! empty( $this->subtitle ) ) { |
|
311 | - add_submenu_page( $this->parent_slug, $this->subtitle, $this->subtitle, $this->capability, $this->menu_slug, $this->menu_callback ); |
|
309 | + $main = add_menu_page($this->title, $this->menu_label, $this->capability, $this->parent_slug, $this->menu_callback, $this->icon_url, $this->position); |
|
310 | + if ( ! empty($this->subtitle)) { |
|
311 | + add_submenu_page($this->parent_slug, $this->subtitle, $this->subtitle, $this->capability, $this->menu_slug, $this->menu_callback); |
|
312 | 312 | } |
313 | 313 | return $main; |
314 | 314 | } |
@@ -325,13 +325,13 @@ discard block |
||
325 | 325 | */ |
326 | 326 | class EE_Admin_Page_Sub_Menu extends EE_Admin_Page_Main_Menu { |
327 | 327 | |
328 | - public function __construct( $menu_args ) { |
|
329 | - parent::__construct( $menu_args ); |
|
328 | + public function __construct($menu_args) { |
|
329 | + parent::__construct($menu_args); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | |
333 | 333 | protected function _add_menu_page() { |
334 | - return add_submenu_page( $this->parent_slug, $this->title, $this->menu_label, $this->capability, $this->menu_slug, $this->menu_callback ); |
|
334 | + return add_submenu_page($this->parent_slug, $this->title, $this->menu_label, $this->capability, $this->menu_slug, $this->menu_callback); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | } //end class EE_Admin_Page_Menu_Map |
@@ -352,18 +352,18 @@ discard block |
||
352 | 352 | |
353 | 353 | |
354 | 354 | |
355 | - public function __construct( $menu_args = array() ) { |
|
356 | - $required = array( 'menu_label', 'menu_slug', 'menu_order', 'parent_slug' ); |
|
357 | - parent::__construct( $menu_args, $required ); |
|
355 | + public function __construct($menu_args = array()) { |
|
356 | + $required = array('menu_label', 'menu_slug', 'menu_order', 'parent_slug'); |
|
357 | + parent::__construct($menu_args, $required); |
|
358 | 358 | } |
359 | 359 | |
360 | 360 | |
361 | 361 | protected function _add_menu_page() { |
362 | - return add_submenu_page( $this->parent_slug, $this->menu_label, $this->_group_link(), $this->capability, $this->menu_slug, '__return_false' ); |
|
362 | + return add_submenu_page($this->parent_slug, $this->menu_label, $this->_group_link(), $this->capability, $this->menu_slug, '__return_false'); |
|
363 | 363 | } |
364 | 364 | |
365 | 365 | |
366 | 366 | private function _group_link() { |
367 | - return '<span class="ee_menu_group" onclick="return false;">' . $this->menu_label . '</span>'; |
|
367 | + return '<span class="ee_menu_group" onclick="return false;">'.$this->menu_label.'</span>'; |
|
368 | 368 | } |
369 | 369 | } //end EE_Admin_Page_Menu_Group |
@@ -187,8 +187,9 @@ discard block |
||
187 | 187 | break; |
188 | 188 | |
189 | 189 | } |
190 | - if ( ! EEH_Class_Tools::has_property( $this, $prop ) ) |
|
191 | - throw new EE_Error( sprintf( __('The $menu_args coming into %s has a index key (%s) representing a property that is not defined by the class. Perhaps there is a typo?', 'event_espresso'), get_class( $this ), $prop ) ); |
|
190 | + if ( ! EEH_Class_Tools::has_property( $this, $prop ) ) { |
|
191 | + throw new EE_Error( sprintf( __('The $menu_args coming into %s has a index key (%s) representing a property that is not defined by the class. Perhaps there is a typo?', 'event_espresso'), get_class( $this ), $prop ) ); |
|
192 | + } |
|
192 | 193 | $this->{$prop} = $value; |
193 | 194 | |
194 | 195 | } |
@@ -203,8 +204,9 @@ discard block |
||
203 | 204 | } |
204 | 205 | |
205 | 206 | //if empty menu_callback let's set default (but only if we have admin page init object) |
206 | - if ( empty( $this->menu_callback ) && $this->admin_init_page instanceof EE_Admin_Page_Init ) |
|
207 | - $this->menu_callback = array( $this->admin_init_page, 'initialize_admin_page' ); |
|
207 | + if ( empty( $this->menu_callback ) && $this->admin_init_page instanceof EE_Admin_Page_Init ) { |
|
208 | + $this->menu_callback = array( $this->admin_init_page, 'initialize_admin_page' ); |
|
209 | + } |
|
208 | 210 | |
209 | 211 | } |
210 | 212 | |
@@ -233,7 +235,7 @@ discard block |
||
233 | 235 | || |
234 | 236 | ( ! $network_admin && in_array( $show_on_menu_int, array( self::BLOG_AND_NETWORK_ADMIN, self::BLOG_ADMIN_ONLY ), TRUE )) ){ |
235 | 237 | $wp_page_slug = $this->_add_menu_page(); |
236 | - }else{ |
|
238 | + } else{ |
|
237 | 239 | $wp_page_slug = ''; |
238 | 240 | } |
239 | 241 |
@@ -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 | /** |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | */ |
116 | 116 | public function __construct($caf = FALSE) { |
117 | 117 | $this->_is_caf = $caf; |
118 | - $this->_req_data = array_merge( $_GET, $_POST ); |
|
118 | + $this->_req_data = array_merge($_GET, $_POST); |
|
119 | 119 | $this->_set_tour_properties(); |
120 | 120 | $this->_set_tour_stops(); |
121 | 121 | $this->_set_tour_options(); |
@@ -158,36 +158,36 @@ discard block |
||
158 | 158 | * @access protected |
159 | 159 | * @return void |
160 | 160 | */ |
161 | - protected function _set_tour_options( $options = array() ) { |
|
161 | + protected function _set_tour_options($options = array()) { |
|
162 | 162 | $defaults = array( |
163 | - 'tipLocation' => 'bottom', // 'top', 'bottom', 'right', 'left' in relation to parent |
|
164 | - 'nubPosition' => 'auto', // override on a per tooltip bases. can be "auto", "right", "top", "bottom", "left" |
|
165 | - 'tipAdjustmentY' => 0, //allow for adjustment of tip |
|
166 | - 'tipAdjustmentX' => 0, //allow for adjustment of tip |
|
163 | + 'tipLocation' => 'bottom', // 'top', 'bottom', 'right', 'left' in relation to parent |
|
164 | + 'nubPosition' => 'auto', // override on a per tooltip bases. can be "auto", "right", "top", "bottom", "left" |
|
165 | + 'tipAdjustmentY' => 0, //allow for adjustment of tip |
|
166 | + 'tipAdjustmentX' => 0, //allow for adjustment of tip |
|
167 | 167 | 'scroll' => true, //whether to scrollTo the next step or not |
168 | - 'scrollSpeed' => 300, // Page scrolling speed in ms |
|
169 | - 'timer' => 0, // 0 = off, all other numbers = time(ms) |
|
170 | - 'autoStart' => true, // true or false - false tour starts when restart called |
|
171 | - 'startTimerOnClick' => true, // true/false to start timer on first click |
|
172 | - 'nextButton' => true, // true/false for next button visibility |
|
168 | + 'scrollSpeed' => 300, // Page scrolling speed in ms |
|
169 | + 'timer' => 0, // 0 = off, all other numbers = time(ms) |
|
170 | + 'autoStart' => true, // true or false - false tour starts when restart called |
|
171 | + 'startTimerOnClick' => true, // true/false to start timer on first click |
|
172 | + 'nextButton' => true, // true/false for next button visibility |
|
173 | 173 | 'button_text' => __('Next', 'event_espresso'), |
174 | - 'tipAnimation' => 'fade', // 'pop' or 'fade' in each tip |
|
175 | - 'pauseAfter' => array(), // array of indexes where to pause the tour after |
|
176 | - 'tipAnimationFadeSpeed' => 300, // if 'fade'- speed in ms of transition |
|
177 | - 'cookieMonster' => true, // true/false for whether cookies are used |
|
178 | - 'cookieName' => $this->get_slug(), // choose your own cookie name (setup will add the prefix for the specific page joyride) |
|
179 | - 'cookieDomain' => false, // set to false or yoursite.com |
|
174 | + 'tipAnimation' => 'fade', // 'pop' or 'fade' in each tip |
|
175 | + 'pauseAfter' => array(), // array of indexes where to pause the tour after |
|
176 | + 'tipAnimationFadeSpeed' => 300, // if 'fade'- speed in ms of transition |
|
177 | + 'cookieMonster' => true, // true/false for whether cookies are used |
|
178 | + 'cookieName' => $this->get_slug(), // choose your own cookie name (setup will add the prefix for the specific page joyride) |
|
179 | + 'cookieDomain' => false, // set to false or yoursite.com |
|
180 | 180 | //'tipContainer' => 'body', // Where the tip be attached if not inline |
181 | - 'modal' => false, // Whether to cover page with modal during the tour |
|
182 | - 'expose' => false, // Whether to expose the elements at each step in the tour (requires modal:true), |
|
183 | - 'postExposeCallback' => 'EEHelpTour.postExposeCallback', // A method to call after an element has been exposed |
|
184 | - 'preRideCallback' => 'EEHelpTour_preRideCallback', // A method to call before the tour starts (passed index, tip, and cloned exposed element) |
|
185 | - 'postRideCallback' => 'EEHelpTour_postRideCallback', // a method to call once the tour closes. This will correspond to the name of a js method that will have to be defined in loaded js. |
|
186 | - 'preStepCallback' => 'EEHelpTour_preStepCallback', // A method to call before each step |
|
187 | - 'postStepCallback' => 'EEHelpTour_postStepCallback', // A method to call after each step (remember this will correspond with a js method that you will have to define in a js file BEFORE ee-help-tour.js loads, if the default methods do not exist, then ee-help-tour.js just substitues empty functions $.noop)/**/ |
|
181 | + 'modal' => false, // Whether to cover page with modal during the tour |
|
182 | + 'expose' => false, // Whether to expose the elements at each step in the tour (requires modal:true), |
|
183 | + 'postExposeCallback' => 'EEHelpTour.postExposeCallback', // A method to call after an element has been exposed |
|
184 | + 'preRideCallback' => 'EEHelpTour_preRideCallback', // A method to call before the tour starts (passed index, tip, and cloned exposed element) |
|
185 | + 'postRideCallback' => 'EEHelpTour_postRideCallback', // a method to call once the tour closes. This will correspond to the name of a js method that will have to be defined in loaded js. |
|
186 | + 'preStepCallback' => 'EEHelpTour_preStepCallback', // A method to call before each step |
|
187 | + 'postStepCallback' => 'EEHelpTour_postStepCallback', // A method to call after each step (remember this will correspond with a js method that you will have to define in a js file BEFORE ee-help-tour.js loads, if the default methods do not exist, then ee-help-tour.js just substitues empty functions $.noop)/**/ |
|
188 | 188 | ); |
189 | 189 | |
190 | - $options = !empty( $options ) && is_array($options) ? array_merge( $defaults, $options ) : $defaults; |
|
190 | + $options = ! empty($options) && is_array($options) ? array_merge($defaults, $options) : $defaults; |
|
191 | 191 | $this->_options = $options; |
192 | 192 | } |
193 | 193 | |
@@ -202,8 +202,8 @@ discard block |
||
202 | 202 | * @return string slug for the tour |
203 | 203 | */ |
204 | 204 | public function get_slug() { |
205 | - if ( empty( $this->_slug ) ) |
|
206 | - throw new EE_Error( sprintf(__('There is no slug set for the help tour class (%s). Make sure that the $_slug property is set in the class constructor', 'event_espresso'), get_class($this) ) ); |
|
205 | + if (empty($this->_slug)) |
|
206 | + throw new EE_Error(sprintf(__('There is no slug set for the help tour class (%s). Make sure that the $_slug property is set in the class constructor', 'event_espresso'), get_class($this))); |
|
207 | 207 | return $this->_slug; |
208 | 208 | } |
209 | 209 | |
@@ -215,8 +215,8 @@ discard block |
||
215 | 215 | * @return string |
216 | 216 | */ |
217 | 217 | public function get_label() { |
218 | - if ( empty( $this->_label ) ) |
|
219 | - throw new EE_Error( sprintf( __('There is no label set for the help tour class (%s). Make sure that the $_label property is set in the class constructor', 'event_espresso'), get_class($this) ) ); |
|
218 | + if (empty($this->_label)) |
|
219 | + throw new EE_Error(sprintf(__('There is no label set for the help tour class (%s). Make sure that the $_label property is set in the class constructor', 'event_espresso'), get_class($this))); |
|
220 | 220 | return $this->_label; |
221 | 221 | } |
222 | 222 | |
@@ -227,8 +227,8 @@ discard block |
||
227 | 227 | * @return array |
228 | 228 | */ |
229 | 229 | public function get_stops() { |
230 | - foreach( $this->_stops as $ind => $stop ) { |
|
231 | - if ( ! isset( $stop['button_text'] ) ) { |
|
230 | + foreach ($this->_stops as $ind => $stop) { |
|
231 | + if ( ! isset($stop['button_text'])) { |
|
232 | 232 | $this->_stops[$ind]['button_text'] = $this->_options['button_text']; |
233 | 233 | } |
234 | 234 | } |
@@ -243,12 +243,12 @@ discard block |
||
243 | 243 | */ |
244 | 244 | public function get_options() { |
245 | 245 | //let's make sure there are not pauses set |
246 | - foreach ( $this->_stops as $ind => $stop ) { |
|
247 | - if ( isset( $stop['pause_after'] ) && $stop['pause_after'] ) { |
|
246 | + foreach ($this->_stops as $ind => $stop) { |
|
247 | + if (isset($stop['pause_after']) && $stop['pause_after']) { |
|
248 | 248 | $this->_options['pauseAfter'][] = $ind; |
249 | 249 | } |
250 | 250 | } |
251 | - return apply_filters( 'FHEE__' . get_class($this) . '__get_options', $this->_options, $this ); |
|
251 | + return apply_filters('FHEE__'.get_class($this).'__get_options', $this->_options, $this); |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | } |
@@ -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 |
@@ -202,8 +203,9 @@ discard block |
||
202 | 203 | * @return string slug for the tour |
203 | 204 | */ |
204 | 205 | public function get_slug() { |
205 | - if ( empty( $this->_slug ) ) |
|
206 | - throw new EE_Error( sprintf(__('There is no slug set for the help tour class (%s). Make sure that the $_slug property is set in the class constructor', 'event_espresso'), get_class($this) ) ); |
|
206 | + if ( empty( $this->_slug ) ) { |
|
207 | + throw new EE_Error( sprintf(__('There is no slug set for the help tour class (%s). Make sure that the $_slug property is set in the class constructor', 'event_espresso'), get_class($this) ) ); |
|
208 | + } |
|
207 | 209 | return $this->_slug; |
208 | 210 | } |
209 | 211 | |
@@ -215,8 +217,9 @@ discard block |
||
215 | 217 | * @return string |
216 | 218 | */ |
217 | 219 | public function get_label() { |
218 | - if ( empty( $this->_label ) ) |
|
219 | - throw new EE_Error( sprintf( __('There is no label set for the help tour class (%s). Make sure that the $_label property is set in the class constructor', 'event_espresso'), get_class($this) ) ); |
|
220 | + if ( empty( $this->_label ) ) { |
|
221 | + throw new EE_Error( sprintf( __('There is no label set for the help tour class (%s). Make sure that the $_label property is set in the class constructor', 'event_espresso'), get_class($this) ) ); |
|
222 | + } |
|
220 | 223 | return $this->_label; |
221 | 224 | } |
222 | 225 |
@@ -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 | /** |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | 'action' => 'admin_option_settings', |
61 | 61 | 'page' => 'espresso_general_settings' |
62 | 62 | ); |
63 | - return '<p>' . sprintf( __('That\'s it for the tour! At any time you can restart a tour by clicking on this help dropdown and then clicking one of the Tour buttons. There are help tours available on all Event Espresso Admin pages. If you want to turn off help tours for all pages, %sgo here%s. All the best with your events!', 'event_espresso'), '<a href="' . EE_Admin_Page::add_query_args_and_nonce($query_args, admin_url('admin.php') ) . '">', '</a>' ) . '</p>'; |
|
63 | + return '<p>'.sprintf(__('That\'s it for the tour! At any time you can restart a tour by clicking on this help dropdown and then clicking one of the Tour buttons. There are help tours available on all Event Espresso Admin pages. If you want to turn off help tours for all pages, %sgo here%s. All the best with your events!', 'event_espresso'), '<a href="'.EE_Admin_Page::add_query_args_and_nonce($query_args, admin_url('admin.php')).'">', '</a>').'</p>'; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | } |
67 | 67 | \ No newline at end of file |
@@ -1,6 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | +} |
|
4 | 5 | |
5 | 6 | /** |
6 | 7 | * Event Espresso |