@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | namespace EventEspresso\core\services\container; |
| 3 | 3 | |
| 4 | 4 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
| 5 | - exit('No direct script access allowed'); |
|
| 5 | + exit('No direct script access allowed'); |
|
| 6 | 6 | } |
| 7 | 7 | |
| 8 | 8 | |
@@ -25,54 +25,54 @@ discard block |
||
| 25 | 25 | { |
| 26 | 26 | |
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * @return string |
|
| 30 | - */ |
|
| 31 | - public function type() |
|
| 32 | - { |
|
| 33 | - return CoffeeMaker::BREW_NEW; |
|
| 34 | - } |
|
| 28 | + /** |
|
| 29 | + * @return string |
|
| 30 | + */ |
|
| 31 | + public function type() |
|
| 32 | + { |
|
| 33 | + return CoffeeMaker::BREW_NEW; |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * @param RecipeInterface $recipe |
|
| 40 | - * @param array $arguments |
|
| 41 | - * @return mixed |
|
| 42 | - */ |
|
| 43 | - public function brew(RecipeInterface $recipe, $arguments = array()) |
|
| 44 | - { |
|
| 45 | - $this->resolveClassAndFilepath($recipe); |
|
| 46 | - $reflector = $this->injector()->getReflectionClass($recipe->fqcn()); |
|
| 47 | - $method = $this->resolveInstantiationMethod($reflector); |
|
| 48 | - switch ($method) { |
|
| 49 | - case 'instance' : |
|
| 50 | - case 'new_instance' : |
|
| 51 | - case 'new_instance_from_db'; |
|
| 52 | - $injector = $this->injector(); |
|
| 53 | - $closure = function ($arguments) use ($recipe, $reflector, $method, $injector) { |
|
| 54 | - return call_user_func_array( |
|
| 55 | - array($reflector->getName(), $method), |
|
| 56 | - $injector->resolveDependencies($recipe, $reflector, $arguments) |
|
| 57 | - ); |
|
| 58 | - }; |
|
| 59 | - break; |
|
| 60 | - case 'newInstance' : |
|
| 61 | - $closure = function () use ($reflector) { |
|
| 62 | - return $reflector->newInstance(); |
|
| 63 | - }; |
|
| 64 | - break; |
|
| 65 | - case 'newInstanceArgs' : |
|
| 66 | - default : |
|
| 67 | - $injector = $this->injector(); |
|
| 68 | - $closure = function ($arguments) use ($recipe, $reflector, $injector) { |
|
| 69 | - return $reflector->newInstanceArgs( |
|
| 70 | - $injector->resolveDependencies($recipe, $reflector, $arguments) |
|
| 71 | - ); |
|
| 72 | - }; |
|
| 73 | - } |
|
| 74 | - return $this->coffeePot()->addClosure($recipe->identifier(), $closure); |
|
| 75 | - } |
|
| 38 | + /** |
|
| 39 | + * @param RecipeInterface $recipe |
|
| 40 | + * @param array $arguments |
|
| 41 | + * @return mixed |
|
| 42 | + */ |
|
| 43 | + public function brew(RecipeInterface $recipe, $arguments = array()) |
|
| 44 | + { |
|
| 45 | + $this->resolveClassAndFilepath($recipe); |
|
| 46 | + $reflector = $this->injector()->getReflectionClass($recipe->fqcn()); |
|
| 47 | + $method = $this->resolveInstantiationMethod($reflector); |
|
| 48 | + switch ($method) { |
|
| 49 | + case 'instance' : |
|
| 50 | + case 'new_instance' : |
|
| 51 | + case 'new_instance_from_db'; |
|
| 52 | + $injector = $this->injector(); |
|
| 53 | + $closure = function ($arguments) use ($recipe, $reflector, $method, $injector) { |
|
| 54 | + return call_user_func_array( |
|
| 55 | + array($reflector->getName(), $method), |
|
| 56 | + $injector->resolveDependencies($recipe, $reflector, $arguments) |
|
| 57 | + ); |
|
| 58 | + }; |
|
| 59 | + break; |
|
| 60 | + case 'newInstance' : |
|
| 61 | + $closure = function () use ($reflector) { |
|
| 62 | + return $reflector->newInstance(); |
|
| 63 | + }; |
|
| 64 | + break; |
|
| 65 | + case 'newInstanceArgs' : |
|
| 66 | + default : |
|
| 67 | + $injector = $this->injector(); |
|
| 68 | + $closure = function ($arguments) use ($recipe, $reflector, $injector) { |
|
| 69 | + return $reflector->newInstanceArgs( |
|
| 70 | + $injector->resolveDependencies($recipe, $reflector, $arguments) |
|
| 71 | + ); |
|
| 72 | + }; |
|
| 73 | + } |
|
| 74 | + return $this->coffeePot()->addClosure($recipe->identifier(), $closure); |
|
| 75 | + } |
|
| 76 | 76 | |
| 77 | 77 | |
| 78 | 78 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | case 'new_instance' : |
| 51 | 51 | case 'new_instance_from_db'; |
| 52 | 52 | $injector = $this->injector(); |
| 53 | - $closure = function ($arguments) use ($recipe, $reflector, $method, $injector) { |
|
| 53 | + $closure = function($arguments) use ($recipe, $reflector, $method, $injector) { |
|
| 54 | 54 | return call_user_func_array( |
| 55 | 55 | array($reflector->getName(), $method), |
| 56 | 56 | $injector->resolveDependencies($recipe, $reflector, $arguments) |
@@ -58,14 +58,14 @@ discard block |
||
| 58 | 58 | }; |
| 59 | 59 | break; |
| 60 | 60 | case 'newInstance' : |
| 61 | - $closure = function () use ($reflector) { |
|
| 61 | + $closure = function() use ($reflector) { |
|
| 62 | 62 | return $reflector->newInstance(); |
| 63 | 63 | }; |
| 64 | 64 | break; |
| 65 | 65 | case 'newInstanceArgs' : |
| 66 | 66 | default : |
| 67 | 67 | $injector = $this->injector(); |
| 68 | - $closure = function ($arguments) use ($recipe, $reflector, $injector) { |
|
| 68 | + $closure = function($arguments) use ($recipe, $reflector, $injector) { |
|
| 69 | 69 | return $reflector->newInstanceArgs( |
| 70 | 70 | $injector->resolveDependencies($recipe, $reflector, $arguments) |
| 71 | 71 | ); |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | namespace EventEspresso\core\services\container; |
| 3 | 3 | |
| 4 | 4 | if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
| 5 | - exit('No direct script access allowed'); |
|
| 5 | + exit('No direct script access allowed'); |
|
| 6 | 6 | } |
| 7 | 7 | |
| 8 | 8 | |
@@ -17,84 +17,84 @@ discard block |
||
| 17 | 17 | interface RecipeInterface |
| 18 | 18 | { |
| 19 | 19 | |
| 20 | - /** |
|
| 21 | - * @return string |
|
| 22 | - */ |
|
| 23 | - public function identifier(); |
|
| 24 | - |
|
| 25 | - /** |
|
| 26 | - * @return string |
|
| 27 | - */ |
|
| 28 | - public function fqcn(); |
|
| 29 | - |
|
| 30 | - /** |
|
| 31 | - * @return array |
|
| 32 | - */ |
|
| 33 | - public function ingredients(); |
|
| 34 | - |
|
| 35 | - /** |
|
| 36 | - * @return string |
|
| 37 | - */ |
|
| 38 | - public function type(); |
|
| 39 | - |
|
| 40 | - /** |
|
| 41 | - * @return array |
|
| 42 | - */ |
|
| 43 | - public function filters(); |
|
| 44 | - |
|
| 45 | - /** |
|
| 46 | - * @return array |
|
| 47 | - */ |
|
| 48 | - public function paths(); |
|
| 49 | - |
|
| 50 | - /** |
|
| 51 | - * @param string $identifier Identifier for the entity class that the Recipe applies to |
|
| 52 | - * Typically a Fully Qualified Class Name |
|
| 53 | - */ |
|
| 54 | - public function setIdentifier($identifier); |
|
| 55 | - |
|
| 56 | - /** |
|
| 57 | - * Ensures incoming string is a valid Fully Qualified Class Name, |
|
| 58 | - * except if this is the default wildcard Recipe ( * ), |
|
| 59 | - * or it's NOT an actual FQCN because the Recipe is using filepaths |
|
| 60 | - * for classes that are not PSR-4 compatible |
|
| 61 | - * PLZ NOTE: |
|
| 62 | - * Recipe::setFqcn() has a check to see if Recipe::$paths is empty or not, |
|
| 63 | - * therefore you should always call Recipe::setPaths() before Recipe::setFqcn() |
|
| 64 | - * |
|
| 65 | - * @param string $fqcn |
|
| 66 | - */ |
|
| 67 | - public function setFqcn($fqcn); |
|
| 68 | - |
|
| 69 | - /** |
|
| 70 | - * @param array $ingredients an array of dependencies where keys are the aliases and values are the FQCNs |
|
| 71 | - * example: |
|
| 72 | - * array( 'ClassInterface' => 'Fully\Qualified\ClassName' ) |
|
| 73 | - */ |
|
| 74 | - public function setIngredients(array $ingredients); |
|
| 75 | - |
|
| 76 | - /** |
|
| 77 | - * @param string $type one of the class constants returned from CoffeeMaker::getTypes() |
|
| 78 | - */ |
|
| 79 | - public function setType($type = CoffeeMaker::BREW_NEW); |
|
| 80 | - |
|
| 81 | - /** |
|
| 82 | - * @param array $filters an array of filters where keys are the aliases and values are the FQCNs |
|
| 83 | - * example: |
|
| 84 | - * array( 'ClassInterface' => 'Fully\Qualified\ClassName' ) |
|
| 85 | - */ |
|
| 86 | - public function setFilters(array $filters); |
|
| 87 | - |
|
| 88 | - /** |
|
| 89 | - * Ensures incoming paths is a valid filepath, or array of valid filepaths, |
|
| 90 | - * and merges them in with any existing filepaths |
|
| 91 | - * PLZ NOTE: |
|
| 92 | - * Recipe::setFqcn() has a check to see if Recipe::$paths is empty or not, |
|
| 93 | - * therefore you should always call Recipe::setPaths() before Recipe::setFqcn() |
|
| 94 | - * |
|
| 95 | - * @param string|array $paths |
|
| 96 | - */ |
|
| 97 | - public function setPaths($paths = array()); |
|
| 20 | + /** |
|
| 21 | + * @return string |
|
| 22 | + */ |
|
| 23 | + public function identifier(); |
|
| 24 | + |
|
| 25 | + /** |
|
| 26 | + * @return string |
|
| 27 | + */ |
|
| 28 | + public function fqcn(); |
|
| 29 | + |
|
| 30 | + /** |
|
| 31 | + * @return array |
|
| 32 | + */ |
|
| 33 | + public function ingredients(); |
|
| 34 | + |
|
| 35 | + /** |
|
| 36 | + * @return string |
|
| 37 | + */ |
|
| 38 | + public function type(); |
|
| 39 | + |
|
| 40 | + /** |
|
| 41 | + * @return array |
|
| 42 | + */ |
|
| 43 | + public function filters(); |
|
| 44 | + |
|
| 45 | + /** |
|
| 46 | + * @return array |
|
| 47 | + */ |
|
| 48 | + public function paths(); |
|
| 49 | + |
|
| 50 | + /** |
|
| 51 | + * @param string $identifier Identifier for the entity class that the Recipe applies to |
|
| 52 | + * Typically a Fully Qualified Class Name |
|
| 53 | + */ |
|
| 54 | + public function setIdentifier($identifier); |
|
| 55 | + |
|
| 56 | + /** |
|
| 57 | + * Ensures incoming string is a valid Fully Qualified Class Name, |
|
| 58 | + * except if this is the default wildcard Recipe ( * ), |
|
| 59 | + * or it's NOT an actual FQCN because the Recipe is using filepaths |
|
| 60 | + * for classes that are not PSR-4 compatible |
|
| 61 | + * PLZ NOTE: |
|
| 62 | + * Recipe::setFqcn() has a check to see if Recipe::$paths is empty or not, |
|
| 63 | + * therefore you should always call Recipe::setPaths() before Recipe::setFqcn() |
|
| 64 | + * |
|
| 65 | + * @param string $fqcn |
|
| 66 | + */ |
|
| 67 | + public function setFqcn($fqcn); |
|
| 68 | + |
|
| 69 | + /** |
|
| 70 | + * @param array $ingredients an array of dependencies where keys are the aliases and values are the FQCNs |
|
| 71 | + * example: |
|
| 72 | + * array( 'ClassInterface' => 'Fully\Qualified\ClassName' ) |
|
| 73 | + */ |
|
| 74 | + public function setIngredients(array $ingredients); |
|
| 75 | + |
|
| 76 | + /** |
|
| 77 | + * @param string $type one of the class constants returned from CoffeeMaker::getTypes() |
|
| 78 | + */ |
|
| 79 | + public function setType($type = CoffeeMaker::BREW_NEW); |
|
| 80 | + |
|
| 81 | + /** |
|
| 82 | + * @param array $filters an array of filters where keys are the aliases and values are the FQCNs |
|
| 83 | + * example: |
|
| 84 | + * array( 'ClassInterface' => 'Fully\Qualified\ClassName' ) |
|
| 85 | + */ |
|
| 86 | + public function setFilters(array $filters); |
|
| 87 | + |
|
| 88 | + /** |
|
| 89 | + * Ensures incoming paths is a valid filepath, or array of valid filepaths, |
|
| 90 | + * and merges them in with any existing filepaths |
|
| 91 | + * PLZ NOTE: |
|
| 92 | + * Recipe::setFqcn() has a check to see if Recipe::$paths is empty or not, |
|
| 93 | + * therefore you should always call Recipe::setPaths() before Recipe::setFqcn() |
|
| 94 | + * |
|
| 95 | + * @param string|array $paths |
|
| 96 | + */ |
|
| 97 | + public function setPaths($paths = array()); |
|
| 98 | 98 | |
| 99 | 99 | } |
| 100 | 100 | // End of file RecipeInterface.php |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | public static function instance() { |
| 60 | 60 | // check if class object is instantiated, and instantiated properly |
| 61 | - if ( self::$_instance === NULL or ! is_object( self::$_instance ) or ! ( self::$_instance instanceof EE_Network_Config )) { |
|
| 61 | + if (self::$_instance === NULL or ! is_object(self::$_instance) or ! (self::$_instance instanceof EE_Network_Config)) { |
|
| 62 | 62 | self::$_instance = new self(); |
| 63 | 63 | } |
| 64 | 64 | return self::$_instance; |
@@ -73,15 +73,15 @@ discard block |
||
| 73 | 73 | * @access private |
| 74 | 74 | */ |
| 75 | 75 | private function __construct() { |
| 76 | - do_action( 'AHEE__EE_Network_Config__construct__begin',$this ); |
|
| 76 | + do_action('AHEE__EE_Network_Config__construct__begin', $this); |
|
| 77 | 77 | //set defaults |
| 78 | - $this->core = apply_filters( 'FHEE__EE_Network_Config___construct__core', new EE_Network_Core_Config() ); |
|
| 78 | + $this->core = apply_filters('FHEE__EE_Network_Config___construct__core', new EE_Network_Core_Config()); |
|
| 79 | 79 | $this->addons = array(); |
| 80 | 80 | |
| 81 | 81 | $this->_load_config(); |
| 82 | 82 | |
| 83 | 83 | // construct__end hook |
| 84 | - do_action( 'AHEE__EE_Network_Config__construct__end',$this ); |
|
| 84 | + do_action('AHEE__EE_Network_Config__construct__end', $this); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | |
@@ -94,25 +94,25 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | private function _load_config() { |
| 96 | 96 | //load network config start hook |
| 97 | - do_action( 'AHEE__EE_Network_Config___load_config__start', $this ); |
|
| 97 | + do_action('AHEE__EE_Network_Config___load_config__start', $this); |
|
| 98 | 98 | $config = $this->get_config(); |
| 99 | - foreach ( $config as $config_prop => $settings ) { |
|
| 100 | - if ( is_object( $settings ) && property_exists( $this, $config_prop ) ) { |
|
| 101 | - $this->{$config_prop} = apply_filters( 'FHEE__EE_Network_Config___load_config__config_settings', $settings, $config_prop, $this ); |
|
| 102 | - if ( method_exists( $settings, 'populate' ) ) { |
|
| 99 | + foreach ($config as $config_prop => $settings) { |
|
| 100 | + if (is_object($settings) && property_exists($this, $config_prop)) { |
|
| 101 | + $this->{$config_prop} = apply_filters('FHEE__EE_Network_Config___load_config__config_settings', $settings, $config_prop, $this); |
|
| 102 | + if (method_exists($settings, 'populate')) { |
|
| 103 | 103 | $this->{$config_prop}->populate(); |
| 104 | 104 | } |
| 105 | - if ( method_exists( $settings, 'do_hooks' ) ) { |
|
| 105 | + if (method_exists($settings, 'do_hooks')) { |
|
| 106 | 106 | $this->{$config_prop}->do_hooks(); |
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | - if ( apply_filters( 'FHEE__EE_Network_Config___load_config__update_network_config', false ) ) { |
|
| 110 | + if (apply_filters('FHEE__EE_Network_Config___load_config__update_network_config', false)) { |
|
| 111 | 111 | $this->update_config(); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | //load network config end hook |
| 115 | - do_action( 'AHEE__EE_Network_Config___load_config__end', $this ); |
|
| 115 | + do_action('AHEE__EE_Network_Config___load_config__end', $this); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | |
@@ -126,8 +126,8 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | public function get_config() { |
| 128 | 128 | // grab network configuration |
| 129 | - $CFG = get_site_option( 'ee_network_config', array() ); |
|
| 130 | - $CFG = apply_filters( 'FHEE__EE_Network_Config__get_config__CFG', $CFG ); |
|
| 129 | + $CFG = get_site_option('ee_network_config', array()); |
|
| 130 | + $CFG = apply_filters('FHEE__EE_Network_Config__get_config__CFG', $CFG); |
|
| 131 | 131 | return $CFG; |
| 132 | 132 | } |
| 133 | 133 | |
@@ -141,39 +141,39 @@ discard block |
||
| 141 | 141 | * @param bool $add_error |
| 142 | 142 | * @return bool success |
| 143 | 143 | */ |
| 144 | - public function update_config( $add_success = FALSE, $add_error = TRUE ) { |
|
| 145 | - do_action( 'AHEE__EE_Network_Config__update_config__begin',$this ); |
|
| 144 | + public function update_config($add_success = FALSE, $add_error = TRUE) { |
|
| 145 | + do_action('AHEE__EE_Network_Config__update_config__begin', $this); |
|
| 146 | 146 | |
| 147 | 147 | //need to bust cache for comparing original if this is a multisite install |
| 148 | - if ( is_multisite() ) { |
|
| 148 | + if (is_multisite()) { |
|
| 149 | 149 | global $current_site; |
| 150 | - $cache_key = $current_site->id . ':ee_network_config'; |
|
| 151 | - wp_cache_delete( $cache_key, 'site-options' ); |
|
| 150 | + $cache_key = $current_site->id.':ee_network_config'; |
|
| 151 | + wp_cache_delete($cache_key, 'site-options'); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | //we have to compare existing saved config with config in memory because if there is no difference that means |
| 155 | 155 | //that the method executed fine but there just was no update. WordPress doesn't distinguish between false because |
| 156 | 156 | //there were 0 records updated because of no change vs false because some error produced problems with the update. |
| 157 | - $original = get_site_option( 'ee_network_config' ); |
|
| 157 | + $original = get_site_option('ee_network_config'); |
|
| 158 | 158 | |
| 159 | - if ( $original == $this ) { |
|
| 159 | + if ($original == $this) { |
|
| 160 | 160 | return true; |
| 161 | 161 | } |
| 162 | 162 | // update |
| 163 | - $saved = update_site_option( 'ee_network_config', $this ); |
|
| 163 | + $saved = update_site_option('ee_network_config', $this); |
|
| 164 | 164 | |
| 165 | - do_action( 'AHEE__EE_Network_Config__update_config__end', $this, $saved ); |
|
| 165 | + do_action('AHEE__EE_Network_Config__update_config__end', $this, $saved); |
|
| 166 | 166 | // if config remains the same or was updated successfully |
| 167 | - if ( $saved ) { |
|
| 168 | - if ( $add_success ) { |
|
| 169 | - $msg = is_multisite() ? __( 'The Event Espresso Network Configuration Settings have been successfully updated.', 'event_espresso' ) : __( 'Extra Event Espresso Configuration settings were successfully updated.', 'event_espresso' ); |
|
| 170 | - EE_Error::add_success( $msg ); |
|
| 167 | + if ($saved) { |
|
| 168 | + if ($add_success) { |
|
| 169 | + $msg = is_multisite() ? __('The Event Espresso Network Configuration Settings have been successfully updated.', 'event_espresso') : __('Extra Event Espresso Configuration settings were successfully updated.', 'event_espresso'); |
|
| 170 | + EE_Error::add_success($msg); |
|
| 171 | 171 | } |
| 172 | 172 | return true; |
| 173 | 173 | } else { |
| 174 | - if ( $add_error ) { |
|
| 175 | - $msg = is_multisite() ? __( 'The Event Espresso Network Configuration Settings were not updated.', 'event_espresso' ) : __( 'Extra Event Espresso Network Configuration settings were not updated.', 'event_espresso' ); |
|
| 176 | - EE_Error::add_error( $msg , __FILE__, __FUNCTION__, __LINE__ ); |
|
| 174 | + if ($add_error) { |
|
| 175 | + $msg = is_multisite() ? __('The Event Espresso Network Configuration Settings were not updated.', 'event_espresso') : __('Extra Event Espresso Network Configuration settings were not updated.', 'event_espresso'); |
|
| 176 | + EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
| 177 | 177 | } |
| 178 | 178 | return false; |
| 179 | 179 | } |
@@ -187,9 +187,9 @@ discard block |
||
| 187 | 187 | * @return array |
| 188 | 188 | */ |
| 189 | 189 | public function __sleep() { |
| 190 | - return apply_filters( 'FHEE__EE_Network_Config__sleep',array( |
|
| 190 | + return apply_filters('FHEE__EE_Network_Config__sleep', array( |
|
| 191 | 191 | 'core', |
| 192 | - ) ); |
|
| 192 | + )); |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | } //end EE_Network_Config. |
@@ -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 | * |
@@ -20,13 +20,13 @@ |
||
| 20 | 20 | { |
| 21 | 21 | |
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * @return string |
|
| 25 | - */ |
|
| 26 | - public function capability() |
|
| 27 | - { |
|
| 28 | - return ''; |
|
| 29 | - } |
|
| 23 | + /** |
|
| 24 | + * @return string |
|
| 25 | + */ |
|
| 26 | + public function capability() |
|
| 27 | + { |
|
| 28 | + return ''; |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | } |
@@ -13,20 +13,20 @@ |
||
| 13 | 13 | interface CapCheckInterface |
| 14 | 14 | { |
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * @return string |
|
| 18 | - */ |
|
| 19 | - public function capability(); |
|
| 16 | + /** |
|
| 17 | + * @return string |
|
| 18 | + */ |
|
| 19 | + public function capability(); |
|
| 20 | 20 | |
| 21 | - /** |
|
| 22 | - * @return string |
|
| 23 | - */ |
|
| 24 | - public function context(); |
|
| 21 | + /** |
|
| 22 | + * @return string |
|
| 23 | + */ |
|
| 24 | + public function context(); |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * @return int|string |
|
| 28 | - */ |
|
| 29 | - public function ID(); |
|
| 26 | + /** |
|
| 27 | + * @return int|string |
|
| 28 | + */ |
|
| 29 | + public function ID(); |
|
| 30 | 30 | |
| 31 | 31 | } |
| 32 | 32 | // End of file CapCheckInterface.php |
@@ -23,30 +23,30 @@ |
||
| 23 | 23 | abstract class Command implements CommandInterface |
| 24 | 24 | { |
| 25 | 25 | |
| 26 | - /* |
|
| 26 | + /* |
|
| 27 | 27 | * @var CapCheckInterface $cap_check |
| 28 | 28 | */ |
| 29 | - protected $cap_check; |
|
| 29 | + protected $cap_check; |
|
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * @return mixed |
|
| 35 | - */ |
|
| 36 | - public function getCapCheck() |
|
| 37 | - { |
|
| 38 | - return $this->cap_check; |
|
| 39 | - } |
|
| 33 | + /** |
|
| 34 | + * @return mixed |
|
| 35 | + */ |
|
| 36 | + public function getCapCheck() |
|
| 37 | + { |
|
| 38 | + return $this->cap_check; |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | 41 | |
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * @param CapCheckInterface $cap_check |
|
| 45 | - */ |
|
| 46 | - public function setCapCheck(CapCheckInterface $cap_check) |
|
| 47 | - { |
|
| 48 | - $this->cap_check = $cap_check; |
|
| 49 | - } |
|
| 43 | + /** |
|
| 44 | + * @param CapCheckInterface $cap_check |
|
| 45 | + */ |
|
| 46 | + public function setCapCheck(CapCheckInterface $cap_check) |
|
| 47 | + { |
|
| 48 | + $this->cap_check = $cap_check; |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | 51 | } |
| 52 | 52 | // End of file Command.php |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | |
| 5 | 5 | use EventEspresso\core\domain\services\capabilities\CapCheckInterface; |
| 6 | 6 | |
| 7 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
| 8 | - exit( 'No direct script access allowed' ); |
|
| 7 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 8 | + exit('No direct script access allowed'); |
|
| 9 | 9 | } |
| 10 | 10 | |
| 11 | 11 | |
@@ -63,11 +63,11 @@ |
||
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | do_action( 'AHEE__SPCO__after_registration_steps' ); |
| 66 | - printf( |
|
| 67 | - esc_html__('%1$scancel registration%2$s', 'event_espresso'), |
|
| 68 | - '<a class="small-text float-right" href="' . $cancel_page_url . '">', |
|
| 69 | - '</a><br class="clear"/><br />' |
|
| 70 | - ); |
|
| 66 | + printf( |
|
| 67 | + esc_html__('%1$scancel registration%2$s', 'event_espresso'), |
|
| 68 | + '<a class="small-text float-right" href="' . $cancel_page_url . '">', |
|
| 69 | + '</a><br class="clear"/><br />' |
|
| 70 | + ); |
|
| 71 | 71 | |
| 72 | 72 | } else { |
| 73 | 73 | ?> |
@@ -1,39 +1,39 @@ discard block |
||
| 1 | 1 | <div id="ee-single-page-checkout-dv" class=""> |
| 2 | 2 | <?php |
| 3 | -if ( ! $empty_cart ) { |
|
| 4 | - if ( apply_filters( 'FHEE__registration_page_wrapper_template__display_time_limit', false ) ) { ?> |
|
| 3 | +if ( ! $empty_cart) { |
|
| 4 | + if (apply_filters('FHEE__registration_page_wrapper_template__display_time_limit', false)) { ?> |
|
| 5 | 5 | <p id="spco-registration-time-limit-pg" class="spco-steps-pg ee-attention important-notice" style="display: none;"> |
| 6 | 6 | <?php echo sprintf( |
| 7 | 7 | apply_filters( |
| 8 | 8 | 'FHEE__registration_page_wrapper_template___time_limit', |
| 9 | - __( 'You have %1$s to complete your registration.', 'event_espresso' ) |
|
| 9 | + __('You have %1$s to complete your registration.', 'event_espresso') |
|
| 10 | 10 | ), |
| 11 | - '<span id="spco-registration-time-limit-spn" class="spco-registration-time-limit-spn">' . $registration_time_limit . '</span>' |
|
| 11 | + '<span id="spco-registration-time-limit-spn" class="spco-registration-time-limit-spn">'.$registration_time_limit.'</span>' |
|
| 12 | 12 | ); |
| 13 | 13 | ?> |
| 14 | 14 | <span id="spco-registration-expiration-spn" class="" style="display:none;"></span> |
| 15 | 15 | </p> |
| 16 | 16 | <?php } |
| 17 | - if ( ! $revisit && apply_filters( 'FHEE__registration_page_wrapper_template__steps_display', TRUE )) { |
|
| 17 | + if ( ! $revisit && apply_filters('FHEE__registration_page_wrapper_template__steps_display', TRUE)) { |
|
| 18 | 18 | ?> |
| 19 | 19 | <h2 id="spco-steps-big-hdr" class="spco-steps-big-hdr"><?php _e(' Steps', 'event_espresso'); ?></h2> |
| 20 | 20 | |
| 21 | 21 | <div id="spco-steps-display-dv"> |
| 22 | 22 | <?php |
| 23 | 23 | $step_nmbr = 1; |
| 24 | - $total_steps = count( $reg_steps ) - 1; |
|
| 25 | - foreach ( $reg_steps as $reg_step ) { |
|
| 26 | - if ( $reg_step instanceof EE_SPCO_Reg_Step && $reg_step->slug() != 'finalize_registration' ) { |
|
| 24 | + $total_steps = count($reg_steps) - 1; |
|
| 25 | + foreach ($reg_steps as $reg_step) { |
|
| 26 | + if ($reg_step instanceof EE_SPCO_Reg_Step && $reg_step->slug() != 'finalize_registration') { |
|
| 27 | 27 | $slug = $reg_step->slug(); |
| 28 | 28 | $step_display_dv_class = $reg_step->is_current_step() ? 'active-step' : 'inactive-step'; |
| 29 | 29 | ?> |
| 30 | 30 | <div id="spco-step-<?php echo $slug; ?>-display-dv" class="spco-step-display-dv <?php echo $step_display_dv_class; ?> steps-<?php echo $total_steps; ?>"> |
| 31 | 31 | <h4 id="spco-step-<?php echo $slug; ?>-display-hdr" class="spco-steps-display-hdr"> |
| 32 | - <span class="spco-step-big-nmbr"><?php echo $step_nmbr; ?></span> <span class="spco-step-name"><?php echo str_replace( ' ', '<br/> ', $reg_step->name() ); ?></span> |
|
| 32 | + <span class="spco-step-big-nmbr"><?php echo $step_nmbr; ?></span> <span class="spco-step-name"><?php echo str_replace(' ', '<br/> ', $reg_step->name()); ?></span> |
|
| 33 | 33 | </h4> |
| 34 | 34 | </div> |
| 35 | 35 | |
| 36 | - <?php if ( $step_nmbr < $total_steps ) { ?> |
|
| 36 | + <?php if ($step_nmbr < $total_steps) { ?> |
|
| 37 | 37 | <div class="spco-step-arrow-dv">»</div> |
| 38 | 38 | <?php |
| 39 | 39 | } |
@@ -47,25 +47,25 @@ discard block |
||
| 47 | 47 | <?php |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - do_action( 'AHEE__SPCO__before_registration_steps' ); |
|
| 50 | + do_action('AHEE__SPCO__before_registration_steps'); |
|
| 51 | 51 | $step_nmbr = 1; |
| 52 | - foreach ( $reg_steps as $reg_step ) { |
|
| 53 | - if ( $reg_step instanceof EE_SPCO_Reg_Step && $reg_step->slug() != 'finalize_registration' ) { |
|
| 52 | + foreach ($reg_steps as $reg_step) { |
|
| 53 | + if ($reg_step instanceof EE_SPCO_Reg_Step && $reg_step->slug() != 'finalize_registration') { |
|
| 54 | 54 | $slug = $reg_step->slug(); |
| 55 | - do_action( 'AHEE__' . $slug . '__reg_step_start', $reg_step ); |
|
| 55 | + do_action('AHEE__'.$slug.'__reg_step_start', $reg_step); |
|
| 56 | 56 | // todo: deprecate hook AHEE__registration_page_attendee_information__start |
| 57 | 57 | ?> |
| 58 | 58 | <div id="spco-<?php echo $slug; ?>-dv" class="spco-step-dv <?php echo $reg_step->div_class(); ?>"> |
| 59 | 59 | <?php echo $reg_step->display_reg_form(); ?> |
| 60 | - <?php do_action( 'AHEE__SPCO_after_reg_step_form', $slug, $next_step ); ?> |
|
| 60 | + <?php do_action('AHEE__SPCO_after_reg_step_form', $slug, $next_step); ?> |
|
| 61 | 61 | </div> |
| 62 | 62 | <?php $step_nmbr++; |
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | - do_action( 'AHEE__SPCO__after_registration_steps' ); |
|
| 65 | + do_action('AHEE__SPCO__after_registration_steps'); |
|
| 66 | 66 | printf( |
| 67 | 67 | esc_html__('%1$scancel registration%2$s', 'event_espresso'), |
| 68 | - '<a class="small-text float-right" href="' . $cancel_page_url . '">', |
|
| 68 | + '<a class="small-text float-right" href="'.$cancel_page_url.'">', |
|
| 69 | 69 | '</a><br class="clear"/><br />' |
| 70 | 70 | ); |
| 71 | 71 | |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | <?php echo $cookies_not_set_msg; ?> |
| 77 | 77 | <?php |
| 78 | 78 | } |
| 79 | -do_action( 'AHEE__SPCO__reg_form_footer' ); |
|
| 79 | +do_action('AHEE__SPCO__reg_form_footer'); |
|
| 80 | 80 | ?> |
| 81 | 81 | |
| 82 | 82 | </div> |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 4 | 4 | exit('NO direct script access allowed'); |
| 5 | 5 | |
| 6 | 6 | /** |
@@ -58,96 +58,96 @@ discard block |
||
| 58 | 58 | '[CO_GOOGLE_URL]' => esc_html__('Link to organization Google page', 'event_espresso'), |
| 59 | 59 | '[CO_LINKEDIN_URL]' => esc_html__('Link to organization LinkedIn page', 'event_espresso'), |
| 60 | 60 | '[CO_INSTAGRAM_URL]' => esc_html__('Link to organization Instagram page', 'event_espresso'), |
| 61 | - '[CO_TAX_NUMBER_*]' => sprintf( esc_html__('This is the shortcode used for displaying any tax number for the company. %1$sNote: This is a special dynamic shortcode.%2$s You can use the "prefix" parameter to indicate what the prefix for this tax number is. It defaults to "VAT/Tax Number:". To change this prefix you do the following format for this shortcode: [CO_TAX_NUMBER_* prefix="GST: "] and that will output: GST: 12345t56. Also take note that if you have NO number in your settings, the prefix is not output either.', 'event_espresso' ),'<strong>','</strong>') |
|
| 61 | + '[CO_TAX_NUMBER_*]' => sprintf(esc_html__('This is the shortcode used for displaying any tax number for the company. %1$sNote: This is a special dynamic shortcode.%2$s You can use the "prefix" parameter to indicate what the prefix for this tax number is. It defaults to "VAT/Tax Number:". To change this prefix you do the following format for this shortcode: [CO_TAX_NUMBER_* prefix="GST: "] and that will output: GST: 12345t56. Also take note that if you have NO number in your settings, the prefix is not output either.', 'event_espresso'), '<strong>', '</strong>') |
|
| 62 | 62 | ); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | |
| 66 | - protected function _parser( $shortcode ) { |
|
| 66 | + protected function _parser($shortcode) { |
|
| 67 | 67 | |
| 68 | - switch ( $shortcode ) { |
|
| 68 | + switch ($shortcode) { |
|
| 69 | 69 | |
| 70 | 70 | case '[COMPANY]' : |
| 71 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'name' ); |
|
| 71 | + return EE_Registry::instance()->CFG->organization->get_pretty('name'); |
|
| 72 | 72 | break; |
| 73 | 73 | |
| 74 | 74 | case '[CO_ADD1]' : |
| 75 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'address_1' ); |
|
| 75 | + return EE_Registry::instance()->CFG->organization->get_pretty('address_1'); |
|
| 76 | 76 | break; |
| 77 | 77 | |
| 78 | 78 | case '[CO_ADD2]' : |
| 79 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'address_2' ); |
|
| 79 | + return EE_Registry::instance()->CFG->organization->get_pretty('address_2'); |
|
| 80 | 80 | break; |
| 81 | 81 | |
| 82 | 82 | case '[CO_CITY]' : |
| 83 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'city' ); |
|
| 83 | + return EE_Registry::instance()->CFG->organization->get_pretty('city'); |
|
| 84 | 84 | break; |
| 85 | 85 | |
| 86 | 86 | case '[CO_STATE]' : |
| 87 | - $state = EE_Registry::instance()->load_model( 'State' )->get_one_by_ID( EE_Registry::instance()->CFG->organization->STA_ID ); |
|
| 87 | + $state = EE_Registry::instance()->load_model('State')->get_one_by_ID(EE_Registry::instance()->CFG->organization->STA_ID); |
|
| 88 | 88 | return $state->name(); |
| 89 | 89 | break; |
| 90 | 90 | |
| 91 | 91 | case '[CO_ZIP]' : |
| 92 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'zip' ); |
|
| 92 | + return EE_Registry::instance()->CFG->organization->get_pretty('zip'); |
|
| 93 | 93 | break; |
| 94 | 94 | |
| 95 | 95 | case '[CO_EMAIL]' : |
| 96 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'email' ); |
|
| 96 | + return EE_Registry::instance()->CFG->organization->get_pretty('email'); |
|
| 97 | 97 | break; |
| 98 | 98 | |
| 99 | 99 | case '[CO_PHONE]' : |
| 100 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'phone' ); |
|
| 100 | + return EE_Registry::instance()->CFG->organization->get_pretty('phone'); |
|
| 101 | 101 | break; |
| 102 | 102 | |
| 103 | 103 | case '[CO_LOGO]' : |
| 104 | - return '<img src="' . EE_Registry::instance()->CFG->organization->get_pretty( 'logo_url' ) . '" id="headerImage" />'; |
|
| 104 | + return '<img src="'.EE_Registry::instance()->CFG->organization->get_pretty('logo_url').'" id="headerImage" />'; |
|
| 105 | 105 | break; |
| 106 | 106 | |
| 107 | 107 | case '[CO_LOGO_URL]' : |
| 108 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'logo_url' ); |
|
| 108 | + return EE_Registry::instance()->CFG->organization->get_pretty('logo_url'); |
|
| 109 | 109 | break; |
| 110 | 110 | |
| 111 | 111 | case '[CO_FACEBOOK_URL]' : |
| 112 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'facebook' ); |
|
| 112 | + return EE_Registry::instance()->CFG->organization->get_pretty('facebook'); |
|
| 113 | 113 | break; |
| 114 | 114 | |
| 115 | 115 | case '[CO_TWITTER_URL]' : |
| 116 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'twitter' ); |
|
| 116 | + return EE_Registry::instance()->CFG->organization->get_pretty('twitter'); |
|
| 117 | 117 | break; |
| 118 | 118 | |
| 119 | 119 | case '[CO_PINTEREST_URL]' : |
| 120 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'pinterest' ); |
|
| 120 | + return EE_Registry::instance()->CFG->organization->get_pretty('pinterest'); |
|
| 121 | 121 | break; |
| 122 | 122 | |
| 123 | 123 | case '[CO_LINKEDIN_URL]' : |
| 124 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'linkedin' ); |
|
| 124 | + return EE_Registry::instance()->CFG->organization->get_pretty('linkedin'); |
|
| 125 | 125 | break; |
| 126 | 126 | |
| 127 | 127 | case '[CO_GOOGLE_URL]' : |
| 128 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'google' ); |
|
| 128 | + return EE_Registry::instance()->CFG->organization->get_pretty('google'); |
|
| 129 | 129 | break; |
| 130 | 130 | |
| 131 | 131 | case '[CO_INSTAGRAM_URL]' : |
| 132 | - return EE_Registry::instance()->CFG->organization->get_pretty( 'instagram' ); |
|
| 132 | + return EE_Registry::instance()->CFG->organization->get_pretty('instagram'); |
|
| 133 | 133 | break; |
| 134 | 134 | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | //also allow for parameter shortcode |
| 138 | - if ( strpos( $shortcode, '[CO_TAX_NUMBER_*' ) !== FALSE ) { |
|
| 138 | + if (strpos($shortcode, '[CO_TAX_NUMBER_*') !== FALSE) { |
|
| 139 | 139 | //first see if there is any company tax number set and bail early if not |
| 140 | 140 | $tax_number = EE_Registry::instance()->CFG->organization->vat; |
| 141 | - if ( empty( $tax_number ) ) { |
|
| 141 | + if (empty($tax_number)) { |
|
| 142 | 142 | return ''; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | //see if there are any attributes. |
| 146 | - $attrs = $this->_get_shortcode_attrs( $shortcode ); |
|
| 146 | + $attrs = $this->_get_shortcode_attrs($shortcode); |
|
| 147 | 147 | |
| 148 | 148 | //set custom attrs if present (or default) |
| 149 | - $prefix = isset( $attrs['prefix'] ) ? $attrs['prefix'] : esc_html__('VAT/Tax Number: ', 'event_espresso'); |
|
| 150 | - return $prefix . $tax_number; |
|
| 149 | + $prefix = isset($attrs['prefix']) ? $attrs['prefix'] : esc_html__('VAT/Tax Number: ', 'event_espresso'); |
|
| 150 | + return $prefix.$tax_number; |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | return ''; |
@@ -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 |
@@ -8,34 +8,34 @@ |
||
| 8 | 8 | ?> |
| 9 | 9 | |
| 10 | 10 | <h4 id="reg-page-totals-hdr" class=""> |
| 11 | - <span class="drk-grey-text"><?php _e('Registrations:', 'event_espresso'); ?></span> <?php echo $reg_count;?> |
|
| 11 | + <span class="drk-grey-text"><?php _e('Registrations:', 'event_espresso'); ?></span> <?php echo $reg_count; ?> |
|
| 12 | 12 | </h4> |
| 13 | 13 | |
| 14 | 14 | <div class="spco-payment-info-dv"> |
| 15 | 15 | <table id="spco-payment-info-table"> |
| 16 | 16 | <thead> |
| 17 | 17 | <tr> |
| 18 | - <th scope="col" width=""><?php _e('Name and Description', 'event_espresso');?></th> |
|
| 19 | - <th scope="col" width="15%" class="jst-cntr"><?php _e('Price', 'event_espresso');?></th> |
|
| 20 | - <th scope="col" width="5%" class="jst-cntr"><?php _e( 'Qty', 'event_espresso' ); ?></th> |
|
| 21 | - <th scope="col" width="15%" class="jst-cntr"><?php _e('Total', 'event_espresso');?></th> |
|
| 22 | - <?php do_action( 'AHEE__registration_page_payment_options__payment_info_table_thead_row_end' ); ?> |
|
| 18 | + <th scope="col" width=""><?php _e('Name and Description', 'event_espresso'); ?></th> |
|
| 19 | + <th scope="col" width="15%" class="jst-cntr"><?php _e('Price', 'event_espresso'); ?></th> |
|
| 20 | + <th scope="col" width="5%" class="jst-cntr"><?php _e('Qty', 'event_espresso'); ?></th> |
|
| 21 | + <th scope="col" width="15%" class="jst-cntr"><?php _e('Total', 'event_espresso'); ?></th> |
|
| 22 | + <?php do_action('AHEE__registration_page_payment_options__payment_info_table_thead_row_end'); ?> |
|
| 23 | 23 | </tr> |
| 24 | 24 | </thead> |
| 25 | 25 | <tbody> |
| 26 | - <?php echo $transaction_details;?> |
|
| 27 | - <?php do_action( 'AHEE__registration_page_payment_options__payment_info_table_tbody_end' ); ?> |
|
| 26 | + <?php echo $transaction_details; ?> |
|
| 27 | + <?php do_action('AHEE__registration_page_payment_options__payment_info_table_tbody_end'); ?> |
|
| 28 | 28 | </tbody> |
| 29 | 29 | </table> |
| 30 | 30 | </div> |
| 31 | 31 | <div class="clear-float"> </div> |
| 32 | 32 | |
| 33 | - <?php echo $before_payment_options; ?> |
|
| 33 | + <?php echo $before_payment_options; ?> |
|
| 34 | 34 | |
| 35 | 35 | <div id="methods-of-payment"> |
| 36 | 36 | <?php echo $payment_options; ?> |
| 37 | 37 | </div> |
| 38 | 38 | <!-- end #methods-of-payment --> |
| 39 | 39 | |
| 40 | - <?php echo $after_payment_options; ?> |
|
| 40 | + <?php echo $after_payment_options; ?> |
|
| 41 | 41 | |