@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | * Defines the default key-values of this field type. |
77 | 77 | */ |
78 | 78 | protected $aDefaultKeys = array( |
79 | - 'select_all_button' => false, // 3.3.0+ to change the label, set the label here |
|
80 | - 'select_none_button' => false, // 3.3.0+ to change the label, set the label here |
|
79 | + 'select_all_button' => false, // 3.3.0+ to change the label, set the label here |
|
80 | + 'select_none_button' => false, // 3.3.0+ to change the label, set the label here |
|
81 | 81 | ); |
82 | 82 | |
83 | 83 | /** |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | protected function getScripts() { |
91 | 91 | new AdminPageFramework_Form_View___Script_CheckboxSelector; |
92 | - $_sClassSelectorSelectAll = $this->_getSelectButtonClassSelectors( |
|
92 | + $_sClassSelectorSelectAll = $this->_getSelectButtonClassSelectors( |
|
93 | 93 | $this->aFieldTypeSlugs, |
94 | 94 | 'select_all_button' // data attribute |
95 | 95 | ); |
@@ -116,14 +116,14 @@ discard block |
||
116 | 116 | * @return string |
117 | 117 | * @internal |
118 | 118 | */ |
119 | - private function _getSelectButtonClassSelectors( array $aFieldTypeSlugs, $sDataAttribute='select_all_button' ) { |
|
119 | + private function _getSelectButtonClassSelectors( array $aFieldTypeSlugs, $sDataAttribute = 'select_all_button' ) { |
|
120 | 120 | |
121 | 121 | $_aClassSelectors = array(); |
122 | 122 | foreach ( $aFieldTypeSlugs as $_sSlug ) { |
123 | - if ( ! is_scalar( $_sSlug ) ) { |
|
123 | + if ( !is_scalar( $_sSlug ) ) { |
|
124 | 124 | continue; |
125 | 125 | } |
126 | - $_aClassSelectors[] = '.admin-page-framework-checkbox-container-' . $_sSlug . "[data-{$sDataAttribute}]"; |
|
126 | + $_aClassSelectors[ ] = '.admin-page-framework-checkbox-container-'.$_sSlug."[data-{$sDataAttribute}]"; |
|
127 | 127 | } |
128 | 128 | return implode( ',', $_aClassSelectors ); |
129 | 129 | |
@@ -184,8 +184,8 @@ discard block |
||
184 | 184 | |
185 | 185 | $_aOutput = array(); |
186 | 186 | $_bIsMultiple = is_array( $aField[ 'label' ] ); |
187 | - foreach( $this->getAsArray( $aField[ 'label' ], true ) as $_sKey => $_sLabel ) { |
|
188 | - $_aOutput[] = $this->_getEachCheckboxOutput( |
|
187 | + foreach ( $this->getAsArray( $aField[ 'label' ], true ) as $_sKey => $_sLabel ) { |
|
188 | + $_aOutput[ ] = $this->_getEachCheckboxOutput( |
|
189 | 189 | $aField, |
190 | 190 | $_bIsMultiple |
191 | 191 | ? $_sKey |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $_sLabel |
194 | 194 | ); |
195 | 195 | } |
196 | - return "<div " . $this->getAttributes( $this->_getCheckboxContainerAttributes( $aField ) ) . ">" |
|
196 | + return "<div ".$this->getAttributes( $this->_getCheckboxContainerAttributes( $aField ) ).">" |
|
197 | 197 | . "<div class='repeatable-field-buttons'></div>" // the repeatable field buttons will be replaced with this element. |
198 | 198 | . implode( PHP_EOL, $_aOutput ) |
199 | 199 | . "</div>"; |
@@ -208,12 +208,12 @@ discard block |
||
208 | 208 | */ |
209 | 209 | protected function _getCheckboxContainerAttributes( array $aField ) { |
210 | 210 | return array( |
211 | - 'class' => 'admin-page-framework-checkbox-container-' . $aField[ 'type' ], |
|
211 | + 'class' => 'admin-page-framework-checkbox-container-'.$aField[ 'type' ], |
|
212 | 212 | 'data-select_all_button' => $aField[ 'select_all_button' ] |
213 | - ? ( ! is_string( $aField[ 'select_all_button' ] ) ? $this->oMsg->get( 'select_all' ) : $aField[ 'select_all_button' ] ) |
|
213 | + ? ( !is_string( $aField[ 'select_all_button' ] ) ? $this->oMsg->get( 'select_all' ) : $aField[ 'select_all_button' ] ) |
|
214 | 214 | : null, |
215 | 215 | 'data-select_none_button' => $aField[ 'select_none_button' ] |
216 | - ? ( ! is_string( $aField[ 'select_none_button' ] ) ? $this->oMsg->get( 'select_none' ) : $aField[ 'select_none_button' ] ) |
|
216 | + ? ( !is_string( $aField[ 'select_none_button' ] ) ? $this->oMsg->get( 'select_none' ) : $aField[ 'select_none_button' ] ) |
|
217 | 217 | : null, |
218 | 218 | ); |
219 | 219 | } |
@@ -231,8 +231,8 @@ discard block |
||
231 | 231 | $_oCheckbox->setAttributesByKey( $sKey ); |
232 | 232 | $_oCheckbox->addClass( $this->_sCheckboxClassSelector ); |
233 | 233 | return $this->getElementByLabel( $aField[ 'before_label' ], $sKey, $aField[ 'label' ] ) |
234 | - . "<div " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-checkbox-label' ) . ">" |
|
235 | - . "<label " . $this->getAttributes( |
|
234 | + . "<div ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-checkbox-label' ).">" |
|
235 | + . "<label ".$this->getAttributes( |
|
236 | 236 | array( |
237 | 237 | 'for' => $_oCheckbox->getAttribute( 'id' ), |
238 | 238 | 'class' => $_oCheckbox->getAttribute( 'disabled' ) |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function _appendInternalAssets( $sInternal, &$aContainer ) { |
70 | 70 | $_aInternals = array_unique( $aContainer ); |
71 | - $sInternal = PHP_EOL . $sInternal; |
|
72 | - foreach( $_aInternals as $_iIndex => $_sInternal ) { |
|
73 | - $sInternal .= $_sInternal . PHP_EOL; |
|
71 | + $sInternal = PHP_EOL.$sInternal; |
|
72 | + foreach ( $_aInternals as $_iIndex => $_sInternal ) { |
|
73 | + $sInternal .= $_sInternal.PHP_EOL; |
|
74 | 74 | unset( $_aInternals[ $_iIndex ] ); |
75 | 75 | } |
76 | 76 | $aContainer = $_aInternals; // update the container array. |
@@ -84,23 +84,23 @@ discard block |
||
84 | 84 | private function _parseAssets( $oFactory ) { |
85 | 85 | |
86 | 86 | // page |
87 | - $_aPageStyles = $this->getElementAsArray( |
|
87 | + $_aPageStyles = $this->getElementAsArray( |
|
88 | 88 | $oFactory->oProp->aPages, |
89 | 89 | array( $this->sCurrentPageSlug, 'style' ) |
90 | 90 | ); |
91 | 91 | $this->_enqueuePageAssets( $_aPageStyles, 'style' ); |
92 | 92 | |
93 | - $_aPageScripts = $this->getElementAsArray( |
|
93 | + $_aPageScripts = $this->getElementAsArray( |
|
94 | 94 | $oFactory->oProp->aPages, |
95 | 95 | array( $this->sCurrentPageSlug, 'script' ) |
96 | 96 | ); |
97 | 97 | $this->_enqueuePageAssets( $_aPageScripts, 'script' ); |
98 | 98 | |
99 | 99 | // In-page tabs |
100 | - if ( ! $this->sCurrentTabSlug ) { |
|
100 | + if ( !$this->sCurrentTabSlug ) { |
|
101 | 101 | return; |
102 | 102 | } |
103 | - $_aInPageTabStyles = $this->getElementAsArray( |
|
103 | + $_aInPageTabStyles = $this->getElementAsArray( |
|
104 | 104 | $oFactory->oProp->aInPageTabs, |
105 | 105 | array( $this->sCurrentPageSlug, $this->sCurrentTabSlug, 'style' ) |
106 | 106 | ); |
@@ -117,10 +117,10 @@ discard block |
||
117 | 117 | * @since 3.6.3 |
118 | 118 | * @return void |
119 | 119 | */ |
120 | - private function _enqueuePageAssets( array $aPageAssets, $sType='style' ) { |
|
121 | - $_sMathodName = "_enqueueAsset_" . $sType; |
|
122 | - foreach( $aPageAssets as $_asPageAsset ) { |
|
123 | - $this->{$_sMathodName}( $_asPageAsset); |
|
120 | + private function _enqueuePageAssets( array $aPageAssets, $sType = 'style' ) { |
|
121 | + $_sMathodName = "_enqueueAsset_".$sType; |
|
122 | + foreach ( $aPageAssets as $_asPageAsset ) { |
|
123 | + $this->{$_sMathodName}( $_asPageAsset ); |
|
124 | 124 | } |
125 | 125 | } |
126 | 126 | |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | } |
146 | 146 | |
147 | 147 | // Insert the CSS rule in the head tag. |
148 | - $this->aCSSRules[] = $_sSRC; |
|
148 | + $this->aCSSRules[ ] = $_sSRC; |
|
149 | 149 | |
150 | 150 | } |
151 | 151 | |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | } |
171 | 171 | |
172 | 172 | // Insert the scripts in the head tag. |
173 | - $this->aScripts[] = $_sSRC; |
|
173 | + $this->aScripts[ ] = $_sSRC; |
|
174 | 174 | |
175 | 175 | } |
176 | 176 |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | static public function getRelativePath( $from, $to ) { |
30 | 30 | |
31 | 31 | // some compatibility fixes for Windows paths |
32 | - $from = is_dir( $from ) ? rtrim( $from, '\/') . '/' : $from; |
|
33 | - $to = is_dir( $to ) ? rtrim( $to, '\/') . '/' : $to; |
|
32 | + $from = is_dir( $from ) ? rtrim( $from, '\/' ).'/' : $from; |
|
33 | + $to = is_dir( $to ) ? rtrim( $to, '\/' ).'/' : $to; |
|
34 | 34 | $from = str_replace( '\\', '/', $from ); |
35 | 35 | $to = str_replace( '\\', '/', $to ); |
36 | 36 | |
@@ -38,21 +38,21 @@ discard block |
||
38 | 38 | $to = explode( '/', $to ); |
39 | 39 | $relPath = $to; |
40 | 40 | |
41 | - foreach( $from as $depth => $dir ) { |
|
41 | + foreach ( $from as $depth => $dir ) { |
|
42 | 42 | // find first non-matching dir |
43 | - if( $dir === $to[ $depth ] ) { |
|
43 | + if ( $dir === $to[ $depth ] ) { |
|
44 | 44 | // ignore this directory |
45 | 45 | array_shift( $relPath ); |
46 | 46 | } else { |
47 | 47 | // get number of remaining dirs to $from |
48 | 48 | $remaining = count( $from ) - $depth; |
49 | - if( $remaining > 1 ) { |
|
49 | + if ( $remaining > 1 ) { |
|
50 | 50 | // add traversals up to first matching dir |
51 | 51 | $padLength = ( count( $relPath ) + $remaining - 1 ) * -1; |
52 | 52 | $relPath = array_pad( $relPath, $padLength, '..' ); |
53 | 53 | break; |
54 | 54 | } else { |
55 | - $relPath[ 0 ] = './' . $relPath[ 0 ]; |
|
55 | + $relPath[ 0 ] = './'.$relPath[ 0 ]; |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | 6, // the second parameter: limit |
82 | 82 | ) |
83 | 83 | ); |
84 | - foreach( $_aBackTrace as $_aDebugInfo ) { |
|
84 | + foreach ( $_aBackTrace as $_aDebugInfo ) { |
|
85 | 85 | $_sCallerFilePath = $_aDebugInfo[ 'file' ]; |
86 | 86 | if ( in_array( $_sCallerFilePath, $_aRedirectedFilePaths ) ) { |
87 | 87 | continue; |
@@ -81,9 +81,9 @@ |
||
81 | 81 | 6, // the second parameter: limit |
82 | 82 | ) |
83 | 83 | ); |
84 | - foreach( $_aBackTrace as $_aDebugInfo ) { |
|
84 | + foreach( $_aBackTrace as $_aDebugInfo ) { |
|
85 | 85 | $_sCallerFilePath = $_aDebugInfo[ 'file' ]; |
86 | - if ( in_array( $_sCallerFilePath, $_aRedirectedFilePaths ) ) { |
|
86 | + if ( in_array( $_sCallerFilePath, $_aRedirectedFilePaths ) ) { |
|
87 | 87 | continue; |
88 | 88 | } |
89 | 89 | break; // catch the first found item. |