@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * @since 3.8.9 |
29 | 29 | * @return void |
30 | 30 | **/ |
31 | - static protected function _log( $mValue, $sFilePath=null, $bStackTrace=false, $iTrace=0, $iStringLengthLimit=99999, $iArrayDepthLimit=50 ) { |
|
31 | + static protected function _log( $mValue, $sFilePath = null, $bStackTrace = false, $iTrace = 0, $iStringLengthLimit = 99999, $iArrayDepthLimit = 50 ) { |
|
32 | 32 | |
33 | 33 | static $_fPreviousTimeStamp = 0; |
34 | 34 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $_sCallerClass = self::___getCallerClassName( $_oCallerInfo, $iTrace ); |
38 | 38 | $_fCurrentTimeStamp = microtime( true ); |
39 | 39 | $_sLogContent = self::___getLogContents( $mValue, $_fCurrentTimeStamp, $_fPreviousTimeStamp, $_sCallerClass, $_sCallerFunction, $iStringLengthLimit, $iArrayDepthLimit ) |
40 | - . ( $bStackTrace ? self::getStackTrace($iTrace + 1 ) : '' ) |
|
40 | + . ( $bStackTrace ? self::getStackTrace( $iTrace + 1 ) : '' ) |
|
41 | 41 | . PHP_EOL; |
42 | 42 | |
43 | 43 | file_put_contents( self::___getLogFilePath( $sFilePath, $_sCallerClass ), $_sLogContent, FILE_APPEND ); |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | round( $_fCurrentTimeStamp - $_fPreviousTimeStamp, 3 ), // elapsed time |
55 | 55 | $_sCallerClass, |
56 | 56 | $_sCallerFunction |
57 | - ) . PHP_EOL |
|
58 | - . self::_getLegibleDetails( $mValue, $iStringLengthLimit, $iArrayDepthLimit ) . PHP_EOL; |
|
57 | + ).PHP_EOL |
|
58 | + . self::_getLegibleDetails( $mValue, $iStringLengthLimit, $iArrayDepthLimit ).PHP_EOL; |
|
59 | 59 | } |
60 | 60 | /** |
61 | 61 | * @since 3.8.9 |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | static private function ___getCallerFunctionName( $oCallerInfo, $iTrace ) { |
65 | 65 | return self::getElement( |
66 | - $oCallerInfo, // subject array |
|
66 | + $oCallerInfo, // subject array |
|
67 | 67 | array( 2 + $iTrace, 'function' ), // key |
68 | 68 | '' // default |
69 | 69 | ); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | static private function ___getCallerClassName( $oCallerInfo, $iTrace ) { |
76 | 76 | return self::getElement( |
77 | - $oCallerInfo, // subject array |
|
77 | + $oCallerInfo, // subject array |
|
78 | 78 | array( 2 + $iTrace, 'class' ), // key |
79 | 79 | '' // default |
80 | 80 | ); |
@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | */ |
90 | 90 | static private function ___getLogFilePath( $bsFilePathOrName, $sCallerClass ) { |
91 | 91 | |
92 | - $_sWPContentDir = WP_CONTENT_DIR . DIRECTORY_SEPARATOR; |
|
92 | + $_sWPContentDir = WP_CONTENT_DIR.DIRECTORY_SEPARATOR; |
|
93 | 93 | |
94 | 94 | // It is a partial file name |
95 | - if ( is_string( $bsFilePathOrName ) && ! self::hasSlash( $bsFilePathOrName ) ) { |
|
96 | - return $_sWPContentDir . $bsFilePathOrName . '_' . date( "Ymd" ) . '.log'; |
|
95 | + if ( is_string( $bsFilePathOrName ) && !self::hasSlash( $bsFilePathOrName ) ) { |
|
96 | + return $_sWPContentDir.$bsFilePathOrName.'_'.date( "Ymd" ).'.log'; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | // Try creating a file. |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | // Return a generated default log path. |
108 | 108 | $_sClassBaseName = $sCallerClass ? basename( $sCallerClass ) : basename( get_class() ); |
109 | - return $_sWPContentDir . $_sClassBaseName . '_' . date( "Ymd" ) . '.log'; |
|
109 | + return $_sWPContentDir.$_sClassBaseName.'_'.date( "Ymd" ).'.log'; |
|
110 | 110 | |
111 | 111 | } |
112 | 112 | /** |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @internal |
116 | 116 | */ |
117 | 117 | static private function ___createFile( $sFilePath ) { |
118 | - if ( ! $sFilePath || true === $sFilePath ) { |
|
118 | + if ( !$sFilePath || true === $sFilePath ) { |
|
119 | 119 | return false; |
120 | 120 | } |
121 | 121 | if ( file_exists( $sFilePath ) ) { |
@@ -137,11 +137,11 @@ discard block |
||
137 | 137 | $_nNow = $fCurrentTimeStamp + ( self::___getSiteGMTOffset() * 60 * 60 ); |
138 | 138 | $_nMicroseconds = str_pad( round( ( $_nNow - floor( $_nNow ) ) * 10000 ), 4, '0' ); |
139 | 139 | $_aOutput = array( |
140 | - date( "Y/m/d H:i:s", $_nNow ) . '.' . $_nMicroseconds, |
|
140 | + date( "Y/m/d H:i:s", $_nNow ).'.'.$_nMicroseconds, |
|
141 | 141 | self::___getFormattedElapsedTime( $nElapsed ), |
142 | 142 | self::___getPageLoadID(), |
143 | 143 | self::getFrameworkVersion(), |
144 | - $sCallerClass . '::' . $sCallerFunction, |
|
144 | + $sCallerClass.'::'.$sCallerFunction, |
|
145 | 145 | current_filter(), |
146 | 146 | self::getCurrentURL(), |
147 | 147 | ); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | */ |
157 | 157 | static private function ___getSiteGMTOffset() { |
158 | 158 | static $_nGMTOffset; |
159 | - $_nGMTOffset = isset( $_nGMTOffset ) |
|
159 | + $_nGMTOffset = isset( $_nGMTOffset ) |
|
160 | 160 | ? $_nGMTOffset |
161 | 161 | : get_option( 'gmt_offset' ); |
162 | 162 | return $_nGMTOffset; |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | */ |
168 | 168 | static private function ___getPageLoadID() { |
169 | 169 | static $_sPageLoadID; |
170 | - $_sPageLoadID = $_sPageLoadID |
|
170 | + $_sPageLoadID = $_sPageLoadID |
|
171 | 171 | ? $_sPageLoadID |
172 | 172 | : uniqid(); |
173 | 173 | return $_sPageLoadID; |
@@ -191,15 +191,15 @@ discard block |
||
191 | 191 | 3, |
192 | 192 | '0' |
193 | 193 | ); |
194 | - $_sElapsed = self::getElement( |
|
195 | - $_aElapsedParts, // subject array |
|
196 | - 0, // key |
|
194 | + $_sElapsed = self::getElement( |
|
195 | + $_aElapsedParts, // subject array |
|
196 | + 0, // key |
|
197 | 197 | 0 // default |
198 | 198 | ); |
199 | - $_sElapsed = strlen( $_sElapsed ) > 1 |
|
200 | - ? '+' . substr( $_sElapsed, -1, 2 ) |
|
201 | - : ' ' . $_sElapsed; |
|
202 | - return $_sElapsed . '.' . $_sElapsedFloat; |
|
199 | + $_sElapsed = strlen( $_sElapsed ) > 1 |
|
200 | + ? '+'.substr( $_sElapsed, -1, 2 ) |
|
201 | + : ' '.$_sElapsed; |
|
202 | + return $_sElapsed.'.'.$_sElapsedFloat; |
|
203 | 203 | |
204 | 204 | } |
205 | 205 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * @param integer $iArrayDepthLimit |
36 | 36 | * @return void |
37 | 37 | */ |
38 | - static public function dump( $asArray, $sFilePath=null, $bStackTrace=false, $iStringLengthLimit=0, $iArrayDepthLimit=0 ) { |
|
38 | + static public function dump( $asArray, $sFilePath = null, $bStackTrace = false, $iStringLengthLimit = 0, $iArrayDepthLimit = 0 ) { |
|
39 | 39 | echo self::get( $asArray, $sFilePath, true, $bStackTrace, $iStringLengthLimit, $iArrayDepthLimit ); |
40 | 40 | } |
41 | 41 | |
@@ -44,12 +44,12 @@ discard block |
||
44 | 44 | * @since 3.8.9 |
45 | 45 | * @return string |
46 | 46 | */ |
47 | - static public function getDetails( $mValue, $bEscape=true, $bStackTrace=false, $iStringLengthLimit=0, $iArrayDepthLimit=0 ) { |
|
47 | + static public function getDetails( $mValue, $bEscape = true, $bStackTrace = false, $iStringLengthLimit = 0, $iArrayDepthLimit = 0 ) { |
|
48 | 48 | $_sValueWithDetails = self::_getArrayRepresentationSanitized( |
49 | 49 | self::_getLegibleDetails( $mValue, $iStringLengthLimit, $iArrayDepthLimit ) |
50 | 50 | ); |
51 | 51 | $_sValueWithDetails = $bStackTrace |
52 | - ? $_sValueWithDetails . PHP_EOL . self::getStackTrace() |
|
52 | + ? $_sValueWithDetails.PHP_EOL.self::getStackTrace() |
|
53 | 53 | : $_sValueWithDetails; |
54 | 54 | return $bEscape |
55 | 55 | ? "<pre class='dump-array'>" |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @param integer $iArrayDepthLimit |
76 | 76 | * @return string |
77 | 77 | */ |
78 | - static public function get( $asArray, $sFilePath=null, $bEscape=true, $bStackTrace=false, $iStringLengthLimit=0, $iArrayDepthLimit=0 ) { |
|
78 | + static public function get( $asArray, $sFilePath = null, $bEscape = true, $bStackTrace = false, $iStringLengthLimit = 0, $iArrayDepthLimit = 0 ) { |
|
79 | 79 | |
80 | 80 | if ( $sFilePath ) { |
81 | 81 | self::log( $asArray, $sFilePath ); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * @param integer $iArrayDepthLimit The depth limit for arrays.* |
118 | 118 | * @return void |
119 | 119 | **/ |
120 | - static public function log( $mValue, $sFilePath=null, $bStackTrace=false, $iTrace=0, $iStringLengthLimit=99999, $iArrayDepthLimit=50 ) { |
|
120 | + static public function log( $mValue, $sFilePath = null, $bStackTrace = false, $iTrace = 0, $iStringLengthLimit = 99999, $iArrayDepthLimit = 50 ) { |
|
121 | 121 | self::_log( $mValue, $sFilePath, $bStackTrace, $iTrace, $iStringLengthLimit, $iArrayDepthLimit ); |
122 | 122 | } |
123 | 123 | |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | * @since unknown |
132 | 132 | * @deprecated 3.2.0 |
133 | 133 | */ |
134 | - static public function dumpArray( $asArray, $sFilePath=null ) { |
|
135 | - self::showDeprecationNotice( 'AdminPageFramework_Debug::' . __FUNCTION__, 'AdminPageFramework_Debug::dump()' ); |
|
134 | + static public function dumpArray( $asArray, $sFilePath = null ) { |
|
135 | + self::showDeprecationNotice( 'AdminPageFramework_Debug::'.__FUNCTION__, 'AdminPageFramework_Debug::dump()' ); |
|
136 | 136 | AdminPageFramework_Debug::dump( $asArray, $sFilePath ); |
137 | 137 | } |
138 | 138 | |
@@ -145,8 +145,8 @@ discard block |
||
145 | 145 | * @since 3.0.0 Changed the $bEncloseInTag parameter to bEscape. |
146 | 146 | * @deprecated 3.2.0 |
147 | 147 | */ |
148 | - static public function getArray( $asArray, $sFilePath=null, $bEscape=true ) { |
|
149 | - self::showDeprecationNotice( 'AdminPageFramework_Debug::' . __FUNCTION__, 'AdminPageFramework_Debug::get()' ); |
|
148 | + static public function getArray( $asArray, $sFilePath = null, $bEscape = true ) { |
|
149 | + self::showDeprecationNotice( 'AdminPageFramework_Debug::'.__FUNCTION__, 'AdminPageFramework_Debug::get()' ); |
|
150 | 150 | return AdminPageFramework_Debug::get( $asArray, $sFilePath, $bEscape ); |
151 | 151 | } |
152 | 152 | |
@@ -157,8 +157,8 @@ discard block |
||
157 | 157 | * @since 3.0.3 Changed the default log location and file name. |
158 | 158 | * @deprecated 3.1.0 Use the `log()` method instead. |
159 | 159 | */ |
160 | - static public function logArray( $asArray, $sFilePath=null ) { |
|
161 | - self::showDeprecationNotice( 'AdminPageFramework_Debug::' . __FUNCTION__, 'AdminPageFramework_Debug::log()' ); |
|
160 | + static public function logArray( $asArray, $sFilePath = null ) { |
|
161 | + self::showDeprecationNotice( 'AdminPageFramework_Debug::'.__FUNCTION__, 'AdminPageFramework_Debug::log()' ); |
|
162 | 162 | AdminPageFramework_Debug::log( $asArray, $sFilePath ); |
163 | 163 | } |
164 | 164 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * @deprecated 3.8.9 |
172 | 172 | */ |
173 | 173 | static public function getAsString( $mValue ) { |
174 | - self::showDeprecationNotice( 'AdminPageFramework_Debug::' . __FUNCTION__ ); |
|
174 | + self::showDeprecationNotice( 'AdminPageFramework_Debug::'.__FUNCTION__ ); |
|
175 | 175 | return self::_getLegible( $mValue ); |
176 | 176 | } |
177 | 177 |
@@ -410,7 +410,7 @@ |
||
410 | 410 | * This is used for element that `label_min_width` is applied. |
411 | 411 | * |
412 | 412 | * @param array $aField |
413 | - * @param array|string $asClassAttributes |
|
413 | + * @param string $asClassAttributes |
|
414 | 414 | * @param array $aAttributes |
415 | 415 | * @return string |
416 | 416 | * @since 3.8.0 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | 'after_label' => null, |
60 | 60 | 'before_field' => null, |
61 | 61 | 'after_field' => null, |
62 | - 'label_min_width' => '', // (string|integer) min-width applied to the input label in pixels. 3.8.0+ Changed the default value from 140 to 0 as it is now applied via embedded CSS. When this value is set by the user, it is set inline and the value will be overridden. [3.8.4+] Changed the value from `0` to `''`. |
|
62 | + 'label_min_width' => '', // (string|integer) min-width applied to the input label in pixels. 3.8.0+ Changed the default value from 140 to 0 as it is now applied via embedded CSS. When this value is set by the user, it is set inline and the value will be overridden. [3.8.4+] Changed the value from `0` to `''`. |
|
63 | 63 | 'before_fieldset' => null, // 3.1.1+ |
64 | 64 | 'after_fieldset' => null, // 3.1.1+ |
65 | 65 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @param object $oMsg The framework message object. |
100 | 100 | * @param boolean $bAutoRegister Whether or not to register the field type(s). |
101 | 101 | */ |
102 | - public function __construct( $asClassName='admin_page_framework', $asFieldTypeSlug=null, $oMsg=null, $bAutoRegister=true ) { |
|
102 | + public function __construct( $asClassName = 'admin_page_framework', $asFieldTypeSlug = null, $oMsg = null, $bAutoRegister = true ) { |
|
103 | 103 | |
104 | 104 | $this->aFieldTypeSlugs = empty( $asFieldTypeSlug ) |
105 | 105 | ? $this->aFieldTypeSlugs |
@@ -110,9 +110,9 @@ discard block |
||
110 | 110 | |
111 | 111 | // This automatically registers the field type. The build-in ones will be registered manually so it will be skipped. |
112 | 112 | if ( $bAutoRegister ) { |
113 | - foreach( ( array ) $asClassName as $_sClassName ) { |
|
113 | + foreach ( ( array ) $asClassName as $_sClassName ) { |
|
114 | 114 | add_filter( |
115 | - 'field_types_' . $_sClassName, |
|
115 | + 'field_types_'.$_sClassName, |
|
116 | 116 | array( $this, '_replyToRegisterInputFieldType' ) |
117 | 117 | ); |
118 | 118 | } |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | } |
162 | 162 | return is_array( $asLabel ) // if the user sets multiple items |
163 | 163 | ? $this->getElement( |
164 | - $asElement, // subject |
|
165 | - $this->getAsArray( $asKey, true /* preserve empty */ ), // dimensional path |
|
164 | + $asElement, // subject |
|
165 | + $this->getAsArray( $asKey, true /* preserve empty */ ), // dimensional path |
|
166 | 166 | '' // default - if the element is not found, return an empty |
167 | 167 | ) |
168 | 168 | : $asElement; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | */ |
179 | 179 | protected function getFieldOutput( array $aFieldset ) { |
180 | 180 | |
181 | - if ( ! is_object( $aFieldset[ '_caller_object' ] ) ) { |
|
181 | + if ( !is_object( $aFieldset[ '_caller_object' ] ) ) { |
|
182 | 182 | return ''; |
183 | 183 | } |
184 | 184 | |
@@ -186,14 +186,14 @@ discard block |
||
186 | 186 | $aFieldset[ '_parent_field_object' ] = $aFieldset[ '_field_object' ]; // 3.6.0+ |
187 | 187 | |
188 | 188 | // 3.7.0+ The caller object is no longer a factory object but a form object. |
189 | - $_oCallerForm = $aFieldset[ '_caller_object' ]; |
|
189 | + $_oCallerForm = $aFieldset[ '_caller_object' ]; |
|
190 | 190 | |
191 | 191 | $_oFieldset = new AdminPageFramework_Form_View___Fieldset( |
192 | - $aFieldset, // the field definition array |
|
193 | - $_oCallerForm->aSavedData, // the stored form data |
|
194 | - $_oCallerForm->getFieldErrors(), // the field error array. |
|
195 | - $_oCallerForm->aFieldTypeDefinitions, // the field type definition array. |
|
196 | - $_oCallerForm->oMsg, // the system message object |
|
192 | + $aFieldset, // the field definition array |
|
193 | + $_oCallerForm->aSavedData, // the stored form data |
|
194 | + $_oCallerForm->getFieldErrors(), // the field error array. |
|
195 | + $_oCallerForm->aFieldTypeDefinitions, // the field type definition array. |
|
196 | + $_oCallerForm->oMsg, // the system message object |
|
197 | 197 | $_oCallerForm->aCallbacks // field output element callables. |
198 | 198 | ); |
199 | 199 | return $_oFieldset->get(); |
@@ -237,13 +237,13 @@ discard block |
||
237 | 237 | * @return array |
238 | 238 | * @internal |
239 | 239 | */ |
240 | - public function getDefinitionArray( $sFieldTypeSlug='' ) { |
|
240 | + public function getDefinitionArray( $sFieldTypeSlug = '' ) { |
|
241 | 241 | |
242 | 242 | // The uniteArrays() method resulted in somewhat being slow due to overhead on checking array keys for recursive array merges. |
243 | 243 | $_aDefaultKeys = $this->aDefaultKeys + self::$_aDefaultKeys; |
244 | - $_aDefaultKeys['attributes'] = isset( $this->aDefaultKeys['attributes'] ) && is_array( $this->aDefaultKeys['attributes'] ) |
|
245 | - ? $this->aDefaultKeys['attributes'] + self::$_aDefaultKeys['attributes'] |
|
246 | - : self::$_aDefaultKeys['attributes']; |
|
244 | + $_aDefaultKeys[ 'attributes' ] = isset( $this->aDefaultKeys[ 'attributes' ] ) && is_array( $this->aDefaultKeys[ 'attributes' ] ) |
|
245 | + ? $this->aDefaultKeys[ 'attributes' ] + self::$_aDefaultKeys[ 'attributes' ] |
|
246 | + : self::$_aDefaultKeys[ 'attributes' ]; |
|
247 | 247 | |
248 | 248 | return array( |
249 | 249 | 'sFieldTypeSlug' => $sFieldTypeSlug, |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | * @param string $sFieldSetType |
290 | 290 | * @internal |
291 | 291 | */ |
292 | - public function _replyToFieldTypeSetter( $sFieldSetType='' ) { |
|
292 | + public function _replyToFieldTypeSetter( $sFieldSetType = '' ) { |
|
293 | 293 | $this->_sFieldSetType = $sFieldSetType; |
294 | 294 | } |
295 | 295 | |
@@ -344,8 +344,8 @@ discard block |
||
344 | 344 | wp_enqueue_script( 'media-upload' ); |
345 | 345 | } |
346 | 346 | |
347 | - if ( in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php', ) ) ) { |
|
348 | - add_filter( 'gettext', array( $this, '_replyToReplaceThickBoxText' ) , 1, 2 ); |
|
347 | + if ( in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php',) ) ) { |
|
348 | + add_filter( 'gettext', array( $this, '_replyToReplaceThickBoxText' ), 1, 2 ); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | } |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | public function _replyToReplaceThickBoxText( $sTranslated, $sText ) { |
364 | 364 | |
365 | 365 | // Replace the button label in the media thick box. |
366 | - if ( ! in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php' ) ) ) { |
|
366 | + if ( !in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php' ) ) ) { |
|
367 | 367 | return $sTranslated; |
368 | 368 | } |
369 | 369 | if ( $sText !== 'Insert into Post' ) { |
@@ -394,10 +394,10 @@ discard block |
||
394 | 394 | */ |
395 | 395 | public function _replyToRemovingMediaLibraryTab( $aTabs ) { |
396 | 396 | |
397 | - if ( ! isset( $_REQUEST[ 'enable_external_source' ] ) ) { |
|
397 | + if ( !isset( $_REQUEST[ 'enable_external_source' ] ) ) { |
|
398 | 398 | return $aTabs; |
399 | 399 | } |
400 | - if ( ! ( boolean ) $_REQUEST[ 'enable_external_source' ] ) { |
|
400 | + if ( !( boolean ) $_REQUEST[ 'enable_external_source' ] ) { |
|
401 | 401 | unset( $aTabs[ 'type_url' ] ); // removes the 'From URL' tab in the thick box. |
402 | 402 | } |
403 | 403 | return $aTabs; |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | * @return string |
416 | 416 | * @since 3.8.0 |
417 | 417 | */ |
418 | - protected function getLabelContainerAttributes( $aField, $asClassAttributes, array $aAttributes=array() ) { |
|
418 | + protected function getLabelContainerAttributes( $aField, $asClassAttributes, array $aAttributes = array() ) { |
|
419 | 419 | |
420 | 420 | $aAttributes[ 'class' ] = $this->getClassAttribute( $asClassAttributes, $this->getElement( $aAttributes, 'class' ) ); |
421 | 421 | $aAttributes[ 'style' ] = $this->getStyleAttribute( |
@@ -337,14 +337,14 @@ discard block |
||
337 | 337 | wp_enqueue_script( 'thickbox' ); |
338 | 338 | wp_enqueue_style( 'thickbox' ); |
339 | 339 | |
340 | - if ( function_exists( 'wp_enqueue_media' ) ) { |
|
340 | + if ( function_exists( 'wp_enqueue_media' ) ) { |
|
341 | 341 | // If the WordPress version is 3.5 or above, |
342 | 342 | new AdminPageFramework_Form_View___Script_MediaUploader( $this->oMsg ); |
343 | 343 | } else { |
344 | 344 | wp_enqueue_script( 'media-upload' ); |
345 | 345 | } |
346 | 346 | |
347 | - if ( in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php', ) ) ) { |
|
347 | + if ( in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php', ) ) ) { |
|
348 | 348 | add_filter( 'gettext', array( $this, '_replyToReplaceThickBoxText' ) , 1, 2 ); |
349 | 349 | } |
350 | 350 | |
@@ -363,13 +363,13 @@ discard block |
||
363 | 363 | public function _replyToReplaceThickBoxText( $sTranslated, $sText ) { |
364 | 364 | |
365 | 365 | // Replace the button label in the media thick box. |
366 | - if ( ! in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php' ) ) ) { |
|
366 | + if ( ! in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php' ) ) ) { |
|
367 | 367 | return $sTranslated; |
368 | 368 | } |
369 | - if ( $sText !== 'Insert into Post' ) { |
|
369 | + if ( $sText !== 'Insert into Post' ) { |
|
370 | 370 | return $sTranslated; |
371 | 371 | } |
372 | - if ( $this->getQueryValueInURLByKey( wp_get_referer(), 'referrer' ) !== 'admin_page_framework' ) { |
|
372 | + if ( $this->getQueryValueInURLByKey( wp_get_referer(), 'referrer' ) !== 'admin_page_framework' ) { |
|
373 | 373 | return $sTranslated; |
374 | 374 | } |
375 | 375 |
@@ -432,8 +432,8 @@ |
||
432 | 432 | /** |
433 | 433 | * |
434 | 434 | * @since 3.5.12 |
435 | - * @param array|string|null $asCategories |
|
436 | - * @param array|string|null $asRemovingCategories |
|
435 | + * @param string|null $asCategories |
|
436 | + * @param string $asRemovingCategories |
|
437 | 437 | * @return string|array |
438 | 438 | * @internal |
439 | 439 | */ |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * </code> |
73 | 73 | * @var array |
74 | 74 | */ |
75 | - public $aFieldTypeSlugs = array( 'system', ); |
|
75 | + public $aFieldTypeSlugs = array( 'system',); |
|
76 | 76 | |
77 | 77 | /** |
78 | 78 | * Defines the default key-values of this field type. |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | * @remark `$_aDefaultKeys` holds shared default key-values defined in the base class. |
93 | 93 | */ |
94 | 94 | protected $aDefaultKeys = array( |
95 | - 'data' => array(), // [3.2.0+] Stores the data to be displayed |
|
96 | - 'print_type' => 1, // [3.4.6+] 1: readable representation of array. 2: print_r() |
|
95 | + 'data' => array(), // [3.2.0+] Stores the data to be displayed |
|
96 | + 'print_type' => 1, // [3.4.6+] 1: readable representation of array. 2: print_r() |
|
97 | 97 | 'attributes' => array( |
98 | 98 | 'rows' => 60, |
99 | 99 | 'autofocus' => null, |
@@ -233,13 +233,13 @@ discard block |
||
233 | 233 | . "<div class='admin-page-framework-input-label-container'>" |
234 | 234 | . "<label for='{$aField[ 'input_id' ]}'>" |
235 | 235 | . $aField[ 'before_input' ] |
236 | - . ( $aField[ 'label' ] && ! $aField[ 'repeatable' ] |
|
237 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
236 | + . ( $aField[ 'label' ] && !$aField[ 'repeatable' ] |
|
237 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
238 | 238 | . $aField[ 'label' ] |
239 | 239 | . "</span>" |
240 | 240 | : "" |
241 | 241 | ) |
242 | - . "<textarea " . $this->getAttributes( $_aInputAttributes ) . " >" |
|
242 | + . "<textarea ".$this->getAttributes( $_aInputAttributes )." >" |
|
243 | 243 | . esc_textarea( $this->___getSystemInformation( $aField[ 'value' ], $aField[ 'data' ], $aField[ 'print_type' ] ) ) |
244 | 244 | . "</textarea>" |
245 | 245 | . $aField[ 'after_input' ] |
@@ -257,15 +257,15 @@ discard block |
||
257 | 257 | * @param integer $iPrintType |
258 | 258 | * @internal |
259 | 259 | */ |
260 | - private function ___getSystemInformation( $asValue=null, $asCustomData=null, $iPrintType=1 ) { |
|
260 | + private function ___getSystemInformation( $asValue = null, $asCustomData = null, $iPrintType = 1 ) { |
|
261 | 261 | |
262 | 262 | if ( isset( $asValue ) ) { |
263 | 263 | return $asValue; |
264 | 264 | } |
265 | 265 | |
266 | - $_aOutput = array(); |
|
267 | - foreach( $this->___getFormattedSystemInformation( $asCustomData ) as $_sSection => $_aInfo ) { |
|
268 | - $_aOutput[] = $this->_____getSystemInfoBySection( $_sSection, $_aInfo, $iPrintType ); |
|
266 | + $_aOutput = array(); |
|
267 | + foreach ( $this->___getFormattedSystemInformation( $asCustomData ) as $_sSection => $_aInfo ) { |
|
268 | + $_aOutput[ ] = $this->_____getSystemInfoBySection( $_sSection, $_aInfo, $iPrintType ); |
|
269 | 269 | } |
270 | 270 | return implode( PHP_EOL, $_aOutput ); |
271 | 271 | |
@@ -281,15 +281,15 @@ discard block |
||
281 | 281 | |
282 | 282 | $_aData = $this->getAsArray( $asCustomData ); |
283 | 283 | $_aData = $_aData + array( |
284 | - 'WordPress' => $this->___getSiteInfoWithCache( ! isset( $_aData[ 'WordPress' ] ) ), |
|
285 | - 'PHP' => $this->_getPHPInfo( ! isset( $_aData[ 'PHP' ] ) ), |
|
286 | - 'PHP Error Log' => $this->___getErrorLogByType( 'php', ! isset( $_aData[ 'PHP Error Log' ] ) ), |
|
284 | + 'WordPress' => $this->___getSiteInfoWithCache( !isset( $_aData[ 'WordPress' ] ) ), |
|
285 | + 'PHP' => $this->_getPHPInfo( !isset( $_aData[ 'PHP' ] ) ), |
|
286 | + 'PHP Error Log' => $this->___getErrorLogByType( 'php', !isset( $_aData[ 'PHP Error Log' ] ) ), |
|
287 | 287 | 'MySQL' => isset( $_aData[ 'MySQL' ] ) |
288 | 288 | ? null |
289 | - : $this->getMySQLInfo(), // defined in the utility class. |
|
290 | - 'MySQL Error Log' => $this->___getErrorLogByType( 'mysql', ! isset( $_aData[ 'MySQL Error Log' ] ) ), |
|
291 | - 'Server' => $this->___getWebServerInfo( ! isset( $_aData[ 'Server' ] ) ), |
|
292 | - 'Browser' => $this->___getClientInfo( ! isset( $_aData[ 'Browser' ] ) ), |
|
289 | + : $this->getMySQLInfo(), // defined in the utility class. |
|
290 | + 'MySQL Error Log' => $this->___getErrorLogByType( 'mysql', !isset( $_aData[ 'MySQL Error Log' ] ) ), |
|
291 | + 'Server' => $this->___getWebServerInfo( !isset( $_aData[ 'Server' ] ) ), |
|
292 | + 'Browser' => $this->___getClientInfo( !isset( $_aData[ 'Browser' ] ) ), |
|
293 | 293 | 'Admin Page Framework' => isset( $_aData[ 'Admin Page Framework' ] ) |
294 | 294 | ? null |
295 | 295 | : AdminPageFramework_Registry::getInfo(), |
@@ -312,10 +312,10 @@ discard block |
||
312 | 312 | switch ( $iPrintType ) { |
313 | 313 | default: |
314 | 314 | case 1: // use the framework readable representation of arrays. |
315 | - return $this->getReadableArrayContents( $sSectionName, $aData, 32 ) . PHP_EOL; |
|
315 | + return $this->getReadableArrayContents( $sSectionName, $aData, 32 ).PHP_EOL; |
|
316 | 316 | case 2: // use print_r() |
317 | - return "[{$sSectionName}]" . PHP_EOL |
|
318 | - . print_r( $aData, true ) . PHP_EOL; |
|
317 | + return "[{$sSectionName}]".PHP_EOL |
|
318 | + . print_r( $aData, true ).PHP_EOL; |
|
319 | 319 | } |
320 | 320 | } |
321 | 321 | /** |
@@ -327,9 +327,9 @@ discard block |
||
327 | 327 | * @param boolean $bGenerateInfo |
328 | 328 | * @return string |
329 | 329 | */ |
330 | - private function ___getClientInfo( $bGenerateInfo=true ) { |
|
330 | + private function ___getClientInfo( $bGenerateInfo = true ) { |
|
331 | 331 | |
332 | - if ( ! $bGenerateInfo ) { |
|
332 | + if ( !$bGenerateInfo ) { |
|
333 | 333 | return ''; |
334 | 334 | } |
335 | 335 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | $_aBrowser = @ini_get( 'browscap' ) |
338 | 338 | ? get_browser( $_SERVER[ 'HTTP_USER_AGENT' ], true ) |
339 | 339 | : array(); |
340 | - unset( $_aBrowser[ 'browser_name_regex' ] ); // this element causes output to be blank |
|
340 | + unset( $_aBrowser[ 'browser_name_regex' ] ); // this element causes output to be blank |
|
341 | 341 | return empty( $_aBrowser ) |
342 | 342 | ? __( 'No browser information found.', 'admin-page-framework' ) |
343 | 343 | : $_aBrowser; |
@@ -353,9 +353,9 @@ discard block |
||
353 | 353 | * @param string $sType The error log type. Either 'php' or 'mysql' is accepted. |
354 | 354 | * @param boolean $bGenerateInfo Whether to generate a log. This is for the caller method to reduce a conditinal statement. |
355 | 355 | */ |
356 | - private function ___getErrorLogByType( $sType, $bGenerateInfo=true ) { |
|
356 | + private function ___getErrorLogByType( $sType, $bGenerateInfo = true ) { |
|
357 | 357 | |
358 | - if ( ! $bGenerateInfo ) { |
|
358 | + if ( !$bGenerateInfo ) { |
|
359 | 359 | return ''; |
360 | 360 | } |
361 | 361 | switch ( $sType ) { |
@@ -388,9 +388,9 @@ discard block |
||
388 | 388 | * @param boolean $bGenerateInfo |
389 | 389 | * @return array The generated site information array. |
390 | 390 | */ |
391 | - private function ___getSiteInfoWithCache( $bGenerateInfo=true ) { |
|
391 | + private function ___getSiteInfoWithCache( $bGenerateInfo = true ) { |
|
392 | 392 | |
393 | - if ( ! $bGenerateInfo || isset( self::$_aSiteInfo ) ) { |
|
393 | + if ( !$bGenerateInfo || isset( self::$_aSiteInfo ) ) { |
|
394 | 394 | return self::$_aSiteInfo; |
395 | 395 | } |
396 | 396 | self::$_aSiteInfo = self::___getSiteInfo(); |
@@ -424,8 +424,8 @@ discard block |
||
424 | 424 | 'wp_remote_get()' => $this->___getWPRemoteGetStatus(), |
425 | 425 | __( 'Multibite String Extension', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'mb_detect_encoding' ), $this->oMsg->get( 'enabled' ), $this->oMsg->get( 'disabled' ) ), |
426 | 426 | __( 'WP_CONTENT_DIR Writeable', 'admin-page-framework' ) => $this->getAOrB( is_writable( WP_CONTENT_DIR ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
427 | - __( 'Active Plugins', 'admin-page-framework' ) => PHP_EOL . $this->___getActivePlugins(), |
|
428 | - __( 'Network Active Plugins', 'admin-page-framework' ) => PHP_EOL . $this->___getNetworkActivePlugins(), |
|
427 | + __( 'Active Plugins', 'admin-page-framework' ) => PHP_EOL.$this->___getActivePlugins(), |
|
428 | + __( 'Network Active Plugins', 'admin-page-framework' ) => PHP_EOL.$this->___getNetworkActivePlugins(), |
|
429 | 429 | __( 'Constants', 'admin-page-framework' ) => $this->___getDefinedConstants( 'user' ), |
430 | 430 | ); |
431 | 431 | } |
@@ -437,9 +437,9 @@ discard block |
||
437 | 437 | * @return string|array |
438 | 438 | * @internal |
439 | 439 | */ |
440 | - private function ___getDefinedConstants( $asCategories=null, $asRemovingCategories=null ) { |
|
440 | + private function ___getDefinedConstants( $asCategories = null, $asRemovingCategories = null ) { |
|
441 | 441 | $_asConstants = $this->getDefinedConstants( $asCategories, $asRemovingCategories ); |
442 | - if ( ! is_array( $_asConstants ) ) { |
|
442 | + if ( !is_array( $_asConstants ) ) { |
|
443 | 443 | return $_asConstants; |
444 | 444 | } |
445 | 445 | if ( isset( $_asConstants[ 'user' ] ) ) { |
@@ -476,12 +476,12 @@ discard block |
||
476 | 476 | |
477 | 477 | // If the WordPress version is less than 3.4, |
478 | 478 | if ( version_compare( $GLOBALS[ 'wp_version' ], '3.4', '<' ) ) { |
479 | - $_aThemeData = get_theme_data( get_stylesheet_directory() . '/style.css' ); |
|
480 | - return $_aThemeData[ 'Name' ] . ' ' . $_aThemeData[ 'Version' ]; |
|
479 | + $_aThemeData = get_theme_data( get_stylesheet_directory().'/style.css' ); |
|
480 | + return $_aThemeData[ 'Name' ].' '.$_aThemeData[ 'Version' ]; |
|
481 | 481 | } |
482 | 482 | |
483 | 483 | $_oThemeData = wp_get_theme(); |
484 | - return $_oThemeData->Name . ' ' . $_oThemeData->Version; |
|
484 | + return $_oThemeData->Name.' '.$_oThemeData->Version; |
|
485 | 485 | |
486 | 486 | } |
487 | 487 | /** |
@@ -495,10 +495,10 @@ discard block |
||
495 | 495 | $_aPluginList = array(); |
496 | 496 | $_aActivePlugins = get_option( 'active_plugins', array() ); |
497 | 497 | foreach ( get_plugins() as $_sPluginPath => $_aPlugin ) { |
498 | - if ( ! in_array( $_sPluginPath, $_aActivePlugins ) ) { |
|
498 | + if ( !in_array( $_sPluginPath, $_aActivePlugins ) ) { |
|
499 | 499 | continue; |
500 | 500 | } |
501 | - $_aPluginList[] = ' ' . $_aPlugin[ 'Name' ] . ': ' . $_aPlugin[ 'Version' ]; |
|
501 | + $_aPluginList[ ] = ' '.$_aPlugin[ 'Name' ].': '.$_aPlugin[ 'Version' ]; |
|
502 | 502 | } |
503 | 503 | return implode( PHP_EOL, $_aPluginList ); |
504 | 504 | |
@@ -510,17 +510,17 @@ discard block |
||
510 | 510 | */ |
511 | 511 | private function ___getNetworkActivePlugins() { |
512 | 512 | |
513 | - if ( ! is_multisite() ) { |
|
513 | + if ( !is_multisite() ) { |
|
514 | 514 | return ''; |
515 | 515 | } |
516 | 516 | $_aPluginList = array(); |
517 | 517 | $_aActivePlugins = get_site_option( 'active_sitewide_plugins', array() ); |
518 | 518 | foreach ( wp_get_active_network_plugins() as $_sPluginPath ) { |
519 | - if ( ! array_key_exists( plugin_basename( $_sPluginPath ), $_aActivePlugins ) ) { |
|
519 | + if ( !array_key_exists( plugin_basename( $_sPluginPath ), $_aActivePlugins ) ) { |
|
520 | 520 | continue; |
521 | 521 | } |
522 | 522 | $_aPlugin = get_plugin_data( $_sPluginPath ); |
523 | - $_aPluginList[] = ' ' . $_aPlugin[ 'Name' ] . ' :' . $_aPlugin[ 'Version' ]; |
|
523 | + $_aPluginList[ ] = ' '.$_aPlugin[ 'Name' ].' :'.$_aPlugin[ 'Version' ]; |
|
524 | 524 | } |
525 | 525 | return implode( PHP_EOL, $_aPluginList ); |
526 | 526 | |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | if ( is_wp_error( $aoResponse ) ) { |
585 | 585 | return true; |
586 | 586 | } |
587 | - if ( $aoResponse[ 'response'][ 'code' ] < 200 ) { |
|
587 | + if ( $aoResponse[ 'response' ][ 'code' ] < 200 ) { |
|
588 | 588 | return true; |
589 | 589 | } |
590 | 590 | if ( $aoResponse[ 'response' ][ 'code' ] >= 300 ) { |
@@ -610,13 +610,13 @@ discard block |
||
610 | 610 | * @param boolean $bGenerateInfo |
611 | 611 | * @return array |
612 | 612 | */ |
613 | - private function _getPHPInfo( $bGenerateInfo=true ) { |
|
613 | + private function _getPHPInfo( $bGenerateInfo = true ) { |
|
614 | 614 | |
615 | - if ( ! $bGenerateInfo || isset( self::$_aPHPInfo ) ) { |
|
615 | + if ( !$bGenerateInfo || isset( self::$_aPHPInfo ) ) { |
|
616 | 616 | return self::$_aPHPInfo; |
617 | 617 | } |
618 | 618 | |
619 | - $_oErrorReporting = new AdminPageFramework_ErrorReporting; |
|
619 | + $_oErrorReporting = new AdminPageFramework_ErrorReporting; |
|
620 | 620 | self::$_aPHPInfo = array( |
621 | 621 | __( 'Version', 'admin-page-framework' ) => phpversion(), |
622 | 622 | __( 'Safe Mode', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'safe_mode' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
@@ -627,16 +627,16 @@ discard block |
||
627 | 627 | __( 'Max Execution Time', 'admin-page-framework' ) => @ini_get( 'max_execution_time' ), |
628 | 628 | __( 'Max Input Vars', 'admin-page-framework' ) => @ini_get( 'max_input_vars' ), |
629 | 629 | __( 'Argument Separator', 'admin-page-framework' ) => @ini_get( 'arg_separator.output' ), |
630 | - __( 'Allow URL File Open', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'allow_url_fopen' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
|
631 | - __( 'Display Errors', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'display_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ), |
|
632 | - __( 'Log Errors', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'log_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ), |
|
630 | + __( 'Allow URL File Open', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'allow_url_fopen' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
|
631 | + __( 'Display Errors', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'display_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ), |
|
632 | + __( 'Log Errors', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'log_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ), |
|
633 | 633 | __( 'Error log location', 'admin-page-framework' ) => @ini_get( 'error_log' ), |
634 | 634 | __( 'Error Reporting Level', 'admin-page-framework' ) => $_oErrorReporting->getErrorLevel(), |
635 | - __( 'FSOCKOPEN', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'fsockopen' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
636 | - __( 'cURL', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'curl_init' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
637 | - __( 'SOAP', 'admin-page-framework' ) => $this->getAOrB( class_exists( 'SoapClient' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
638 | - __( 'SUHOSIN', 'admin-page-framework' ) => $this->getAOrB( extension_loaded( 'suhosin' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
639 | - 'ini_set()' => $this->getAOrB( function_exists( 'ini_set' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
635 | + __( 'FSOCKOPEN', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'fsockopen' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
636 | + __( 'cURL', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'curl_init' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
637 | + __( 'SOAP', 'admin-page-framework' ) => $this->getAOrB( class_exists( 'SoapClient' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
638 | + __( 'SUHOSIN', 'admin-page-framework' ) => $this->getAOrB( extension_loaded( 'suhosin' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
639 | + 'ini_set()' => $this->getAOrB( function_exists( 'ini_set' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
640 | 640 | ) |
641 | 641 | + $this->getPHPInfo() |
642 | 642 | + array( |
@@ -656,10 +656,10 @@ discard block |
||
656 | 656 | * @param boolean $bGenerateInfo |
657 | 657 | * @return array|string |
658 | 658 | */ |
659 | - private function ___getWebServerInfo( $bGenerateInfo=true ) { |
|
659 | + private function ___getWebServerInfo( $bGenerateInfo = true ) { |
|
660 | 660 | return $bGenerateInfo |
661 | 661 | ? array( |
662 | - __( 'Web Server', 'admin-page-framework' ) => $_SERVER['SERVER_SOFTWARE'], |
|
662 | + __( 'Web Server', 'admin-page-framework' ) => $_SERVER[ 'SERVER_SOFTWARE' ], |
|
663 | 663 | 'SSL' => $this->getAOrB( is_ssl(), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
664 | 664 | __( 'Session', 'admin-page-framework' ) => $this->getAOrB( isset( $_SESSION ), $this->oMsg->get( 'enabled' ), $this->oMsg->get( 'disabled' ) ), |
665 | 665 | __( 'Session Name', 'admin-page-framework' ) => esc_html( @ini_get( 'session.name' ) ), |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | * @since 2.1.5 |
30 | 30 | * @internal |
31 | 31 | */ |
32 | - public function _enqueueStyles( $aSRCs, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
32 | + public function _enqueueStyles( $aSRCs, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
33 | 33 | |
34 | 34 | $_aHandleIDs = array(); |
35 | - foreach( ( array ) $aSRCs as $_sSRC ) { |
|
36 | - $_aHandleIDs[] = $this->_enqueueStyle( $_sSRC, $aPostTypes, $aCustomArgs ); |
|
35 | + foreach ( ( array ) $aSRCs as $_sSRC ) { |
|
36 | + $_aHandleIDs[ ] = $this->_enqueueStyle( $_sSRC, $aPostTypes, $aCustomArgs ); |
|
37 | 37 | } |
38 | 38 | return $_aHandleIDs; |
39 | 39 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
58 | 58 | * @internal |
59 | 59 | */ |
60 | - public function _enqueueStyle( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
60 | + public function _enqueueStyle( $sSRC, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
61 | 61 | |
62 | 62 | $sSRC = trim( $sSRC ); |
63 | 63 | if ( empty( $sSRC ) ) { return ''; } |
@@ -73,13 +73,13 @@ discard block |
||
73 | 73 | 'sSRC' => $sSRC, |
74 | 74 | 'aPostTypes' => empty( $aPostTypes ) ? $this->oProp->aPostTypes : $aPostTypes, |
75 | 75 | 'sType' => 'style', |
76 | - 'handle_id' => 'style_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->iEnqueuedStyleIndex ), |
|
76 | + 'handle_id' => 'style_'.$this->oProp->sClassName.'_'.( ++$this->oProp->iEnqueuedStyleIndex ), |
|
77 | 77 | ), |
78 | 78 | self::$_aStructure_EnqueuingResources |
79 | 79 | ); |
80 | 80 | |
81 | 81 | // Store the attributes in another container by url. |
82 | - $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingStyles[ $_sSRCHash ]['handle_id'] ] = $this->oProp->aEnqueuingStyles[ $_sSRCHash ]['attributes']; |
|
82 | + $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'attributes' ]; |
|
83 | 83 | |
84 | 84 | return $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'handle_id' ]; |
85 | 85 | |
@@ -91,11 +91,11 @@ discard block |
||
91 | 91 | * @since 2.1.5 |
92 | 92 | * @internal |
93 | 93 | */ |
94 | - public function _enqueueScripts( $aSRCs, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
94 | + public function _enqueueScripts( $aSRCs, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
95 | 95 | |
96 | 96 | $_aHandleIDs = array(); |
97 | - foreach( ( array ) $aSRCs as $_sSRC ) { |
|
98 | - $_aHandleIDs[] = $this->_enqueueScript( $_sSRC, $aPostTypes, $aCustomArgs ); |
|
97 | + foreach ( ( array ) $aSRCs as $_sSRC ) { |
|
98 | + $_aHandleIDs[ ] = $this->_enqueueScript( $_sSRC, $aPostTypes, $aCustomArgs ); |
|
99 | 99 | } |
100 | 100 | return $_aHandleIDs; |
101 | 101 | |
@@ -120,9 +120,9 @@ discard block |
||
120 | 120 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
121 | 121 | * @internal |
122 | 122 | */ |
123 | - public function _enqueueScript( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
123 | + public function _enqueueScript( $sSRC, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
124 | 124 | |
125 | - $sSRC = trim( $sSRC ); |
|
125 | + $sSRC = trim( $sSRC ); |
|
126 | 126 | if ( empty( $sSRC ) ) { |
127 | 127 | return ''; |
128 | 128 | } |
@@ -140,13 +140,13 @@ discard block |
||
140 | 140 | 'sSRC' => $sSRC, |
141 | 141 | 'aPostTypes' => empty( $aPostTypes ) ? $this->oProp->aPostTypes : $aPostTypes, |
142 | 142 | 'sType' => 'script', |
143 | - 'handle_id' => 'script_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->iEnqueuedScriptIndex ), |
|
143 | + 'handle_id' => 'script_'.$this->oProp->sClassName.'_'.( ++$this->oProp->iEnqueuedScriptIndex ), |
|
144 | 144 | ), |
145 | 145 | self::$_aStructure_EnqueuingResources |
146 | 146 | ); |
147 | 147 | |
148 | 148 | // Store the attributes in another container by url. |
149 | - $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingScripts[ $_sSRCHash ]['handle_id'] ] = $this->oProp->aEnqueuingScripts[ $_sSRCHash ]['attributes']; |
|
149 | + $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'attributes' ]; |
|
150 | 150 | |
151 | 151 | return $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'handle_id' ]; |
152 | 152 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | * @since 3.0.0 |
159 | 159 | * @internal |
160 | 160 | */ |
161 | - public function _forceToEnqueueStyle( $sSRC, $aCustomArgs=array() ) { |
|
161 | + public function _forceToEnqueueStyle( $sSRC, $aCustomArgs = array() ) { |
|
162 | 162 | return $this->_enqueueStyle( $sSRC, array(), $aCustomArgs ); |
163 | 163 | } |
164 | 164 | /** |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | * @since 3.0.0 |
168 | 168 | * @internal |
169 | 169 | */ |
170 | - public function _forceToEnqueueScript( $sSRC, $aCustomArgs=array() ) { |
|
170 | + public function _forceToEnqueueScript( $sSRC, $aCustomArgs = array() ) { |
|
171 | 171 | return $this->_enqueueScript( $sSRC, array(), $aCustomArgs ); |
172 | 172 | } |
173 | 173 |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | public $sNotice = ''; |
46 | 46 | public $aAttributes = array(); |
47 | 47 | public $aCallbacks = array( |
48 | - 'should_show' => null, // determines whether the admin notice should be displayed. |
|
48 | + 'should_show' => null, // determines whether the admin notice should be displayed. |
|
49 | 49 | ); |
50 | 50 | /**#@-*/ |
51 | 51 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * </ul> |
62 | 62 | * @since 3.5.0 |
63 | 63 | */ |
64 | - public function __construct( $sNotice, array $aAttributes=array( 'class' => 'error' ), array $aCallbacks=array() ) { |
|
64 | + public function __construct( $sNotice, array $aAttributes = array( 'class' => 'error' ), array $aCallbacks = array() ) { |
|
65 | 65 | |
66 | 66 | $this->aAttributes = $aAttributes + array( |
67 | 67 | 'class' => 'error', // 'updated' etc. |
@@ -69,17 +69,17 @@ discard block |
||
69 | 69 | $this->aAttributes[ 'class' ] = $this->getClassAttribute( |
70 | 70 | $this->aAttributes[ 'class' ], |
71 | 71 | 'admin-page-framework-settings-notice-message', |
72 | - 'admin-page-framework-settings-notice-container', // Moved from `AdminPageFramework_Factory_View`. |
|
72 | + 'admin-page-framework-settings-notice-container', // Moved from `AdminPageFramework_Factory_View`. |
|
73 | 73 | 'notice', |
74 | 74 | 'is-dismissible' // 3.5.12+ |
75 | 75 | ); |
76 | - $this->aCallbacks = $aCallbacks + $this->aCallbacks; |
|
76 | + $this->aCallbacks = $aCallbacks + $this->aCallbacks; |
|
77 | 77 | |
78 | 78 | // Load resources. |
79 | 79 | new AdminPageFramework_AdminNotice___Script; |
80 | 80 | |
81 | 81 | // An empty value may be set in order only to load the fade-in script. |
82 | - if ( ! $sNotice ) { |
|
82 | + if ( !$sNotice ) { |
|
83 | 83 | return; |
84 | 84 | } |
85 | 85 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function _replyToDisplayAdminNotice() { |
109 | 109 | |
110 | - if ( ! $this->_shouldProceed() ) { |
|
110 | + if ( !$this->_shouldProceed() ) { |
|
111 | 111 | return; |
112 | 112 | } |
113 | 113 | |
@@ -118,14 +118,14 @@ discard block |
||
118 | 118 | 'display: none' |
119 | 119 | ); |
120 | 120 | |
121 | - echo "<div " . $this->getAttributes( $_aAttributes ) . ">" |
|
121 | + echo "<div ".$this->getAttributes( $_aAttributes ).">" |
|
122 | 122 | . "<p>" |
123 | 123 | . self::$_aNotices[ $this->sNotice ] |
124 | 124 | . "</p>" |
125 | 125 | . "</div>" |
126 | 126 | // Insert the same message except it is not hidden. |
127 | 127 | . "<noscript>" |
128 | - . "<div " . $this->getAttributes( $this->aAttributes ) . ">" |
|
128 | + . "<div ".$this->getAttributes( $this->aAttributes ).">" |
|
129 | 129 | . "<p>" |
130 | 130 | . self::$_aNotices[ $this->sNotice ] |
131 | 131 | . "</p>" |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | private function _shouldProceed() { |
145 | 145 | |
146 | - if ( ! is_callable( $this->aCallbacks[ 'should_show' ] ) ) { |
|
146 | + if ( !is_callable( $this->aCallbacks[ 'should_show' ] ) ) { |
|
147 | 147 | return true; |
148 | 148 | } |
149 | 149 | return call_user_func_array( |
@@ -337,8 +337,8 @@ |
||
337 | 337 | ) + $_aAttributes |
338 | 338 | ); |
339 | 339 | return "<p class='submit-confirm-container'><label>" |
340 | - . $_sInput |
|
341 | - . "<span>{$_aConfirm[ 'label' ]}</span>" |
|
340 | + . $_sInput |
|
341 | + . "<span>{$_aConfirm[ 'label' ]}</span>" |
|
342 | 342 | . "</label></p>"; |
343 | 343 | } |
344 | 344 |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | /** |
192 | 192 | * Defines the field type slugs used for this field type. |
193 | 193 | */ |
194 | - public $aFieldTypeSlugs = array( 'submit', ); |
|
194 | + public $aFieldTypeSlugs = array( 'submit',); |
|
195 | 195 | |
196 | 196 | /** |
197 | 197 | * Defines the default key-values of this field type. |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | 'redirect_url' => null, |
203 | 203 | 'href' => null, |
204 | 204 | 'reset' => null, |
205 | - 'email' => null, // [3.3.0+] string of an email address to send to or it can be an array with the following keys. |
|
205 | + 'email' => null, // [3.3.0+] string of an email address to send to or it can be an array with the following keys. |
|
206 | 206 | 'confirm' => '', |
207 | 207 | /* |
208 | 208 | array( |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | 'attachments' => null, // string|array The file path(s) or an array representing the key structure of the submitted form data holding the value. The first key should be the section ID and the second key is the the field ID. |
214 | 214 | ) |
215 | 215 | */ |
216 | - 'skip_confirmation' => false, // 3.7.6+ For emails. |
|
216 | + 'skip_confirmation' => false, // 3.7.6+ For emails. |
|
217 | 217 | 'attributes' => array( |
218 | 218 | 'class' => 'button button-primary', |
219 | 219 | ), |
@@ -294,17 +294,17 @@ discard block |
||
294 | 294 | |
295 | 295 | return |
296 | 296 | $aField[ 'before_label' ] |
297 | - . "<div " . $this->getAttributes( $_aLabelContainerAttributes ) . ">" |
|
297 | + . "<div ".$this->getAttributes( $_aLabelContainerAttributes ).">" |
|
298 | 298 | . $this->_getExtraFieldsBeforeLabel( $aField ) // this is for the import field type that cannot place file input tag inside the label tag. |
299 | - . "<label " . $this->getAttributes( $_aLabelAttributes ) . ">" |
|
299 | + . "<label ".$this->getAttributes( $_aLabelAttributes ).">" |
|
300 | 300 | . $aField[ 'before_input' ] |
301 | 301 | . $this->_getExtraInputFields( $aField ) |
302 | - . "<input " . $this->getAttributes( $_aInputAttributes ) . " />" // this method is defined in the base class |
|
302 | + . "<input ".$this->getAttributes( $_aInputAttributes )." />" // this method is defined in the base class |
|
303 | 303 | . $aField[ 'after_input' ] |
304 | 304 | . "</label>" |
305 | 305 | . $this->___getConfirmationCheckbox( $aField ) |
306 | 306 | . "</div>" |
307 | - . $aField['after_label']; |
|
307 | + . $aField[ 'after_label' ]; |
|
308 | 308 | |
309 | 309 | } |
310 | 310 | /** |
@@ -316,12 +316,12 @@ discard block |
||
316 | 316 | if ( empty( $aField[ 'confirm' ] ) ) { |
317 | 317 | return ''; |
318 | 318 | } |
319 | - $_aConfirm = is_string( $aField[ 'confirm' ] ) |
|
319 | + $_aConfirm = is_string( $aField[ 'confirm' ] ) |
|
320 | 320 | ? array( |
321 | 321 | 'label' => $aField[ 'confirm' ] |
322 | 322 | ) |
323 | 323 | : $this->getAsArray( $aField[ 'confirm' ] ); |
324 | - $_aConfirm = $_aConfirm + array( |
|
324 | + $_aConfirm = $_aConfirm + array( |
|
325 | 325 | 'label' => $this->oMsg->get( 'submit_confirmation_label' ), |
326 | 326 | 'error' => $this->oMsg->get( 'submit_confirmation_error' ), |
327 | 327 | ); |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | private function _getLabelAttributes( array $aField, array $aInputAttributes ) { |
373 | 373 | return array( |
374 | 374 | 'style' => $aField[ 'label_min_width' ] |
375 | - ? "min-width:" . $this->getLengthSanitized( $aField[ 'label_min_width' ] ) . ";" |
|
375 | + ? "min-width:".$this->getLengthSanitized( $aField[ 'label_min_width' ] ).";" |
|
376 | 376 | : null, |
377 | 377 | 'for' => $aInputAttributes[ 'id' ], |
378 | 378 | 'class' => $aInputAttributes[ 'disabled' ] |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | private function _getLabelContainerAttributes( array $aField ) { |
392 | 392 | return array( |
393 | 393 | 'style' => $aField[ 'label_min_width' ] || '0' === ( string ) $aField[ 'label_min_width' ] |
394 | - ? "min-width:" . $this->getLengthSanitized( $aField[ 'label_min_width' ] ) . ";" |
|
394 | + ? "min-width:".$this->getLengthSanitized( $aField[ 'label_min_width' ] ).";" |
|
395 | 395 | : null, |
396 | 396 | 'class' => 'admin-page-framework-input-label-container' |
397 | 397 | . ' admin-page-framework-input-button-container' |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | protected function _getExtraInputFields( &$aField ) { |
446 | 446 | |
447 | 447 | $_aOutput = array(); |
448 | - $_aOutput[] = $this->getHTMLTag( |
|
448 | + $_aOutput[ ] = $this->getHTMLTag( |
|
449 | 449 | 'input', |
450 | 450 | array( |
451 | 451 | 'type' => 'hidden', |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | 'value' => $aField[ 'input_id' ], |
454 | 454 | ) |
455 | 455 | ); |
456 | - $_aOutput[] = $this->getHTMLTag( |
|
456 | + $_aOutput[ ] = $this->getHTMLTag( |
|
457 | 457 | 'input', |
458 | 458 | array( |
459 | 459 | 'type' => 'hidden', |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | 'value' => $aField[ 'field_id' ], |
462 | 462 | ) |
463 | 463 | ); |
464 | - $_aOutput[] = $this->getHTMLTag( |
|
464 | + $_aOutput[ ] = $this->getHTMLTag( |
|
465 | 465 | 'input', |
466 | 466 | array( |
467 | 467 | 'type' => 'hidden', |
@@ -469,11 +469,11 @@ discard block |
||
469 | 469 | 'value' => $aField[ '_input_name_flat' ], |
470 | 470 | ) |
471 | 471 | ); |
472 | - $_aOutput[] = $this->_getHiddenInput_SectionID( $aField ); |
|
473 | - $_aOutput[] = $this->_getHiddenInputByKey( $aField, 'redirect_url' ); |
|
474 | - $_aOutput[] = $this->_getHiddenInputByKey( $aField, 'href' ); |
|
475 | - $_aOutput[] = $this->_getHiddenInput_Reset( $aField ); |
|
476 | - $_aOutput[] = $this->_getHiddenInput_Email( $aField ); |
|
472 | + $_aOutput[ ] = $this->_getHiddenInput_SectionID( $aField ); |
|
473 | + $_aOutput[ ] = $this->_getHiddenInputByKey( $aField, 'redirect_url' ); |
|
474 | + $_aOutput[ ] = $this->_getHiddenInputByKey( $aField, 'href' ); |
|
475 | + $_aOutput[ ] = $this->_getHiddenInput_Reset( $aField ); |
|
476 | + $_aOutput[ ] = $this->_getHiddenInput_Email( $aField ); |
|
477 | 477 | return implode( PHP_EOL, array_filter( $_aOutput ) ); |
478 | 478 | |
479 | 479 | } |
@@ -490,9 +490,9 @@ discard block |
||
490 | 490 | 'input', |
491 | 491 | array( |
492 | 492 | 'type' => 'hidden', |
493 | - 'name' => "__submit[{$aField['input_id']}][section_id]", |
|
494 | - 'value' => isset( $aField['section_id'] ) && '_default' !== $aField['section_id'] |
|
495 | - ? $aField['section_id'] |
|
493 | + 'name' => "__submit[{$aField[ 'input_id' ]}][section_id]", |
|
494 | + 'value' => isset( $aField[ 'section_id' ] ) && '_default' !== $aField[ 'section_id' ] |
|
495 | + ? $aField[ 'section_id' ] |
|
496 | 496 | : '', |
497 | 497 | ) |
498 | 498 | ); |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | 'input', |
513 | 513 | array( |
514 | 514 | 'type' => 'hidden', |
515 | - 'name' => "__submit[{$aField['input_id']}][{$sKey}]", |
|
515 | + 'name' => "__submit[{$aField[ 'input_id' ]}][{$sKey}]", |
|
516 | 516 | 'value' => $aField[ $sKey ], |
517 | 517 | ) |
518 | 518 | ) |
@@ -527,15 +527,15 @@ discard block |
||
527 | 527 | * @return string the HTML input tag output for the 'reset' argument. |
528 | 528 | */ |
529 | 529 | private function _getHiddenInput_Reset( array $aField ) { |
530 | - if ( ! $aField[ 'reset' ] ) { |
|
530 | + if ( !$aField[ 'reset' ] ) { |
|
531 | 531 | return ''; |
532 | 532 | } |
533 | - return ! $this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'reset' ) |
|
533 | + return !$this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'reset' ) |
|
534 | 534 | ? $this->getHTMLTag( |
535 | 535 | 'input', |
536 | 536 | array( |
537 | 537 | 'type' => 'hidden', |
538 | - 'name' => "__submit[{$aField['input_id']}][is_reset]", |
|
538 | + 'name' => "__submit[{$aField[ 'input_id' ]}][is_reset]", |
|
539 | 539 | 'value' => '1', |
540 | 540 | ) |
541 | 541 | ) |
@@ -564,10 +564,10 @@ discard block |
||
564 | 564 | return ''; |
565 | 565 | } |
566 | 566 | $this->setTransient( |
567 | - 'apf_em_' . md5( $aField[ '_input_name_flat' ] . get_current_user_id() ), |
|
567 | + 'apf_em_'.md5( $aField[ '_input_name_flat' ].get_current_user_id() ), |
|
568 | 568 | $aField[ 'email' ] |
569 | 569 | ); |
570 | - return ! $this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'email' ) |
|
570 | + return !$this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'email' ) |
|
571 | 571 | ? $this->getHTMLTag( |
572 | 572 | 'input', |
573 | 573 | array( |
@@ -595,19 +595,19 @@ discard block |
||
595 | 595 | * @return boolean |
596 | 596 | * @internal |
597 | 597 | */ |
598 | - private function _checkConfirmationDisplayed( $aField, $sFlatFieldName, $sType='reset' ) { |
|
598 | + private function _checkConfirmationDisplayed( $aField, $sFlatFieldName, $sType = 'reset' ) { |
|
599 | 599 | |
600 | - switch( $sType ) { |
|
600 | + switch ( $sType ) { |
|
601 | 601 | default: |
602 | 602 | case 'reset': // admin page framework _ reset confirmation |
603 | - $_sTransientKey = 'apf_rc_' . md5( $sFlatFieldName . get_current_user_id() ); |
|
603 | + $_sTransientKey = 'apf_rc_'.md5( $sFlatFieldName.get_current_user_id() ); |
|
604 | 604 | break; |
605 | 605 | case 'email': // admin page framework _ email confirmation |
606 | - $_sTransientKey = 'apf_ec_' . md5( $sFlatFieldName . get_current_user_id() ); |
|
606 | + $_sTransientKey = 'apf_ec_'.md5( $sFlatFieldName.get_current_user_id() ); |
|
607 | 607 | break; |
608 | 608 | } |
609 | 609 | |
610 | - $_bConfirmed = false === $this->getTransient( $_sTransientKey ) && ! $aField[ 'skip_confirmation' ] |
|
610 | + $_bConfirmed = false === $this->getTransient( $_sTransientKey ) && !$aField[ 'skip_confirmation' ] |
|
611 | 611 | ? false |
612 | 612 | : true; |
613 | 613 |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | * @return array The label container attribute array. |
389 | 389 | * @internal |
390 | 390 | */ |
391 | - private function _getLabelContainerAttributes( array $aField ) { |
|
391 | + private function _getLabelContainerAttributes( array $aField ) { |
|
392 | 392 | return array( |
393 | 393 | 'style' => $aField[ 'label_min_width' ] || '0' === ( string ) $aField[ 'label_min_width' ] |
394 | 394 | ? "min-width:" . $this->getLengthSanitized( $aField[ 'label_min_width' ] ) . ";" |
@@ -636,19 +636,19 @@ discard block |
||
636 | 636 | * @internal |
637 | 637 | * @param array $aField |
638 | 638 | */ |
639 | - protected function _getInputFieldValueFromLabel( $aField ) { |
|
639 | + protected function _getInputFieldValueFromLabel( $aField ) { |
|
640 | 640 | |
641 | 641 | // If the value key is explicitly set, use it. But the empty string will be ignored. |
642 | - if ( isset( $aField[ 'value' ] ) && $aField[ 'value' ] != '' ) { |
|
642 | + if ( isset( $aField[ 'value' ] ) && $aField[ 'value' ] != '' ) { |
|
643 | 643 | return $aField[ 'value' ]; |
644 | 644 | } |
645 | 645 | |
646 | - if ( isset( $aField[ 'label' ] ) ) { |
|
646 | + if ( isset( $aField[ 'label' ] ) ) { |
|
647 | 647 | return $aField[ 'label' ]; |
648 | 648 | } |
649 | 649 | |
650 | 650 | // If the default value is set, |
651 | - if ( isset( $aField[ 'default' ] ) ) { |
|
651 | + if ( isset( $aField[ 'default' ] ) ) { |
|
652 | 652 | return $aField[ 'default' ]; |
653 | 653 | } |
654 | 654 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | /** |
41 | 41 | * Defines the field type slugs used for this field type. |
42 | 42 | */ |
43 | - public $aFieldTypeSlugs = array( 'import', ); |
|
43 | + public $aFieldTypeSlugs = array( 'import',); |
|
44 | 44 | |
45 | 45 | /** |
46 | 46 | * Defines the default key-values of this field type. |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * @return string |
135 | 135 | */ |
136 | 136 | protected function getField( $aField ) { |
137 | - $aField[ 'attributes'][ 'name' ] = "__import[submit][{$aField[ 'input_id' ]}]"; |
|
137 | + $aField[ 'attributes' ][ 'name' ] = "__import[submit][{$aField[ 'input_id' ]}]"; |
|
138 | 138 | $aField[ 'label' ] = $aField[ 'label' ] |
139 | 139 | ? $aField[ 'label' ] |
140 | 140 | : $this->oMsg->get( 'import' ); |
@@ -153,13 +153,13 @@ discard block |
||
153 | 153 | */ |
154 | 154 | protected function _getExtraFieldsBeforeLabel( &$aField ) { |
155 | 155 | return "<label>" |
156 | - . "<input " . $this->getAttributes( |
|
156 | + . "<input ".$this->getAttributes( |
|
157 | 157 | array( |
158 | 158 | 'id' => "{$aField[ 'input_id' ]}_file", |
159 | 159 | 'type' => 'file', |
160 | 160 | 'name' => "__import[{$aField[ 'input_id' ]}]", |
161 | 161 | ) + $aField[ 'attributes' ][ 'file' ] |
162 | - ) . " />" |
|
162 | + )." />" |
|
163 | 163 | . "</label>"; |
164 | 164 | } |
165 | 165 | |
@@ -172,44 +172,44 @@ discard block |
||
172 | 172 | */ |
173 | 173 | protected function _getExtraInputFields( &$aField ) { |
174 | 174 | |
175 | - $aHiddenAttributes = array( 'type' => 'hidden', ); |
|
175 | + $aHiddenAttributes = array( 'type' => 'hidden',); |
|
176 | 176 | return |
177 | - "<input " . $this->getAttributes( |
|
177 | + "<input ".$this->getAttributes( |
|
178 | 178 | array( |
179 | - 'name' => "__import[{$aField['input_id']}][input_id]", |
|
180 | - 'value' => $aField['input_id'], |
|
179 | + 'name' => "__import[{$aField[ 'input_id' ]}][input_id]", |
|
180 | + 'value' => $aField[ 'input_id' ], |
|
181 | 181 | ) + $aHiddenAttributes |
182 | - ) . "/>" |
|
183 | - . "<input " . $this->getAttributes( |
|
182 | + )."/>" |
|
183 | + . "<input ".$this->getAttributes( |
|
184 | 184 | array( |
185 | - 'name' => "__import[{$aField['input_id']}][field_id]", |
|
186 | - 'value' => $aField['field_id'], |
|
185 | + 'name' => "__import[{$aField[ 'input_id' ]}][field_id]", |
|
186 | + 'value' => $aField[ 'field_id' ], |
|
187 | 187 | ) + $aHiddenAttributes |
188 | - ) . "/>" |
|
189 | - . "<input " . $this->getAttributes( |
|
188 | + )."/>" |
|
189 | + . "<input ".$this->getAttributes( |
|
190 | 190 | array( |
191 | - 'name' => "__import[{$aField['input_id']}][section_id]", |
|
192 | - 'value' => isset( $aField['section_id'] ) && $aField['section_id'] != '_default' ? $aField['section_id'] : '', |
|
191 | + 'name' => "__import[{$aField[ 'input_id' ]}][section_id]", |
|
192 | + 'value' => isset( $aField[ 'section_id' ] ) && $aField[ 'section_id' ] != '_default' ? $aField[ 'section_id' ] : '', |
|
193 | 193 | ) + $aHiddenAttributes |
194 | - ) . "/>" |
|
195 | - . "<input " . $this->getAttributes( |
|
194 | + )."/>" |
|
195 | + . "<input ".$this->getAttributes( |
|
196 | 196 | array( |
197 | - 'name' => "__import[{$aField['input_id']}][is_merge]", |
|
198 | - 'value' => $aField['is_merge'], |
|
197 | + 'name' => "__import[{$aField[ 'input_id' ]}][is_merge]", |
|
198 | + 'value' => $aField[ 'is_merge' ], |
|
199 | 199 | ) + $aHiddenAttributes |
200 | - ) . "/>" |
|
201 | - . "<input " . $this->getAttributes( |
|
200 | + )."/>" |
|
201 | + . "<input ".$this->getAttributes( |
|
202 | 202 | array( |
203 | - 'name' => "__import[{$aField['input_id']}][option_key]", |
|
204 | - 'value' => $aField['option_key'], |
|
203 | + 'name' => "__import[{$aField[ 'input_id' ]}][option_key]", |
|
204 | + 'value' => $aField[ 'option_key' ], |
|
205 | 205 | ) + $aHiddenAttributes |
206 | - ) . "/>" |
|
207 | - . "<input " . $this->getAttributes( |
|
206 | + )."/>" |
|
207 | + . "<input ".$this->getAttributes( |
|
208 | 208 | array( |
209 | - 'name' => "__import[{$aField['input_id']}][format]", |
|
210 | - 'value' => $aField['format'], |
|
209 | + 'name' => "__import[{$aField[ 'input_id' ]}][format]", |
|
210 | + 'value' => $aField[ 'format' ], |
|
211 | 211 | ) + $aHiddenAttributes |
212 | - ) . "/>" |
|
212 | + )."/>" |
|
213 | 213 | ; |
214 | 214 | } |
215 | 215 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function get() { |
43 | 43 | |
44 | - foreach( $this->_getFormattedDimensionalKeys( $this->aFieldAddresses ) as $_sFlatFieldAddress ) { |
|
44 | + foreach ( $this->_getFormattedDimensionalKeys( $this->aFieldAddresses ) as $_sFlatFieldAddress ) { |
|
45 | 45 | |
46 | 46 | $_aDimensionalKeys = explode( '|', $_sFlatFieldAddress ); |
47 | 47 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | // If the retrieved value does not exist, null will be given. |
54 | 54 | // This occurs with page meta boxes. |
55 | - if ( ! is_array( $_aDynamicElements ) ) { |
|
55 | + if ( !is_array( $_aDynamicElements ) ) { |
|
56 | 56 | continue; |
57 | 57 | } |
58 | 58 |