@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\core\services\locators; |
3 | 3 | |
4 | -use EventEspresso\core\exceptions\InvalidDataTypeException; |
|
4 | +use EventEspresso\core\exceptions\InvalidDataTypeException; |
|
5 | 5 | use FilesystemIterator; |
6 | 6 | use GlobIterator; |
7 | 7 |
@@ -5,8 +5,8 @@ discard block |
||
5 | 5 | use FilesystemIterator; |
6 | 6 | use GlobIterator; |
7 | 7 | |
8 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
9 | - exit( 'No direct script access allowed' ); |
|
8 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
9 | + exit('No direct script access allowed'); |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | * @param string $file_mask |
39 | 39 | * @throws \EventEspresso\core\exceptions\InvalidDataTypeException |
40 | 40 | */ |
41 | - public function setFileMask( $file_mask ) { |
|
42 | - if ( ! is_string( $file_mask ) ) { |
|
43 | - throw new InvalidDataTypeException( '$file_mask', $file_mask, 'string' ); |
|
41 | + public function setFileMask($file_mask) { |
|
42 | + if ( ! is_string($file_mask)) { |
|
43 | + throw new InvalidDataTypeException('$file_mask', $file_mask, 'string'); |
|
44 | 44 | } |
45 | 45 | $this->file_mask = $file_mask; |
46 | 46 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * @return int |
64 | 64 | */ |
65 | 65 | public function count() { |
66 | - return count( $this->filepaths ); |
|
66 | + return count($this->filepaths); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | |
@@ -77,13 +77,13 @@ discard block |
||
77 | 77 | * @return \FilesystemIterator |
78 | 78 | * @throws \EventEspresso\core\exceptions\InvalidDataTypeException |
79 | 79 | */ |
80 | - public function locate( $directory_paths ) { |
|
81 | - if ( ! ( is_string( $directory_paths ) || is_array( $directory_paths ) ) ) { |
|
82 | - throw new InvalidDataTypeException( '$directory_paths', $directory_paths, 'string or array' ); |
|
80 | + public function locate($directory_paths) { |
|
81 | + if ( ! (is_string($directory_paths) || is_array($directory_paths))) { |
|
82 | + throw new InvalidDataTypeException('$directory_paths', $directory_paths, 'string or array'); |
|
83 | 83 | } |
84 | - foreach ( (array) $directory_paths as $directory_path ) { |
|
85 | - foreach ( $this->findFilesByPath( $directory_path ) as $key => $file ) { |
|
86 | - $this->filepaths[ $key ] = \EEH_File::standardise_directory_separators( $file ); |
|
84 | + foreach ((array) $directory_paths as $directory_path) { |
|
85 | + foreach ($this->findFilesByPath($directory_path) as $key => $file) { |
|
86 | + $this->filepaths[$key] = \EEH_File::standardise_directory_separators($file); |
|
87 | 87 | } |
88 | 88 | } |
89 | 89 | return $this->filepaths; |
@@ -98,12 +98,12 @@ discard block |
||
98 | 98 | * @param string $directory_path |
99 | 99 | * @return \FilesystemIterator |
100 | 100 | */ |
101 | - protected function findFilesByPath( $directory_path = '' ) { |
|
102 | - $iterator = new GlobIterator ( |
|
103 | - \EEH_File::end_with_directory_separator( $directory_path ) . $this->file_mask |
|
101 | + protected function findFilesByPath($directory_path = '') { |
|
102 | + $iterator = new GlobIterator( |
|
103 | + \EEH_File::end_with_directory_separator($directory_path).$this->file_mask |
|
104 | 104 | ); |
105 | - foreach ( $this->flags as $flag ) { |
|
106 | - $iterator->setFlags( $flag ); |
|
105 | + foreach ($this->flags as $flag) { |
|
106 | + $iterator->setFlags($flag); |
|
107 | 107 | } |
108 | 108 | return $iterator; |
109 | 109 | } |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\core\services\locators; |
3 | 3 | |
4 | -use EventEspresso\core\exceptions\InvalidClassException; |
|
5 | -use EventEspresso\core\exceptions\InvalidDataTypeException; |
|
4 | +use EventEspresso\core\exceptions\InvalidClassException; |
|
5 | +use EventEspresso\core\exceptions\InvalidDataTypeException; |
|
6 | 6 | use EventEspresso\Core\Psr4Autoloader; |
7 | 7 | use FilesystemIterator; |
8 | 8 |
@@ -77,7 +77,7 @@ |
||
77 | 77 | * given a valid namespace, will find all files that match the provided mask |
78 | 78 | * |
79 | 79 | * @access public |
80 | - * @param string|array $namespaces |
|
80 | + * @param string $namespaces |
|
81 | 81 | * @return FilesystemIterator |
82 | 82 | * @throws \EventEspresso\core\exceptions\InvalidClassException |
83 | 83 | * @throws \EventEspresso\core\exceptions\InvalidDataTypeException |
@@ -6,8 +6,8 @@ discard block |
||
6 | 6 | use EventEspresso\Core\Psr4Autoloader; |
7 | 7 | use FilesystemIterator; |
8 | 8 | |
9 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
10 | - exit( 'No direct script access allowed' ); |
|
9 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
10 | + exit('No direct script access allowed'); |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | |
@@ -40,14 +40,14 @@ discard block |
||
40 | 40 | * @param string $namespace_base_dir |
41 | 41 | * @throws \EventEspresso\core\exceptions\InvalidDataTypeException |
42 | 42 | */ |
43 | - protected function setNamespace( $namespace, $namespace_base_dir ) { |
|
44 | - if ( ! is_string( $namespace ) ) { |
|
45 | - throw new InvalidDataTypeException( '$namespace', $namespace, 'string' ); |
|
43 | + protected function setNamespace($namespace, $namespace_base_dir) { |
|
44 | + if ( ! is_string($namespace)) { |
|
45 | + throw new InvalidDataTypeException('$namespace', $namespace, 'string'); |
|
46 | 46 | } |
47 | - if ( ! is_string( $namespace_base_dir ) ) { |
|
48 | - throw new InvalidDataTypeException( '$namespace_base_dir', $namespace_base_dir, 'string' ); |
|
47 | + if ( ! is_string($namespace_base_dir)) { |
|
48 | + throw new InvalidDataTypeException('$namespace_base_dir', $namespace_base_dir, 'string'); |
|
49 | 49 | } |
50 | - $this->namespaces[ $namespace ] = $namespace_base_dir; |
|
50 | + $this->namespaces[$namespace] = $namespace_base_dir; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * @return int |
68 | 68 | */ |
69 | 69 | public function count() { |
70 | - return count( $this->FQCNs ); |
|
70 | + return count($this->FQCNs); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | |
@@ -82,13 +82,13 @@ discard block |
||
82 | 82 | * @throws \EventEspresso\core\exceptions\InvalidClassException |
83 | 83 | * @throws \EventEspresso\core\exceptions\InvalidDataTypeException |
84 | 84 | */ |
85 | - public function locate( $namespaces ) { |
|
86 | - if ( ! ( is_string( $namespaces ) || is_array( $namespaces ) ) ) { |
|
87 | - throw new InvalidDataTypeException( '$namespaces', $namespaces, 'string or array' ); |
|
85 | + public function locate($namespaces) { |
|
86 | + if ( ! (is_string($namespaces) || is_array($namespaces))) { |
|
87 | + throw new InvalidDataTypeException('$namespaces', $namespaces, 'string or array'); |
|
88 | 88 | } |
89 | - foreach ( (array) $namespaces as $namespace ) { |
|
90 | - foreach ( $this->FindFQCNsByNamespace( $namespace ) as $key => $file ) { |
|
91 | - $this->FQCNs[ $key ] = $file; |
|
89 | + foreach ((array) $namespaces as $namespace) { |
|
90 | + foreach ($this->FindFQCNsByNamespace($namespace) as $key => $file) { |
|
91 | + $this->FQCNs[$key] = $file; |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 | return $this->FQCNs; |
@@ -107,24 +107,24 @@ discard block |
||
107 | 107 | * @throws \EventEspresso\core\exceptions\InvalidClassException |
108 | 108 | * @throws \EventEspresso\core\exceptions\InvalidDataTypeException |
109 | 109 | */ |
110 | - protected function FindFQCNsByNamespace( $partial_namespace ) { |
|
110 | + protected function FindFQCNsByNamespace($partial_namespace) { |
|
111 | 111 | $iterator = new FilesystemIterator( |
112 | - $this->getDirectoryFromPartialNamespace( $partial_namespace ) |
|
112 | + $this->getDirectoryFromPartialNamespace($partial_namespace) |
|
113 | 113 | ); |
114 | - foreach ( $this->flags as $flag ) { |
|
115 | - $iterator->setFlags( $flag ); |
|
114 | + foreach ($this->flags as $flag) { |
|
115 | + $iterator->setFlags($flag); |
|
116 | 116 | } |
117 | - if ( iterator_count( $iterator ) === 0 ) { |
|
117 | + if (iterator_count($iterator) === 0) { |
|
118 | 118 | return array(); |
119 | 119 | } |
120 | - foreach ( $iterator as $file ) { |
|
121 | - $file = \EEH_File::standardise_directory_separators( $file ); |
|
122 | - foreach ( $this->namespaces as $namespace => $base_dir ) { |
|
120 | + foreach ($iterator as $file) { |
|
121 | + $file = \EEH_File::standardise_directory_separators($file); |
|
122 | + foreach ($this->namespaces as $namespace => $base_dir) { |
|
123 | 123 | $namespace .= Psr4Autoloader::NS; |
124 | - if ( strpos( $file, $base_dir ) === 0 ) { |
|
125 | - $this->FQCNs[] = Psr4Autoloader::NS . str_replace( |
|
126 | - array( $base_dir, DS, '.php' ), |
|
127 | - array( $namespace, Psr4Autoloader::NS, '' ), |
|
124 | + if (strpos($file, $base_dir) === 0) { |
|
125 | + $this->FQCNs[] = Psr4Autoloader::NS.str_replace( |
|
126 | + array($base_dir, DS, '.php'), |
|
127 | + array($namespace, Psr4Autoloader::NS, ''), |
|
128 | 128 | $file |
129 | 129 | ); |
130 | 130 | } |
@@ -144,25 +144,25 @@ discard block |
||
144 | 144 | * @throws \EventEspresso\core\exceptions\InvalidDataTypeException |
145 | 145 | * @throws \EventEspresso\core\exceptions\InvalidClassException |
146 | 146 | */ |
147 | - protected function getDirectoryFromPartialNamespace( $partial_namespace ) { |
|
148 | - if ( empty( $partial_namespace ) ) { |
|
149 | - throw new InvalidClassException( $partial_namespace ); |
|
147 | + protected function getDirectoryFromPartialNamespace($partial_namespace) { |
|
148 | + if (empty($partial_namespace)) { |
|
149 | + throw new InvalidClassException($partial_namespace); |
|
150 | 150 | } |
151 | 151 | // load our PSR-4 Autoloader so we can get the list of registered namespaces from it |
152 | 152 | $psr4_loader = \EE_Psr4AutoloaderInit::psr4_loader(); |
153 | 153 | // breakup the incoming namespace into segments then loop thru them |
154 | - $namespace_segments = explode( Psr4Autoloader::NS, trim( $partial_namespace, Psr4Autoloader::NS ) ); |
|
154 | + $namespace_segments = explode(Psr4Autoloader::NS, trim($partial_namespace, Psr4Autoloader::NS)); |
|
155 | 155 | // we're only interested in the first element, so pull that from the array |
156 | - $namespace = array_shift( $namespace_segments ); |
|
156 | + $namespace = array_shift($namespace_segments); |
|
157 | 157 | // check if there's a base directory registered for that namespace |
158 | - $prefix = $psr4_loader->prefixes( $namespace . Psr4Autoloader::NS ); |
|
158 | + $prefix = $psr4_loader->prefixes($namespace.Psr4Autoloader::NS); |
|
159 | 159 | // nope? then the incoming namespace is invalid |
160 | - if ( empty( $prefix ) || empty( $prefix[0] ) ) { |
|
161 | - throw new InvalidClassException( $partial_namespace ); |
|
160 | + if (empty($prefix) || empty($prefix[0])) { |
|
161 | + throw new InvalidClassException($partial_namespace); |
|
162 | 162 | } |
163 | - $this->setNamespace( $namespace, $prefix[0] ); |
|
163 | + $this->setNamespace($namespace, $prefix[0]); |
|
164 | 164 | // but if it's good, add that base directory to the rest of the path, and return it |
165 | - return $prefix[0] . implode( DS, $namespace_segments ) . DS; |
|
165 | + return $prefix[0].implode(DS, $namespace_segments).DS; |
|
166 | 166 | } |
167 | 167 | |
168 | 168 |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\core\services\commands; |
3 | 3 | |
4 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
5 | - exit( 'No direct script access allowed' ); |
|
4 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
5 | + exit('No direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | |
@@ -25,14 +25,14 @@ discard block |
||
25 | 25 | * @param int $code |
26 | 26 | * @param \Exception $previous |
27 | 27 | */ |
28 | - public function __construct( $command_name, $message = '', $code = 0, \Exception $previous = null ) { |
|
29 | - if ( empty( $message ) ) { |
|
28 | + public function __construct($command_name, $message = '', $code = 0, \Exception $previous = null) { |
|
29 | + if (empty($message)) { |
|
30 | 30 | $message = sprintf( |
31 | - __( 'The supplied Command Handler "%1$s" does not have a valid name. It should be in the following format: "{CommandName}Handler" ', 'event_espresso' ), |
|
31 | + __('The supplied Command Handler "%1$s" does not have a valid name. It should be in the following format: "{CommandName}Handler" ', 'event_espresso'), |
|
32 | 32 | $command_name |
33 | 33 | ); |
34 | 34 | } |
35 | - parent::__construct( $message, $code, $previous ); |
|
35 | + parent::__construct($message, $code, $previous); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | } |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\core\services\commands; |
3 | 3 | |
4 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
5 | - exit( 'No direct script access allowed' ); |
|
4 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
5 | + exit('No direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * @param \EventEspresso\core\services\commands\CommandInterface $command |
20 | 20 | * @return mixed |
21 | 21 | */ |
22 | - public function handle( CommandInterface $command ); |
|
22 | + public function handle(CommandInterface $command); |
|
23 | 23 | |
24 | 24 | } |
25 | 25 | // End of file CommandHandlerInterface.php |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\core\services\commands; |
3 | 3 | |
4 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
5 | - exit( 'No direct script access allowed' ); |
|
4 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
5 | + exit('No direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | |
@@ -25,14 +25,14 @@ discard block |
||
25 | 25 | * @param int $code |
26 | 26 | * @param \Exception $previous |
27 | 27 | */ |
28 | - public function __construct( $command_handler_name, $message = '', $code = 0, \Exception $previous = null ) { |
|
29 | - if ( empty( $message ) ) { |
|
28 | + public function __construct($command_handler_name, $message = '', $code = 0, \Exception $previous = null) { |
|
29 | + if (empty($message)) { |
|
30 | 30 | $message = sprintf( |
31 | - __( 'The requested Command Handler "%1$s" could not be located or does not exist.', 'event_espresso' ), |
|
31 | + __('The requested Command Handler "%1$s" could not be located or does not exist.', 'event_espresso'), |
|
32 | 32 | $command_handler_name |
33 | 33 | ); |
34 | 34 | } |
35 | - parent::__construct( $message, $code, $previous ); |
|
35 | + parent::__construct($message, $code, $previous); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * stating where the proper subsections should be placed (but usually leaving them to layout |
9 | 9 | * their own headers and footers etc). |
10 | 10 | */ |
11 | -abstract class EE_Form_Section_Layout_Base{ |
|
11 | +abstract class EE_Form_Section_Layout_Base { |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * Form form section to lay out |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * __construct |
23 | 23 | */ |
24 | - function __construct(){ |
|
24 | + function __construct() { |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * The form section on which this strategy is to perform |
31 | 31 | * @param EE_Form_Section_Proper $form |
32 | 32 | */ |
33 | - function _construct_finalize(EE_Form_Section_Proper $form){ |
|
33 | + function _construct_finalize(EE_Form_Section_Proper $form) { |
|
34 | 34 | $this->_form_section = $form; |
35 | 35 | } |
36 | 36 | |
@@ -53,28 +53,28 @@ discard block |
||
53 | 53 | * Returns the HTML |
54 | 54 | * @return string HTML for displaying |
55 | 55 | */ |
56 | - function layout_form(){ |
|
56 | + function layout_form() { |
|
57 | 57 | $html = ''; |
58 | 58 | // layout_form_begin |
59 | 59 | $html .= apply_filters( |
60 | - 'FHEE__EE_Form_Section_Layout_Base__layout_form__start__for_' . $this->_form_section->name(), |
|
60 | + 'FHEE__EE_Form_Section_Layout_Base__layout_form__start__for_'.$this->_form_section->name(), |
|
61 | 61 | $this->layout_form_begin(), |
62 | 62 | $this->_form_section |
63 | 63 | ); |
64 | 64 | // layout_form_loop |
65 | 65 | $html .= apply_filters( |
66 | - 'FHEE__EE_Form_Section_Layout_Base__layout_form__loop__for_' . $this->_form_section->name(), |
|
66 | + 'FHEE__EE_Form_Section_Layout_Base__layout_form__loop__for_'.$this->_form_section->name(), |
|
67 | 67 | $this->layout_form_loop(), |
68 | 68 | $this->_form_section |
69 | 69 | ); |
70 | 70 | // layout_form_end |
71 | 71 | $html .= apply_filters( |
72 | - 'FHEE__EE_Form_Section_Layout_Base__layout_form__end__for_' . $this->_form_section->name(), |
|
72 | + 'FHEE__EE_Form_Section_Layout_Base__layout_form__end__for_'.$this->_form_section->name(), |
|
73 | 73 | $this->layout_form_end(), |
74 | 74 | $this->_form_section |
75 | 75 | ); |
76 | 76 | |
77 | - $html = $this->add_form_section_hooks_and_filters( $html ); |
|
77 | + $html = $this->add_form_section_hooks_and_filters($html); |
|
78 | 78 | return $html; |
79 | 79 | } |
80 | 80 | |
@@ -83,20 +83,20 @@ discard block |
||
83 | 83 | /** |
84 | 84 | * @return string |
85 | 85 | */ |
86 | - function layout_form_loop(){ |
|
86 | + function layout_form_loop() { |
|
87 | 87 | $html = ''; |
88 | - foreach( $this->_form_section->subsections() as $name => $subsection ){ |
|
89 | - if ( $subsection instanceof EE_Form_Input_Base ){ |
|
88 | + foreach ($this->_form_section->subsections() as $name => $subsection) { |
|
89 | + if ($subsection instanceof EE_Form_Input_Base) { |
|
90 | 90 | $html .= apply_filters( |
91 | - 'FHEE__EE_Form_Section_Layout_Base__layout_form__loop_for_input_' . $name . '__in_' . $this->_form_section->name(), |
|
92 | - $this->layout_input( $subsection ), |
|
91 | + 'FHEE__EE_Form_Section_Layout_Base__layout_form__loop_for_input_'.$name.'__in_'.$this->_form_section->name(), |
|
92 | + $this->layout_input($subsection), |
|
93 | 93 | $this->_form_section, |
94 | 94 | $subsection |
95 | 95 | ); |
96 | - } elseif ( $subsection instanceof EE_Form_Section_Base ){ |
|
96 | + } elseif ($subsection instanceof EE_Form_Section_Base) { |
|
97 | 97 | $html .= apply_filters( |
98 | - 'FHEE__EE_Form_Section_Layout_Base__layout_form__loop_for_non_input_' . $name . '__in_' . $this->_form_section->name(), |
|
99 | - $this->layout_subsection( $subsection ), |
|
98 | + 'FHEE__EE_Form_Section_Layout_Base__layout_form__loop_for_non_input_'.$name.'__in_'.$this->_form_section->name(), |
|
99 | + $this->layout_subsection($subsection), |
|
100 | 100 | $this->_form_section, |
101 | 101 | $subsection |
102 | 102 | ); |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | * @param EE_Form_Section_Base $subsection |
145 | 145 | * @return string html |
146 | 146 | */ |
147 | - abstract function layout_subsection( $subsection ); |
|
147 | + abstract function layout_subsection($subsection); |
|
148 | 148 | |
149 | 149 | |
150 | 150 | |
@@ -153,10 +153,10 @@ discard block |
||
153 | 153 | * @param EE_Form_Input_Base $input |
154 | 154 | * @return string |
155 | 155 | */ |
156 | - public function display_label($input){ |
|
157 | - $class = $input->required() ? 'ee-required-label ' . $input->html_label_class() : $input->html_label_class(); |
|
158 | - $label_text = $input->required() ? $input->html_label_text() . '<span class="ee-asterisk">*</span>' : $input->html_label_text(); |
|
159 | - return '<label id="' . $input->html_label_id() . '" class="' . $class . '" style="' . $input->html_label_style() . '" for="' . $input->html_name() . '">' . $label_text . '</label>'; |
|
156 | + public function display_label($input) { |
|
157 | + $class = $input->required() ? 'ee-required-label '.$input->html_label_class() : $input->html_label_class(); |
|
158 | + $label_text = $input->required() ? $input->html_label_text().'<span class="ee-asterisk">*</span>' : $input->html_label_text(); |
|
159 | + return '<label id="'.$input->html_label_id().'" class="'.$class.'" style="'.$input->html_label_style().'" for="'.$input->html_name().'">'.$label_text.'</label>'; |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | |
@@ -169,10 +169,10 @@ discard block |
||
169 | 169 | * @param EE_Form_Input_Base $input |
170 | 170 | * @return string |
171 | 171 | */ |
172 | - public function display_errors($input){ |
|
173 | - if( $input->get_validation_errors() ){ |
|
174 | - return "<label id='" . $input->html_id() . "-error' class='error' for='{$input->html_name()}'>" . $input->get_validation_error_string() . "</label>"; |
|
175 | - }else{ |
|
172 | + public function display_errors($input) { |
|
173 | + if ($input->get_validation_errors()) { |
|
174 | + return "<label id='".$input->html_id()."-error' class='error' for='{$input->html_name()}'>".$input->get_validation_error_string()."</label>"; |
|
175 | + } else { |
|
176 | 176 | return ''; |
177 | 177 | } |
178 | 178 | } |
@@ -182,10 +182,10 @@ discard block |
||
182 | 182 | * @param EE_Form_Input_Base $input |
183 | 183 | * @return string |
184 | 184 | */ |
185 | - public function display_help_text( $input ){ |
|
186 | - if ( $input->html_help_text() != '' ) { |
|
185 | + public function display_help_text($input) { |
|
186 | + if ($input->html_help_text() != '') { |
|
187 | 187 | $tag = is_admin() ? 'p' : 'span'; |
188 | - return '<' . $tag . ' id="' . $input->html_id() . '-help" class="' . $input->html_help_class() . '" style="' . $input->html_help_style() . '">' . $input->html_help_text() . '</' . $tag . '>'; |
|
188 | + return '<'.$tag.' id="'.$input->html_id().'-help" class="'.$input->html_help_class().'" style="'.$input->html_help_style().'">'.$input->html_help_text().'</'.$tag.'>'; |
|
189 | 189 | } |
190 | 190 | return ''; |
191 | 191 | } |
@@ -197,13 +197,13 @@ discard block |
||
197 | 197 | * @param string $html |
198 | 198 | * @return string |
199 | 199 | */ |
200 | - public function add_form_section_hooks_and_filters( $html ){ |
|
200 | + public function add_form_section_hooks_and_filters($html) { |
|
201 | 201 | // replace dashes and spaces with underscores |
202 | - $hook_name = str_replace( array( '-', ' ' ), '_', $this->_form_section->html_id() ); |
|
203 | - do_action( 'AHEE__Form_Section_Layout__' . $hook_name, $this->_form_section ); |
|
204 | - $html = apply_filters( 'AFEE__Form_Section_Layout__' . $hook_name . '__html', $html, $this->_form_section ); |
|
205 | - $html .= EEH_HTML::nl() . '<!-- AHEE__Form_Section_Layout__' . $hook_name . '__html -->'; |
|
206 | - $html .= EEH_HTML::nl() . '<!-- AFEE__Form_Section_Layout__' . $hook_name . ' -->'; |
|
202 | + $hook_name = str_replace(array('-', ' '), '_', $this->_form_section->html_id()); |
|
203 | + do_action('AHEE__Form_Section_Layout__'.$hook_name, $this->_form_section); |
|
204 | + $html = apply_filters('AFEE__Form_Section_Layout__'.$hook_name.'__html', $html, $this->_form_section); |
|
205 | + $html .= EEH_HTML::nl().'<!-- AHEE__Form_Section_Layout__'.$hook_name.'__html -->'; |
|
206 | + $html .= EEH_HTML::nl().'<!-- AFEE__Form_Section_Layout__'.$hook_name.' -->'; |
|
207 | 207 | return $html; |
208 | 208 | } |
209 | 209 |
@@ -172,7 +172,7 @@ |
||
172 | 172 | public function display_errors($input){ |
173 | 173 | if( $input->get_validation_errors() ){ |
174 | 174 | return "<label id='" . $input->html_id() . "-error' class='error' for='{$input->html_name()}'>" . $input->get_validation_error_string() . "</label>"; |
175 | - }else{ |
|
175 | + } else{ |
|
176 | 176 | return ''; |
177 | 177 | } |
178 | 178 | } |
@@ -1,13 +1,13 @@ discard block |
||
1 | 1 | <div id="reg-admin-approve-decline-reg-status-dv"> |
2 | 2 | |
3 | 3 | <h2 id="reg-admin-reg-details-reg-status-hdr"> |
4 | - <?php echo __( 'Current Registration Status : ', 'event_espresso' ); ?> |
|
4 | + <?php echo __('Current Registration Status : ', 'event_espresso'); ?> |
|
5 | 5 | <span class="<?php echo $reg_status_class; ?> bigger-text"><?php echo $reg_status_value; ?></span> |
6 | 6 | </h2> |
7 | - <?php do_action( 'AHEE__reg_status_change_buttons__after_header', $REG_ID ); ?> |
|
7 | + <?php do_action('AHEE__reg_status_change_buttons__after_header', $REG_ID); ?> |
|
8 | 8 | |
9 | 9 | <h3 id="reg-admin-reg-details-reg-status-hdr"> |
10 | - <?php echo __( 'Change Registration Status to :', 'event_espresso' ); ?> |
|
10 | + <?php echo __('Change Registration Status to :', 'event_espresso'); ?> |
|
11 | 11 | </h3> |
12 | 12 | |
13 | 13 | <form id="reg_status_change_form" method="POST" action="<?php echo $form_url; ?>"> |
@@ -16,15 +16,15 @@ discard block |
||
16 | 16 | <input type="hidden" name="return" value="view_registration"> |
17 | 17 | <?php echo $nonce; ?> |
18 | 18 | <?php echo $status_buttons; ?> |
19 | - <?php if ( $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'registration_message_type' ) ) : ?> |
|
19 | + <?php if ($attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'registration_message_type')) : ?> |
|
20 | 20 | <span id="send-related-messages-dv"> |
21 | - <label for="txn-reg-status-send-notifications-inp" class="important-notice"><?php _e( '...and send related messages ?', 'event_espresso' ); ?> |
|
21 | + <label for="txn-reg-status-send-notifications-inp" class="important-notice"><?php _e('...and send related messages ?', 'event_espresso'); ?> |
|
22 | 22 | <input type="checkbox" value="1" id="txn-reg-status-send-notifications-inp" name="txn_reg_status_change[send_notifications]"> |
23 | 23 | </label> |
24 | 24 | <br/> |
25 | 25 | </span> |
26 | 26 | <br/> |
27 | - <p class="description"><?php _e( 'If the "send related messages"checkbox is checked when changing status, then the related messages will be sent to the registrant.', 'event_espresso' ); ?></p> |
|
27 | + <p class="description"><?php _e('If the "send related messages"checkbox is checked when changing status, then the related messages will be sent to the registrant.', 'event_espresso'); ?></p> |
|
28 | 28 | <?php endif; ?> |
29 | 29 | </form> |
30 | 30 | </div> |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\core\libraries\form_sections\form_handlers; |
3 | 3 | |
4 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
5 | - exit( 'No direct script access allowed' ); |
|
4 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
5 | + exit('No direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | * @param int $code |
27 | 27 | * @param \Exception $previous |
28 | 28 | */ |
29 | - public function __construct( $actual, $message = '', $code = 0, \Exception $previous = null ) { |
|
30 | - if ( empty( $message ) ) { |
|
29 | + public function __construct($actual, $message = '', $code = 0, \Exception $previous = null) { |
|
30 | + if (empty($message)) { |
|
31 | 31 | $message = sprintf( |
32 | 32 | __( |
33 | 33 | 'A valid Form Handler was expected but instead "%1$s" was received.', |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $actual |
37 | 37 | ); |
38 | 38 | } |
39 | - parent::__construct( $message, $code, $previous ); |
|
39 | + parent::__construct($message, $code, $previous); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | } |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | |
4 | 4 | use EE_Form_Section_Proper; |
5 | 5 | |
6 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
7 | - exit( 'No direct script access allowed' ); |
|
6 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
7 | + exit('No direct script access allowed'); |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | /** |
37 | 37 | * @param \EE_Form_Section_Proper $form |
38 | 38 | */ |
39 | - public function setForm( \EE_Form_Section_Proper $form ); |
|
39 | + public function setForm(\EE_Form_Section_Proper $form); |
|
40 | 40 | |
41 | 41 | |
42 | 42 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | /** |
54 | 54 | * @param boolean $displayable |
55 | 55 | */ |
56 | - public function setDisplayable( $displayable = false ); |
|
56 | + public function setDisplayable($displayable = false); |
|
57 | 57 | |
58 | 58 | |
59 | 59 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | /** |
95 | 95 | * @param string $submit_btn_text |
96 | 96 | */ |
97 | - public function setSubmitBtnText( $submit_btn_text ); |
|
97 | + public function setSubmitBtnText($submit_btn_text); |
|
98 | 98 | |
99 | 99 | |
100 | 100 | |
@@ -108,14 +108,14 @@ discard block |
||
108 | 108 | /** |
109 | 109 | * @param string $form_action |
110 | 110 | */ |
111 | - public function setFormAction( $form_action ); |
|
111 | + public function setFormAction($form_action); |
|
112 | 112 | |
113 | 113 | |
114 | 114 | |
115 | 115 | /** |
116 | 116 | * @param array $form_args |
117 | 117 | */ |
118 | - public function addFormActionArgs( $form_args = array() ); |
|
118 | + public function addFormActionArgs($form_args = array()); |
|
119 | 119 | |
120 | 120 | |
121 | 121 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * |
136 | 136 | * @param string $form_config |
137 | 137 | */ |
138 | - public function setFormConfig( $form_config ); |
|
138 | + public function setFormConfig($form_config); |
|
139 | 139 | |
140 | 140 | |
141 | 141 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * @param array $submitted_form_data |
188 | 188 | * @return bool |
189 | 189 | */ |
190 | - public function process( $submitted_form_data = array() ); |
|
190 | + public function process($submitted_form_data = array()); |
|
191 | 191 | |
192 | 192 | |
193 | 193 | |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * @param string $text |
198 | 198 | * @return \EE_Submit_Input |
199 | 199 | */ |
200 | - public function generateSubmitButton( $text = '' ); |
|
200 | + public function generateSubmitButton($text = ''); |
|
201 | 201 | |
202 | 202 | |
203 | 203 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | * @param string $text |
217 | 217 | * @return \EE_Submit_Input |
218 | 218 | */ |
219 | - public function generateCancelButton( $text = '' ); |
|
219 | + public function generateCancelButton($text = ''); |
|
220 | 220 | |
221 | 221 | |
222 | 222 |