@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | public function __construct() { |
21 | 21 | |
22 | - if ( ! $this->_shouldLoadDemo() ) { |
|
22 | + if ( !$this->_shouldLoadDemo() ) { |
|
23 | 23 | return; |
24 | 24 | } |
25 | 25 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | do_action( 'admin_page_framework_loader_action_before_loading_demo' ); |
31 | 31 | |
32 | 32 | // Include example components. |
33 | - include( AdminPageFrameworkLoader_Registry::$sDirPath . '/example/admin-page-framework-demo-bootstrap.php' ); |
|
33 | + include( AdminPageFrameworkLoader_Registry::$sDirPath.'/example/admin-page-framework-demo-bootstrap.php' ); |
|
34 | 34 | |
35 | 35 | do_action( 'admin_page_framework_loader_action_after_loading_demo' ); |
36 | 36 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | // Check if the demo is enabled. |
49 | 49 | $_oOption = AdminPageFrameworkLoader_Option::getInstance(); |
50 | - if ( ! $_oOption->get( 'enable_demo' ) ) { |
|
50 | + if ( !$_oOption->get( 'enable_demo' ) ) { |
|
51 | 51 | $this->_setPointerToolTips(); |
52 | 52 | return false; |
53 | 53 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | 'options' => array( |
77 | 77 | 'content' => sprintf( '<h3> %1$s </h3> <p> %2$s </p>', |
78 | 78 | AdminPageFrameworkLoader_Registry::NAME, |
79 | - __( 'Check out the functionality of Admin Page Framework by enabling the demo.','admin-page-framework-loader' ) |
|
79 | + __( 'Check out the functionality of Admin Page Framework by enabling the demo.', 'admin-page-framework-loader' ) |
|
80 | 80 | ), |
81 | 81 | 'position' => array( 'edge' => 'left', 'align' => 'middle' ) |
82 | 82 | ) |
@@ -9,12 +9,12 @@ |
||
9 | 9 | * @since 3.5.0 |
10 | 10 | */ |
11 | 11 | |
12 | - /** |
|
13 | - * |
|
14 | - * |
|
15 | - * @action do admin_page_framework_loader_action_before_loading_demo |
|
16 | - * @action do admin_page_framework_loader_action_after_loading_demo |
|
17 | - */ |
|
12 | + /** |
|
13 | + * |
|
14 | + * |
|
15 | + * @action do admin_page_framework_loader_action_before_loading_demo |
|
16 | + * @action do admin_page_framework_loader_action_after_loading_demo |
|
17 | + */ |
|
18 | 18 | class AdminPageFrameworkLoader_Demo { |
19 | 19 | |
20 | 20 | public function __construct() { |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | // Property object |
134 | 134 | $this->oProp = $oProp; |
135 | 135 | |
136 | - if ( $this->oProp->bIsAdmin && ! $this->oProp->bIsAdminAjax ) { |
|
136 | + if ( $this->oProp->bIsAdmin && !$this->oProp->bIsAdminAjax ) { |
|
137 | 137 | if ( did_action( 'current_screen' ) ) { |
138 | 138 | $this->_replyToLoadComponents(); |
139 | 139 | } else { |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $this->oLink = $this->oLink; |
161 | 161 | } |
162 | 162 | |
163 | - if ( ! $this->_isInThePage() ) { |
|
163 | + if ( !$this->_isInThePage() ) { |
|
164 | 164 | return; |
165 | 165 | } |
166 | 166 | |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | 'network_admin_page' => 'AdminPageFramework_HelpPane_Page', |
267 | 267 | 'post_meta_box' => 'AdminPageFramework_HelpPane_MetaBox', |
268 | 268 | 'page_meta_box' => 'AdminPageFramework_HelpPane_MetaBox_Page', |
269 | - 'post_type' => null, // no help pane class for the post type factory class. |
|
269 | + 'post_type' => null, // no help pane class for the post type factory class. |
|
270 | 270 | 'taxonomy_field' => 'AdminPageFramework_HelpPane_TaxonomyField', |
271 | 271 | 'widget' => 'AdminPageFramework_HelpPane_Widget', |
272 | 272 | 'user_meta' => 'AdminPageFramework_HelpPane_UserMeta', |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | */ |
328 | 328 | protected function _getPageLoadInfoInstance( $oProp, $oMsg ) { |
329 | 329 | |
330 | - if ( ! isset( $this->_aPageLoadClassNameMap[ $oProp->sStructureType ] ) ) { |
|
330 | + if ( !isset( $this->_aPageLoadClassNameMap[ $oProp->sStructureType ] ) ) { |
|
331 | 331 | return null; |
332 | 332 | } |
333 | 333 | $_sClassName = $this->_aPageLoadClassNameMap[ $oProp->sStructureType ]; |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | $_aClassNameMap = array_shift( $_aParams ); |
350 | 350 | $_sKey = array_shift( $_aParams ); |
351 | 351 | |
352 | - if ( ! isset( $_aClassNameMap[ $_sKey ] ) ) { |
|
352 | + if ( !isset( $_aClassNameMap[ $_sKey ] ) ) { |
|
353 | 353 | return null; |
354 | 354 | } |
355 | 355 | |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | */ |
414 | 414 | public function __get( $sPropertyName ) { |
415 | 415 | |
416 | - switch( $sPropertyName ) { |
|
416 | + switch ( $sPropertyName ) { |
|
417 | 417 | case 'oHeadTag': // 3.3.0+ for backward compatibility |
418 | 418 | $sPropertyName = 'oResource'; |
419 | 419 | break; |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | // Set and return the sub class object instance. |
423 | 423 | if ( in_array( $sPropertyName, $this->_aSubClassNames ) ) { |
424 | 424 | return call_user_func( |
425 | - array( $this, "_replyTpSetAndGetInstance_{$sPropertyName}" ) |
|
425 | + array( $this, "_replyTpSetAndGetInstance_{$sPropertyName}" ) |
|
426 | 426 | ); |
427 | 427 | } |
428 | 428 | |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | * |
504 | 504 | * @internal |
505 | 505 | */ |
506 | - public function __call( $sMethodName, $aArguments=null ) { |
|
506 | + public function __call( $sMethodName, $aArguments = null ) { |
|
507 | 507 | |
508 | 508 | $_mFirstArg = $this->oUtil->getElement( $aArguments, 0 ); |
509 | 509 | |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | |
543 | 543 | // Check if the method name contains a backslash. |
544 | 544 | if ( false === strpos( $sMethodName, "\\" ) ) { |
545 | - return $this->oUtil->getElement( $aArguments, 0 ); // the first element - the filter value |
|
545 | + return $this->oUtil->getElement( $aArguments, 0 ); // the first element - the filter value |
|
546 | 546 | } |
547 | 547 | |
548 | 548 | // if the method name contains a backslash, the user may be using a name space. |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | array( $this, $_sAutoCallbackClassName ), |
554 | 554 | $aArguments |
555 | 555 | ) |
556 | - : $this->oUtil->getElement( $aArguments, 0 ); // the first argument |
|
556 | + : $this->oUtil->getElement( $aArguments, 0 ); // the first argument |
|
557 | 557 | |
558 | 558 | } |
559 | 559 | |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | */ |
564 | 564 | private function _triggerUndefinedMethodWarning( $sMethodName ) { |
565 | 565 | trigger_error( |
566 | - AdminPageFramework_Registry::NAME . ': ' |
|
566 | + AdminPageFramework_Registry::NAME.': ' |
|
567 | 567 | . sprintf( |
568 | 568 | __( 'The method is not defined: %1$s', $this->oProp->sTextDomain ), |
569 | 569 | $sMethodName |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | if ( $this->oProp->bIsAdmin && ! $this->oProp->bIsAdminAjax ) { |
137 | 137 | if ( did_action( 'current_screen' ) ) { |
138 | 138 | $this->_replyToLoadComponents(); |
139 | - } else { |
|
139 | + } else { |
|
140 | 140 | add_action( 'current_screen', array( $this, '_replyToLoadComponents' ) ); |
141 | 141 | } |
142 | 142 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $this->oLink = $this->oLink; |
161 | 161 | } |
162 | 162 | |
163 | - if ( ! $this->_isInThePage() ) { |
|
163 | + if ( ! $this->_isInThePage() ) { |
|
164 | 164 | return; |
165 | 165 | } |
166 | 166 | |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * @since 3.1.0 |
198 | 198 | * @internal |
199 | 199 | */ |
200 | - protected function _isInstantiatable() { |
|
200 | + protected function _isInstantiatable() { |
|
201 | 201 | return true; |
202 | 202 | } |
203 | 203 | |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | * @since 3.2.0 Changed the scope to public from protected as the head tag object will access it. |
211 | 211 | * @internal |
212 | 212 | */ |
213 | - public function _isInThePage() { |
|
213 | + public function _isInThePage() { |
|
214 | 214 | return true; |
215 | 215 | } |
216 | 216 | |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | } |
421 | 421 | |
422 | 422 | // Set and return the sub class object instance. |
423 | - if ( in_array( $sPropertyName, $this->_aSubClassNames ) ) { |
|
423 | + if ( in_array( $sPropertyName, $this->_aSubClassNames ) ) { |
|
424 | 424 | return call_user_func( |
425 | 425 | array( $this, "_replyTpSetAndGetInstance_{$sPropertyName}" ) |
426 | 426 | ); |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | * |
504 | 504 | * @internal |
505 | 505 | */ |
506 | - public function __call( $sMethodName, $aArguments=null ) { |
|
506 | + public function __call( $sMethodName, $aArguments=null ) { |
|
507 | 507 | |
508 | 508 | $_mFirstArg = $this->oUtil->getElement( $aArguments, 0 ); |
509 | 509 |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Admin Page Framework |
|
4 | - * |
|
5 | - * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | - * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | - * |
|
8 | - */ |
|
3 | + * Admin Page Framework |
|
4 | + * |
|
5 | + * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | + * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | + * |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Provides methods to handle importing options. |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Admin Page Framework |
|
4 | - * |
|
5 | - * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | - * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | - * |
|
8 | - */ |
|
3 | + * Admin Page Framework |
|
4 | + * |
|
5 | + * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | + * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | + * |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Provides methods to handle importing options. |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Admin Page Framework |
|
4 | - * |
|
5 | - * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | - * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | - * |
|
8 | - */ |
|
3 | + * Admin Page Framework |
|
4 | + * |
|
5 | + * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | + * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | + * |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Provides methods to handle importing options. |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * Defines the field type slugs used for this field type. |
23 | 23 | */ |
24 | - public $aFieldTypeSlugs = array( 'size', ); |
|
24 | + public $aFieldTypeSlugs = array( 'size',); |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Defines the default key-values of this field type. |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | protected $aDefaultKeys = array( |
32 | 32 | 'is_multiple' => false, // indicates whether the select tag alloes multiple selections. |
33 | - 'units' => null, // do not define units here since this will be merged with the user defined field array. |
|
33 | + 'units' => null, // do not define units here since this will be merged with the user defined field array. |
|
34 | 34 | 'attributes' => array( |
35 | 35 | 'size' => array( |
36 | 36 | 'size' => 10, |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | protected $aDefaultUnits = array( |
61 | 61 | 'px' => 'px', // pixel |
62 | - '%' => '%', // percentage |
|
62 | + '%' => '%', // percentage |
|
63 | 63 | 'em' => 'em', // font size |
64 | 64 | 'ex' => 'ex', // font height |
65 | 65 | 'in' => 'in', // inch |
@@ -116,8 +116,8 @@ discard block |
||
116 | 116 | ); |
117 | 117 | |
118 | 118 | $_aOutput = array(); |
119 | - foreach( ( array ) $aField[ 'label' ] as $_isKey => $_sLabel ) { |
|
120 | - $_aOutput[] = $this->_getFieldOutputByLabel( |
|
119 | + foreach ( ( array ) $aField[ 'label' ] as $_isKey => $_sLabel ) { |
|
120 | + $_aOutput[ ] = $this->_getFieldOutputByLabel( |
|
121 | 121 | $_isKey, |
122 | 122 | $_sLabel, |
123 | 123 | $aField |
@@ -139,22 +139,22 @@ discard block |
||
139 | 139 | |
140 | 140 | $_aBaseAttributes = $_bMultiLabels |
141 | 141 | ? array( |
142 | - 'name' => $aField[ 'attributes' ][ 'name' ] . "[{$isKey}]", |
|
143 | - 'id' => $aField[ 'attributes' ][ 'id' ] . "_{$isKey}", |
|
142 | + 'name' => $aField[ 'attributes' ][ 'name' ]."[{$isKey}]", |
|
143 | + 'id' => $aField[ 'attributes' ][ 'id' ]."_{$isKey}", |
|
144 | 144 | 'value' => $aField[ 'value' ], |
145 | 145 | ) |
146 | 146 | + $aField[ 'attributes' ] |
147 | 147 | : $aField[ 'attributes' ]; |
148 | 148 | unset( |
149 | - $_aBaseAttributes['unit'], |
|
150 | - $_aBaseAttributes['size'] |
|
149 | + $_aBaseAttributes[ 'unit' ], |
|
150 | + $_aBaseAttributes[ 'size' ] |
|
151 | 151 | ); |
152 | 152 | |
153 | 153 | $_aOutput = array( |
154 | 154 | $this->getElementByLabel( $aField[ 'before_label' ], $isKey, $aField[ 'label' ] ), |
155 | - "<div class='admin-page-framework-input-label-container admin-page-framework-select-label' style='min-width: " . $this->sanitizeLength( $aField[ 'label_min_width' ] ) . ";'>", |
|
156 | - $this->_getNumberInputPart( $aField, $_aBaseAttributes, $isKey, $aField[ 'label' ] ), // The size (number) part |
|
157 | - $this->_getUnitSelectInput( $aField, $_aBaseAttributes, $isKey, $aField[ 'label' ] ), // The unit (select) part |
|
155 | + "<div class='admin-page-framework-input-label-container admin-page-framework-select-label' style='min-width: ".$this->sanitizeLength( $aField[ 'label_min_width' ] ).";'>", |
|
156 | + $this->_getNumberInputPart( $aField, $_aBaseAttributes, $isKey, $aField[ 'label' ] ), // The size (number) part |
|
157 | + $this->_getUnitSelectInput( $aField, $_aBaseAttributes, $isKey, $aField[ 'label' ] ), // The unit (select) part |
|
158 | 158 | "</div>", |
159 | 159 | $this->getElementByLabel( $aField[ 'after_label' ], $isKey, $aField[ 'label' ] ) |
160 | 160 | ); |
@@ -170,39 +170,39 @@ discard block |
||
170 | 170 | private function _getNumberInputPart( array $aField, array $aBaseAttributes, $isKey, $bMultiLabels ) { |
171 | 171 | |
172 | 172 | // Size and Size Label |
173 | - $_aSizeAttributes = $this->_getSizeAttributes( |
|
173 | + $_aSizeAttributes = $this->_getSizeAttributes( |
|
174 | 174 | $aField, |
175 | 175 | $aBaseAttributes, |
176 | 176 | $bMultiLabels |
177 | 177 | ? $isKey |
178 | 178 | : '' |
179 | 179 | ); |
180 | - $_aSizeLabelAttributes = array( |
|
180 | + $_aSizeLabelAttributes = array( |
|
181 | 181 | 'for' => $_aSizeAttributes[ 'id' ], |
182 | 182 | 'class' => $_aSizeAttributes[ 'disabled' ] |
183 | 183 | ? 'disabled' |
184 | 184 | : null, |
185 | 185 | ); |
186 | 186 | |
187 | - $_sLabel = $this->getElementByLabel( |
|
187 | + $_sLabel = $this->getElementByLabel( |
|
188 | 188 | $aField[ 'label' ], |
189 | 189 | $isKey, |
190 | 190 | $aField[ 'label' ] |
191 | 191 | ); |
192 | - return "<label " . $this->getAttributes( $_aSizeLabelAttributes ) . ">" |
|
192 | + return "<label ".$this->getAttributes( $_aSizeLabelAttributes ).">" |
|
193 | 193 | . $this->getElement( |
194 | 194 | $aField, |
195 | 195 | $bMultiLabels |
196 | 196 | ? array( 'before_label', $isKey, 'size' ) |
197 | 197 | : array( 'before_label', 'size' ) |
198 | 198 | ) |
199 | - . ( $aField['label'] && ! $aField[ 'repeatable' ] |
|
200 | - ? "<span class='admin-page-framework-input-label-string' style='min-width:" . $this->sanitizeLength( $aField[ 'label_min_width' ] ) . ";'>" |
|
199 | + . ( $aField[ 'label' ] && !$aField[ 'repeatable' ] |
|
200 | + ? "<span class='admin-page-framework-input-label-string' style='min-width:".$this->sanitizeLength( $aField[ 'label_min_width' ] ).";'>" |
|
201 | 201 | . $_sLabel |
202 | 202 | . "</span>" |
203 | 203 | : "" |
204 | 204 | ) |
205 | - . "<input " . $this->getAttributes( $_aSizeAttributes ) . " />" |
|
205 | + . "<input ".$this->getAttributes( $_aSizeAttributes )." />" |
|
206 | 206 | . $this->getElement( |
207 | 207 | $aField, |
208 | 208 | $bMultiLabels |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | ) |
245 | 245 | : $aField[ 'units' ]; |
246 | 246 | |
247 | - return "<label " . $this->getAttributes( |
|
247 | + return "<label ".$this->getAttributes( |
|
248 | 248 | array( |
249 | 249 | 'for' => $_aUnitAttributes[ 'id' ], |
250 | 250 | 'class' => $_aUnitAttributes[ 'disabled' ] |
@@ -275,9 +275,9 @@ discard block |
||
275 | 275 | * @since 3.5.3 |
276 | 276 | * @return array an unit attribute array |
277 | 277 | */ |
278 | - private function _getUnitAttributes( array $aField, array $aBaseAttributes, $isLabelKey='' ) { |
|
278 | + private function _getUnitAttributes( array $aField, array $aBaseAttributes, $isLabelKey = '' ) { |
|
279 | 279 | |
280 | - $_bIsMultiple = $aField[ 'is_multiple' ] |
|
280 | + $_bIsMultiple = $aField[ 'is_multiple' ] |
|
281 | 281 | ? true |
282 | 282 | : $this->getElement( |
283 | 283 | $aField, |
@@ -289,13 +289,13 @@ discard block |
||
289 | 289 | |
290 | 290 | $_aSelectAttributes = array( |
291 | 291 | 'type' => 'select', |
292 | - 'id' => $aField[ 'input_id' ] . ( '' === $isLabelKey ? '' : '_' . $isLabelKey ) . '_' . 'unit', |
|
292 | + 'id' => $aField[ 'input_id' ].( '' === $isLabelKey ? '' : '_'.$isLabelKey ).'_'.'unit', |
|
293 | 293 | 'multiple' => $_bIsMultiple |
294 | 294 | ? 'multiple' |
295 | 295 | : null, |
296 | 296 | 'name' => $_bIsMultiple |
297 | - ? "{$aField['_input_name']}" . ( '' === $isLabelKey ? '' : '[' . $isLabelKey . ']' ) . "[unit][]" |
|
298 | - : "{$aField['_input_name']}" . ( '' === $isLabelKey ? '' : '[' . $isLabelKey . ']' ) . "[unit]", |
|
297 | + ? "{$aField[ '_input_name' ]}".( '' === $isLabelKey ? '' : '['.$isLabelKey.']' )."[unit][]" |
|
298 | + : "{$aField[ '_input_name' ]}".( '' === $isLabelKey ? '' : '['.$isLabelKey.']' )."[unit]", |
|
299 | 299 | 'value' => $this->getElement( |
300 | 300 | $aField, |
301 | 301 | array( 'value', 'unit' ), |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | '' === $isLabelKey |
308 | 308 | ? array( 'attributes', 'unit' ) |
309 | 309 | : array( 'attributes', $isLabelKey, 'unit' ), |
310 | - $this->aDefaultKeys['attributes']['unit'] |
|
310 | + $this->aDefaultKeys[ 'attributes' ][ 'unit' ] |
|
311 | 311 | ) |
312 | 312 | + $aBaseAttributes; |
313 | 313 | return $_aSelectAttributes; |
@@ -320,15 +320,15 @@ discard block |
||
320 | 320 | * @since 3.5.3 |
321 | 321 | * @return array an size attribute array |
322 | 322 | */ |
323 | - private function _getSizeAttributes( array $aField, array $aBaseAttributes, $sLabelKey='' ) { |
|
323 | + private function _getSizeAttributes( array $aField, array $aBaseAttributes, $sLabelKey = '' ) { |
|
324 | 324 | |
325 | 325 | return array( |
326 | 326 | 'type' => 'number', |
327 | - 'id' => $aField['input_id'] . '_' . ( '' !== $sLabelKey ? $sLabelKey . '_' : '' ) . 'size', |
|
328 | - 'name' => $aField[ '_input_name' ] . ( '' !== $sLabelKey ? "[{$sLabelKey}]" : '' ) . '[size]', |
|
327 | + 'id' => $aField[ 'input_id' ].'_'.( '' !== $sLabelKey ? $sLabelKey.'_' : '' ).'size', |
|
328 | + 'name' => $aField[ '_input_name' ].( '' !== $sLabelKey ? "[{$sLabelKey}]" : '' ).'[size]', |
|
329 | 329 | 'value' => $this->getElement( |
330 | - $aField, // subject |
|
331 | - array( 'value', 'size' ), // dimensional keys |
|
330 | + $aField, // subject |
|
331 | + array( 'value', 'size' ), // dimensional keys |
|
332 | 332 | '' // default |
333 | 333 | ), |
334 | 334 | ) |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @param object $oForm |
30 | 30 | * @param string $sHeadActionHook The action hook triggered inside the `<head>` tag. For front-end forms, use `wp_head`. |
31 | 31 | */ |
32 | - public function __construct( $oForm, $sHeadActionHook='admin_head' ) { |
|
32 | + public function __construct( $oForm, $sHeadActionHook = 'admin_head' ) { |
|
33 | 33 | |
34 | 34 | $this->oForm = $oForm; |
35 | 35 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * as multiple instances of the factory class is loaded among separate pages, |
54 | 54 | * one gets denied here and if it can load earlier than the one which should insert the below script. |
55 | 55 | */ |
56 | - if ( ! $this->oForm->isInThePage() ) { |
|
56 | + if ( !$this->oForm->isInThePage() ) { |
|
57 | 57 | return; |
58 | 58 | } |
59 | 59 | |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | private function _getScripts_RequiredInHead() { |
77 | 77 | return 'document.write( "<style class=\'admin-page-framework-js-embedded-inline-style\'>' |
78 | 78 | . str_replace( |
79 | - '\\n', // search |
|
80 | - '', // replace |
|
79 | + '\\n', // search |
|
80 | + '', // replace |
|
81 | 81 | esc_js( $this->_getInlineCSS() ) // subject |
82 | 82 | ) |
83 | 83 | . '</style>" );'; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | $this->oForm = $oForm; |
35 | 35 | |
36 | - if ( in_array( $this->oForm->aArguments[ 'structure_type' ], array( 'widget' ) ) ) { |
|
36 | + if ( in_array( $this->oForm->aArguments[ 'structure_type' ], array( 'widget' ) ) ) { |
|
37 | 37 | return; |
38 | 38 | } |
39 | 39 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * @return string |
98 | 98 | * @since DEVVER |
99 | 99 | */ |
100 | - private function _getScriptElementConcealerCSSRules() { |
|
100 | + private function _getScriptElementConcealerCSSRules() { |
|
101 | 101 | |
102 | 102 | // Avoid hiding framework forms in widgets. In some cases, the user sets a form in any page, |
103 | 103 | // which causes a different structure form type including `admin_page` gets loaded even in widgets.php (or any page builder pages dealing with widgets) |
@@ -103,10 +103,10 @@ discard block |
||
103 | 103 | * @since DEVVER |
104 | 104 | */ |
105 | 105 | public function _replyToEnqueueScripts() { |
106 | - if ( ! $this->oForm->isInThePage() ) { |
|
106 | + if ( !$this->oForm->isInThePage() ) { |
|
107 | 107 | return; |
108 | 108 | } |
109 | - foreach( $this->oForm->getResources( 'src_scripts' ) as $_asEnqueue ) { |
|
109 | + foreach ( $this->oForm->getResources( 'src_scripts' ) as $_asEnqueue ) { |
|
110 | 110 | $this->_enqueueScript( $_asEnqueue ); |
111 | 111 | } |
112 | 112 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | private function _getFormattedEnqueueScript( $asEnqueue ) { |
155 | 155 | static $_iCallCount = 1; |
156 | 156 | $_aEnqueueItem = $this->getAsArray( $asEnqueue ) + array( |
157 | - 'handle_id' => 'script_' . $this->oForm->aArguments[ 'caller_id' ] . '_' . $_iCallCount, |
|
157 | + 'handle_id' => 'script_'.$this->oForm->aArguments[ 'caller_id' ].'_'.$_iCallCount, |
|
158 | 158 | 'src' => null, |
159 | 159 | 'dependencies' => null, |
160 | 160 | 'version' => null, |
@@ -177,10 +177,10 @@ discard block |
||
177 | 177 | */ |
178 | 178 | public function _replyToEnqueueStyles() { |
179 | 179 | |
180 | - if ( ! $this->oForm->isInThePage() ) { |
|
180 | + if ( !$this->oForm->isInThePage() ) { |
|
181 | 181 | return; |
182 | 182 | } |
183 | - foreach( $this->oForm->getResources( 'src_styles' ) as $_asEnqueueItem ) { |
|
183 | + foreach ( $this->oForm->getResources( 'src_styles' ) as $_asEnqueueItem ) { |
|
184 | 184 | $this->_enqueueStyle( $_asEnqueueItem ); |
185 | 185 | } |
186 | 186 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | private function _getFormattedEnqueueStyle( $asEnqueue ) { |
202 | 202 | static $_iCallCount = 1; |
203 | 203 | $_aEnqueueItem = $this->getAsArray( $asEnqueue ) + array( |
204 | - 'handle_id' => 'style_' . $this->oForm->aArguments[ 'caller_id' ] . '_' . $_iCallCount, |
|
204 | + 'handle_id' => 'style_'.$this->oForm->aArguments[ 'caller_id' ].'_'.$_iCallCount, |
|
205 | 205 | 'src' => null, |
206 | 206 | 'dependencies' => null, |
207 | 207 | 'version' => null, |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | */ |
223 | 223 | public function _replyToAddStyle() { |
224 | 224 | |
225 | - if ( ! $this->oForm->isInThePage() ) { |
|
225 | + if ( !$this->oForm->isInThePage() ) { |
|
226 | 226 | return; |
227 | 227 | } |
228 | 228 | $_sCSSRules = $this->_getFormattedInlineStyles( |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | */ |
268 | 268 | public function _replyToAddScript() { |
269 | 269 | |
270 | - if ( ! $this->oForm->isInThePage() ) { |
|
270 | + if ( !$this->oForm->isInThePage() ) { |
|
271 | 271 | return; |
272 | 272 | } |
273 | 273 |
@@ -230,7 +230,7 @@ |
||
230 | 230 | ); |
231 | 231 | |
232 | 232 | $_sID = $this->sanitizeSlug( strtolower( $this->oForm->aArguments[ 'caller_id' ] ) ); |
233 | - if ( $_sCSSRules ) { |
|
233 | + if ( $_sCSSRules ) { |
|
234 | 234 | echo "<style type='text/css' id='inline-style-{$_sID}' class='admin-page-framework-form-style'>" |
235 | 235 | . $_sCSSRules |
236 | 236 | . "</style>"; |
@@ -82,11 +82,11 @@ discard block |
||
82 | 82 | 'confirm_perform_task' => 'Please confirm your action.', |
83 | 83 | 'specified_option_been_deleted' => 'The specified options have been deleted.', |
84 | 84 | 'nonce_verification_failed' => 'A problem occurred while processing the form data. Please try again.', |
85 | - 'check_max_input_vars' => 'Not all form fields could not be sent. Please check your server settings of PHP <code>max_input_vars</code> and consult the server administrator to increase the value. <code>max input vars</code>: %1$s. <code>$_POST</code> count: %2$s', // 3.5.11+ |
|
86 | - 'send_email' => 'Is it okay to send the email?', // 3.3.0+ |
|
87 | - 'email_sent' => 'The email has been sent.', // 3.3.0+, 3.3.5+ deprecated |
|
85 | + 'check_max_input_vars' => 'Not all form fields could not be sent. Please check your server settings of PHP <code>max_input_vars</code> and consult the server administrator to increase the value. <code>max input vars</code>: %1$s. <code>$_POST</code> count: %2$s', // 3.5.11+ |
|
86 | + 'send_email' => 'Is it okay to send the email?', // 3.3.0+ |
|
87 | + 'email_sent' => 'The email has been sent.', // 3.3.0+, 3.3.5+ deprecated |
|
88 | 88 | 'email_scheduled' => 'The email has been scheduled.', // 3.3.5+ |
89 | - 'email_could_not_send' => 'There was a problem sending the email', // 3.3.0+ |
|
89 | + 'email_could_not_send' => 'There was a problem sending the email', // 3.3.0+ |
|
90 | 90 | |
91 | 91 | // AdminPageFramework_PostType |
92 | 92 | 'title' => 'Title', |
@@ -112,14 +112,14 @@ discard block |
||
112 | 112 | 'upload_file' => 'Upload File', |
113 | 113 | 'use_this_file' => 'Use This File', |
114 | 114 | 'select_file' => 'Select File', |
115 | - 'remove_value' => 'Remove Value', // 3.2.0+ |
|
116 | - 'select_all' => 'Select All', // 3.3.0+ |
|
117 | - 'select_none' => 'Select None', // 3.3.0+ |
|
115 | + 'remove_value' => 'Remove Value', // 3.2.0+ |
|
116 | + 'select_all' => 'Select All', // 3.3.0+ |
|
117 | + 'select_none' => 'Select None', // 3.3.0+ |
|
118 | 118 | 'no_term_found' => 'No term found.', // 3.3.2+ |
119 | 119 | |
120 | 120 | // AdminPageFramework_Form_View___Script_{...} |
121 | 121 | 'select' => 'Select', // 3.4.2+ |
122 | - 'insert' => 'Insert', // 3.4.2+ |
|
122 | + 'insert' => 'Insert', // 3.4.2+ |
|
123 | 123 | 'use_this' => 'Use This', // 3.4.2+ |
124 | 124 | 'return_to_library' => 'Return to Library', // 3.4.2+ |
125 | 125 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | * @since 3.2.0 Changed it to create an instance per text domain basis. |
197 | 197 | * @remark This class should be instantiated via this method. |
198 | 198 | */ |
199 | - public static function getInstance( $sTextDomain='admin-page-framework' ) { |
|
199 | + public static function getInstance( $sTextDomain = 'admin-page-framework' ) { |
|
200 | 200 | |
201 | 201 | $_oInstance = isset( self::$_aInstancesByTextDomain[ $sTextDomain ] ) && ( self::$_aInstancesByTextDomain[ $sTextDomain ] instanceof AdminPageFramework_Message ) |
202 | 202 | ? self::$_aInstancesByTextDomain[ $sTextDomain ] |
@@ -209,21 +209,21 @@ discard block |
||
209 | 209 | * Ensures that only one instance of this class object exists. ( no multiple instances of this object ) |
210 | 210 | * @deprecated 3.2.0 |
211 | 211 | */ |
212 | - public static function instantiate( $sTextDomain='admin-page-framework' ) { |
|
212 | + public static function instantiate( $sTextDomain = 'admin-page-framework' ) { |
|
213 | 213 | return self::getInstance( $sTextDomain ); |
214 | 214 | } |
215 | 215 | |
216 | 216 | /** |
217 | 217 | * Sets up properties. |
218 | 218 | */ |
219 | - public function __construct( $sTextDomain='admin-page-framework' ) { |
|
219 | + public function __construct( $sTextDomain = 'admin-page-framework' ) { |
|
220 | 220 | |
221 | 221 | $this->_sTextDomain = $sTextDomain; |
222 | 222 | |
223 | 223 | // Fill the $aMessages property with the keys extracted from the $aDefaults property |
224 | 224 | // with the value of null. The null is set to let it trigger the __get() method |
225 | 225 | // so that each translation item gets processed individually. |
226 | - $this->aMessages = array_fill_keys( |
|
226 | + $this->aMessages = array_fill_keys( |
|
227 | 227 | array_keys( $this->aDefaults ), |
228 | 228 | null |
229 | 229 | ); |
@@ -257,13 +257,13 @@ discard block |
||
257 | 257 | * @since DEVVER If no key is specified, return the entire mesage array. |
258 | 258 | * @return string|array |
259 | 259 | */ |
260 | - public function get( $sKey='' ) { |
|
261 | - if ( ! $sKey ) { |
|
260 | + public function get( $sKey = '' ) { |
|
261 | + if ( !$sKey ) { |
|
262 | 262 | return $this->_getAllMessages(); |
263 | 263 | } |
264 | 264 | return isset( $this->aMessages[ $sKey ] ) |
265 | 265 | ? __( $this->aMessages[ $sKey ], $this->_sTextDomain ) |
266 | - : __( $this->{$sKey}, $this->_sTextDomain ); // triggers __get() |
|
266 | + : __( $this->{$sKey}, $this->_sTextDomain ); // triggers __get() |
|
267 | 267 | } |
268 | 268 | /** |
269 | 269 | * Returns the all registered messag items. |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Admin Page Framework |
|
4 | - * |
|
5 | - * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | - * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | - * |
|
8 | - */ |
|
3 | + * Admin Page Framework |
|
4 | + * |
|
5 | + * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | + * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | + * |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Provides methods for creating fields in the taxonomy page (edit-tags.php). |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Admin Page Framework Loader |
|
4 | - * |
|
5 | - * Demonstrates the usage of Admin Page Framework. |
|
6 | - * |
|
7 | - * http://en.michaeluno.jp/admin-page-framework/ |
|
8 | - * Copyright (c) 2013-2015 Michael Uno; Licensed GPLv2 |
|
9 | - * |
|
10 | - */ |
|
3 | + * Admin Page Framework Loader |
|
4 | + * |
|
5 | + * Demonstrates the usage of Admin Page Framework. |
|
6 | + * |
|
7 | + * http://en.michaeluno.jp/admin-page-framework/ |
|
8 | + * Copyright (c) 2013-2015 Michael Uno; Licensed GPLv2 |
|
9 | + * |
|
10 | + */ |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * Adds a tab of the set page to the loader plugin. |