@@ -174,6 +174,7 @@ discard block |
||
174 | 174 | * Returns the repeatable fields script. |
175 | 175 | * |
176 | 176 | * @since 2.1.3 |
177 | + * @param string $sFieldsContainerID |
|
177 | 178 | */ |
178 | 179 | protected function _getRepeaterFieldEnablerScript( $sFieldsContainerID, $iFieldCount, $aSettings ) { |
179 | 180 | |
@@ -244,6 +245,7 @@ discard block |
||
244 | 245 | /** |
245 | 246 | * @since 3.8.13 |
246 | 247 | * @param array $aArguments |
248 | + * @param string $sSmallButtonSelector |
|
247 | 249 | * @return string |
248 | 250 | */ |
249 | 251 | private function ___getAddButtonAttribtes( $aArguments, $sFieldsContainerID, $sSmallButtonSelector ) { |
@@ -262,7 +264,7 @@ discard block |
||
262 | 264 | } |
263 | 265 | /** |
264 | 266 | * @since 3.8.13 |
265 | - * @param array $aArguments |
|
267 | + * @param string $sSmallButtonSelector |
|
266 | 268 | * @return string |
267 | 269 | */ |
268 | 270 | private function ___getRemvoeButtonAttribtes( $sFieldsContainerID, $sSmallButtonSelector, $iFieldCount ) { |
@@ -306,6 +308,7 @@ discard block |
||
306 | 308 | * Returns the sortable fields script. |
307 | 309 | * |
308 | 310 | * @since 3.0.0 |
311 | + * @param string $sFieldsContainerID |
|
309 | 312 | */ |
310 | 313 | protected function _getSortableFieldEnablerScript( $sFieldsContainerID ) { |
311 | 314 |
@@ -255,8 +255,8 @@ discard block |
||
255 | 255 | 'href' => empty( $aArguments[ 'disabled' ] ) |
256 | 256 | ? null |
257 | 257 | : '#TB_inline?width=' . $aArguments[ 'disabled' ][ 'box_width' ] |
258 | - . '&height=' . $aArguments[ 'disabled' ][ 'box_height' ] |
|
259 | - . '&inlineId=' . 'repeatable_field_disabled_' . $sFieldsContainerID, |
|
258 | + . '&height=' . $aArguments[ 'disabled' ][ 'box_height' ] |
|
259 | + . '&inlineId=' . 'repeatable_field_disabled_' . $sFieldsContainerID, |
|
260 | 260 | ); |
261 | 261 | return $this->getAttributes( $_sPlusButtonAttributes ); |
262 | 262 | } |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | private function ___getRemvoeButtonAttribtes( $sFieldsContainerID, $sSmallButtonSelector, $iFieldCount ) { |
269 | 269 | $_aMinusButtonAttributes = array( |
270 | 270 | 'class' => 'repeatable-field-remove-button button-secondary repeatable-field-button button' |
271 | - . $sSmallButtonSelector, |
|
271 | + . $sSmallButtonSelector, |
|
272 | 272 | 'title' => $this->oMsg->get( 'remove' ), |
273 | 273 | 'style' => $iFieldCount <= 1 |
274 | 274 | ? 'visibility: hidden' |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @param object $oMsg An object storing the system messages. |
69 | 69 | * @param array $aCallbacks An array storing the form-field specific callbacks. |
70 | 70 | */ |
71 | - public function __construct( $aFieldset, $aOptions, $aErrors, &$aFieldTypeDefinitions, &$oMsg, array $aCallbacks=array() ) { |
|
71 | + public function __construct( $aFieldset, $aOptions, $aErrors, &$aFieldTypeDefinitions, &$oMsg, array $aCallbacks = array() ) { |
|
72 | 72 | |
73 | 73 | // Set up the properties that will be accessed later in the methods. |
74 | 74 | $this->aFieldset = $this->_getFormatted( $aFieldset, $aFieldTypeDefinitions ); |
@@ -77,13 +77,13 @@ discard block |
||
77 | 77 | $this->aErrors = $this->getAsArray( $aErrors ); |
78 | 78 | $this->oMsg = $oMsg; |
79 | 79 | $this->aCallbacks = $aCallbacks + array( |
80 | - 'hfID' => null, // the input id attribute |
|
81 | - 'hfTagID' => null, // the fieldset/field row container id attribute |
|
82 | - 'hfName' => null, // the input name attribute |
|
83 | - 'hfNameFlat' => null, // the flat input name attribute |
|
80 | + 'hfID' => null, // the input id attribute |
|
81 | + 'hfTagID' => null, // the fieldset/field row container id attribute |
|
82 | + 'hfName' => null, // the input name attribute |
|
83 | + 'hfNameFlat' => null, // the flat input name attribute |
|
84 | 84 | 'hfInputName' => null, |
85 | 85 | 'hfInputNameFlat' => null, |
86 | - 'hfClass' => null, // the class attribute |
|
86 | + 'hfClass' => null, // the class attribute |
|
87 | 87 | ); |
88 | 88 | |
89 | 89 | // 2. Load necessary JavaScript scripts. |
@@ -150,9 +150,9 @@ discard block |
||
150 | 150 | * @since 3.2.0 Added the `$sFieldsType` parameter. |
151 | 151 | * @internal |
152 | 152 | */ |
153 | - private function _loadScripts( $sStructureType='' ) { |
|
153 | + private function _loadScripts( $sStructureType = '' ) { |
|
154 | 154 | |
155 | - if ( 'widget' === $sStructureType && ! self::$_bIsLoadedJSScripts_Widget ) { |
|
155 | + if ( 'widget' === $sStructureType && !self::$_bIsLoadedJSScripts_Widget ) { |
|
156 | 156 | new AdminPageFramework_Form_View___Script_Widget; |
157 | 157 | self::$_bIsLoadedJSScripts_Widget = true; |
158 | 158 | } |
@@ -177,8 +177,8 @@ discard block |
||
177 | 177 | */ |
178 | 178 | protected function _getRepeaterFieldEnablerScript( $sFieldsContainerID, $iFieldCount, $aSettings ) { |
179 | 179 | |
180 | - $_sSmallButtons = '"' . $this->___getRepeatableButtonHTML( $sFieldsContainerID, ( array ) $aSettings, $iFieldCount, true ) . '"'; |
|
181 | - $_sNestedFieldsButtons = '"' . $this->___getRepeatableButtonHTML( $sFieldsContainerID, ( array ) $aSettings, $iFieldCount, false ) . '"'; |
|
180 | + $_sSmallButtons = '"'.$this->___getRepeatableButtonHTML( $sFieldsContainerID, ( array ) $aSettings, $iFieldCount, true ).'"'; |
|
181 | + $_sNestedFieldsButtons = '"'.$this->___getRepeatableButtonHTML( $sFieldsContainerID, ( array ) $aSettings, $iFieldCount, false ).'"'; |
|
182 | 182 | $_aJSArray = json_encode( $aSettings ); |
183 | 183 | $_sScript = <<<JAVASCRIPTS |
184 | 184 | jQuery( document ).ready( function() { |
@@ -224,18 +224,18 @@ discard block |
||
224 | 224 | * @since 3.8.0 |
225 | 225 | * @return string |
226 | 226 | */ |
227 | - private function ___getRepeatableButtonHTML( $sFieldsContainerID, array $aArguments, $iFieldCount, $bSmall=true ) { |
|
227 | + private function ___getRepeatableButtonHTML( $sFieldsContainerID, array $aArguments, $iFieldCount, $bSmall = true ) { |
|
228 | 228 | |
229 | 229 | // @todo Move this formatting routine to the field-set formatter class. |
230 | 230 | $_oFormatter = new AdminPageFramework_Form_Model___Format_RepeatableField( $aArguments, $this->oMsg ); |
231 | 231 | $_aArguments = $_oFormatter->get(); |
232 | 232 | $_sSmallButtonSelector = $bSmall ? ' button-small' : ''; |
233 | - return "<div " . $this->___getContainerAttributes( $_aArguments ) . " >" |
|
234 | - . "<a " . $this->___getRemvoeButtonAttribtes( $sFieldsContainerID, $_sSmallButtonSelector, $iFieldCount ) . ">-</a>" |
|
235 | - . "<a " . $this->___getAddButtonAttribtes( $_aArguments, $sFieldsContainerID, $_sSmallButtonSelector ) . ">+</a>" |
|
233 | + return "<div ".$this->___getContainerAttributes( $_aArguments )." >" |
|
234 | + . "<a ".$this->___getRemvoeButtonAttribtes( $sFieldsContainerID, $_sSmallButtonSelector, $iFieldCount ).">-</a>" |
|
235 | + . "<a ".$this->___getAddButtonAttribtes( $_aArguments, $sFieldsContainerID, $_sSmallButtonSelector ).">+</a>" |
|
236 | 236 | . "</div>" |
237 | 237 | . $this->getModalForDisabledRepeatableElement( |
238 | - 'repeatable_field_disabled_' . $sFieldsContainerID, |
|
238 | + 'repeatable_field_disabled_'.$sFieldsContainerID, |
|
239 | 239 | $_aArguments[ 'disabled' ] |
240 | 240 | ); |
241 | 241 | |
@@ -254,9 +254,9 @@ discard block |
||
254 | 254 | 'data-id' => $sFieldsContainerID, |
255 | 255 | 'href' => empty( $aArguments[ 'disabled' ] ) |
256 | 256 | ? null |
257 | - : '#TB_inline?width=' . $aArguments[ 'disabled' ][ 'box_width' ] |
|
258 | - . '&height=' . $aArguments[ 'disabled' ][ 'box_height' ] |
|
259 | - . '&inlineId=' . 'repeatable_field_disabled_' . $sFieldsContainerID, |
|
257 | + : '#TB_inline?width='.$aArguments[ 'disabled' ][ 'box_width' ] |
|
258 | + . '&height='.$aArguments[ 'disabled' ][ 'box_height' ] |
|
259 | + . '&inlineId='.'repeatable_field_disabled_'.$sFieldsContainerID, |
|
260 | 260 | ); |
261 | 261 | return $this->getAttributes( $_sPlusButtonAttributes ); |
262 | 262 | } |
@@ -283,10 +283,10 @@ discard block |
||
283 | 283 | * @return string |
284 | 284 | */ |
285 | 285 | private function ___getContainerAttributes( $aArguments ) { |
286 | - $_aContainerAttributes = array( |
|
286 | + $_aContainerAttributes = array( |
|
287 | 287 | 'class' => $this->getClassAttribute( |
288 | 288 | 'admin-page-framework-repeatable-field-buttons', |
289 | - ! empty( $aArguments[ 'disabled' ] ) |
|
289 | + !empty( $aArguments[ 'disabled' ] ) |
|
290 | 290 | ? 'disabled' |
291 | 291 | : '' |
292 | 292 | ), |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | unset( $aArguments[ 'disabled' ] ); |
300 | 300 | } |
301 | 301 | return $this->getAttributes( $_aContainerAttributes ) |
302 | - . ' ' . $this->getDataAttributes( $aArguments ); |
|
302 | + . ' '.$this->getDataAttributes( $aArguments ); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | /** |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | return self::getAttributes( $_aAttriubtes ) . ' ' . self::getDataAttributes( $aArguments ); |
514 | 514 | } |
515 | 515 | /** |
516 | - * @return array |
|
516 | + * @return string |
|
517 | 517 | * @sicne 3.8.13 |
518 | 518 | */ |
519 | 519 | static private function ___getRemoveButtonAttributes( $sContainerTagID, $oMsg, $iSectionCount ) { |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | |
533 | 533 | /** |
534 | 534 | * @since 3.8.13 |
535 | - * @return array |
|
535 | + * @return string |
|
536 | 536 | */ |
537 | 537 | static private function ___getAddButtonAttributes( $sContainerTagID, $oMsg, $aArguments ) { |
538 | 538 | return self::getAttributes( |
@@ -520,7 +520,7 @@ |
||
520 | 520 | return self::getAttributes( |
521 | 521 | array( |
522 | 522 | 'class' => 'repeatable-section-remove-button button-secondary ' |
523 | - . 'repeatable-section-button button button-large', |
|
523 | + . 'repeatable-section-button button button-large', |
|
524 | 524 | 'title' => $oMsg->get( 'remove_section' ), |
525 | 525 | 'style' => $iSectionCount <= 1 |
526 | 526 | ? 'display:none' |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | if ( empty( $asArguments ) ) { |
442 | 442 | return ''; |
443 | 443 | } |
444 | - if ( self::hasBeenCalled( 'repeatable_section_' . $sContainerTagID ) ) { |
|
444 | + if ( self::hasBeenCalled( 'repeatable_section_'.$sContainerTagID ) ) { |
|
445 | 445 | return ''; |
446 | 446 | } |
447 | 447 | |
@@ -449,16 +449,16 @@ discard block |
||
449 | 449 | $_oFormatter = new AdminPageFramework_Form_Model___Format_RepeatableSection( $asArguments, $oMsg ); |
450 | 450 | $_aArguments = $_oFormatter->get(); |
451 | 451 | $_sButtons = "<div class='admin-page-framework-repeatable-section-buttons-outer-container'>" |
452 | - . "<div " . self::___getContainerAttributes( $_aArguments, $oMsg ) . ' >' |
|
453 | - . "<a " . self::___getRemoveButtonAttributes( $sContainerTagID, $oMsg, $iSectionCount ) . ">-</a>" |
|
454 | - . "<a " . self::___getAddButtonAttributes( $sContainerTagID, $oMsg, $_aArguments ) . ">+</a>" |
|
452 | + . "<div ".self::___getContainerAttributes( $_aArguments, $oMsg ).' >' |
|
453 | + . "<a ".self::___getRemoveButtonAttributes( $sContainerTagID, $oMsg, $iSectionCount ).">-</a>" |
|
454 | + . "<a ".self::___getAddButtonAttributes( $sContainerTagID, $oMsg, $_aArguments ).">+</a>" |
|
455 | 455 | . "</div>" |
456 | 456 | . "</div>" |
457 | 457 | . AdminPageFramework_Form_Utility::getModalForDisabledRepeatableElement( |
458 | - 'repeatable_section_disabled_' . $sContainerTagID, |
|
458 | + 'repeatable_section_disabled_'.$sContainerTagID, |
|
459 | 459 | $_aArguments[ 'disabled' ] |
460 | 460 | ); |
461 | - $_sButtonsHTML = '"' . $_sButtons . '"'; |
|
461 | + $_sButtonsHTML = '"'.$_sButtons.'"'; |
|
462 | 462 | $_aJSArray = json_encode( $_aArguments ); |
463 | 463 | $_sScript = <<<JAVASCRIPTS |
464 | 464 | jQuery( document ).ready( function() { |
@@ -505,12 +505,12 @@ discard block |
||
505 | 505 | empty( $aArguments[ 'disabled' ] ) ? '' : 'disabled' |
506 | 506 | ), |
507 | 507 | ); |
508 | - unset( $aArguments[ 'disabled' ][ 'message' ] ); // this element can contain HTML tags. |
|
508 | + unset( $aArguments[ 'disabled' ][ 'message' ] ); // this element can contain HTML tags. |
|
509 | 509 | // Needs to remove it if it is empty as its data attribute will be checked in the JavaScript script. |
510 | 510 | if ( empty( $aArguments[ 'disabled' ] ) ) { |
511 | 511 | unset( $aArguments[ 'disabled' ] ); |
512 | 512 | } |
513 | - return self::getAttributes( $_aAttriubtes ) . ' ' . self::getDataAttributes( $aArguments ); |
|
513 | + return self::getAttributes( $_aAttriubtes ).' '.self::getDataAttributes( $aArguments ); |
|
514 | 514 | } |
515 | 515 | /** |
516 | 516 | * @return array |
@@ -541,10 +541,10 @@ discard block |
||
541 | 541 | . 'repeatable-section-button button button-large', |
542 | 542 | 'title' => $oMsg->get( 'add_section' ), |
543 | 543 | 'data-id' => $sContainerTagID, |
544 | - 'href' => ! empty( $aArguments[ 'disabled' ] ) |
|
545 | - ? '#TB_inline?width=' . $aArguments[ 'disabled' ][ 'box_width' ] |
|
546 | - . '&height=' . $aArguments[ 'disabled' ][ 'box_height' ] |
|
547 | - . '&inlineId=' . 'repeatable_section_disabled_' . $sContainerTagID |
|
544 | + 'href' => !empty( $aArguments[ 'disabled' ] ) |
|
545 | + ? '#TB_inline?width='.$aArguments[ 'disabled' ][ 'box_width' ] |
|
546 | + . '&height='.$aArguments[ 'disabled' ][ 'box_height' ] |
|
547 | + . '&inlineId='.'repeatable_section_disabled_'.$sContainerTagID |
|
548 | 548 | : null, |
549 | 549 | ) |
550 | 550 | ); |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | * @since 3.8.13 |
37 | 37 | */ |
38 | 38 | static protected $_aStructure_Disabled = array( |
39 | - 'message' => 'The ability of repeating sections is disabled.', // will be reassigned |
|
40 | - 'caption' => 'Warning', // will be reassigned |
|
39 | + 'message' => 'The ability of repeating sections is disabled.', // will be reassigned |
|
40 | + 'caption' => 'Warning', // will be reassigned |
|
41 | 41 | 'box_width' => 300, |
42 | 42 | 'box_height' => 72, |
43 | 43 | ); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function __construct( /* array $asArguments, $oMsg */ ) { |
56 | 56 | |
57 | - $_aParameters = func_get_args() + array( |
|
57 | + $_aParameters = func_get_args() + array( |
|
58 | 58 | $this->_aArguments, |
59 | 59 | null |
60 | 60 | ); |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | public function get() { |
74 | 74 | |
75 | 75 | $_aArguments = $this->_aArguments + self::$_aStructure; |
76 | - unset( $_aArguments[ 0 ] ); // remove the 0 index element converted from `'repeatable => 'true',`. |
|
77 | - if ( ! empty( $_aArguments[ 'disabled' ] ) ) { |
|
76 | + unset( $_aArguments[ 0 ] ); // remove the 0 index element converted from `'repeatable => 'true',`. |
|
77 | + if ( !empty( $_aArguments[ 'disabled' ] ) ) { |
|
78 | 78 | $_aArguments[ 'disabled' ] = $_aArguments[ 'disabled' ] + array( |
79 | 79 | 'message' => $this->_getDefaultMessage(), |
80 | 80 | 'caption' => $this->_oMsg->get( 'warning_caption' ), |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | static public function hasNestedFields( array $aFieldset ) { |
61 | 61 | |
62 | - if ( ! self::hasFieldDefinitionsInContent( $aFieldset ) ) { |
|
62 | + if ( !self::hasFieldDefinitionsInContent( $aFieldset ) ) { |
|
63 | 63 | return false; |
64 | 64 | } |
65 | 65 | // At this point, the `content` argument contains either the definition of nested fields or inline-mixed fields. |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | static public function hasFieldDefinitionsInContent( array $aFieldset ) { |
105 | 105 | |
106 | - if ( ! isset( $aFieldset[ 'content' ] ) ) { |
|
106 | + if ( !isset( $aFieldset[ 'content' ] ) ) { |
|
107 | 107 | return false; |
108 | 108 | } |
109 | 109 | if ( empty( $aFieldset[ 'content' ] ) ) { |
@@ -138,10 +138,10 @@ discard block |
||
138 | 138 | * @since 3.8.13 |
139 | 139 | */ |
140 | 140 | static public function isDynamicField( $aField ) { |
141 | - if ( ! empty( $aField[ 'repeatable' ] ) ) { |
|
141 | + if ( !empty( $aField[ 'repeatable' ] ) ) { |
|
142 | 142 | return true; |
143 | 143 | } |
144 | - if ( ! empty( $aField[ 'sortable' ] ) ) { |
|
144 | + if ( !empty( $aField[ 'sortable' ] ) ) { |
|
145 | 145 | return true; |
146 | 146 | } |
147 | 147 | return false; |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | if ( empty( $sString ) ) { |
171 | 171 | return $sString; |
172 | 172 | } |
173 | - return $sString . '|'; |
|
173 | + return $sString.'|'; |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | /** |
@@ -186,17 +186,17 @@ discard block |
||
186 | 186 | */ |
187 | 187 | static public function getFieldsetReformattedBySubFieldIndex( array $aFieldset, $iSubFieldIndex, $bHasSubFields, array $aParentFieldset ) { |
188 | 188 | |
189 | - $_oCallerForm = $aFieldset[ '_caller_object' ]; |
|
189 | + $_oCallerForm = $aFieldset[ '_caller_object' ]; |
|
190 | 190 | |
191 | 191 | // Add sub-field index to the parent field path for repeated nested items. |
192 | - $aFieldset[ '_parent_field_path' ] = self::getAOrB( |
|
192 | + $aFieldset[ '_parent_field_path' ] = self::getAOrB( |
|
193 | 193 | $bHasSubFields, |
194 | - $aFieldset[ '_parent_field_path' ] . '|' . $iSubFieldIndex, |
|
194 | + $aFieldset[ '_parent_field_path' ].'|'.$iSubFieldIndex, |
|
195 | 195 | $aFieldset[ '_parent_field_path' ] |
196 | 196 | ); |
197 | - $aFieldset[ '_parent_tag_id' ] = self::getAOrB( |
|
197 | + $aFieldset[ '_parent_tag_id' ] = self::getAOrB( |
|
198 | 198 | $bHasSubFields, |
199 | - $aParentFieldset[ 'tag_id' ] . '__' . $iSubFieldIndex, |
|
199 | + $aParentFieldset[ 'tag_id' ].'__'.$iSubFieldIndex, |
|
200 | 200 | $aParentFieldset[ 'tag_id' ] |
201 | 201 | ); |
202 | 202 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $aFieldset, |
206 | 206 | $aFieldset[ '_structure_type' ], |
207 | 207 | $aFieldset[ 'capability' ], |
208 | - ( integer ) $iSubFieldIndex + 1, // 1-based count (not index) |
|
208 | + ( integer ) $iSubFieldIndex + 1, // 1-based count (not index) |
|
209 | 209 | $aFieldset[ '_subsection_index' ], |
210 | 210 | $aFieldset[ '_is_section_repeatable' ], |
211 | 211 | $aFieldset[ '_caller_object' ] |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | |
215 | 215 | $_oFieldsetOutputFormatter = new AdminPageFramework_Form_Model___Format_FieldsetOutput( |
216 | 216 | $aFieldset, |
217 | - $aFieldset[ '_section_index' ], // `_section_index` is defined in the ...FieldsetOutput class. Since this is a nested item, it should be already set. |
|
217 | + $aFieldset[ '_section_index' ], // `_section_index` is defined in the ...FieldsetOutput class. Since this is a nested item, it should be already set. |
|
218 | 218 | $_oCallerForm->aFieldTypeDefinitions |
219 | 219 | ); |
220 | 220 | return $_oFieldsetOutputFormatter->get(); |
@@ -251,12 +251,12 @@ discard block |
||
251 | 251 | if ( empty( $aArguments ) ) { |
252 | 252 | return ''; |
253 | 253 | } |
254 | - if ( self::hasBeenCalled( 'disabled_repeatable_elements_modal_' . $sBoxElementID ) ) { |
|
254 | + if ( self::hasBeenCalled( 'disabled_repeatable_elements_modal_'.$sBoxElementID ) ) { |
|
255 | 255 | return ''; |
256 | 256 | } |
257 | 257 | add_thickbox(); // to display a message to the user. |
258 | 258 | return "<div id='{$sBoxElementID}' style='display:none'>" |
259 | - . "<p>" . $aArguments[ 'message' ] . "</p>" |
|
259 | + . "<p>".$aArguments[ 'message' ]."</p>" |
|
260 | 260 | . "</div>"; |
261 | 261 | |
262 | 262 | } |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | */ |
17 | 17 | class AdminPageFrameworkLoader_Registry_Base { |
18 | 18 | |
19 | - const VERSION = '3.8.13b06'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!! |
|
19 | + const VERSION = '3.8.13b06'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!! |
|
20 | 20 | const NAME = 'Admin Page Framework - Loader'; // the name is not 'Admin Page Framework' because warning messages gets confusing. |
21 | - const SHORTNAME = 'Admin Page Framework'; // used for a menu title etc. |
|
21 | + const SHORTNAME = 'Admin Page Framework'; // used for a menu title etc. |
|
22 | 22 | const DESCRIPTION = 'Loads Admin Page Framework which facilitates WordPress plugin and theme development.'; |
23 | 23 | const URI = 'http://admin-page-framework.michaeluno.jp/'; |
24 | 24 | const AUTHOR = 'miunosoft (Michael Uno)'; |
@@ -55,14 +55,14 @@ discard block |
||
55 | 55 | * @remark This is also accessed from `uninstall.php` so do not remove. |
56 | 56 | * @remark Do not exceed 8 characters as a transient name allows 45 characters or less ( 40 for site transients ) so that md5 (32 characters) can be added. |
57 | 57 | */ |
58 | - const TRANSIENT_PREFIX = 'APFL_'; |
|
58 | + const TRANSIENT_PREFIX = 'APFL_'; |
|
59 | 59 | |
60 | 60 | /** |
61 | 61 | * The hook slug used for the prefix of action and filter hook names. |
62 | 62 | * |
63 | 63 | * @remark The ending underscore is not necessary. |
64 | 64 | */ |
65 | - const HOOK_SLUG = 'admin_page_framework_loader'; |
|
65 | + const HOOK_SLUG = 'admin_page_framework_loader'; |
|
66 | 66 | |
67 | 67 | /** |
68 | 68 | * The text domain slug and its path. |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | static public $aAdminPages = array( |
118 | 118 | // key => 'page slug' |
119 | - 'about' => 'apfl_about', // the welcome page |
|
119 | + 'about' => 'apfl_about', // the welcome page |
|
120 | 120 | 'addon' => 'apfl_addons', |
121 | 121 | 'tool' => 'apfl_tools', |
122 | 122 | 'help' => 'apfl_contact', |
@@ -154,12 +154,12 @@ discard block |
||
154 | 154 | * @since 3.5.0 |
155 | 155 | * @return string |
156 | 156 | */ |
157 | - public static function getPluginURL( $sRelativePath='' ) { |
|
157 | + public static function getPluginURL( $sRelativePath = '' ) { |
|
158 | 158 | if ( isset( self::$_sPluginURLCache ) ) { |
159 | - return self::$_sPluginURLCache . $sRelativePath; |
|
159 | + return self::$_sPluginURLCache.$sRelativePath; |
|
160 | 160 | } |
161 | 161 | self::$_sPluginURLCache = trailingslashit( plugins_url( '', self::$sFilePath ) ); |
162 | - return self::$_sPluginURLCache . $sRelativePath; |
|
162 | + return self::$_sPluginURLCache.$sRelativePath; |
|
163 | 163 | } |
164 | 164 | /** |
165 | 165 | * @since 3.7.9 |
@@ -189,13 +189,13 @@ discard block |
||
189 | 189 | * @since 3.5.0 |
190 | 190 | * @return void |
191 | 191 | */ |
192 | - static public function setAdminNotice( $sMessage, $sClassAttribute='error' ) { |
|
193 | - if ( ! is_admin() ) { |
|
192 | + static public function setAdminNotice( $sMessage, $sClassAttribute = 'error' ) { |
|
193 | + if ( !is_admin() ) { |
|
194 | 194 | return; |
195 | 195 | } |
196 | - self::$_aAdminNotices[] = array( |
|
196 | + self::$_aAdminNotices[ ] = array( |
|
197 | 197 | 'message' => $sMessage, |
198 | - 'class_attribute' => trim( $sClassAttribute ) . ' notice is-dismissible', |
|
198 | + 'class_attribute' => trim( $sClassAttribute ).' notice is-dismissible', |
|
199 | 199 | ); |
200 | 200 | add_action( 'admin_notices', array( __CLASS__, '_replyToSetAdminNotice' ) ); |
201 | 201 | } |
@@ -205,12 +205,12 @@ discard block |
||
205 | 205 | * @return void |
206 | 206 | */ |
207 | 207 | static public function _replyToSetAdminNotice() { |
208 | - foreach( self::$_aAdminNotices as $_aAdminNotice ) { |
|
209 | - echo "<div class='" . esc_attr( $_aAdminNotice['class_attribute'] ) . " notice is-dismissible'>" |
|
208 | + foreach ( self::$_aAdminNotices as $_aAdminNotice ) { |
|
209 | + echo "<div class='".esc_attr( $_aAdminNotice[ 'class_attribute' ] )." notice is-dismissible'>" |
|
210 | 210 | ."<p>" |
211 | 211 | . sprintf( |
212 | - '<strong>%1$s</strong>: ' . $_aAdminNotice['message'], |
|
213 | - self::NAME . ' ' . self::VERSION |
|
212 | + '<strong>%1$s</strong>: '.$_aAdminNotice[ 'message' ], |
|
213 | + self::NAME.' '.self::VERSION |
|
214 | 214 | ) |
215 | 215 | . "</p>" |
216 | 216 | . "</div>"; |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | AdminPageFrameworkLoader_Registry::setUp( __FILE__ ); |
223 | 223 | |
224 | 224 | // Initial checks. - Do no load if accessed directly, not exiting because the 'uninstall.php' and inclusion list generator will load this file. |
225 | -if ( ! defined( 'ABSPATH' ) ) { |
|
225 | +if ( !defined( 'ABSPATH' ) ) { |
|
226 | 226 | return; |
227 | 227 | } |
228 | 228 | if ( defined( 'DOING_UNINSTALL' ) && DOING_UNINSTALL ) { |
@@ -234,8 +234,8 @@ discard block |
||
234 | 234 | |
235 | 235 | $_bFrameworkLoaded = class_exists( 'AdminPageFramework_Registry', false ); |
236 | 236 | if ( |
237 | - ! $_bFrameworkLoaded |
|
238 | - || ! defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility |
|
237 | + !$_bFrameworkLoaded |
|
238 | + || !defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility |
|
239 | 239 | || version_compare( AdminPageFramework_Registry::VERSION, AdminPageFrameworkLoader_Registry::VERSION, '<' ) |
240 | 240 | ) { |
241 | 241 | AdminPageFrameworkLoader_Registry::setAdminNotice( |
@@ -253,18 +253,18 @@ discard block |
||
253 | 253 | add_action( 'admin_init', 'AdminPageFrameworkLoader_Warning' ); |
254 | 254 | |
255 | 255 | // Include the library file - the development version will be available if you cloned the GitHub repository. |
256 | -$_sDevelopmentVersionPath = AdminPageFrameworkLoader_Registry::$sDirPath . '/development/admin-page-framework.php'; |
|
256 | +$_sDevelopmentVersionPath = AdminPageFrameworkLoader_Registry::$sDirPath.'/development/admin-page-framework.php'; |
|
257 | 257 | $_bDebugMode = defined( 'WP_DEBUG' ) && WP_DEBUG; |
258 | 258 | $_bLoadDevelopmentVersion = $_bDebugMode && file_exists( $_sDevelopmentVersionPath ); |
259 | 259 | include( |
260 | 260 | $_bLoadDevelopmentVersion |
261 | 261 | ? $_sDevelopmentVersionPath |
262 | - : AdminPageFrameworkLoader_Registry::$sDirPath . '/library/apf/admin-page-framework.php' |
|
262 | + : AdminPageFrameworkLoader_Registry::$sDirPath.'/library/apf/admin-page-framework.php' |
|
263 | 263 | ); |
264 | 264 | |
265 | 265 | // Include the framework loader plugin components. |
266 | 266 | include( AdminPageFramework_Registry::$aClassFiles[ 'AdminPageFramework_PluginBootstrap' ] ); |
267 | -include( AdminPageFrameworkLoader_Registry::$sDirPath . '/include/class/AdminPageFrameworkLoader_Bootstrap.php' ); |
|
267 | +include( AdminPageFrameworkLoader_Registry::$sDirPath.'/include/class/AdminPageFrameworkLoader_Bootstrap.php' ); |
|
268 | 268 | new AdminPageFrameworkLoader_Bootstrap( |
269 | 269 | AdminPageFrameworkLoader_Registry::$sFilePath, |
270 | 270 | AdminPageFrameworkLoader_Registry::HOOK_SLUG // hook prefix |