@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * @since 3.5.0 |
25 | 25 | */ |
26 | 26 | public function getClasses() { |
27 | - return include( dirname( $this->sFilePath ) . '/include/loader-class-map.php' ); |
|
27 | + return include( dirname( $this->sFilePath ).'/include/loader-class-map.php' ); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | if ( $_oRequirementCheck->check() ) { |
48 | 48 | $_oRequirementCheck->deactivatePlugin( |
49 | 49 | $this->sFilePath, |
50 | - __( 'Deactivating the plugin', 'admin-page-framework-loader' ), // additional message |
|
50 | + __( 'Deactivating the plugin', 'admin-page-framework-loader' ), // additional message |
|
51 | 51 | true // is in the activation hook. This will exit the script. |
52 | 52 | ); |
53 | 53 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | public function setLocalization() { |
63 | 63 | |
64 | 64 | // This plugin does not have messages to be displayed in the front end. |
65 | - if ( ! $this->bIsAdmin ) { |
|
65 | + if ( !$this->bIsAdmin ) { |
|
66 | 66 | return; |
67 | 67 | } |
68 | 68 | |
@@ -70,13 +70,13 @@ discard block |
||
70 | 70 | load_plugin_textdomain( |
71 | 71 | AdminPageFrameworkLoader_Registry::TEXT_DOMAIN, |
72 | 72 | false, |
73 | - $_sPluginBaseNameDirName . '/' . AdminPageFrameworkLoader_Registry::TEXT_DOMAIN_PATH |
|
73 | + $_sPluginBaseNameDirName.'/'.AdminPageFrameworkLoader_Registry::TEXT_DOMAIN_PATH |
|
74 | 74 | ); |
75 | 75 | |
76 | 76 | load_plugin_textdomain( |
77 | 77 | 'admin-page-framework', |
78 | 78 | false, |
79 | - $_sPluginBaseNameDirName . '/' . AdminPageFrameworkLoader_Registry::TEXT_DOMAIN_PATH |
|
79 | + $_sPluginBaseNameDirName.'/'.AdminPageFrameworkLoader_Registry::TEXT_DOMAIN_PATH |
|
80 | 80 | ); |
81 | 81 | |
82 | 82 | } |
@@ -99,14 +99,14 @@ discard block |
||
99 | 99 | |
100 | 100 | // Loader plugin admin pages. |
101 | 101 | new AdminPageFrameworkLoader_AdminPage( |
102 | - AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ], // the option key |
|
102 | + AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ], // the option key |
|
103 | 103 | $this->sFilePath // caller script path |
104 | 104 | ); |
105 | 105 | |
106 | 106 | // Network admin pages. |
107 | 107 | if ( is_network_admin() ) { |
108 | 108 | new AdminPageFrameworkLoader_NetworkAdmin( |
109 | - AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ], // the option key |
|
109 | + AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ], // the option key |
|
110 | 110 | $this->sFilePath // caller script path |
111 | 111 | ); |
112 | 112 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * @since 3.6.4 |
126 | 126 | */ |
127 | 127 | private function ___shouldShowAdminPages() { |
128 | - if ( ! $this->bIsAdmin ) { |
|
128 | + if ( !$this->bIsAdmin ) { |
|
129 | 129 | return false; |
130 | 130 | } |
131 | 131 | if ( AdminPageFrameworkLoader_Utility::isSilentMode() ) { |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | /** |
39 | 39 | * Stores section set definitions. |
40 | 40 | */ |
41 | - public $aSectionsets = array( |
|
41 | + public $aSectionsets = array( |
|
42 | 42 | '_default' => array( |
43 | 43 | 'section_id' => '_default', |
44 | 44 | ), |
@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | /** |
48 | 48 | * Stores field set definitions. |
49 | 49 | */ |
50 | - public $aFieldsets = array(); |
|
50 | + public $aFieldsets = array(); |
|
51 | 51 | |
52 | 52 | /** |
53 | 53 | * Multi-dimensional array holding the saved form data. |
54 | 54 | */ |
55 | - public $aSavedData = array(); |
|
55 | + public $aSavedData = array(); |
|
56 | 56 | |
57 | 57 | /** |
58 | 58 | * The capability level of the form. |
@@ -62,13 +62,13 @@ discard block |
||
62 | 62 | * Each secitonset and fieldset has individual capability. If they are not set, |
63 | 63 | * This value will be applied. |
64 | 64 | */ |
65 | - public $sCapability = ''; // default - an empty string |
|
65 | + public $sCapability = ''; // default - an empty string |
|
66 | 66 | |
67 | 67 | /** |
68 | 68 | * Stores callback functions. |
69 | 69 | * Each value will have a callback. |
70 | 70 | */ |
71 | - public $aCallbacks = array( |
|
71 | + public $aCallbacks = array( |
|
72 | 72 | |
73 | 73 | /** |
74 | 74 | * @return string The form default capability level. |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | 'get_form_object' => array( $this, 'replyToGetSelf' ), |
272 | 272 | ) |
273 | 273 | + $this->aCallbacks; |
274 | - $this->oMsg = $_aParameters[ 2 ] ? $_aParameters[ 2 ] : new $this->aSubClasses[ 'message' ]; |
|
274 | + $this->oMsg = $_aParameters[ 2 ] ? $_aParameters[ 2 ] : new $this->aSubClasses[ 'message' ]; |
|
275 | 275 | |
276 | 276 | // Sub-class objects |
277 | 277 | $this->___setSubClassObjects(); |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | + $this->aArguments; |
295 | 295 | $aArguments[ 'caller_id' ] = $aArguments[ 'caller_id' ] |
296 | 296 | ? $aArguments[ 'caller_id' ] |
297 | - : get_class( $this ); // if a caller id is empty, this class name will be used. |
|
297 | + : get_class( $this ); // if a caller id is empty, this class name will be used. |
|
298 | 298 | |
299 | 299 | if ( $this->sStructureType ) { |
300 | 300 | $aArguments[ 'structure_type' ] = $this->sStructureType; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | // Widgets can be called multiple times for the number of user-created widget instances for one class instance |
42 | 42 | // so make sure it is processed only once per page. |
43 | 43 | if ( $this->hasBeenCalled( 'resource_' . $oForm->aArguments[ 'caller_id' ] ) ) { |
44 | - return; |
|
44 | + return; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | $this->___setHooks(); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | /** |
129 | 129 | * @param array $aRegister |
130 | 130 | * @since 3.9.0 |
131 | - */ |
|
131 | + */ |
|
132 | 132 | private function ___registerScript( array $aRegister ) { |
133 | 133 | |
134 | 134 | $aRegister = $aRegister + array( |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | // Widgets can be called multiple times for the number of user-created widget instances for one class instance |
42 | 42 | // so make sure it is processed only once per page. |
43 | - if ( $this->hasBeenCalled( 'resource_' . $oForm->aArguments[ 'caller_id' ] ) ) { |
|
43 | + if ( $this->hasBeenCalled( 'resource_'.$oForm->aArguments[ 'caller_id' ] ) ) { |
|
44 | 44 | return; |
45 | 45 | } |
46 | 46 | |
@@ -113,16 +113,16 @@ discard block |
||
113 | 113 | * @since 3.7.0 |
114 | 114 | */ |
115 | 115 | public function _replyToEnqueueScripts() { |
116 | - if ( ! $this->oForm->isInThePage() ) { |
|
116 | + if ( !$this->oForm->isInThePage() ) { |
|
117 | 117 | return; |
118 | 118 | } |
119 | 119 | $_aRegister = $this->oForm->getResources( 'register' ); |
120 | - foreach( $this->getElementAsArray( $_aRegister, array( 'scripts' ) ) as $_iIndex => $_aRegister ) { |
|
120 | + foreach ( $this->getElementAsArray( $_aRegister, array( 'scripts' ) ) as $_iIndex => $_aRegister ) { |
|
121 | 121 | $this->___registerScript( $_aRegister ); |
122 | 122 | } |
123 | - foreach( $this->oForm->getResources( 'src_scripts' ) as $_isIndex => $_asEnqueue ) { |
|
123 | + foreach ( $this->oForm->getResources( 'src_scripts' ) as $_isIndex => $_asEnqueue ) { |
|
124 | 124 | $this->___enqueueScript( $_asEnqueue ); |
125 | - $this->oForm->unsetResources( array( 'src_scripts', $_isIndex ) ); // no longer needed |
|
125 | + $this->oForm->unsetResources( array( 'src_scripts', $_isIndex ) ); // no longer needed |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 | /** |
@@ -132,10 +132,10 @@ discard block |
||
132 | 132 | private function ___registerScript( array $aRegister ) { |
133 | 133 | |
134 | 134 | $aRegister = $aRegister + array( |
135 | - 'handle_id' => '', 'src' => '', |
|
136 | - 'dependencies' => array(), 'version' => false, |
|
135 | + 'handle_id' => '', 'src' => '', |
|
136 | + 'dependencies' => array(), 'version' => false, |
|
137 | 137 | 'in_footer' => false, |
138 | - 'translation' => array(), 'translation_var' => '', |
|
138 | + 'translation' => array(), 'translation_var' => '', |
|
139 | 139 | ); |
140 | 140 | $_bRegistered = wp_register_script( |
141 | 141 | $aRegister[ 'handle_id' ], |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $aRegister[ 'version' ], |
145 | 145 | $aRegister[ 'in_footer' ] |
146 | 146 | ); |
147 | - if ( $_bRegistered && ! empty( $aRegister[ 'translation' ] ) ) { |
|
147 | + if ( $_bRegistered && !empty( $aRegister[ 'translation' ] ) ) { |
|
148 | 148 | wp_localize_script( |
149 | 149 | $aRegister[ 'handle_id' ], |
150 | 150 | $aRegister[ 'translation_var' ] ? $aRegister[ 'translation_var' ] : $aRegister[ 'translation_var' ], |
@@ -166,12 +166,12 @@ discard block |
||
166 | 166 | |
167 | 167 | $_sSetHandleID = $this->getElement( $this->getAsArray( $asEnqueue ), 'handle_id', '' ); |
168 | 168 | $_aEnqueueItem = $this->___getFormattedEnqueueScript( $asEnqueue ); |
169 | - $_sCacheID = $_sSetHandleID . $this->getElement( $_aEnqueueItem, 'src', '' ); |
|
169 | + $_sCacheID = $_sSetHandleID.$this->getElement( $_aEnqueueItem, 'src', '' ); |
|
170 | 170 | |
171 | 171 | // Do not load the same items multiple times. |
172 | 172 | // Checking if src is not empty is because there is a case that src is empty to just use handle ID to enqueue an item |
173 | 173 | // Allow same SRCs as field types extends another field type and script can have the same resource but with a different handle ID and translations. |
174 | - if ( ! empty( $_sCacheID ) && isset( self::$_aEnqueued[ $_sCacheID ] ) ) { |
|
174 | + if ( !empty( $_sCacheID ) && isset( self::$_aEnqueued[ $_sCacheID ] ) ) { |
|
175 | 175 | return; |
176 | 176 | } |
177 | 177 | self::$_aEnqueued[ $_sCacheID ] = $_aEnqueueItem; |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | private function ___getFormattedEnqueueScript( $asEnqueue ) { |
203 | 203 | static $_iCallCount = 1; |
204 | 204 | $_aEnqueueItem = $this->getAsArray( $asEnqueue ) + array( |
205 | - 'handle_id' => 'admin-page-framework-script-form-' . $this->oForm->aArguments[ 'caller_id' ] . '_' . $_iCallCount, |
|
205 | + 'handle_id' => 'admin-page-framework-script-form-'.$this->oForm->aArguments[ 'caller_id' ].'_'.$_iCallCount, |
|
206 | 206 | 'src' => null, |
207 | 207 | 'dependencies' => null, |
208 | 208 | 'version' => null, |
@@ -227,14 +227,14 @@ discard block |
||
227 | 227 | */ |
228 | 228 | public function _replyToEnqueueStyles() { |
229 | 229 | |
230 | - if ( ! $this->oForm->isInThePage() ) { |
|
230 | + if ( !$this->oForm->isInThePage() ) { |
|
231 | 231 | return; |
232 | 232 | } |
233 | 233 | $_aRegister = $this->oForm->getResources( 'register' ); |
234 | - foreach( $this->getElementAsArray( $_aRegister, array( 'styles' ) ) as $_iIndex => $_aRegister ) { |
|
234 | + foreach ( $this->getElementAsArray( $_aRegister, array( 'styles' ) ) as $_iIndex => $_aRegister ) { |
|
235 | 235 | $this->___registerStyle( $_aRegister ); |
236 | 236 | } |
237 | - foreach( $this->oForm->getResources( 'src_styles' ) as $_isIndex => $_asEnqueueItem ) { |
|
237 | + foreach ( $this->oForm->getResources( 'src_styles' ) as $_isIndex => $_asEnqueueItem ) { |
|
238 | 238 | $this->___enqueueStyle( $_asEnqueueItem ); |
239 | 239 | $this->oForm->unsetResources( array( 'src_styles', $_isIndex ) ); // no longer needed |
240 | 240 | } |
@@ -246,8 +246,8 @@ discard block |
||
246 | 246 | */ |
247 | 247 | private function ___registerStyle( array $aRegister ) { |
248 | 248 | $_aRegister = $aRegister + array( |
249 | - 'handle_id' => null, 'src' => null, |
|
250 | - 'dependencies' => array(), 'version' => false, |
|
249 | + 'handle_id' => null, 'src' => null, |
|
250 | + 'dependencies' => array(), 'version' => false, |
|
251 | 251 | 'media' => 'all', |
252 | 252 | ); |
253 | 253 | wp_register_style( |
@@ -272,8 +272,8 @@ discard block |
||
272 | 272 | $_aEnqueueItem[ 'media' ] |
273 | 273 | ); |
274 | 274 | $_aAddData = array( 'conditional', 'rtl', 'suffix', 'alt', 'title' ); |
275 | - foreach( $_aAddData as $_sDataKey ) { |
|
276 | - if ( ! isset( $aEnqueueItem[ $_sDataKey ] ) ) { |
|
275 | + foreach ( $_aAddData as $_sDataKey ) { |
|
276 | + if ( !isset( $aEnqueueItem[ $_sDataKey ] ) ) { |
|
277 | 277 | continue; |
278 | 278 | } |
279 | 279 | wp_style_add_data( $aEnqueueItem[ 'handle_id' ], $_sDataKey, $aEnqueueItem[ $_sDataKey ] ); |
@@ -285,12 +285,12 @@ discard block |
||
285 | 285 | private function ___getFormattedEnqueueStyle( $asEnqueue ) { |
286 | 286 | static $_iCallCount = 1; |
287 | 287 | $_aEnqueueItem = $this->getAsArray( $asEnqueue ) + array( |
288 | - 'handle_id' => 'admin-page-framework-style-form-' . $this->oForm->aArguments[ 'caller_id' ] . '_' . $_iCallCount, |
|
289 | - 'src' => null, 'dependencies' => null, |
|
290 | - 'version' => null, 'media' => null, |
|
288 | + 'handle_id' => 'admin-page-framework-style-form-'.$this->oForm->aArguments[ 'caller_id' ].'_'.$_iCallCount, |
|
289 | + 'src' => null, 'dependencies' => null, |
|
290 | + 'version' => null, 'media' => null, |
|
291 | 291 | 'conditional' => null, |
292 | - 'rtl' => null, 'suffix' => null, |
|
293 | - 'alt' => null, 'title' => null, |
|
292 | + 'rtl' => null, 'suffix' => null, |
|
293 | + 'alt' => null, 'title' => null, |
|
294 | 294 | ); |
295 | 295 | if ( is_string( $asEnqueue ) ) { |
296 | 296 | $_aEnqueueItem[ 'src' ] = $asEnqueue; |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | $_sSRCRaw = wp_normalize_path( $aEnqueueItem[ 'src' ] ); |
316 | 316 | $_sSRC = $this->getResolvedSRC( $_sSRCRaw ); // at this point, it is a URL |
317 | 317 | |
318 | - if ( ! $this->oForm->aArguments[ 'autoload_min_resource' ] ) { |
|
318 | + if ( !$this->oForm->aArguments[ 'autoload_min_resource' ] ) { |
|
319 | 319 | return $_sSRC; |
320 | 320 | } |
321 | 321 | |
@@ -341,16 +341,16 @@ discard block |
||
341 | 341 | + array( 'dirname' => '', 'filename' => '', 'basename' => '', 'extension' => '' ); // avoid undefined index warnings |
342 | 342 | |
343 | 343 | // If there is no extension, avoid using a minified version. |
344 | - if ( ! $_aPathParts[ 'extension' ] ) { |
|
344 | + if ( !$_aPathParts[ 'extension' ] ) { |
|
345 | 345 | return $_sSRC; |
346 | 346 | } |
347 | 347 | |
348 | 348 | $_aPathPartsURL = pathinfo( $_sSRC ) |
349 | 349 | + array( 'dirname' => '', 'filename' => '', 'basename' => '', 'extension' => '' ); // avoid undefined index warnings |
350 | 350 | |
351 | - $_sPathMinifiedVersion = $_aPathParts[ 'dirname' ] . '/' . $_aPathParts[ 'filename' ] . $_sMinPrefix . '.' . $_aPathParts[ 'extension' ]; |
|
351 | + $_sPathMinifiedVersion = $_aPathParts[ 'dirname' ].'/'.$_aPathParts[ 'filename' ].$_sMinPrefix.'.'.$_aPathParts[ 'extension' ]; |
|
352 | 352 | return file_exists( $_sPathMinifiedVersion ) |
353 | - ? $_aPathPartsURL[ 'dirname' ] . '/' . $_aPathPartsURL[ 'filename' ] . $_sMinPrefix . '.' . $_aPathPartsURL[ 'extension' ] |
|
353 | + ? $_aPathPartsURL[ 'dirname' ].'/'.$_aPathPartsURL[ 'filename' ].$_sMinPrefix.'.'.$_aPathPartsURL[ 'extension' ] |
|
354 | 354 | : $_sSRC; |
355 | 355 | |
356 | 356 | } |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | */ |
366 | 366 | public function _replyToAddStyle() { |
367 | 367 | |
368 | - if ( ! $this->oForm->isInThePage() ) { |
|
368 | + if ( !$this->oForm->isInThePage() ) { |
|
369 | 369 | return; |
370 | 370 | } |
371 | 371 | $_sCSSRules = $this->___getFormattedInternalStyles( |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | */ |
408 | 408 | public function _replyToAddScript() { |
409 | 409 | |
410 | - if ( ! $this->oForm->isInThePage() ) { |
|
410 | + if ( !$this->oForm->isInThePage() ) { |
|
411 | 411 | return; |
412 | 412 | } |
413 | 413 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | /** |
21 | 21 | * Stores the default argument values. |
22 | 22 | */ |
23 | - public $aArguments = array( |
|
23 | + public $aArguments = array( |
|
24 | 24 | 'attributes' => array( |
25 | 25 | 'container' => array(), |
26 | 26 | 'title' => array(), |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | 'description' => array(), |
29 | 29 | 'icon' => array(), |
30 | 30 | ), |
31 | - 'icon' => null, // the icon output to override |
|
32 | - 'dash-icon' => 'dashicons-editor-help', // the dash-icon class selector for the icon |
|
33 | - 'icon_alt_text' => '[?]', // [3.8.5+] alternative text when icon is not available. For WP v3.7.x or below. |
|
31 | + 'icon' => null, // the icon output to override |
|
32 | + 'dash-icon' => 'dashicons-editor-help', // the dash-icon class selector for the icon |
|
33 | + 'icon_alt_text' => '[?]', // [3.8.5+] alternative text when icon is not available. For WP v3.7.x or below. |
|
34 | 34 | 'title' => null, |
35 | - 'content' => null, // will be assigned in the constructor |
|
36 | - 'width' => null, // [3.9.0] |
|
37 | - 'height' => null, // [3.9.0] |
|
35 | + 'content' => null, // will be assigned in the constructor |
|
36 | + 'width' => null, // [3.9.0] |
|
37 | + 'height' => null, // [3.9.0] |
|
38 | 38 | ); |
39 | 39 | |
40 | 40 | public $sTitleElementID; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | if ( is_string( $asContent ) ) { |
91 | 91 | return true; |
92 | 92 | } |
93 | - if ( is_array( $asContent ) && ! $this->isAssociative( $asContent ) ) { |
|
93 | + if ( is_array( $asContent ) && !$this->isAssociative( $asContent ) ) { |
|
94 | 94 | return true; |
95 | 95 | } |
96 | 96 | return false; |
@@ -103,16 +103,16 @@ discard block |
||
103 | 103 | * @return string The output. |
104 | 104 | */ |
105 | 105 | public function get() { |
106 | - if ( ! $this->aArguments[ 'content' ] ) { |
|
106 | + if ( !$this->aArguments[ 'content' ] ) { |
|
107 | 107 | return ''; |
108 | 108 | } |
109 | 109 | $_aAttributes = array( |
110 | 110 | 'data-width' => $this->getElement( $this->aArguments, array( 'width' ) ), |
111 | 111 | 'data-height' => $this->getElement( $this->aArguments, array( 'height' ) ), |
112 | 112 | ); |
113 | - return "<span " . $this->___getElementAttributes( 'container', array( 'admin-page-framework-form-tooltip', 'no-js' ), $_aAttributes ) . ">" |
|
113 | + return "<span ".$this->___getElementAttributes( 'container', array( 'admin-page-framework-form-tooltip', 'no-js' ), $_aAttributes ).">" |
|
114 | 114 | . $this->___getTipIcon() |
115 | - . "<span " . $this->___getElementAttributes( 'content', 'admin-page-framework-form-tooltip-content' ) . ">" |
|
115 | + . "<span ".$this->___getElementAttributes( 'content', 'admin-page-framework-form-tooltip-content' ).">" |
|
116 | 116 | . $this->___getTipTitle() |
117 | 117 | . $this->___getDescriptions() |
118 | 118 | . "</span>" |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | return $this->aArguments[ 'icon' ]; |
131 | 131 | } |
132 | 132 | if ( version_compare( $GLOBALS[ 'wp_version' ], '3.8', '>=' ) ) { |
133 | - return "<span " . $this->___getElementAttributes( |
|
133 | + return "<span ".$this->___getElementAttributes( |
|
134 | 134 | 'icon', |
135 | 135 | array( |
136 | 136 | 'dashicons', |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | private function ___getTipTitle() { |
150 | 150 | if ( isset( $this->aArguments[ 'title' ] ) ) { |
151 | - return "<span " . $this->___getElementAttributes( 'title', 'admin-page-framework-form-tooltip-title' ) . ">" |
|
151 | + return "<span ".$this->___getElementAttributes( 'title', 'admin-page-framework-form-tooltip-title' ).">" |
|
152 | 152 | . $this->aArguments[ 'title' ] |
153 | 153 | . "</span>"; |
154 | 154 | } |
@@ -160,9 +160,9 @@ discard block |
||
160 | 160 | */ |
161 | 161 | private function ___getDescriptions() { |
162 | 162 | if ( isset( $this->aArguments[ 'content' ] ) ) { |
163 | - return "<span " . $this->___getElementAttributes( 'description', 'admin-page-framework-form-tooltip-description' ) . ">" |
|
163 | + return "<span ".$this->___getElementAttributes( 'description', 'admin-page-framework-form-tooltip-description' ).">" |
|
164 | 164 | . implode( |
165 | - "</span><span " . $this->___getElementAttributes( 'description', 'admin-page-framework-form-tooltip-description' ) . ">", |
|
165 | + "</span><span ".$this->___getElementAttributes( 'description', 'admin-page-framework-form-tooltip-description' ).">", |
|
166 | 166 | $this->getAsArray( $this->aArguments[ 'content' ] ) |
167 | 167 | ) |
168 | 168 | . "</span>" |
@@ -179,11 +179,11 @@ discard block |
||
179 | 179 | * @return string |
180 | 180 | * @since 3.8.5 |
181 | 181 | */ |
182 | - private function ___getElementAttributes( $sElementKey, $asClassSelectors, $aAdditional=array() ) { |
|
182 | + private function ___getElementAttributes( $sElementKey, $asClassSelectors, $aAdditional = array() ) { |
|
183 | 183 | $_aContainerAttributes = $this->getElementAsArray( |
184 | 184 | $this->aArguments, |
185 | 185 | array( 'attributes', $sElementKey ) |
186 | - ) + array( 'class' => '' ) ; |
|
186 | + ) + array( 'class' => '' ); |
|
187 | 187 | $_aContainerAttributes[ 'class' ] = $this->getClassAttribute( |
188 | 188 | $_aContainerAttributes[ 'class' ], |
189 | 189 | $asClassSelectors |
@@ -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' |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | if ( empty( $asArguments ) ) { |
28 | 28 | return ''; |
29 | 29 | } |
30 | - if ( self::hasBeenCalled( 'repeatable_section_' . $sContainerTagID ) ) { |
|
30 | + if ( self::hasBeenCalled( 'repeatable_section_'.$sContainerTagID ) ) { |
|
31 | 31 | return ''; |
32 | 32 | } |
33 | 33 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $_aArguments = $_oFormatter->get(); |
36 | 36 | $_aArguments[ 'id' ] = $sContainerTagID; |
37 | 37 | $_sButtons = self::___getRepeatableSectionButtons( $_aArguments, $oMsg, $sContainerTagID, $iSectionCount ); |
38 | - return "<div class='hidden repeatable-section-buttons-model' " . self::getDataAttributes( $_aArguments ) . ">" |
|
38 | + return "<div class='hidden repeatable-section-buttons-model' ".self::getDataAttributes( $_aArguments ).">" |
|
39 | 39 | . $_sButtons |
40 | 40 | . "</div>"; |
41 | 41 | |
@@ -52,17 +52,17 @@ discard block |
||
52 | 52 | $_sIconAdd = "<span class='dashicons dashicons-plus-alt2'></span>"; |
53 | 53 | } |
54 | 54 | return "<div class='admin-page-framework-repeatable-section-buttons-outer-container'>" |
55 | - . "<div " . self::___getContainerAttributes( $_aArguments, $oMsg ) . ' >' |
|
56 | - . "<a " . self::___getRemoveButtonAttributes( $sContainerTagID, $oMsg, $iSectionCount ) . ">" |
|
55 | + . "<div ".self::___getContainerAttributes( $_aArguments, $oMsg ).' >' |
|
56 | + . "<a ".self::___getRemoveButtonAttributes( $sContainerTagID, $oMsg, $iSectionCount ).">" |
|
57 | 57 | . $_sIconRemove |
58 | 58 | . "</a>" |
59 | - . "<a " . self::___getAddButtonAttributes( $sContainerTagID, $oMsg, $_aArguments ) . ">" |
|
59 | + . "<a ".self::___getAddButtonAttributes( $sContainerTagID, $oMsg, $_aArguments ).">" |
|
60 | 60 | . $_sIconAdd |
61 | 61 | . "</a>" |
62 | 62 | . "</div>" |
63 | 63 | . "</div>" |
64 | 64 | . AdminPageFramework_Form_Utility::getModalForDisabledRepeatableElement( |
65 | - 'repeatable_section_disabled_' . $sContainerTagID, |
|
65 | + 'repeatable_section_disabled_'.$sContainerTagID, |
|
66 | 66 | $_aArguments[ 'disabled' ] |
67 | 67 | ); |
68 | 68 | } |
@@ -79,12 +79,12 @@ discard block |
||
79 | 79 | empty( $aArguments[ 'disabled' ] ) ? '' : 'disabled' |
80 | 80 | ), |
81 | 81 | ); |
82 | - unset( $aArguments[ 'disabled' ][ 'message' ] ); // this element can contain HTML tags. |
|
82 | + unset( $aArguments[ 'disabled' ][ 'message' ] ); // this element can contain HTML tags. |
|
83 | 83 | // Needs to remove it if it is empty as its data attribute will be checked in the JavaScript script. |
84 | 84 | if ( empty( $aArguments[ 'disabled' ] ) ) { |
85 | 85 | unset( $aArguments[ 'disabled' ] ); |
86 | 86 | } |
87 | - return self::getAttributes( $_aAttributes ) . ' ' . self::getDataAttributes( $aArguments ); |
|
87 | + return self::getAttributes( $_aAttributes ).' '.self::getDataAttributes( $aArguments ); |
|
88 | 88 | } |
89 | 89 | /** |
90 | 90 | * @return string |
@@ -115,10 +115,10 @@ discard block |
||
115 | 115 | . 'repeatable-section-button button button-large', |
116 | 116 | 'title' => $oMsg->get( 'add_section' ), |
117 | 117 | 'data-id' => $sContainerTagID, |
118 | - 'href' => ! empty( $aArguments[ 'disabled' ] ) |
|
119 | - ? '#TB_inline?width=' . $aArguments[ 'disabled' ][ 'box_width' ] |
|
120 | - . '&height=' . $aArguments[ 'disabled' ][ 'box_height' ] |
|
121 | - . '&inlineId=' . 'repeatable_section_disabled_' . $sContainerTagID |
|
118 | + 'href' => !empty( $aArguments[ 'disabled' ] ) |
|
119 | + ? '#TB_inline?width='.$aArguments[ 'disabled' ][ 'box_width' ] |
|
120 | + . '&height='.$aArguments[ 'disabled' ][ 'box_height' ] |
|
121 | + . '&inlineId='.'repeatable_section_disabled_'.$sContainerTagID |
|
122 | 122 | : null, |
123 | 123 | ) |
124 | 124 | ); |
@@ -549,7 +549,7 @@ |
||
549 | 549 | * @return string The generated section tab list as HTML. |
550 | 550 | */ |
551 | 551 | private function ___getSectionTabList( $sSectionTabSlug, array $aSectionTabList ) { |
552 | - return $sSectionTabSlug |
|
552 | + return $sSectionTabSlug |
|
553 | 553 | ? "<ul class='admin-page-framework-section-tabs nav-tab-wrapper'>" |
554 | 554 | . implode( PHP_EOL, $aSectionTabList ) |
555 | 555 | . "</ul>" |
@@ -129,16 +129,16 @@ discard block |
||
129 | 129 | */ |
130 | 130 | public function get() { |
131 | 131 | |
132 | - $_oFormatSectionsetsByTab = new AdminPageFramework_Form_View___Format_SectionsetsByTab( |
|
132 | + $_oFormatSectionsetsByTab = new AdminPageFramework_Form_View___Format_SectionsetsByTab( |
|
133 | 133 | $this->aStructure[ 'sectionsets' ], |
134 | 134 | $this->aStructure[ 'fieldsets' ], |
135 | 135 | $this->aArguments[ 'nested_depth' ] |
136 | 136 | ); |
137 | 137 | |
138 | - $_aOutput = array(); |
|
139 | - foreach( $_oFormatSectionsetsByTab->getTabs() as $_sSectionTabSlug ) { |
|
138 | + $_aOutput = array(); |
|
139 | + foreach ( $_oFormatSectionsetsByTab->getTabs() as $_sSectionTabSlug ) { |
|
140 | 140 | |
141 | - $_aOutput[] = $this->___getFormOutput( |
|
141 | + $_aOutput[ ] = $this->___getFormOutput( |
|
142 | 142 | $_oFormatSectionsetsByTab->getSectionsets( $_sSectionTabSlug ), |
143 | 143 | $_oFormatSectionsetsByTab->getFieldsets( $_sSectionTabSlug ), |
144 | 144 | $_sSectionTabSlug, |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | |
156 | 156 | // Generate id for this output |
157 | 157 | $_sOutput = implode( PHP_EOL, $_aOutput ); |
158 | - $_sElementID = "admin-page-framework-sectionsets-" . uniqid(); |
|
158 | + $_sElementID = "admin-page-framework-sectionsets-".uniqid(); |
|
159 | 159 | return $this->___getSpinnerOutput( $_sOutput ) |
160 | 160 | . "<div id='{$_sElementID}' class='admin-page-framework-sectionsets admin-page-framework-form-js-on'>" |
161 | 161 | . $_sOutput |
@@ -189,17 +189,17 @@ discard block |
||
189 | 189 | |
190 | 190 | // A sectionset is a set of sections. |
191 | 191 | $_sSectionSet = $this->___getSectionsetsTables( |
192 | - $aSectionsets, // section-set definition (already divided by section tab) |
|
193 | - $aFieldsets, // field-set definitions (already divided by section tab) |
|
192 | + $aSectionsets, // section-set definition (already divided by section tab) |
|
193 | + $aFieldsets, // field-set definitions (already divided by section tab) |
|
194 | 194 | $aCallbacks |
195 | 195 | ); |
196 | 196 | return $_sSectionSet |
197 | - ? "<div " . $this->getAttributes( |
|
197 | + ? "<div ".$this->getAttributes( |
|
198 | 198 | array( |
199 | 199 | 'class' => 'admin-page-framework-sectionset', |
200 | - 'id' => "sectionset-{$sSectionTabSlug}_" . md5( serialize( $aSectionsets ) ), |
|
200 | + 'id' => "sectionset-{$sSectionTabSlug}_".md5( serialize( $aSectionsets ) ), |
|
201 | 201 | ) |
202 | - ) . ">" |
|
202 | + ).">" |
|
203 | 203 | . $_sSectionSet |
204 | 204 | . "</div>" |
205 | 205 | : ''; |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | * If there is no field overall to the section and its section tab, return an empty string. |
232 | 232 | * Otherwise, the section-sets container gets rendered and its CSS rules such as margins give unwanted results. |
233 | 233 | */ |
234 | - if ( ! count( $aFieldsets ) ) { |
|
234 | + if ( !count( $aFieldsets ) ) { |
|
235 | 235 | return ''; |
236 | 236 | } |
237 | 237 | |
@@ -243,13 +243,13 @@ discard block |
||
243 | 243 | ); |
244 | 244 | $_sSectionTabSlug = $_aFirstSectionset[ 'section_tab_slug' ]; |
245 | 245 | $_sThisSectionID = $_aFirstSectionset[ 'section_id' ]; |
246 | - $_sSectionsID = 'sections-' . $_sThisSectionID; |
|
246 | + $_sSectionsID = 'sections-'.$_sThisSectionID; |
|
247 | 247 | $_aCollapsible = $this->___getCollapsibleArgumentForSections( |
248 | 248 | $_aFirstSectionset |
249 | 249 | ); |
250 | 250 | |
251 | - foreach( $aSectionsets as $_aSectionset ) { |
|
252 | - $_aOutputs = $this->___getSectionsetTable( |
|
251 | + foreach ( $aSectionsets as $_aSectionset ) { |
|
252 | + $_aOutputs = $this->___getSectionsetTable( |
|
253 | 253 | $_aOutputs, |
254 | 254 | $_sSectionsID, |
255 | 255 | $_aSectionset, |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | * Changed the visibility scope to private. Changed the 1st parameter from `$aSection`. |
278 | 278 | * @return array |
279 | 279 | */ |
280 | - private function ___getCollapsibleArgumentForSections( array $aSectionset=array() ) { |
|
280 | + private function ___getCollapsibleArgumentForSections( array $aSectionset = array() ) { |
|
281 | 281 | |
282 | 282 | $_oArgumentFormater = new AdminPageFramework_Form_Model___Format_CollapsibleSection( |
283 | 283 | $aSectionset[ 'collapsible' ], |
@@ -305,19 +305,19 @@ discard block |
||
305 | 305 | */ |
306 | 306 | private function ___getSectionsetTable( $_aOutputs, $_sSectionsID, array $_aSection, array $aFieldsInSections ) { |
307 | 307 | |
308 | - if ( ! $this->isSectionsetVisible( $_aSection ) ) { |
|
308 | + if ( !$this->isSectionsetVisible( $_aSection ) ) { |
|
309 | 309 | return $_aOutputs; |
310 | 310 | } |
311 | 311 | |
312 | 312 | // If the 'save' argument is false, insert a flag that disables saving the section inputs. |
313 | - $_aOutputs[ 'section_contents' ][] = $this->___getUnsetFlagSectionInputTag( $_aSection ); |
|
313 | + $_aOutputs[ 'section_contents' ][ ] = $this->___getUnsetFlagSectionInputTag( $_aSection ); |
|
314 | 314 | |
315 | 315 | // For repeatable sections - sub-sections are divided field definition arrays by sub-section index, |
316 | 316 | // not section definition arrays. |
317 | - $_aSubSections = $this->getIntegerKeyElements( |
|
317 | + $_aSubSections = $this->getIntegerKeyElements( |
|
318 | 318 | $this->getElementAsArray( |
319 | 319 | $aFieldsInSections, // subject array |
320 | - $_aSection[ '_section_path' ], // dimensional path |
|
320 | + $_aSection[ '_section_path' ], // dimensional path |
|
321 | 321 | array() // default |
322 | 322 | ) |
323 | 323 | ); |
@@ -359,29 +359,29 @@ discard block |
||
359 | 359 | private function ___getSubSections( $_aOutputs, $_sSectionsID, $_aSection, $_aSubSections ) { |
360 | 360 | |
361 | 361 | // Add the repeatable sections enabler script. |
362 | - if ( ! empty( $_aSection[ 'repeatable' ] ) ) { |
|
363 | - $_aOutputs[ 'section_contents' ][] = AdminPageFramework_Form_View___SectionRepeatableButtons::get( |
|
362 | + if ( !empty( $_aSection[ 'repeatable' ] ) ) { |
|
363 | + $_aOutputs[ 'section_contents' ][ ] = AdminPageFramework_Form_View___SectionRepeatableButtons::get( |
|
364 | 364 | $_sSectionsID, |
365 | 365 | $_aOutputs[ 'count_subsections' ], |
366 | 366 | $_aSection[ 'repeatable' ], |
367 | 367 | $this->oMsg |
368 | 368 | ); |
369 | - $_aOutputs[ 'section_contents' ][] = $this->___getRepeatableSectionFlagTag( $_aSection ); |
|
369 | + $_aOutputs[ 'section_contents' ][ ] = $this->___getRepeatableSectionFlagTag( $_aSection ); |
|
370 | 370 | } |
371 | 371 | // Add the sortable sections enabler script. 3.6.0+ |
372 | - if ( ! empty( $_aSection[ 'sortable' ] ) ) { |
|
372 | + if ( !empty( $_aSection[ 'sortable' ] ) ) { |
|
373 | 373 | // @deprecated 3.9.0 |
374 | 374 | // $_aOutputs[ 'section_contents' ][] = AdminPageFramework_Form_View___Script_SortableSection::getEnabler( |
375 | 375 | // $_sSectionsID, |
376 | 376 | // $_aSection[ 'sortable' ], |
377 | 377 | // $this->oMsg |
378 | 378 | // ); |
379 | - $_aOutputs[ 'section_contents' ][] = $this->___getSortableSectionFlagTag( $_aSection ); |
|
379 | + $_aOutputs[ 'section_contents' ][ ] = $this->___getSortableSectionFlagTag( $_aSection ); |
|
380 | 380 | } |
381 | 381 | |
382 | 382 | // Get the section tables. |
383 | 383 | $_aSubSections = $this->numerizeElements( $_aSubSections ); // will include the main section as well. |
384 | - foreach( $_aSubSections as $_iIndex => $_aFields ) { |
|
384 | + foreach ( $_aSubSections as $_iIndex => $_aFields ) { |
|
385 | 385 | |
386 | 386 | $_oEachSectionArguments = new AdminPageFramework_Form_Model___Format_EachSection( |
387 | 387 | $_aSection, |
@@ -411,8 +411,8 @@ discard block |
||
411 | 411 | array( |
412 | 412 | 'class' => 'element-address', |
413 | 413 | 'type' => 'hidden', |
414 | - 'name' => '__repeatable_elements_' . $aSection[ '_structure_type' ] |
|
415 | - . '[' . $aSection[ 'section_id' ] . ']', |
|
414 | + 'name' => '__repeatable_elements_'.$aSection[ '_structure_type' ] |
|
415 | + . '['.$aSection[ 'section_id' ].']', |
|
416 | 416 | // @todo examine whether this value should include a section index. |
417 | 417 | 'value' => $aSection[ 'section_id' ], |
418 | 418 | ) |
@@ -430,8 +430,8 @@ discard block |
||
430 | 430 | array( |
431 | 431 | 'class' => 'element-address', |
432 | 432 | 'type' => 'hidden', |
433 | - 'name' => '__sortable_elements_' . $aSection[ '_structure_type' ] |
|
434 | - . '[' . $aSection[ 'section_id' ] . ']', |
|
433 | + 'name' => '__sortable_elements_'.$aSection[ '_structure_type' ] |
|
434 | + . '['.$aSection[ 'section_id' ].']', |
|
435 | 435 | // @todo examine whether this value should include a section index. |
436 | 436 | 'value' => $aSection[ 'section_id' ], |
437 | 437 | ) |
@@ -453,8 +453,8 @@ discard block |
||
453 | 453 | 'input', |
454 | 454 | array( |
455 | 455 | 'type' => 'hidden', |
456 | - 'name' => '__unset_' . $aSection[ '_structure_type' ] . '[' . $aSection[ 'section_id' ] . ']', |
|
457 | - 'value' => "__dummy_option_key|" . $aSection[ 'section_id' ], |
|
456 | + 'name' => '__unset_'.$aSection[ '_structure_type' ].'['.$aSection[ 'section_id' ].']', |
|
457 | + 'value' => "__dummy_option_key|".$aSection[ 'section_id' ], |
|
458 | 458 | 'class' => 'unset-element-names element-address', |
459 | 459 | ) |
460 | 460 | ); |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | private function ___getSectionTableWithTabList( array $_aOutputs, array $aSectionset, $aFieldsetsPerSection ) { |
471 | 471 | |
472 | 472 | // Tab list |
473 | - $_aOutputs[ 'section_tab_list' ][] = $this->___getTabList( |
|
473 | + $_aOutputs[ 'section_tab_list' ][ ] = $this->___getTabList( |
|
474 | 474 | $aSectionset, |
475 | 475 | $aFieldsetsPerSection, |
476 | 476 | $this->aCallbacks[ 'fieldset_output' ] |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | |
479 | 479 | // Section container |
480 | 480 | $_oSectionTable = new AdminPageFramework_Form_View___Section( |
481 | - $this->aArguments, // for nested sections |
|
481 | + $this->aArguments, // for nested sections |
|
482 | 482 | $aSectionset, |
483 | 483 | $this->aStructure, |
484 | 484 | $aFieldsetsPerSection, |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | $this->aCallbacks, |
489 | 489 | $this->oMsg |
490 | 490 | ); |
491 | - $_aOutputs[ 'section_contents' ][] = $_oSectionTable->get(); |
|
491 | + $_aOutputs[ 'section_contents' ][ ] = $_oSectionTable->get(); |
|
492 | 492 | |
493 | 493 | return $_aOutputs; |
494 | 494 | |
@@ -516,9 +516,9 @@ discard block |
||
516 | 516 | 'section_index' => null, |
517 | 517 | 'collapsible' => $aCollapsible, |
518 | 518 | 'container_type' => 'sections', // section or sections |
519 | - 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
519 | + 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
520 | 520 | ), |
521 | - array(), // fieldsets |
|
521 | + array(), // fieldsets |
|
522 | 522 | $this->aSavedData, |
523 | 523 | $this->aFieldErrors, |
524 | 524 | $this->aStructure[ 'field_type_definitions' ], |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | $aOutputs[ 'count_subsections' ] |
536 | 536 | ); |
537 | 537 | return $_oCollapsibleSectionTitle->get() |
538 | - . "<div " . $_oSectionsTablesContainerAttributes->get() . ">" |
|
538 | + . "<div ".$_oSectionsTablesContainerAttributes->get().">" |
|
539 | 539 | . $this->___getSectionTabList( $sSectionTabSlug, $aOutputs[ 'section_tab_list' ] ) |
540 | 540 | . implode( PHP_EOL, $aOutputs[ 'section_contents' ] ) |
541 | 541 | . "</div>"; |
@@ -566,21 +566,21 @@ discard block |
||
566 | 566 | */ |
567 | 567 | private function ___getTabList( array $aSection, array $aFields, $hfFieldCallback ) { |
568 | 568 | |
569 | - if ( ! $aSection[ 'section_tab_slug' ] ) { |
|
569 | + if ( !$aSection[ 'section_tab_slug' ] ) { |
|
570 | 570 | return ''; |
571 | 571 | } |
572 | 572 | |
573 | 573 | $iSectionIndex = $aSection[ '_index' ]; |
574 | 574 | |
575 | - $_sSectionTagID = 'section-' . $aSection[ 'section_id' ] . '__' . $iSectionIndex; |
|
575 | + $_sSectionTagID = 'section-'.$aSection[ 'section_id' ].'__'.$iSectionIndex; |
|
576 | 576 | $_aTabAttributes = $aSection[ 'attributes' ][ 'tab' ] |
577 | 577 | + array( |
578 | 578 | 'class' => 'admin-page-framework-section-tab nav-tab', |
579 | 579 | 'id' => "section_tab-{$_sSectionTagID}", |
580 | 580 | 'style' => null |
581 | 581 | ); |
582 | - $_aTabAttributes[ 'class' ] = $this->getClassAttribute( $_aTabAttributes[ 'class' ], $aSection[ 'class' ][ 'tab' ] ); // 3.3.1+ |
|
583 | - $_aTabAttributes[ 'style' ] = $this->getStyleAttribute( $_aTabAttributes[ 'style' ], $aSection[ 'hidden' ] ? 'display:none' : null ); // 3.3.1+ |
|
582 | + $_aTabAttributes[ 'class' ] = $this->getClassAttribute( $_aTabAttributes[ 'class' ], $aSection[ 'class' ][ 'tab' ] ); // 3.3.1+ |
|
583 | + $_aTabAttributes[ 'style' ] = $this->getStyleAttribute( $_aTabAttributes[ 'style' ], $aSection[ 'hidden' ] ? 'display:none' : null ); // 3.3.1+ |
|
584 | 584 | |
585 | 585 | $_oSectionTitle = new AdminPageFramework_Form_View___SectionTitle( |
586 | 586 | array( |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | 'tag' => 'h4', |
589 | 589 | 'section_index' => $iSectionIndex, |
590 | 590 | |
591 | - 'sectionset' => $aSection, // 3.7.0+ for tooltip |
|
591 | + 'sectionset' => $aSection, // 3.7.0+ for tooltip |
|
592 | 592 | ), |
593 | 593 | $aFields, |
594 | 594 | $this->aSavedData, |
@@ -598,7 +598,7 @@ discard block |
||
598 | 598 | $this->aCallbacks // field output element callables. |
599 | 599 | ); |
600 | 600 | |
601 | - return "<li " . $this->getAttributes( $_aTabAttributes ) . ">" |
|
601 | + return "<li ".$this->getAttributes( $_aTabAttributes ).">" |
|
602 | 602 | . "<a href='#{$_sSectionTagID}'>" |
603 | 603 | . $_oSectionTitle->get() |
604 | 604 | ."</a>" |
@@ -17,15 +17,15 @@ discard block |
||
17 | 17 | */ |
18 | 18 | class AdminPageFramework_Form_View___CollapsibleSectionTitle extends AdminPageFramework_Form_View___SectionTitle { |
19 | 19 | |
20 | - public $aArguments = array( |
|
20 | + public $aArguments = array( |
|
21 | 21 | 'title' => null, |
22 | 22 | 'tag' => null, |
23 | 23 | 'section_index' => null, |
24 | 24 | 'collapsible' => array(), |
25 | 25 | 'container_type' => 'section', // section or sections |
26 | - 'sectionset' => array(), // 3.7.0+ sectionset definition array |
|
26 | + 'sectionset' => array(), // 3.7.0+ sectionset definition array |
|
27 | 27 | ); |
28 | - public $aFieldsets = array(); |
|
28 | + public $aFieldsets = array(); |
|
29 | 29 | public $aSavedData = array(); |
30 | 30 | public $aFieldErrors = array(); |
31 | 31 | public $aFieldTypeDefinitions = array(); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @param array|boolean $aCollapsible The collapsible argument. |
70 | 70 | * @param string $sContainer The position context. Accepts either 'sections' or 'section'. If the set position in the argument array does not match this value, the method will return an empty string. |
71 | 71 | */ |
72 | - private function ___getCollapsibleSectionTitleBlock( array $aCollapsible, $sContainer='sections', $iSectionIndex=null ) { |
|
72 | + private function ___getCollapsibleSectionTitleBlock( array $aCollapsible, $sContainer = 'sections', $iSectionIndex = null ) { |
|
73 | 73 | |
74 | 74 | if ( $sContainer !== $aCollapsible[ 'container' ] ) { |
75 | 75 | return ''; |
@@ -85,9 +85,9 @@ discard block |
||
85 | 85 | ); |
86 | 86 | |
87 | 87 | $_aSectionset = $this->aArguments[ 'sectionset' ]; |
88 | - $_sSectionTitleTagID = str_replace( '|', '_', $_aSectionset[ '_section_path' ] ) . '_' . $iSectionIndex; |
|
88 | + $_sSectionTitleTagID = str_replace( '|', '_', $_aSectionset[ '_section_path' ] ).'_'.$iSectionIndex; |
|
89 | 89 | |
90 | - return "<div " . $this->getAttributes( |
|
90 | + return "<div ".$this->getAttributes( |
|
91 | 91 | array( |
92 | 92 | 'id' => $_sSectionTitleTagID, |
93 | 93 | 'class' => $this->getClassAttribute( |
@@ -108,11 +108,11 @@ discard block |
||
108 | 108 | 'collapsed', |
109 | 109 | '' |
110 | 110 | ), |
111 | - 'admin-page-framework-collapsible-type-' . $aCollapsible[ 'type' ] |
|
111 | + 'admin-page-framework-collapsible-type-'.$aCollapsible[ 'type' ] |
|
112 | 112 | ), |
113 | 113 | ) |
114 | 114 | + $this->getDataAttributeArray( $aCollapsible ) |
115 | - ) . ">" |
|
115 | + ).">" |
|
116 | 116 | . $_sSectionTitle |
117 | 117 | . "</div>"; |
118 | 118 |
@@ -113,10 +113,10 @@ discard block |
||
113 | 113 | ); |
114 | 114 | |
115 | 115 | $_aNewFieldsets = array(); |
116 | - foreach( $aFieldsets as $_sSectionPath => $_aItems ) { |
|
116 | + foreach ( $aFieldsets as $_sSectionPath => $_aItems ) { |
|
117 | 117 | |
118 | 118 | // If the section is not set, skip. |
119 | - if ( ! isset( $aSectionsets[ $_sSectionPath ] ) ) { |
|
119 | + if ( !isset( $aSectionsets[ $_sSectionPath ] ) ) { |
|
120 | 120 | continue; |
121 | 121 | } |
122 | 122 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $_aItems, |
126 | 126 | $this->getElement( // 3.6.0+ Get the section's capability |
127 | 127 | $aSectionsets, |
128 | - array( $_sSectionPath, 'capability', ), |
|
128 | + array( $_sSectionPath, 'capability',), |
|
129 | 129 | $sCapability |
130 | 130 | ), |
131 | 131 | $aSectionsets |
@@ -182,16 +182,16 @@ discard block |
||
182 | 182 | */ |
183 | 183 | private function ___getNormalFieldsetsFormatted( $aItems, $sCapability, $aSectionsets, $_abSectionRepeatable ) { |
184 | 184 | |
185 | - $_aNewItems = array(); |
|
186 | - foreach( $aItems as $_sFieldID => $_aFieldset ) { |
|
185 | + $_aNewItems = array(); |
|
186 | + foreach ( $aItems as $_sFieldID => $_aFieldset ) { |
|
187 | 187 | |
188 | 188 | // Insert the formatted field definition array. The fields count is needed to set each order value. |
189 | - $_aFieldset = $this->___getFieldsetFormatted( |
|
189 | + $_aFieldset = $this->___getFieldsetFormatted( |
|
190 | 190 | $_aFieldset, |
191 | 191 | $aSectionsets, |
192 | 192 | $sCapability, |
193 | 193 | count( $_aNewItems ), // index of elements - zero based |
194 | - null, // sub-section index |
|
194 | + null, // sub-section index |
|
195 | 195 | $_abSectionRepeatable, |
196 | 196 | $this->oCallerForm |
197 | 197 | ); |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | * @return boolean |
211 | 211 | */ |
212 | 212 | private function ___isSubSections( $aItems, $_abSectionRepeatable ) { |
213 | - if ( ! empty( $_abSectionRepeatable ) ) { |
|
213 | + if ( !empty( $_abSectionRepeatable ) ) { |
|
214 | 214 | return true; |
215 | 215 | } |
216 | 216 | return ( boolean ) count( $this->getIntegerKeyElements( $aItems ) ); |
@@ -221,9 +221,9 @@ discard block |
||
221 | 221 | private function ___getSubSectionsFormatted( $aItems, $sCapability, $aSectionsets, $_abSectionRepeatable ) { |
222 | 222 | |
223 | 223 | $_aNewFieldset = array(); |
224 | - foreach( $this->numerizeElements( $aItems ) as $_iSubSectionIndex => $_aFieldsets ) { |
|
224 | + foreach ( $this->numerizeElements( $aItems ) as $_iSubSectionIndex => $_aFieldsets ) { |
|
225 | 225 | |
226 | - foreach( $_aFieldsets as $_aFieldset ) { |
|
226 | + foreach ( $_aFieldsets as $_aFieldset ) { |
|
227 | 227 | $_iCountElement = count( $this->getElementAsArray( $_aNewFieldset, $_iSubSectionIndex ) ); |
228 | 228 | $_aFieldset = $this->___getFieldsetFormatted( |
229 | 229 | $_aFieldset, |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | if ( empty( $_aFieldset ) ) { |
238 | 238 | continue; |
239 | 239 | } |
240 | - $_aNewFieldset[ $_iSubSectionIndex ][ $_aFieldset['field_id'] ] = $_aFieldset; |
|
240 | + $_aNewFieldset[ $_iSubSectionIndex ][ $_aFieldset[ 'field_id' ] ] = $_aFieldset; |
|
241 | 241 | } |
242 | 242 | uasort( $_aNewFieldset[ $_iSubSectionIndex ], array( $this, 'sortArrayByKey' ) ); |
243 | 243 | |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | } |
265 | 265 | |
266 | 266 | $_aSortedFields = array(); |
267 | - foreach( $aSectionsets as $_sSectionPath => $_aSecitonset ) { |
|
267 | + foreach ( $aSectionsets as $_sSectionPath => $_aSecitonset ) { |
|
268 | 268 | if ( isset( $aFieldsets[ $_sSectionPath ] ) ) { |
269 | 269 | $_aSortedFields[ $_sSectionPath ] = $aFieldsets[ $_sSectionPath ]; |
270 | 270 | } |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | private function ___getFieldsetFormatted( $aFieldset, $aSectionsets, $sCapability, $iCountOfElements, $iSubSectionIndex, $bIsSectionRepeatable, $oCallerObject ) { |
284 | 284 | |
285 | 285 | // 3.8.0+ Dropped the check for $aFieldset[ 'type' ] to allow it to be omitted. |
286 | - if ( ! isset( $aFieldset[ 'field_id' ] ) ) { |
|
286 | + if ( !isset( $aFieldset[ 'field_id' ] ) ) { |
|
287 | 287 | return; |
288 | 288 | } |
289 | 289 |
@@ -42,10 +42,10 @@ discard block |
||
42 | 42 | 'posttype', |
43 | 43 | 'size', |
44 | 44 | 'section_title', // 3.0.0+ |
45 | - 'system', // 3.3.0+ |
|
46 | - 'inline_mixed', // 3.8.0+ |
|
47 | - '_nested', // 3.8.0+ |
|
48 | - 'contact', // 3.9.0+ |
|
45 | + 'system', // 3.3.0+ |
|
46 | + 'inline_mixed', // 3.8.0+ |
|
47 | + '_nested', // 3.8.0+ |
|
48 | + 'contact', // 3.9.0+ |
|
49 | 49 | 'table' // 3.9.0+ |
50 | 50 | ); |
51 | 51 | |
@@ -76,16 +76,16 @@ discard block |
||
76 | 76 | public function get() { |
77 | 77 | |
78 | 78 | $_aFieldTypeDefinitions = array(); |
79 | - foreach( self::$_aDefaultFieldTypeSlugs as $_sFieldTypeSlug ) { |
|
79 | + foreach ( self::$_aDefaultFieldTypeSlugs as $_sFieldTypeSlug ) { |
|
80 | 80 | |
81 | 81 | $_sFieldTypeClassName = "AdminPageFramework_FieldType_{$_sFieldTypeSlug}"; |
82 | 82 | $_oFieldType = new $_sFieldTypeClassName( |
83 | - $this->sCallerID, // usually an instantiated class name |
|
84 | - null, // field type slugs - if it is different from the one defined in the class property |
|
83 | + $this->sCallerID, // usually an instantiated class name |
|
84 | + null, // field type slugs - if it is different from the one defined in the class property |
|
85 | 85 | $this->oMsg, |
86 | 86 | false // `false` to disable auto-registering. |
87 | 87 | ); |
88 | - foreach( $_oFieldType->aFieldTypeSlugs as $_sSlug ) { |
|
88 | + foreach ( $_oFieldType->aFieldTypeSlugs as $_sSlug ) { |
|
89 | 89 | $_aFieldTypeDefinitions[ $_sSlug ] = $_oFieldType->getDefinitionArray(); |
90 | 90 | } |
91 | 91 | } |