@@ -80,7 +80,7 @@ |
||
80 | 80 | return $_aNestedSections; |
81 | 81 | |
82 | 82 | } |
83 | - private function getFAQContents() { |
|
83 | + private function getFAQContents() { |
|
84 | 84 | |
85 | 85 | $_aReplacements = array( |
86 | 86 | '%PLUGIN_DIR_URL%' => AdminPageFrameworkLoader_Registry::getPluginURL(), |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function replyToLoadTab( $oAdminPage ) { |
23 | 23 | |
24 | - $_aSections = $this->getContentsByHeader( $this->getFAQContents(), 4 ); |
|
25 | - foreach( $_aSections as $_iIndex => $_aContent ) { |
|
24 | + $_aSections = $this->getContentsByHeader( $this->getFAQContents(), 4 ); |
|
25 | + foreach ( $_aSections as $_iIndex => $_aContent ) { |
|
26 | 26 | |
27 | 27 | $_sTitle = $_aContent[ 0 ]; |
28 | 28 | $_sContent = $this->_getFAQSubSections( $_aContent[ 1 ] ); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $oAdminPage->addSettingSections( |
33 | 33 | $this->sPageSlug, // the target page slug |
34 | 34 | array( |
35 | - 'section_id' => 'faq_sections_' . $_iIndex, |
|
35 | + 'section_id' => 'faq_sections_'.$_iIndex, |
|
36 | 36 | 'tab_slug' => $this->sTabSlug, |
37 | 37 | 'section_tab_slug' => 'apf_faq', |
38 | 38 | 'title' => $_sTitle, |
@@ -54,17 +54,17 @@ discard block |
||
54 | 54 | |
55 | 55 | $_aNestedSections = array(); |
56 | 56 | $_iLastIndex = count( $aItems ) - 1; |
57 | - foreach( $aItems as $_iIndex => $_aContent ) { |
|
57 | + foreach ( $aItems as $_iIndex => $_aContent ) { |
|
58 | 58 | |
59 | - $_oParser = new AdminPageFramework_WPReadmeParser( $_aContent[ 1 ] ); |
|
59 | + $_oParser = new AdminPageFramework_WPReadmeParser( $_aContent[ 1 ] ); |
|
60 | 60 | |
61 | 61 | // If no sections, return the contents of the first item. |
62 | - if ( ! $_aContent[ 0 ] ) { |
|
62 | + if ( !$_aContent[ 0 ] ) { |
|
63 | 63 | return $_oParser->get(); |
64 | 64 | } |
65 | 65 | |
66 | - $_aNestedSections[] = array( |
|
67 | - 'section_id' => 'faq_item_' . $_iIndex, |
|
66 | + $_aNestedSections[ ] = array( |
|
67 | + 'section_id' => 'faq_item_'.$_iIndex, |
|
68 | 68 | 'title' => $_aContent[ 0 ], |
69 | 69 | 'collapsible' => array( |
70 | 70 | 'toggle_all_button' => $_iLastIndex === $_iIndex |
@@ -80,14 +80,14 @@ discard block |
||
80 | 80 | return $_aNestedSections; |
81 | 81 | |
82 | 82 | } |
83 | - private function getFAQContents() { |
|
83 | + private function getFAQContents() { |
|
84 | 84 | |
85 | - $_aReplacements = array( |
|
85 | + $_aReplacements = array( |
|
86 | 86 | '%PLUGIN_DIR_URL%' => AdminPageFrameworkLoader_Registry::getPluginURL(), |
87 | 87 | '%WP_ADMIN_URL%' => admin_url(), |
88 | 88 | ); |
89 | 89 | $_oWPReadmeParser = new AdminPageFramework_WPReadmeParser( |
90 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/readme.txt', |
|
90 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/readme.txt', |
|
91 | 91 | $_aReplacements |
92 | 92 | ); |
93 | 93 | return $_oWPReadmeParser->getRawSection( 'Frequently asked questions' ); |
@@ -163,7 +163,7 @@ |
||
163 | 163 | */ |
164 | 164 | public function validate( $aInput, $aOldInput, $oFactory, $aSubmit ) { |
165 | 165 | |
166 | - // Local variables |
|
166 | + // Local variables |
|
167 | 167 | $_bIsValid = true; |
168 | 168 | $_aErrors = array(); |
169 | 169 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | 'title' => __( 'Your Name', 'admin-page-framework-loader' ), |
30 | 30 | 'type' => 'text', |
31 | 31 | 'default' => $_oCurrentUser->user_lastname || $_oCurrentUser->user_firstname |
32 | - ? $_oCurrentUser->user_lastname . ' ' . $_oCurrentUser->user_lastname |
|
32 | + ? $_oCurrentUser->user_lastname.' '.$_oCurrentUser->user_lastname |
|
33 | 33 | : '', |
34 | 34 | 'attributes' => array( |
35 | 35 | 'required' => 'required', |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | array( |
113 | 113 | 'field_id' => 'allow_sending_system_information', |
114 | 114 | 'title' => __( 'Confirmation', 'admin-page-framework-loader' ) |
115 | - . ' (' . __( 'required', 'admin-page-framework-loader' ) . ')', |
|
115 | + . ' ('.__( 'required', 'admin-page-framework-loader' ).')', |
|
116 | 116 | 'type' => 'checkbox', |
117 | 117 | 'label' => __( 'I understand that the system information including a PHP version and WordPress version etc. will be sent along with the messages to help developer trouble-shoot the problem.', 'admin-page-framework-loader' ), |
118 | 118 | 'attributes' => array( |
@@ -167,12 +167,12 @@ discard block |
||
167 | 167 | $_bIsValid = true; |
168 | 168 | $_aErrors = array(); |
169 | 169 | |
170 | - if ( ! $aInput[ 'allow_sending_system_information' ] ) { |
|
170 | + if ( !$aInput[ 'allow_sending_system_information' ] ) { |
|
171 | 171 | $_bIsValid = false; |
172 | 172 | $_aErrors[ 'allow_sending_system_information' ] = __( 'We need necessary information to help you.', 'admin-page-framework-loader' ); |
173 | 173 | } |
174 | 174 | |
175 | - if ( ! $_bIsValid ) { |
|
175 | + if ( !$_bIsValid ) { |
|
176 | 176 | |
177 | 177 | $oFactory->setFieldErrors( $_aErrors ); |
178 | 178 | $oFactory->setSettingNotice( __( 'Please help us to help you.', 'admin-page-framework-loader' ) ); |
@@ -9,12 +9,12 @@ |
||
9 | 9 | * @since 3.5.0 |
10 | 10 | */ |
11 | 11 | |
12 | - /** |
|
13 | - * |
|
14 | - * |
|
15 | - * @action do admin_page_framework_loader_action_before_loading_demo |
|
16 | - * @action do admin_page_framework_loader_action_after_loading_demo |
|
17 | - */ |
|
12 | + /** |
|
13 | + * |
|
14 | + * |
|
15 | + * @action do admin_page_framework_loader_action_before_loading_demo |
|
16 | + * @action do admin_page_framework_loader_action_after_loading_demo |
|
17 | + */ |
|
18 | 18 | class AdminPageFrameworkLoader_Demo { |
19 | 19 | |
20 | 20 | public function __construct() { |
@@ -19,14 +19,14 @@ discard block |
||
19 | 19 | |
20 | 20 | public function __construct() { |
21 | 21 | |
22 | - if ( ! $this->_shouldLoadDemo() ) { |
|
22 | + if ( !$this->_shouldLoadDemo() ) { |
|
23 | 23 | return; |
24 | 24 | } |
25 | 25 | |
26 | 26 | do_action( 'admin_page_framework_loader_action_before_loading_demo' ); |
27 | 27 | |
28 | 28 | // Include example components. |
29 | - include( AdminPageFrameworkLoader_Registry::$sDirPath . '/example/admin-page-framework-demo-bootstrap.php' ); |
|
29 | + include( AdminPageFrameworkLoader_Registry::$sDirPath.'/example/admin-page-framework-demo-bootstrap.php' ); |
|
30 | 30 | |
31 | 31 | do_action( 'admin_page_framework_loader_action_after_loading_demo' ); |
32 | 32 | |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | |
44 | 44 | // Check if the demo is enabled. |
45 | 45 | $_oOption = AdminPageFrameworkLoader_Option::getInstance(); |
46 | - if ( ! $_oOption->get( 'enable_admin_pages' ) ) { |
|
46 | + if ( !$_oOption->get( 'enable_admin_pages' ) ) { |
|
47 | 47 | return false; |
48 | 48 | } |
49 | - if ( ! $_oOption->get( 'enable_demo' ) ) { |
|
49 | + if ( !$_oOption->get( 'enable_demo' ) ) { |
|
50 | 50 | $this->_setPointerToolTips(); |
51 | 51 | return false; |
52 | 52 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | 'options' => array( |
75 | 75 | 'content' => sprintf( '<h3> %1$s </h3> <p> %2$s </p>', |
76 | 76 | AdminPageFrameworkLoader_Registry::NAME, |
77 | - __( 'Check out the functionality of Admin Page Framework by enabling the demo.','admin-page-framework-loader' ) |
|
77 | + __( 'Check out the functionality of Admin Page Framework by enabling the demo.', 'admin-page-framework-loader' ) |
|
78 | 78 | ), |
79 | 79 | 'position' => array( 'edge' => 'left', 'align' => 'middle' ) |
80 | 80 | ) |
@@ -232,6 +232,8 @@ discard block |
||
232 | 232 | * @remark The meta box class may be instantiated multiple times so prevent echoing the same styles multiple times. |
233 | 233 | * @parameter string $sIDPrefix The id selector embedded in the script tag. |
234 | 234 | * @parameter string $sClassName The class name that identify the call group. This is important for the meta-box class because it can be instantiated multiple times in one particular page. |
235 | + * @param string $sIDPrefix |
|
236 | + * @param string $sClassName |
|
235 | 237 | */ |
236 | 238 | protected function _printCommonStyles( $sIDPrefix, $sClassName ) { |
237 | 239 | |
@@ -315,6 +317,8 @@ discard block |
||
315 | 317 | * @remark The meta box class may be instantiated multiple times so prevent echoing the same styles multiple times. |
316 | 318 | * @parametr string $sIDPrefix The id selector embedded in the script tag. |
317 | 319 | * @parametr string $sClassName The class name that identify the call group. This is important for the meta-box class because it can be instantiated multiple times in one particular page. |
320 | + * @param string $sIDPrefix |
|
321 | + * @param string $sClassName |
|
318 | 322 | */ |
319 | 323 | protected function _printCommonScripts( $sIDPrefix, $sClassName ) { |
320 | 324 |
@@ -162,7 +162,7 @@ |
||
162 | 162 | /* |
163 | 163 | * Shared methods |
164 | 164 | */ |
165 | - /** |
|
165 | + /** |
|
166 | 166 | * Checks the src url of the enqueued script/style to determine whether or not to set up a attribute modification callback. |
167 | 167 | * |
168 | 168 | * If it is one of the framework added item, the method sets up a hook to modify the url to add custom attributes. |
@@ -36,19 +36,19 @@ discard block |
||
36 | 36 | |
37 | 37 | /* The system internal keys. */ |
38 | 38 | 'sSRC' => null, |
39 | - 'aPostTypes' => array(), // for meta box class |
|
39 | + 'aPostTypes' => array(), // for meta box class |
|
40 | 40 | 'sPageSlug' => null, |
41 | 41 | 'sTabSlug' => null, |
42 | - 'sType' => null, // script or style |
|
42 | + 'sType' => null, // script or style |
|
43 | 43 | |
44 | 44 | /* The below keys are for users. */ |
45 | 45 | 'handle_id' => null, |
46 | 46 | 'dependencies' => array(), |
47 | - 'version' => false, // although the type should be string, the wp_enqueue_...() functions want false as the default value. |
|
48 | - 'translation' => array(), // only for scripts |
|
49 | - 'in_footer' => false, // only for scripts |
|
50 | - 'media' => 'all', // only for styles |
|
51 | - 'attributes' => array(), // 3.3.0+ - the attribute array |
|
47 | + 'version' => false, // although the type should be string, the wp_enqueue_...() functions want false as the default value. |
|
48 | + 'translation' => array(), // only for scripts |
|
49 | + 'in_footer' => false, // only for scripts |
|
50 | + 'media' => 'all', // only for styles |
|
51 | + 'attributes' => array(), // 3.3.0+ - the attribute array |
|
52 | 52 | |
53 | 53 | ); |
54 | 54 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * @remark This value should be overridden in an extended class. |
60 | 60 | * @internal |
61 | 61 | */ |
62 | - protected $_sClassSelector_Style = 'admin-page-framework-style'; |
|
62 | + protected $_sClassSelector_Style = 'admin-page-framework-style'; |
|
63 | 63 | |
64 | 64 | /** |
65 | 65 | * Stores the class selector used to the class-specific script. |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @remark This value should be overridden in an extended class. |
69 | 69 | * @internal |
70 | 70 | */ |
71 | - protected $_sClassSelector_Script = 'admin-page-framework-script'; |
|
71 | + protected $_sClassSelector_Script = 'admin-page-framework-script'; |
|
72 | 72 | |
73 | 73 | /** |
74 | 74 | * Stores hand IDs by resource url to look up handle id and add custom arguments. |
@@ -143,8 +143,8 @@ discard block |
||
143 | 143 | * @internal |
144 | 144 | */ |
145 | 145 | |
146 | - public function _forceToEnqueueStyle( $sSRC, $aCustomArgs=array() ) {} |
|
147 | - public function _forceToEnqueueScript( $sSRC, $aCustomArgs=array() ) {} |
|
146 | + public function _forceToEnqueueStyle( $sSRC, $aCustomArgs = array() ) {} |
|
147 | + public function _forceToEnqueueScript( $sSRC, $aCustomArgs = array() ) {} |
|
148 | 148 | |
149 | 149 | /** |
150 | 150 | * A helper function for the _replyToEnqueueScripts() and the `_replyToEnqueueStyle()` methods. |
@@ -204,8 +204,8 @@ discard block |
||
204 | 204 | return $sSanitizedURL; |
205 | 205 | } |
206 | 206 | |
207 | - $_sAttributes = $this->getAttributes( $_aAttributes ); |
|
208 | - return $sSanitizedURL . "' " . rtrim( $_sAttributes, "'\"" ); |
|
207 | + $_sAttributes = $this->getAttributes( $_aAttributes ); |
|
208 | + return $sSanitizedURL."' ".rtrim( $_sAttributes, "'\"" ); |
|
209 | 209 | |
210 | 210 | } |
211 | 211 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | */ |
226 | 226 | protected function _printCommonStyles( $sIDPrefix, $sClassName ) { |
227 | 227 | |
228 | - if ( $this->hasBeenCalled( 'COMMON_STYLES: ' . get_class( $this ) . '::' . __METHOD__ ) ) { |
|
228 | + if ( $this->hasBeenCalled( 'COMMON_STYLES: '.get_class( $this ).'::'.__METHOD__ ) ) { |
|
229 | 229 | return; |
230 | 230 | } |
231 | 231 | $_oCaller = $this->oProp->oCaller; |
@@ -241,10 +241,10 @@ discard block |
||
241 | 241 | */ |
242 | 242 | private function ___getCommonStyleTag( $oCaller, $sIDPrefix ) { |
243 | 243 | |
244 | - $_sStyle = $this->addAndApplyFilters( |
|
244 | + $_sStyle = $this->addAndApplyFilters( |
|
245 | 245 | $oCaller, |
246 | 246 | array( |
247 | - "style_common_admin_page_framework", // 3.2.1+ |
|
247 | + "style_common_admin_page_framework", // 3.2.1+ |
|
248 | 248 | "style_common_{$this->oProp->sClassName}", |
249 | 249 | ), |
250 | 250 | AdminPageFramework_CSS::getDefaultCSS() |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | $_sStyle = $this->isDebugMode() ? $_sStyle : $this->getCSSMinified( $_sStyle ); |
253 | 253 | $_sStyle = trim( $_sStyle ); |
254 | 254 | if ( $_sStyle ) { |
255 | - echo "<style type='text/css' id='" . esc_attr( strtolower( $sIDPrefix ) ) . "'>" |
|
255 | + echo "<style type='text/css' id='".esc_attr( strtolower( $sIDPrefix ) )."'>" |
|
256 | 256 | . $_sStyle |
257 | 257 | . "</style>"; |
258 | 258 | } |
@@ -267,10 +267,10 @@ discard block |
||
267 | 267 | */ |
268 | 268 | private function ___getCommonIEStyleTag( $oCaller, $sIDPrefix ) { |
269 | 269 | |
270 | - $_sStyleIE = $this->addAndApplyFilters( |
|
270 | + $_sStyleIE = $this->addAndApplyFilters( |
|
271 | 271 | $oCaller, |
272 | 272 | array( |
273 | - "style_ie_common_admin_page_framework", // 3.2.1+ |
|
273 | + "style_ie_common_admin_page_framework", // 3.2.1+ |
|
274 | 274 | "style_ie_common_{$this->oProp->sClassName}", |
275 | 275 | ), |
276 | 276 | AdminPageFramework_CSS::getDefaultCSSIE() |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | $_sStyleIE = $this->isDebugMode() ? $_sStyleIE : $this->getCSSMinified( $_sStyleIE ); |
279 | 279 | $_sStyleIE = trim( $_sStyleIE ); |
280 | 280 | return $_sStyleIE |
281 | - ? "<!--[if IE]><style type='text/css' id='" . esc_attr( strtolower( $sIDPrefix . "-ie" ) ) . "'>" |
|
281 | + ? "<!--[if IE]><style type='text/css' id='".esc_attr( strtolower( $sIDPrefix."-ie" ) )."'>" |
|
282 | 282 | . $_sStyleIE |
283 | 283 | . "</style><![endif]-->" |
284 | 284 | : ''; |
@@ -297,23 +297,23 @@ discard block |
||
297 | 297 | */ |
298 | 298 | protected function _printCommonScripts( $sIDPrefix, $sClassName ) { |
299 | 299 | |
300 | - if ( $this->hasBeenCalled( 'COMMON_SCRIPT: ' . get_class( $this ) . '::' . __METHOD__ ) ) { |
|
300 | + if ( $this->hasBeenCalled( 'COMMON_SCRIPT: '.get_class( $this ).'::'.__METHOD__ ) ) { |
|
301 | 301 | return; |
302 | 302 | } |
303 | 303 | |
304 | 304 | $_sScript = $this->addAndApplyFilters( |
305 | 305 | $this->oProp->oCaller, |
306 | 306 | array( |
307 | - "script_common_admin_page_framework", // 3.2.1+ |
|
307 | + "script_common_admin_page_framework", // 3.2.1+ |
|
308 | 308 | "script_common_{$this->oProp->sClassName}", |
309 | 309 | ), |
310 | 310 | AdminPageFramework_Property_Base::$_sDefaultScript |
311 | 311 | ); |
312 | 312 | $_sScript = trim( $_sScript ); |
313 | - if ( ! $_sScript ) { |
|
313 | + if ( !$_sScript ) { |
|
314 | 314 | return; |
315 | 315 | } |
316 | - echo "<script type='text/javascript' id='" . esc_attr( strtolower( $sIDPrefix ) ) . "'>" |
|
316 | + echo "<script type='text/javascript' id='".esc_attr( strtolower( $sIDPrefix ) )."'>" |
|
317 | 317 | . '/* <![CDATA[ */' |
318 | 318 | . $_sScript |
319 | 319 | . '/* ]]> */' |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | */ |
332 | 332 | protected function _printClassSpecificStyles( $sIDPrefix ) { |
333 | 333 | |
334 | - $_oCaller = $this->oProp->oCaller; |
|
334 | + $_oCaller = $this->oProp->oCaller; |
|
335 | 335 | echo $this->_getClassSpecificStyleTag( $_oCaller, $sIDPrefix ); |
336 | 336 | echo $this->_getClassSpecificIEStyleTag( $_oCaller, $sIDPrefix ); |
337 | 337 | |
@@ -352,18 +352,18 @@ discard block |
||
352 | 352 | static $_iCallCount = 0; |
353 | 353 | |
354 | 354 | $_sFilterName = "style_{$this->oProp->sClassName}"; |
355 | - if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { // 3.8.22 |
|
355 | + if ( $this->hasBeenCalled( 'FILTER: '.$_sFilterName ) ) { // 3.8.22 |
|
356 | 356 | return ''; |
357 | 357 | } |
358 | 358 | $_sStyle = $this->addAndApplyFilters( $_oCaller, $_sFilterName, $this->oProp->sStyle ); |
359 | 359 | $_sStyle = $this->isDebugMode() ? $_sStyle : $this->getCSSMinified( $_sStyle ); |
360 | 360 | $_sStyle = trim( $_sStyle ); |
361 | - if ( ! $_sStyle ) { |
|
361 | + if ( !$_sStyle ) { |
|
362 | 362 | return ''; |
363 | 363 | } |
364 | 364 | $_iCallCount++; |
365 | - $_sID = strtolower( "{$sIDPrefix}-" . $this->oProp->sClassName . "_{$_iCallCount}" ); |
|
366 | - return "<style type='text/css' id='" . esc_attr( $_sID ) . "'>" |
|
365 | + $_sID = strtolower( "{$sIDPrefix}-".$this->oProp->sClassName."_{$_iCallCount}" ); |
|
366 | + return "<style type='text/css' id='".esc_attr( $_sID )."'>" |
|
367 | 367 | . $_sStyle |
368 | 368 | . "</style>"; |
369 | 369 | |
@@ -379,18 +379,18 @@ discard block |
||
379 | 379 | static $_iCallCountIE = 1; |
380 | 380 | |
381 | 381 | $_sFilterName = "style_ie_{$this->oProp->sClassName}"; |
382 | - if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { // 3.8.22 |
|
382 | + if ( $this->hasBeenCalled( 'FILTER: '.$_sFilterName ) ) { // 3.8.22 |
|
383 | 383 | return ''; |
384 | 384 | } |
385 | 385 | $_sStyleIE = $this->addAndApplyFilters( $_oCaller, $_sFilterName, $this->oProp->sStyleIE ); |
386 | 386 | $_sStyleIE = $this->isDebugMode() ? $_sStyleIE : $this->getCSSMinified( $_sStyleIE ); |
387 | 387 | $_sStyleIE = trim( $_sStyleIE ); |
388 | - if ( ! $_sStyleIE ) { |
|
388 | + if ( !$_sStyleIE ) { |
|
389 | 389 | return ''; |
390 | 390 | } |
391 | 391 | $_iCallCountIE++; |
392 | - $_sID = strtolower( "{$sIDPrefix}-ie-{$this->oProp->sClassName}_{$_iCallCountIE}" ); |
|
393 | - return "<!--[if IE]><style type='text/css' id='" . esc_attr( $_sID ) . "'>" |
|
392 | + $_sID = strtolower( "{$sIDPrefix}-ie-{$this->oProp->sClassName}_{$_iCallCountIE}" ); |
|
393 | + return "<!--[if IE]><style type='text/css' id='".esc_attr( $_sID )."'>" |
|
394 | 394 | . $_sStyleIE |
395 | 395 | . "</style><![endif]-->"; |
396 | 396 | |
@@ -407,18 +407,18 @@ discard block |
||
407 | 407 | |
408 | 408 | static $_iCallCount = 1; |
409 | 409 | $_sFilterName = "script_{$this->oProp->sClassName}"; |
410 | - if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { // 3.8.22 |
|
410 | + if ( $this->hasBeenCalled( 'FILTER: '.$_sFilterName ) ) { // 3.8.22 |
|
411 | 411 | return ''; |
412 | 412 | } |
413 | 413 | $_sScript = $this->addAndApplyFilters( $this->oProp->oCaller, $_sFilterName, $this->oProp->sScript ); |
414 | 414 | $_sScript = trim( $_sScript ); |
415 | - if ( ! $_sScript ) { |
|
415 | + if ( !$_sScript ) { |
|
416 | 416 | return ''; |
417 | 417 | } |
418 | 418 | |
419 | 419 | $_iCallCount++; |
420 | 420 | $_sID = strtolower( "{$sIDPrefix}-{$this->oProp->sClassName}_{$_iCallCount}" ); |
421 | - echo "<script type='text/javascript' id='" . esc_attr( $_sID ) . "'>" |
|
421 | + echo "<script type='text/javascript' id='".esc_attr( $_sID )."'>" |
|
422 | 422 | . '/* <![CDATA[ */' |
423 | 423 | . $_sScript |
424 | 424 | . '/* ]]> */' |
@@ -442,12 +442,12 @@ discard block |
||
442 | 442 | public function _replyToAddStyle() { |
443 | 443 | |
444 | 444 | $_oCaller = $this->oProp->oCaller; |
445 | - if ( ! $_oCaller->isInThePage() ) { |
|
445 | + if ( !$_oCaller->isInThePage() ) { |
|
446 | 446 | return; |
447 | 447 | } |
448 | 448 | |
449 | 449 | $this->_printCommonStyles( 'admin-page-framework-style-common', get_class() ); |
450 | - $this->_printClassSpecificStyles( $this->_sClassSelector_Style . '-' . $this->oProp->sStructureType ); |
|
450 | + $this->_printClassSpecificStyles( $this->_sClassSelector_Style.'-'.$this->oProp->sStructureType ); |
|
451 | 451 | |
452 | 452 | } |
453 | 453 | /** |
@@ -462,12 +462,12 @@ discard block |
||
462 | 462 | public function _replyToAddScript() { |
463 | 463 | |
464 | 464 | $_oCaller = $this->oProp->oCaller; |
465 | - if ( ! $_oCaller->isInThePage() ) { |
|
465 | + if ( !$_oCaller->isInThePage() ) { |
|
466 | 466 | return; |
467 | 467 | } |
468 | 468 | |
469 | 469 | $this->_printCommonScripts( 'admin-page-framework-script-common', get_class() ); |
470 | - $this->_printClassSpecificScripts( $this->_sClassSelector_Script . '-' . $this->oProp->sStructureType ); |
|
470 | + $this->_printClassSpecificScripts( $this->_sClassSelector_Script.'-'.$this->oProp->sStructureType ); |
|
471 | 471 | |
472 | 472 | } |
473 | 473 | |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | * @internal |
520 | 520 | */ |
521 | 521 | public function _replyToEnqueueStyles() { |
522 | - foreach( $this->oProp->aEnqueuingStyles as $_sKey => $_aEnqueuingStyle ) { |
|
522 | + foreach ( $this->oProp->aEnqueuingStyles as $_sKey => $_aEnqueuingStyle ) { |
|
523 | 523 | $this->_enqueueSRCByCondition( $_aEnqueuingStyle ); |
524 | 524 | unset( $this->oProp->aEnqueuingStyles[ $_sKey ] ); |
525 | 525 | } |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | * @internal |
537 | 537 | */ |
538 | 538 | public function _replyToEnqueueScripts() { |
539 | - foreach( $this->oProp->aEnqueuingScripts as $_sKey => $_aEnqueuingScript ) { |
|
539 | + foreach ( $this->oProp->aEnqueuingScripts as $_sKey => $_aEnqueuingScript ) { |
|
540 | 540 | $this->_enqueueSRCByCondition( $_aEnqueuingScript ); |
541 | 541 | unset( $this->oProp->aEnqueuingScripts[ $_sKey ] ); |
542 | 542 | } |
@@ -352,7 +352,8 @@ discard block |
||
352 | 352 | static $_iCallCount = 0; |
353 | 353 | |
354 | 354 | $_sFilterName = "style_{$this->oProp->sClassName}"; |
355 | - if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { // 3.8.22 |
|
355 | + if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { |
|
356 | +// 3.8.22 |
|
356 | 357 | return ''; |
357 | 358 | } |
358 | 359 | $_sStyle = $this->addAndApplyFilters( $_oCaller, $_sFilterName, $this->oProp->sStyle ); |
@@ -379,7 +380,8 @@ discard block |
||
379 | 380 | static $_iCallCountIE = 1; |
380 | 381 | |
381 | 382 | $_sFilterName = "style_ie_{$this->oProp->sClassName}"; |
382 | - if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { // 3.8.22 |
|
383 | + if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { |
|
384 | +// 3.8.22 |
|
383 | 385 | return ''; |
384 | 386 | } |
385 | 387 | $_sStyleIE = $this->addAndApplyFilters( $_oCaller, $_sFilterName, $this->oProp->sStyleIE ); |
@@ -407,7 +409,8 @@ discard block |
||
407 | 409 | |
408 | 410 | static $_iCallCount = 1; |
409 | 411 | $_sFilterName = "script_{$this->oProp->sClassName}"; |
410 | - if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { // 3.8.22 |
|
412 | + if ( $this->hasBeenCalled( 'FILTER: ' . $_sFilterName ) ) { |
|
413 | +// 3.8.22 |
|
411 | 414 | return ''; |
412 | 415 | } |
413 | 416 | $_sScript = $this->addAndApplyFilters( $this->oProp->oCaller, $_sFilterName, $this->oProp->sScript ); |
@@ -109,7 +109,7 @@ |
||
109 | 109 | * Converts bytes to HR. |
110 | 110 | * |
111 | 111 | * @access private |
112 | - * @param mixed $bytes |
|
112 | + * @param mixed $nBytes |
|
113 | 113 | * @remark This is influenced by the work of Mike Jolley. |
114 | 114 | * @see http://mikejolley.com/projects/wp-page-load-stats/ |
115 | 115 | */ |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function __construct( $oProp, $oMsg ) { |
29 | 29 | |
30 | - if ( ! $this->_shouldProceed( $oProp ) ) { |
|
30 | + if ( !$this->_shouldProceed( $oProp ) ) { |
|
31 | 31 | return; |
32 | 32 | } |
33 | 33 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | private function _shouldProceed( $oProp ) { |
46 | 46 | |
47 | - if ( $oProp->bIsAdminAjax || ! $oProp->bIsAdmin ) { |
|
47 | + if ( $oProp->bIsAdminAjax || !$oProp->bIsAdmin ) { |
|
48 | 48 | return false; |
49 | 49 | } |
50 | 50 | return ( boolean ) $oProp->bShowDebugInfo; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | public function _replyToGetPageLoadInfo( $sFooterHTML ) { |
72 | 72 | |
73 | 73 | // 3.8.8+ The `bShowDebugInfo` property may be updated by the user during the page load. |
74 | - if ( ! $this->oProp->bShowDebugInfo ) { |
|
74 | + if ( !$this->oProp->bShowDebugInfo ) { |
|
75 | 75 | return $sFooterHTML; |
76 | 76 | } |
77 | 77 | |
@@ -99,10 +99,10 @@ discard block |
||
99 | 99 | $_sInitialMemoryUsage = round( $this->_convertBytesToHR( $this->_nInitialMemoryUsage ), 2 ); |
100 | 100 | return "<div id='admin-page-framework-page-load-stats'>" |
101 | 101 | . "<ul>" |
102 | - . "<li>" . sprintf( $this->oMsg->get( 'queries_in_seconds' ), $_nQueryCount, $_nSeconds ) . "</li>" |
|
103 | - . "<li>" . sprintf( $this->oMsg->get( 'out_of_x_memory_used' ), $_nMemoryUsage, $_nMemoryLimit, round( ( $_nMemoryUsage / $_nMemoryLimit ), 2 ) * 100 . '%' ) . "</li>" |
|
104 | - . "<li>" . sprintf( $this->oMsg->get( 'peak_memory_usage' ), $_nMemoryPeakUsage ) . "</li>" |
|
105 | - . "<li>" . sprintf( $this->oMsg->get( 'initial_memory_usage' ), $_sInitialMemoryUsage ) . "</li>" |
|
102 | + . "<li>".sprintf( $this->oMsg->get( 'queries_in_seconds' ), $_nQueryCount, $_nSeconds )."</li>" |
|
103 | + . "<li>".sprintf( $this->oMsg->get( 'out_of_x_memory_used' ), $_nMemoryUsage, $_nMemoryLimit, round( ( $_nMemoryUsage / $_nMemoryLimit ), 2 ) * 100.'%' )."</li>" |
|
104 | + . "<li>".sprintf( $this->oMsg->get( 'peak_memory_usage' ), $_nMemoryPeakUsage )."</li>" |
|
105 | + . "<li>".sprintf( $this->oMsg->get( 'initial_memory_usage' ), $_sInitialMemoryUsage )."</li>" |
|
106 | 106 | . "</ul>" |
107 | 107 | . "</div>"; |
108 | 108 | |
@@ -120,8 +120,8 @@ discard block |
||
120 | 120 | */ |
121 | 121 | private function _convertToNumber( $nSize ) { |
122 | 122 | |
123 | - $_nReturn = substr( $nSize, 0, -1 ); |
|
124 | - switch( strtoupper( substr( $nSize, -1 ) ) ) { |
|
123 | + $_nReturn = substr( $nSize, 0, -1 ); |
|
124 | + switch ( strtoupper( substr( $nSize, -1 ) ) ) { |
|
125 | 125 | case 'P': |
126 | 126 | $_nReturn *= 1024; |
127 | 127 | case 'T': |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $_nLog = log( $nBytes, 1024 ); |
151 | 151 | $_iPower = ( int ) $_nLog; |
152 | 152 | $_iSize = pow( 1024, $_nLog - $_iPower ); |
153 | - return $_iSize . $_aUnits[ $_iPower ]; |
|
153 | + return $_iSize.$_aUnits[ $_iPower ]; |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | } |
@@ -77,6 +77,8 @@ |
||
77 | 77 | } |
78 | 78 | /** |
79 | 79 | * @since 3.6.0 |
80 | + * @param boolean $abCollapsible |
|
81 | + * @param string $sTitle |
|
80 | 82 | * @return array |
81 | 83 | */ |
82 | 84 | private function _getArguments( $abCollapsible, $sTitle, array $aSection ) { |
@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | * @since 3.6.0 Moved from `AdminPageFramework_FormDefinition`. |
25 | 25 | */ |
26 | 26 | static public $aStructure = array( |
27 | - 'title' => null, // (string) the section title will be assigned by default in the section formatting method. |
|
28 | - 'is_collapsed' => true, // (boolean) whether it is already collapsed or expanded |
|
29 | - 'toggle_all_button' => null, // (boolean|string|array) the position of where to display the toggle-all button that toggles the folding state of all collapsible sections. Accepts the following values. 'top-right', 'top-left', 'bottom-right', 'bottom-left'. If true is passed, the default 'top-right' will be used. To not to display, do not set any or pass `false` or `null`. |
|
30 | - 'collapse_others_on_expand' => true, // (boolean) whether the other collapsible sections should be folded when the section is unfolded. |
|
31 | - 'container' => 'sections', // (string) the container element that collapsible styling gets applied to. Either 'sections' or 'section' is accepted. |
|
32 | - 'type' => 'box', // 3.7.0+ (string) supported types 'box', 'button' Default: `box`. The `button` type is only supported when the `container` argument is `section`. |
|
27 | + 'title' => null, // (string) the section title will be assigned by default in the section formatting method. |
|
28 | + 'is_collapsed' => true, // (boolean) whether it is already collapsed or expanded |
|
29 | + 'toggle_all_button' => null, // (boolean|string|array) the position of where to display the toggle-all button that toggles the folding state of all collapsible sections. Accepts the following values. 'top-right', 'top-left', 'bottom-right', 'bottom-left'. If true is passed, the default 'top-right' will be used. To not to display, do not set any or pass `false` or `null`. |
|
30 | + 'collapse_others_on_expand' => true, // (boolean) whether the other collapsible sections should be folded when the section is unfolded. |
|
31 | + 'container' => 'sections', // (string) the container element that collapsible styling gets applied to. Either 'sections' or 'section' is accepted. |
|
32 | + 'type' => 'box', // 3.7.0+ (string) supported types 'box', 'button' Default: `box`. The `button` type is only supported when the `container` argument is `section`. |
|
33 | 33 | ); |
34 | 34 | |
35 | 35 | public $abCollapsible = false; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * @remark The framework will not pass this parameter when formatting a section definition array. |
43 | 43 | * It will be passed when the framework is rendering a form table to generate collapsible elements. |
44 | 44 | */ |
45 | - public $aSection = array(); |
|
45 | + public $aSection = array(); |
|
46 | 46 | |
47 | 47 | /** |
48 | 48 | * Sets up properties. |
@@ -85,14 +85,14 @@ discard block |
||
85 | 85 | |
86 | 86 | $_aCollapsible = $this->getAsArray( $this->abCollapsible ) + array( |
87 | 87 | 'title' => $sTitle, |
88 | - ) + self::$aStructure; |
|
88 | + ) + self::$aStructure; |
|
89 | 89 | |
90 | 90 | $_aCollapsible[ 'toggle_all_button' ] = implode( |
91 | 91 | ',', |
92 | 92 | $this->getAsArray( $_aCollapsible[ 'toggle_all_button' ] ) |
93 | 93 | ); |
94 | 94 | |
95 | - if ( ! empty( $aSection ) ) { |
|
95 | + if ( !empty( $aSection ) ) { |
|
96 | 96 | $_aCollapsible[ 'toggle_all_button' ] = $this->_getToggleAllButtonArgument( |
97 | 97 | $_aCollapsible[ 'toggle_all_button' ], |
98 | 98 | $aSection |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | private function _getToggleAllButtonArgument( $sToggleAll, array $aSection ) { |
118 | 118 | |
119 | - if ( ! $aSection[ 'repeatable' ] ) { |
|
119 | + if ( !$aSection[ 'repeatable' ] ) { |
|
120 | 120 | return $sToggleAll; |
121 | 121 | } |
122 | 122 | |
@@ -126,13 +126,13 @@ discard block |
||
126 | 126 | } |
127 | 127 | |
128 | 128 | // Disable the toggle all button for middle sub-sections in repeatable sections. |
129 | - if ( ! $aSection[ '_is_first_index' ] && ! $aSection[ '_is_last_index' ] ) { |
|
129 | + if ( !$aSection[ '_is_first_index' ] && !$aSection[ '_is_last_index' ] ) { |
|
130 | 130 | return 0; |
131 | 131 | } |
132 | 132 | |
133 | 133 | $_aToggleAll = $this->getAOrB( |
134 | - true === $sToggleAll || 1 === $sToggleAll, // evaluate |
|
135 | - array( 'top-right', 'bottom-right' ), // if true |
|
134 | + true === $sToggleAll || 1 === $sToggleAll, // evaluate |
|
135 | + array( 'top-right', 'bottom-right' ), // if true |
|
136 | 136 | explode( ',', $sToggleAll ) // if false |
137 | 137 | ); |
138 | 138 | $_aToggleAll = $this->getAOrB( |
@@ -23,7 +23,6 @@ |
||
23 | 23 | * @internal |
24 | 24 | * @since 3.5.3 |
25 | 25 | * @since 3.6.0 Moved from `AdminPageFramework_FormDefinition`. |
26 | - * @param array $aFieldset a field definition array. |
|
27 | 26 | * @return boolean |
28 | 27 | */ |
29 | 28 | protected function _isSectionSet() { |
@@ -60,6 +60,7 @@ |
||
60 | 60 | /** |
61 | 61 | * Applies the subject string to the set callback filter function. |
62 | 62 | * @since 3.6.0 |
63 | + * @param string $sSubject |
|
63 | 64 | */ |
64 | 65 | protected function _getFiltered( $sSubject ) { |
65 | 66 | return is_callable( $this->hfCallback ) |
@@ -54,9 +54,9 @@ |
||
54 | 54 | $_sIndex = $this->getAOrB( |
55 | 55 | '0' !== $this->sIndex && empty( $this->sIndex ), |
56 | 56 | '', |
57 | - "[" . $this->sIndex . "]" |
|
57 | + "[".$this->sIndex."]" |
|
58 | 58 | ); |
59 | - return $this->_getFiltered( $this->_getFieldName() . $_sIndex ); |
|
59 | + return $this->_getFiltered( $this->_getFieldName().$_sIndex ); |
|
60 | 60 | |
61 | 61 | } |
62 | 62 |
@@ -105,10 +105,8 @@ |
||
105 | 105 | * If a parameter is not passed, it returns the entire attribute array. |
106 | 106 | * |
107 | 107 | * @since 3.5.3 |
108 | - * @return string|array|null The specified attribute value or the entire attribute array if not specified. |
|
108 | + * @return string The specified attribute value or the entire attribute array if not specified. |
|
109 | 109 | * If not set, null will be returned as the `getAttributes()` method will not list an attribute with the null value. |
110 | - * @param string $sName The attribute name. |
|
111 | - * @param string $sDefault The defaqult value if the value is not set. |
|
112 | 110 | */ |
113 | 111 | public function getAttribute( /* $sName=null, $sDefault=null */ ) { |
114 | 112 | $_aParams = func_get_args() + array( |
@@ -127,7 +127,7 @@ |
||
127 | 127 | * @return string The set class selector(s). |
128 | 128 | */ |
129 | 129 | public function addClass( /* $asSelectors1, $asSelectors2 */ ) { |
130 | - foreach( func_get_args() as $_asSelectors ) { |
|
130 | + foreach( func_get_args() as $_asSelectors ) { |
|
131 | 131 | $this->aAttributes['class'] = $this->getClassAttribute( |
132 | 132 | $this->aAttributes['class'], |
133 | 133 | $_asSelectors |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | * @param array $aAttributes The attribute array. A field definition array is deprecated. |
64 | 64 | * @param array $aOptions options that allows the user to set custom container tags and class selectors. |
65 | 65 | */ |
66 | - public function __construct( array $aAttributes, array $aOptions=array() ) { |
|
66 | + public function __construct( array $aAttributes, array $aOptions = array() ) { |
|
67 | 67 | |
68 | - $this->aAttributes = $this->getElementAsArray( |
|
68 | + $this->aAttributes = $this->getElementAsArray( |
|
69 | 69 | $aAttributes, |
70 | 70 | 'attributes', |
71 | 71 | $aAttributes // if the above key is not set, this will be set |
@@ -127,13 +127,13 @@ discard block |
||
127 | 127 | * @return string The set class selector(s). |
128 | 128 | */ |
129 | 129 | public function addClass( /* $asSelectors1, $asSelectors2 */ ) { |
130 | - foreach( func_get_args() as $_asSelectors ) { |
|
131 | - $this->aAttributes['class'] = $this->getClassAttribute( |
|
132 | - $this->aAttributes['class'], |
|
130 | + foreach ( func_get_args() as $_asSelectors ) { |
|
131 | + $this->aAttributes[ 'class' ] = $this->getClassAttribute( |
|
132 | + $this->aAttributes[ 'class' ], |
|
133 | 133 | $_asSelectors |
134 | 134 | ); |
135 | 135 | } |
136 | - return $this->aAttributes['class']; |
|
136 | + return $this->aAttributes[ 'class' ]; |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | // $this->aAttributes[ $_aParams[ 0 ] ] = $_aParams[ 1 ]; |
159 | 159 | $this->setMultiDimensionalArray( |
160 | 160 | $this->aAttributes, |
161 | - $this->getElementAsArray( $_aParams, 0 ), // $asAttributeName |
|
161 | + $this->getElementAsArray( $_aParams, 0 ), // $asAttributeName |
|
162 | 162 | $_aParams[ 1 ] // $mValue |
163 | 163 | ); |
164 | 164 | } |