@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | $_aItems = $this->getContentsByHeader( $this->getReadmeContents(), 3 ); |
25 | 25 | $_iLastIndex = count( $_aItems ) - 1; |
26 | - foreach( $_aItems as $_iIndex => $_aContent ) { |
|
26 | + foreach ( $_aItems as $_iIndex => $_aContent ) { |
|
27 | 27 | |
28 | 28 | $_oParser = new AdminPageFramework_WPReadmeParser; |
29 | 29 | $_oParser->setText( $_aContent[ 1 ] ); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $oAdminPage->addSettingSections( |
32 | 32 | $this->sPageSlug, // the target page slug |
33 | 33 | array( |
34 | - 'section_id' => 'examples_' . $_iIndex, |
|
34 | + 'section_id' => 'examples_'.$_iIndex, |
|
35 | 35 | 'title' => $_aContent[ 0 ], |
36 | 36 | 'collapsible' => array( |
37 | 37 | 'toggle_all_button' => $_iLastIndex === $_iIndex |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | /** |
53 | 53 | * @return string |
54 | 54 | */ |
55 | - private function getReadMeContents() { |
|
55 | + private function getReadMeContents() { |
|
56 | 56 | return $this->_getReadmeContents( |
57 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/text/examples.txt', |
|
57 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/text/examples.txt', |
|
58 | 58 | '', |
59 | 59 | array( 'Examples' ) |
60 | 60 | ); |
@@ -53,7 +53,7 @@ |
||
53 | 53 | /** |
54 | 54 | * @return string |
55 | 55 | */ |
56 | - private function getReadMeContents() { |
|
56 | + private function getReadMeContents() { |
|
57 | 57 | return $this->_getReadmeContents( |
58 | 58 | AdminPageFrameworkLoader_Registry::$sDirPath . '/readme.txt', // source path |
59 | 59 | '', // TOC title |
@@ -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' ); |
@@ -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(), |
@@ -25,14 +25,14 @@ discard block |
||
25 | 25 | |
26 | 26 | $_aItems = $this->getContentsByHeader( $this->getReadmeContents(), 4 ); |
27 | 27 | $_iLastIndex = count( $_aItems ) - 1; |
28 | - foreach( $_aItems as $_iIndex => $_aContent ) { |
|
28 | + foreach ( $_aItems as $_iIndex => $_aContent ) { |
|
29 | 29 | |
30 | 30 | $_oParser = new AdminPageFramework_WPReadmeParser( $_aContent[ 1 ] ); |
31 | 31 | $_sContent = $_oParser->get(); |
32 | 32 | $oAdminPage->addSettingSections( |
33 | 33 | $this->sPageSlug, // the target page slug |
34 | 34 | array( |
35 | - 'section_id' => 'tips_' . $_iIndex, |
|
35 | + 'section_id' => 'tips_'.$_iIndex, |
|
36 | 36 | 'title' => $_aContent[ 0 ], |
37 | 37 | 'collapsible' => array( |
38 | 38 | 'toggle_all_button' => $_iLastIndex === $_iIndex |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | /** |
54 | 54 | * @return string |
55 | 55 | */ |
56 | - private function getReadMeContents() { |
|
56 | + private function getReadMeContents() { |
|
57 | 57 | return $this->_getReadmeContents( |
58 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/readme.txt', // source path |
|
58 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/readme.txt', // source path |
|
59 | 59 | '', // TOC title |
60 | 60 | array( 'Other Notes' ) // sections |
61 | 61 | ); |
@@ -53,7 +53,7 @@ |
||
53 | 53 | /** |
54 | 54 | * @return string |
55 | 55 | */ |
56 | - private function getReadMeContents() { |
|
56 | + private function getReadMeContents() { |
|
57 | 57 | return $this->_getReadmeContents( |
58 | 58 | AdminPageFrameworkLoader_Registry::$sDirPath . '/readme.txt', // source path |
59 | 59 | '', // TOC title |
@@ -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 |
@@ -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. |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | * @internal |
143 | 143 | */ |
144 | 144 | |
145 | - public function _forceToEnqueueStyle( $sSRC, $aCustomArgs=array() ) {} |
|
146 | - public function _forceToEnqueueScript( $sSRC, $aCustomArgs=array() ) {} |
|
145 | + public function _forceToEnqueueStyle( $sSRC, $aCustomArgs = array() ) {} |
|
146 | + public function _forceToEnqueueScript( $sSRC, $aCustomArgs = array() ) {} |
|
147 | 147 | |
148 | 148 | /** |
149 | 149 | * A helper function for the _replyToEnqueueScripts() and the `_replyToEnqueueStyle()` methods. |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | } |
205 | 205 | |
206 | 206 | $_sAttributes = $this->getAttributes( $_aAttributes ); |
207 | - $_sModifiedURL = $sSanitizedURL . "' " . rtrim( $_sAttributes, "'\"" ); // '" |
|
207 | + $_sModifiedURL = $sSanitizedURL."' ".rtrim( $_sAttributes, "'\"" ); // '" |
|
208 | 208 | |
209 | 209 | return $_sModifiedURL; |
210 | 210 | |
@@ -252,10 +252,10 @@ discard block |
||
252 | 252 | */ |
253 | 253 | private function _getStyleTag( $oCaller, $sIDPrefix ) { |
254 | 254 | |
255 | - $_sStyle = $this->addAndApplyFilters( |
|
255 | + $_sStyle = $this->addAndApplyFilters( |
|
256 | 256 | $oCaller, |
257 | 257 | array( |
258 | - "style_common_admin_page_framework", // 3.2.1+ |
|
258 | + "style_common_admin_page_framework", // 3.2.1+ |
|
259 | 259 | "style_common_{$this->oProp->sClassName}", |
260 | 260 | ), |
261 | 261 | AdminPageFramework_CSS::getDefaultCSS() |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | // : $this->getCSSMinified( $_sStyle ); |
269 | 269 | |
270 | 270 | if ( $_sStyle ) { |
271 | - echo "<style type='text/css' id='" . esc_attr( $sIDPrefix ) . "'>" |
|
271 | + echo "<style type='text/css' id='".esc_attr( $sIDPrefix )."'>" |
|
272 | 272 | . $_sStyle |
273 | 273 | . "</style>"; |
274 | 274 | } |
@@ -282,10 +282,10 @@ discard block |
||
282 | 282 | */ |
283 | 283 | private function _getIEStyleTag( $oCaller, $sIDPrefix ) { |
284 | 284 | |
285 | - $_sStyleIE = $this->addAndApplyFilters( |
|
285 | + $_sStyleIE = $this->addAndApplyFilters( |
|
286 | 286 | $oCaller, |
287 | 287 | array( |
288 | - "style_ie_common_admin_page_framework", // 3.2.1+ |
|
288 | + "style_ie_common_admin_page_framework", // 3.2.1+ |
|
289 | 289 | "style_ie_common_{$this->oProp->sClassName}", |
290 | 290 | ), |
291 | 291 | AdminPageFramework_CSS::getDefaultCSSIE() |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | // ? trim( $_sStyleIE ) |
297 | 297 | // : $this->getCSSMinified( $_sStyleIE ); |
298 | 298 | return $_sStyleIE |
299 | - ? "<!--[if IE]><style type='text/css' id='" . esc_attr( $sIDPrefix . "-ie" ) . "'>" |
|
299 | + ? "<!--[if IE]><style type='text/css' id='".esc_attr( $sIDPrefix."-ie" )."'>" |
|
300 | 300 | . $_sStyleIE |
301 | 301 | . "</style><![endif]-->" |
302 | 302 | : ''; |
@@ -329,14 +329,14 @@ discard block |
||
329 | 329 | $_sScript = $this->addAndApplyFilters( |
330 | 330 | $this->oProp->oCaller, |
331 | 331 | array( |
332 | - "script_common_admin_page_framework", // 3.2.1+ |
|
332 | + "script_common_admin_page_framework", // 3.2.1+ |
|
333 | 333 | "script_common_{$this->oProp->sClassName}", |
334 | 334 | ), |
335 | 335 | AdminPageFramework_Property_Base::$_sDefaultScript |
336 | 336 | ); |
337 | 337 | $_sScript = trim( $_sScript ); |
338 | 338 | if ( $_sScript ) { |
339 | - echo "<script type='text/javascript' id='" . esc_attr( $sIDPrefix ) . "'>" |
|
339 | + echo "<script type='text/javascript' id='".esc_attr( $sIDPrefix )."'>" |
|
340 | 340 | . '/* <![CDATA[ */' |
341 | 341 | . $_sScript |
342 | 342 | . '/* ]]> */' |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | */ |
356 | 356 | protected function _printClassSpecificStyles( $sIDPrefix ) { |
357 | 357 | |
358 | - $_oCaller = $this->oProp->oCaller; |
|
358 | + $_oCaller = $this->oProp->oCaller; |
|
359 | 359 | echo $this->_getClassSpecificStyleTag( $_oCaller, $sIDPrefix ); |
360 | 360 | echo $this->_getClassSpecificIEStyleTag( $_oCaller, $sIDPrefix ); |
361 | 361 | |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | // : $this->getCSSMinified( $_sStyle ); |
387 | 387 | if ( $_sStyle ) { |
388 | 388 | $_iCallCount++; |
389 | - return "<style type='text/css' id='" . esc_attr( "{$sIDPrefix}-{$this->oProp->sClassName}_{$_iCallCount}" ) . "'>" |
|
389 | + return "<style type='text/css' id='".esc_attr( "{$sIDPrefix}-{$this->oProp->sClassName}_{$_iCallCount}" )."'>" |
|
390 | 390 | . $_sStyle |
391 | 391 | . "</style>"; |
392 | 392 | } |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | // : $this->getCSSMinified( $_sStyleIE ); |
415 | 415 | if ( $_sStyleIE ) { |
416 | 416 | $_iCallCountIE++; |
417 | - return "<!--[if IE]><style type='text/css' id='" . esc_attr( "{$sIDPrefix}-ie-{$this->oProp->sClassName}_{$_iCallCountIE}" ) . "'>" |
|
417 | + return "<!--[if IE]><style type='text/css' id='".esc_attr( "{$sIDPrefix}-ie-{$this->oProp->sClassName}_{$_iCallCountIE}" )."'>" |
|
418 | 418 | . $_sStyleIE |
419 | 419 | . "</style><![endif]-->"; |
420 | 420 | } |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | $_sScript = trim( $_sScript ); |
443 | 443 | if ( $_sScript ) { |
444 | 444 | $_iCallCount++; |
445 | - echo "<script type='text/javascript' id='" . esc_attr( "{$sIDPrefix}-{$this->oProp->sClassName}_{$_iCallCount}" ) . "'>" |
|
445 | + echo "<script type='text/javascript' id='".esc_attr( "{$sIDPrefix}-{$this->oProp->sClassName}_{$_iCallCount}" )."'>" |
|
446 | 446 | . '/* <![CDATA[ */' |
447 | 447 | . $_sScript |
448 | 448 | . '/* ]]> */' |
@@ -467,12 +467,12 @@ discard block |
||
467 | 467 | public function _replyToAddStyle() { |
468 | 468 | |
469 | 469 | $_oCaller = $this->oProp->oCaller; |
470 | - if ( ! $_oCaller->isInThePage() ) { |
|
470 | + if ( !$_oCaller->isInThePage() ) { |
|
471 | 471 | return; |
472 | 472 | } |
473 | 473 | |
474 | 474 | $this->_printCommonStyles( 'admin-page-framework-style-common', get_class() ); |
475 | - $this->_printClassSpecificStyles( $this->_sClassSelector_Style . '-' . $this->oProp->sStructureType ); |
|
475 | + $this->_printClassSpecificStyles( $this->_sClassSelector_Style.'-'.$this->oProp->sStructureType ); |
|
476 | 476 | |
477 | 477 | } |
478 | 478 | /** |
@@ -487,12 +487,12 @@ discard block |
||
487 | 487 | public function _replyToAddScript() { |
488 | 488 | |
489 | 489 | $_oCaller = $this->oProp->oCaller; |
490 | - if ( ! $_oCaller->isInThePage() ) { |
|
490 | + if ( !$_oCaller->isInThePage() ) { |
|
491 | 491 | return; |
492 | 492 | } |
493 | 493 | |
494 | 494 | $this->_printCommonScripts( 'admin-page-framework-script-common', get_class() ); |
495 | - $this->_printClassSpecificScripts( $this->_sClassSelector_Script . '-' . $this->oProp->sStructureType ); |
|
495 | + $this->_printClassSpecificScripts( $this->_sClassSelector_Script.'-'.$this->oProp->sStructureType ); |
|
496 | 496 | |
497 | 497 | } |
498 | 498 | |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | * @internal |
545 | 545 | */ |
546 | 546 | public function _replyToEnqueueStyles() { |
547 | - foreach( $this->oProp->aEnqueuingStyles as $_sKey => $_aEnqueuingStyle ) { |
|
547 | + foreach ( $this->oProp->aEnqueuingStyles as $_sKey => $_aEnqueuingStyle ) { |
|
548 | 548 | $this->_enqueueSRCByCondition( $_aEnqueuingStyle ); |
549 | 549 | unset( $this->oProp->aEnqueuingStyles[ $_sKey ] ); |
550 | 550 | } |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | * @internal |
562 | 562 | */ |
563 | 563 | public function _replyToEnqueueScripts() { |
564 | - foreach( $this->oProp->aEnqueuingScripts as $_sKey => $_aEnqueuingScript ) { |
|
564 | + foreach ( $this->oProp->aEnqueuingScripts as $_sKey => $_aEnqueuingScript ) { |
|
565 | 565 | $this->_enqueueSRCByCondition( $_aEnqueuingScript ); |
566 | 566 | unset( $this->oProp->aEnqueuingScripts[ $_sKey ] ); |
567 | 567 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | */ |
233 | 233 | protected function _printCommonStyles( $sIDPrefix, $sClassName ) { |
234 | 234 | |
235 | - if ( self::$_bCommonStyleLoaded ) { |
|
235 | + if ( self::$_bCommonStyleLoaded ) { |
|
236 | 236 | return; |
237 | 237 | } |
238 | 238 | self::$_bCommonStyleLoaded = true; |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | * @since 3.2.0 Changed it unset the enqueued item so that the method can be called multiple times. |
522 | 522 | * @internal |
523 | 523 | */ |
524 | - public function _replyToEnqueueStyles() { |
|
524 | + public function _replyToEnqueueStyles() { |
|
525 | 525 | foreach( $this->oProp->aEnqueuingStyles as $_sKey => $_aEnqueuingStyle ) { |
526 | 526 | $this->_enqueueSRCByConditoin( $_aEnqueuingStyle ); |
527 | 527 | unset( $this->oProp->aEnqueuingStyles[ $_sKey ] ); |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | * @since 3.2.0 Changed it unset the enqueued item so that the method can be called multiple times. |
539 | 539 | * @internal |
540 | 540 | */ |
541 | - public function _replyToEnqueueScripts() { |
|
541 | + public function _replyToEnqueueScripts() { |
|
542 | 542 | foreach( $this->oProp->aEnqueuingScripts as $_sKey => $_aEnqueuingScript ) { |
543 | 543 | $this->_enqueueSRCByConditoin( $_aEnqueuingScript ); |
544 | 544 | unset( $this->oProp->aEnqueuingScripts[ $_sKey ] ); |
@@ -370,6 +370,8 @@ |
||
370 | 370 | * Sets up necessary property values. |
371 | 371 | * |
372 | 372 | * @remark This class gets instantiated in every factory class so the constructor should be lightest as possible. |
373 | + * @param string $sCapability |
|
374 | + * @param string $sTextDomain |
|
373 | 375 | */ |
374 | 376 | public function __construct( $oCaller, $sCallerPath, $sClassName, $sCapability, $sTextDomain, $sStructureType ) { |
375 | 377 |
@@ -321,14 +321,14 @@ discard block |
||
321 | 321 | * @since 3.7.0 |
322 | 322 | */ |
323 | 323 | public $aFormCallbacks = array( |
324 | - 'hfID' => null, // the input id attribute |
|
325 | - 'hfTagID' => null, // the field container id attribute |
|
326 | - 'hfName' => null, // the field name attribute |
|
327 | - 'hfNameFlat' => null, // the flat field name attribute |
|
324 | + 'hfID' => null, // the input id attribute |
|
325 | + 'hfTagID' => null, // the field container id attribute |
|
326 | + 'hfName' => null, // the field name attribute |
|
327 | + 'hfNameFlat' => null, // the flat field name attribute |
|
328 | 328 | // @todo Document the differences between `hfName` and `hfInputName` |
329 | - 'hfInputName' => null, // 3.6.0+ the field input name attribute |
|
330 | - 'hfInputNameFlat' => null, // 3.6.0+ the flat field input name |
|
331 | - 'hfClass' => null, // the class attribute |
|
329 | + 'hfInputName' => null, // 3.6.0+ the field input name attribute |
|
330 | + 'hfInputNameFlat' => null, // 3.6.0+ the flat field input name |
|
331 | + 'hfClass' => null, // the class attribute |
|
332 | 332 | ); |
333 | 333 | |
334 | 334 | /** |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | */ |
438 | 438 | private function ___getURLQuery() { |
439 | 439 | |
440 | - if ( ! $this->bIsAdminAjax ) { |
|
440 | + if ( !$this->bIsAdminAjax ) { |
|
441 | 441 | return $_GET; |
442 | 442 | } |
443 | 443 | parse_str( |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | * @since 3.7.9 |
454 | 454 | */ |
455 | 455 | private function ___setGlobals() { |
456 | - if ( ! isset( $GLOBALS[ 'aAdminPageFramework' ] ) ) { |
|
456 | + if ( !isset( $GLOBALS[ 'aAdminPageFramework' ] ) ) { |
|
457 | 457 | $GLOBALS[ 'aAdminPageFramework' ] = array( |
458 | 458 | 'aFieldFlags' => array() |
459 | 459 | ); |
@@ -524,8 +524,8 @@ discard block |
||
524 | 524 | 'hfTagID' => array( $this->oCaller, '_replyToGetInputTagIDAttribute' ), // the fields & fieldset & field row container id attribute |
525 | 525 | 'hfName' => array( $this->oCaller, '_replyToGetFieldNameAttribute' ), // the input name attribute |
526 | 526 | 'hfNameFlat' => array( $this->oCaller, '_replyToGetFlatFieldName' ), // the flat input name attribute |
527 | - 'hfInputName' => array( $this->oCaller, '_replyToGetInputNameAttribute' ), // 3.6.0+ the field input name attribute |
|
528 | - 'hfInputNameFlat' => array( $this->oCaller, '_replyToGetFlatInputName' ), // 3.6.0+ the flat field input name |
|
527 | + 'hfInputName' => array( $this->oCaller, '_replyToGetInputNameAttribute' ), // 3.6.0+ the field input name attribute |
|
528 | + 'hfInputNameFlat' => array( $this->oCaller, '_replyToGetFlatInputName' ), // 3.6.0+ the flat field input name |
|
529 | 529 | 'hfClass' => array( $this->oCaller, '_replyToGetInputClassAttribute' ), // the class attribute |
530 | 530 | 'hfSectionName' => array( $this->oCaller, '_replyToGetSectionName' ), // 3.6.0+ |
531 | 531 | ) + $this->aFormCallbacks; |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | * @remark The information can be used to embed into the footer etc. |
600 | 600 | * @return array The information of the script. |
601 | 601 | */ |
602 | - protected function getCallerInfo( $sCallerPath='' ) { |
|
602 | + protected function getCallerInfo( $sCallerPath = '' ) { |
|
603 | 603 | |
604 | 604 | if ( isset( self::$_aScriptDataCaches[ $sCallerPath ] ) ) { |
605 | 605 | return self::$_aScriptDataCaches[ $sCallerPath ]; |
@@ -717,11 +717,11 @@ discard block |
||
717 | 717 | |
718 | 718 | // 3.7.9 Moved from the constructor to make it lighter. |
719 | 719 | if ( 'sClassHash' === $sName ) { |
720 | - $this->sClassHash = md5( $this->sClassName ); |
|
720 | + $this->sClassHash = md5( $this->sClassName ); |
|
721 | 721 | return $this->sClassHash; |
722 | 722 | } |
723 | 723 | if ( 'sScriptType' === $sName ) { |
724 | - $this->sScriptType = $this->_getCallerType( $this->sCallerPath ); // 3.7.6+ |
|
724 | + $this->sScriptType = $this->_getCallerType( $this->sCallerPath ); // 3.7.6+ |
|
725 | 725 | return $this->sScriptType; |
726 | 726 | } |
727 | 727 | if ( 'oUtil' === $sName ) { |
@@ -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 | */ |
@@ -63,7 +63,7 @@ |
||
63 | 63 | */ |
64 | 64 | public function _replyToGetPageLoadInfo( $sFooterHTML ) { |
65 | 65 | |
66 | - if ( self::$_bLoadedPageLoadInfo ) { |
|
66 | + if ( self::$_bLoadedPageLoadInfo ) { |
|
67 | 67 | return; |
68 | 68 | } |
69 | 69 | self::$_bLoadedPageLoadInfo = true; |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function __construct( $oProp, $oMsg ) { |
30 | 30 | |
31 | - if ( ! $this->_shouldProceed( $oProp ) ) { |
|
31 | + if ( !$this->_shouldProceed( $oProp ) ) { |
|
32 | 32 | return; |
33 | 33 | } |
34 | 34 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | private function _shouldProceed( $oProp ) { |
47 | 47 | |
48 | - if ( $oProp->bIsAdminAjax || ! $oProp->bIsAdmin ) { |
|
48 | + if ( $oProp->bIsAdminAjax || !$oProp->bIsAdmin ) { |
|
49 | 49 | return false; |
50 | 50 | } |
51 | 51 | return ( boolean ) $oProp->bShowDebugInfo; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | public function _replyToGetPageLoadInfo( $sFooterHTML ) { |
73 | 73 | |
74 | 74 | // 3.8.8+ The `bShowDebugInfo` property may be updated by the user during the page load. |
75 | - if ( ! $this->oProp->bShowDebugInfo ) { |
|
75 | + if ( !$this->oProp->bShowDebugInfo ) { |
|
76 | 76 | return $sFooterHTML; |
77 | 77 | } |
78 | 78 | |
@@ -100,10 +100,10 @@ discard block |
||
100 | 100 | $_sInitialMemoryUsage = round( $this->_convertBytesToHR( $this->_nInitialMemoryUsage ), 2 ); |
101 | 101 | return "<div id='admin-page-framework-page-load-stats'>" |
102 | 102 | . "<ul>" |
103 | - . "<li>" . sprintf( $this->oMsg->get( 'queries_in_seconds' ), $_nQueryCount, $_nSeconds ) . "</li>" |
|
104 | - . "<li>" . sprintf( $this->oMsg->get( 'out_of_x_memory_used' ), $_nMemoryUsage, $_nMemoryLimit, round( ( $_nMemoryUsage / $_nMemoryLimit ), 2 ) * 100 . '%' ) . "</li>" |
|
105 | - . "<li>" . sprintf( $this->oMsg->get( 'peak_memory_usage' ), $_nMemoryPeakUsage ) . "</li>" |
|
106 | - . "<li>" . sprintf( $this->oMsg->get( 'initial_memory_usage' ), $_sInitialMemoryUsage ) . "</li>" |
|
103 | + . "<li>".sprintf( $this->oMsg->get( 'queries_in_seconds' ), $_nQueryCount, $_nSeconds )."</li>" |
|
104 | + . "<li>".sprintf( $this->oMsg->get( 'out_of_x_memory_used' ), $_nMemoryUsage, $_nMemoryLimit, round( ( $_nMemoryUsage / $_nMemoryLimit ), 2 ) * 100.'%' )."</li>" |
|
105 | + . "<li>".sprintf( $this->oMsg->get( 'peak_memory_usage' ), $_nMemoryPeakUsage )."</li>" |
|
106 | + . "<li>".sprintf( $this->oMsg->get( 'initial_memory_usage' ), $_sInitialMemoryUsage )."</li>" |
|
107 | 107 | . "</ul>" |
108 | 108 | . "</div>"; |
109 | 109 | |
@@ -121,8 +121,8 @@ discard block |
||
121 | 121 | */ |
122 | 122 | private function _convertToNumber( $nSize ) { |
123 | 123 | |
124 | - $_nReturn = substr( $nSize, 0, -1 ); |
|
125 | - switch( strtoupper( substr( $nSize, -1 ) ) ) { |
|
124 | + $_nReturn = substr( $nSize, 0, -1 ); |
|
125 | + switch ( strtoupper( substr( $nSize, -1 ) ) ) { |
|
126 | 126 | case 'P': |
127 | 127 | $_nReturn *= 1024; |
128 | 128 | case 'T': |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $_nLog = log( $nBytes, 1024 ); |
152 | 152 | $_iPower = ( int ) $_nLog; |
153 | 153 | $_iSize = pow( 1024, $_nLog - $_iPower ); |
154 | - return $_iSize . $_aUnits[ $_iPower ]; |
|
154 | + return $_iSize.$_aUnits[ $_iPower ]; |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | } |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * @access public |
188 | 188 | * @remark The actual registration will be performed in the `_replyToRegisterSettings()` method with the `admin_menu` hook. |
189 | 189 | * @remark The `$oForm` property should be created in each extended class. |
190 | - * @param array|string $aSection the section array. If a string is passed, it is considered as a target page slug that will be used as a page slug element from the next call so that the element can be omitted. |
|
190 | + * @param array|string $aSectionset the section array. If a string is passed, it is considered as a target page slug that will be used as a page slug element from the next call so that the element can be omitted. |
|
191 | 191 | * <h4>Section Definition Array</h4> |
192 | 192 | * <ul> |
193 | 193 | * <li>**section_id** - (string) the section ID. Avoid using non-alphabetic characters except underscore and numbers.</li> |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | * @since 3.0.0 The scope changed to public to indicate the users will use. |
300 | 300 | * @return void |
301 | 301 | * @remark The $oForm property should be created in each extended class. |
302 | - * @param array|string $asField A field definition array or a string of the target section id. |
|
302 | + * @param array|string $asFieldset A field definition array or a string of the target section id. |
|
303 | 303 | * <h4>Built-in Field Types</h4> |
304 | 304 | * <ul> |
305 | 305 | * <li>**text** - a normal field to enter text input.</li> |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * @return array|string |
44 | 44 | * @since DEVVER |
45 | 45 | */ |
46 | - public function getMessage( $sKey='' ) { |
|
46 | + public function getMessage( $sKey = '' ) { |
|
47 | 47 | return $this->oMsg->get( $sKey ); |
48 | 48 | } |
49 | 49 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * @return array The array holing the queued items. |
64 | 64 | * @internal |
65 | 65 | */ |
66 | - public function enqueueStyles( $aSRCs, $_vArg2=null ) {} |
|
66 | + public function enqueueStyles( $aSRCs, $_vArg2 = null ) {} |
|
67 | 67 | |
68 | 68 | /** |
69 | 69 | * Enqueues a style of the given source. |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * @return string The style handle ID. If the passed url is not a valid url string, an empty string will be returned. |
84 | 84 | * @internal |
85 | 85 | */ |
86 | - public function enqueueStyle( $sSRC, $_vArg2=null ) {} |
|
86 | + public function enqueueStyle( $sSRC, $_vArg2 = null ) {} |
|
87 | 87 | |
88 | 88 | /** |
89 | 89 | * Enqueues scripts by the given sources. |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | * @return array The array holding the queued items. |
105 | 105 | * @internal |
106 | 106 | */ |
107 | - public function enqueueScripts( $aSRCs, $_vArg2=null ) {} |
|
107 | + public function enqueueScripts( $aSRCs, $_vArg2 = null ) {} |
|
108 | 108 | /** |
109 | 109 | * Enqueues a script by the given source. |
110 | 110 | * |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
137 | 137 | * @internal |
138 | 138 | */ |
139 | - public function enqueueScript( $sSRC, $_vArg2=null ) {} |
|
139 | + public function enqueueScript( $sSRC, $_vArg2 = null ) {} |
|
140 | 140 | |
141 | 141 | /* |
142 | 142 | * Help Pane |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | * @since 2.1.0 |
155 | 155 | * @remark This method just adds the given text into the class property. The actual registration will be performed with the `replyToRegisterHelpTabTextForMetaBox()` method. |
156 | 156 | */ |
157 | - public function addHelpText( $sHTMLContent, $sHTMLSidebarContent="" ) { |
|
157 | + public function addHelpText( $sHTMLContent, $sHTMLSidebarContent = "" ) { |
|
158 | 158 | if ( method_exists( $this->oHelpPane, '_addHelpText' ) ) { |
159 | 159 | $this->oHelpPane->_addHelpText( $sHTMLContent, $sHTMLSidebarContent ); |
160 | 160 | } |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | */ |
191 | 191 | public function addSettingSections( /* $aSection1, $aSection2=null, $_and_more=null */ ) { |
192 | 192 | |
193 | - foreach( func_get_args() as $_asSectionset ) { |
|
193 | + foreach ( func_get_args() as $_asSectionset ) { |
|
194 | 194 | $this->addSettingSection( $_asSectionset ); |
195 | 195 | } |
196 | 196 | |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | */ |
262 | 262 | public function addSettingSection( $aSectionset ) { |
263 | 263 | |
264 | - if ( ! is_array( $aSectionset ) ) { |
|
264 | + if ( !is_array( $aSectionset ) ) { |
|
265 | 265 | return; |
266 | 266 | } |
267 | 267 | |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | * @return void |
295 | 295 | */ |
296 | 296 | public function addSettingFields( /* $aField1, $aField2=null, $_and_more=null */ ) { |
297 | - foreach( func_get_args() as $_aFieldset ) { |
|
297 | + foreach ( func_get_args() as $_aFieldset ) { |
|
298 | 298 | $this->addSettingField( $_aFieldset ); |
299 | 299 | } |
300 | 300 | } |
@@ -671,7 +671,7 @@ discard block |
||
671 | 671 | * @param boolean $bOverride (optional) If true, only one message will be shown in the next page load. false: do not override when there is a message of the same id. true: override the previous one. |
672 | 672 | * @return void |
673 | 673 | */ |
674 | - public function setSettingNotice( $sMessage, $sType='error', $asAttributes=array(), $bOverride=true ) { |
|
674 | + public function setSettingNotice( $sMessage, $sType = 'error', $asAttributes = array(), $bOverride = true ) { |
|
675 | 675 | $this->oForm->setSubmitNotice( |
676 | 676 | $sMessage, |
677 | 677 | $sType, |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | * @param string $sType If empty, the method will check if a message exists in all types. Otherwise, it checks the existence of a message of the specified type. |
691 | 691 | * @return boolean True if a setting notice is set; otherwise, false. |
692 | 692 | */ |
693 | - public function hasSettingNotice( $sType='' ) { |
|
693 | + public function hasSettingNotice( $sType = '' ) { |
|
694 | 694 | return $this->oForm->hasSubmitNotice( $sType ); |
695 | 695 | } |
696 | 696 |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | */ |
170 | 170 | public function addSettingSections( /* $aSection1, $aSection2=null, $_and_more=null */ ) { |
171 | 171 | |
172 | - foreach( func_get_args() as $_asSectionset ) { |
|
172 | + foreach( func_get_args() as $_asSectionset ) { |
|
173 | 173 | $this->addSettingSection( $_asSectionset ); |
174 | 174 | } |
175 | 175 | |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | */ |
239 | 239 | public function addSettingSection( $aSectionset ) { |
240 | 240 | |
241 | - if ( ! is_array( $aSectionset ) ) { |
|
241 | + if ( ! is_array( $aSectionset ) ) { |
|
242 | 242 | return; |
243 | 243 | } |
244 | 244 | |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | * @return void |
272 | 272 | */ |
273 | 273 | public function addSettingFields( /* $aField1, $aField2=null, $_and_more=null */ ) { |
274 | - foreach( func_get_args() as $_aFieldset ) { |
|
274 | + foreach( func_get_args() as $_aFieldset ) { |
|
275 | 275 | $this->addSettingField( $_aFieldset ); |
276 | 276 | } |
277 | 277 | } |
@@ -306,18 +306,18 @@ discard block |
||
306 | 306 | } |
307 | 307 | |
308 | 308 | /** |
309 | - * Adds form fields. |
|
310 | - * |
|
311 | - * It inserts the given field definition arrays into the class property and later they are parsed when fields are registered. The field definition array requires specific keys. Refer to the parameter section of this method. |
|
312 | - * |
|
313 | - * @since 2.0.0 |
|
314 | - * @since 3.5.3 Removed the parameter declarations as they are caught with the func_get_args(). |
|
315 | - * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
316 | - * @param array the field definition array. |
|
317 | - * @param array (optional) another field array. |
|
318 | - * @param array (optional) add more field arrays to the next parameters as many as necessary. |
|
319 | - * @return void |
|
320 | - */ |
|
309 | + * Adds form fields. |
|
310 | + * |
|
311 | + * It inserts the given field definition arrays into the class property and later they are parsed when fields are registered. The field definition array requires specific keys. Refer to the parameter section of this method. |
|
312 | + * |
|
313 | + * @since 2.0.0 |
|
314 | + * @since 3.5.3 Removed the parameter declarations as they are caught with the func_get_args(). |
|
315 | + * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
316 | + * @param array the field definition array. |
|
317 | + * @param array (optional) another field array. |
|
318 | + * @param array (optional) add more field arrays to the next parameters as many as necessary. |
|
319 | + * @return void |
|
320 | + */ |
|
321 | 321 | public function addSettingFields( /* $aField1, $aField2=null, $_and_more=null */ ) { |
322 | 322 | foreach( func_get_args() as $_aFieldset ) { |
323 | 323 | $this->addSettingField( $_aFieldset ); |
@@ -348,57 +348,57 @@ discard block |
||
348 | 348 | * @return void |
349 | 349 | * @remark The $oForm property should be created in each extended class. |
350 | 350 | * @param array|string $asField A field definition array or a string of the target section id. |
351 | - * <h4>Built-in Field Types</h4> |
|
352 | - * <ul> |
|
353 | - * <li>[text](./class-AdminPageFramework_FieldType_text.html) - a normal field to enter short text input.</li> |
|
354 | - * <li>[password](./class-AdminPageFramework_FieldType_text.html) - a masked text input field.</li> |
|
355 | - * <li>[textarea](./class-AdminPageFramework_FieldType_textarea.html) - a text input field with multiple lines. It supports rich text editors.</li> |
|
356 | - * <li>[radio](./class-AdminPageFramework_FieldType_radio.html) - a set of radio buttons that lets the user pick an option.</li> |
|
357 | - * <li>[checkbox](./class-AdminPageFramework_FieldType_checkbox.html) - a check box that lets the user enable/disable an item.</li> |
|
358 | - * <li>[select](./class-AdminPageFramework_FieldType_select.html) - a drop-down list that lest the user pick one or more item(s) from a list.</li> |
|
359 | - * <li>[hidden](./class-AdminPageFramework_FieldType_hidden.html) - a field with invisible input values.</li> |
|
360 | - * <li>[file](./class-AdminPageFramework_FieldType_file.html) - a file uploader that lets the user upload files.</li> |
|
361 | - * <li>[image](./class-AdminPageFramework_FieldType_image.html) - a text field with an image uploader that lets the user set the image URL.</li> |
|
362 | - * <li>[media](./class-AdminPageFramework_FieldType_media.html) - a text field with a media uploader that lets the user set the file URL.</li> |
|
363 | - * <li>[color](./class-AdminPageFramework_FieldType_color.html) - a text field with a color picker.</li> |
|
364 | - * <li>[submit](./class-AdminPageFramework_FieldType_submit.html) - a submit button that lets the user send the form.</li> |
|
365 | - * <li>[export](./class-AdminPageFramework_FieldType_export.html) - a custom submit field that lets the user export stored data.</li> |
|
366 | - * <li>[import](./class-AdminPageFramework_FieldType_import.html) - a custom combination field of file and submit fields that let the user import data.</li> |
|
367 | - * <li>[posttype](./class-AdminPageFramework_FieldType_posttype.html) - a check-list of post types enabled on the site.</li> |
|
368 | - * <li>[taxonomy](./class-AdminPageFramework_FieldType_taxonomy.html) - a set of check-lists of taxonomies enabled on the site in a tabbed box.</li> |
|
369 | - * <li>[size](./class-AdminPageFramework_FieldType_size.html) - a combination field of the text and the select fields that let the user set sizes with a selectable unit.</li> |
|
370 | - * <li>[section_title](./class-AdminPageFramework_FieldType_section_title.html) - [3.0.0+] a text field type that will be placed in the section title so that it lets the user set the section title. Note that only one field with this field type is allowed per a section.</li> |
|
371 | - * <li>[system](./class-AdminPageFramework_FieldType_system.html) - [3.3.0+] a custom text area field that displays the system information including the PHP settings, the framework version, MySQL version etc.</li> |
|
372 | - * <li>[inline_mixed](./class-AdminPageFramework_FieldType_inline_mixed.html) - [3.8.0+] a field that include inner fields with different field types. </li> |
|
373 | - * </ul> |
|
374 | - * <h4>Field Definition Arguments</h4> |
|
375 | - * <ul> |
|
376 | - * <li>**field_id** - (required, string) the field ID. Avoid using non-alphabetic characters except underscore and numbers.</li> |
|
377 | - * <li>**type** - (optional, string) the type of the field. The supported types are listed below. When creating nested fields, this argument can be omitted.</li> |
|
378 | - * <li>**section_id** - (optional, string) the section ID that the field belongs to. If not set, the internal `_default` section ID will be assigned.</li> |
|
379 | - * <li>**title** - (optional, string) the title of the section.</li> |
|
380 | - * <li>**description** - (optional, string) the description of the field which is inserted into the after the input field tag.</li> |
|
381 | - * <li>**tip** - (optional, string) the tip for the field which is displayed when the mouse is hovered over the field title.</li> |
|
382 | - * <li>**capability** - (optional, string) the <a href="http://codex.wordpress.org/Roles_and_Capabilities">access level</a> of the section. If the page visitor does not have sufficient capability, the section will be invisible to them.</li> |
|
383 | - * <li>**error_message** - (optional, string) the error message to display above the input field.</li> |
|
384 | - * <li>**before_field** - (optional, string) the HTML string to insert before the input field output.</li> |
|
385 | - * <li>**after_field** - (optional, string) the HTML string to insert after the input field output.</li> |
|
386 | - * <li>**if** - (optional, boolean) if the passed value is false, the section will not be registered.</li> |
|
387 | - * <li>**order** - (optional, integer) the order number of the section. The higher the number is, the lower the position it gets.</li> |
|
388 | - * <li>**label** - (optional, string) the text label(s) associated with and displayed along with the input field. Some input types can ignore this key.</li> |
|
389 | - * <li>**default** - (optional, string|array) the default value(s) assigned to the input tag's value attribute.</li> |
|
390 | - * <li>**value** - (optional, string|array) the value(s) assigned to the input tag's `value` attribute to override the default and the stored value.</li> |
|
391 | - * <li>**delimiter** - (optional, string) the HTML string that delimits multiple elements. This is available if the <var>label</var> key is passed as array. It will be enclosed in inline-block elements so the passed HTML string should not contain block elements.</li> |
|
392 | - * <li>**before_input** - (optional, string) the HTML string inserted right before the input tag. It will be enclosed in the <code>label</code> tag so the passed HTML string should not contain block elements.</li> |
|
393 | - * <li>**after_input** - (optional, string) the HTML string inserted right after the input tag. It will be enclosed in the <code>label</code> tag so the passed HTML string should not contain block elements.</li> |
|
394 | - * <li>**label_min_width** - (optional, string) the inline style property of the `min-width` of the label tag for the field. If the unit is not specified, 'px' is applied. Default: `120`. e.g. `100%`</li> |
|
395 | - * <li>**help** - (optional, string) the help description added to the contextual help tab.</li> |
|
396 | - * <li>**help_aside** - (optional, string) the additional help description for the side bar of the contextual help tab.</li> |
|
397 | - * <li>**repeatable** - [3.0.0+] (optional, array|boolean) whether the fields should be repeatable. If it yields true, the plus and the minus buttons appear next to each field that lets the user add/remove the fields. Optionally an setting array can be passed. |
|
398 | - * <h5>Repeatable Fields Setting Array</h5> |
|
399 | - * <ul> |
|
400 | - * <li>**max** - the allowed maximum number of fields to be repeated.</li> |
|
401 | - * <li>**min** - the allowed minimum number of fields to be repeated.</li> |
|
351 | + * <h4>Built-in Field Types</h4> |
|
352 | + * <ul> |
|
353 | + * <li>[text](./class-AdminPageFramework_FieldType_text.html) - a normal field to enter short text input.</li> |
|
354 | + * <li>[password](./class-AdminPageFramework_FieldType_text.html) - a masked text input field.</li> |
|
355 | + * <li>[textarea](./class-AdminPageFramework_FieldType_textarea.html) - a text input field with multiple lines. It supports rich text editors.</li> |
|
356 | + * <li>[radio](./class-AdminPageFramework_FieldType_radio.html) - a set of radio buttons that lets the user pick an option.</li> |
|
357 | + * <li>[checkbox](./class-AdminPageFramework_FieldType_checkbox.html) - a check box that lets the user enable/disable an item.</li> |
|
358 | + * <li>[select](./class-AdminPageFramework_FieldType_select.html) - a drop-down list that lest the user pick one or more item(s) from a list.</li> |
|
359 | + * <li>[hidden](./class-AdminPageFramework_FieldType_hidden.html) - a field with invisible input values.</li> |
|
360 | + * <li>[file](./class-AdminPageFramework_FieldType_file.html) - a file uploader that lets the user upload files.</li> |
|
361 | + * <li>[image](./class-AdminPageFramework_FieldType_image.html) - a text field with an image uploader that lets the user set the image URL.</li> |
|
362 | + * <li>[media](./class-AdminPageFramework_FieldType_media.html) - a text field with a media uploader that lets the user set the file URL.</li> |
|
363 | + * <li>[color](./class-AdminPageFramework_FieldType_color.html) - a text field with a color picker.</li> |
|
364 | + * <li>[submit](./class-AdminPageFramework_FieldType_submit.html) - a submit button that lets the user send the form.</li> |
|
365 | + * <li>[export](./class-AdminPageFramework_FieldType_export.html) - a custom submit field that lets the user export stored data.</li> |
|
366 | + * <li>[import](./class-AdminPageFramework_FieldType_import.html) - a custom combination field of file and submit fields that let the user import data.</li> |
|
367 | + * <li>[posttype](./class-AdminPageFramework_FieldType_posttype.html) - a check-list of post types enabled on the site.</li> |
|
368 | + * <li>[taxonomy](./class-AdminPageFramework_FieldType_taxonomy.html) - a set of check-lists of taxonomies enabled on the site in a tabbed box.</li> |
|
369 | + * <li>[size](./class-AdminPageFramework_FieldType_size.html) - a combination field of the text and the select fields that let the user set sizes with a selectable unit.</li> |
|
370 | + * <li>[section_title](./class-AdminPageFramework_FieldType_section_title.html) - [3.0.0+] a text field type that will be placed in the section title so that it lets the user set the section title. Note that only one field with this field type is allowed per a section.</li> |
|
371 | + * <li>[system](./class-AdminPageFramework_FieldType_system.html) - [3.3.0+] a custom text area field that displays the system information including the PHP settings, the framework version, MySQL version etc.</li> |
|
372 | + * <li>[inline_mixed](./class-AdminPageFramework_FieldType_inline_mixed.html) - [3.8.0+] a field that include inner fields with different field types. </li> |
|
373 | + * </ul> |
|
374 | + * <h4>Field Definition Arguments</h4> |
|
375 | + * <ul> |
|
376 | + * <li>**field_id** - (required, string) the field ID. Avoid using non-alphabetic characters except underscore and numbers.</li> |
|
377 | + * <li>**type** - (optional, string) the type of the field. The supported types are listed below. When creating nested fields, this argument can be omitted.</li> |
|
378 | + * <li>**section_id** - (optional, string) the section ID that the field belongs to. If not set, the internal `_default` section ID will be assigned.</li> |
|
379 | + * <li>**title** - (optional, string) the title of the section.</li> |
|
380 | + * <li>**description** - (optional, string) the description of the field which is inserted into the after the input field tag.</li> |
|
381 | + * <li>**tip** - (optional, string) the tip for the field which is displayed when the mouse is hovered over the field title.</li> |
|
382 | + * <li>**capability** - (optional, string) the <a href="http://codex.wordpress.org/Roles_and_Capabilities">access level</a> of the section. If the page visitor does not have sufficient capability, the section will be invisible to them.</li> |
|
383 | + * <li>**error_message** - (optional, string) the error message to display above the input field.</li> |
|
384 | + * <li>**before_field** - (optional, string) the HTML string to insert before the input field output.</li> |
|
385 | + * <li>**after_field** - (optional, string) the HTML string to insert after the input field output.</li> |
|
386 | + * <li>**if** - (optional, boolean) if the passed value is false, the section will not be registered.</li> |
|
387 | + * <li>**order** - (optional, integer) the order number of the section. The higher the number is, the lower the position it gets.</li> |
|
388 | + * <li>**label** - (optional, string) the text label(s) associated with and displayed along with the input field. Some input types can ignore this key.</li> |
|
389 | + * <li>**default** - (optional, string|array) the default value(s) assigned to the input tag's value attribute.</li> |
|
390 | + * <li>**value** - (optional, string|array) the value(s) assigned to the input tag's `value` attribute to override the default and the stored value.</li> |
|
391 | + * <li>**delimiter** - (optional, string) the HTML string that delimits multiple elements. This is available if the <var>label</var> key is passed as array. It will be enclosed in inline-block elements so the passed HTML string should not contain block elements.</li> |
|
392 | + * <li>**before_input** - (optional, string) the HTML string inserted right before the input tag. It will be enclosed in the <code>label</code> tag so the passed HTML string should not contain block elements.</li> |
|
393 | + * <li>**after_input** - (optional, string) the HTML string inserted right after the input tag. It will be enclosed in the <code>label</code> tag so the passed HTML string should not contain block elements.</li> |
|
394 | + * <li>**label_min_width** - (optional, string) the inline style property of the `min-width` of the label tag for the field. If the unit is not specified, 'px' is applied. Default: `120`. e.g. `100%`</li> |
|
395 | + * <li>**help** - (optional, string) the help description added to the contextual help tab.</li> |
|
396 | + * <li>**help_aside** - (optional, string) the additional help description for the side bar of the contextual help tab.</li> |
|
397 | + * <li>**repeatable** - [3.0.0+] (optional, array|boolean) whether the fields should be repeatable. If it yields true, the plus and the minus buttons appear next to each field that lets the user add/remove the fields. Optionally an setting array can be passed. |
|
398 | + * <h5>Repeatable Fields Setting Array</h5> |
|
399 | + * <ul> |
|
400 | + * <li>**max** - the allowed maximum number of fields to be repeated.</li> |
|
401 | + * <li>**min** - the allowed minimum number of fields to be repeated.</li> |
|
402 | 402 | * <li>**disabled** - (optional, boolean|array) [3.8.13+] |
403 | 403 | * <ul> |
404 | 404 | * <li>**label** - (optional, string) the message to show when the user clicks on the `Add` repeatable button.</li> |
@@ -407,108 +407,108 @@ discard block |
||
407 | 407 | * <li>**box_width** - (optional, integer) the height of the modal window that displays the message. Default: 100.</li> |
408 | 408 | * <ul> |
409 | 409 | * </li> |
410 | - * </ul> |
|
411 | - * </li> |
|
412 | - * <li>**sortable** - [3.0.0+] (optional, boolean) whether the fields should be sortable. If it yields true, the fields will be enclosed in a draggable box. |
|
413 | - * <li>**attributes** - [3.0.0+] (optional, array) holds key-value pairs representing the attribute and its property. Note that some field types have specific keys in the first dimensions. e.g. `array( 'class' => 'my_custom_class_selector', 'style' => 'background-color:#777', 'size' => 20, )` Every field holds the following nested attribute definition arrays. |
|
414 | - * <ul> |
|
415 | - * <li>**fieldrow** - the `td` tag element containing the field output.</li> |
|
416 | - * <li>**fieldset** - the `fieldset` tag element containing the field output.</li> |
|
417 | - * <li>**fields** - the `div` tag element containing the sub-fields and the main field.</li> |
|
418 | - * <li>**field** - the `div` tag element containing each field.</li> |
|
419 | - * </ul> |
|
420 | - * </li> |
|
421 | - * <li>**show_title_column** - [3.0.0+] (optional, boolean) If true, the field title column will be omitted from the output.</li> |
|
422 | - * <li>**hidden** - [3.0.0+] (optional, boolean) If true, the entire field row output will be invisible with the inline style attribute of `style="display:none"`.</li> |
|
423 | - * <li>**save** - [3.6.0+] (optional, boolean) If `false`, the field value will not be saved. Default: `true`</li> |
|
424 | - * <li>**content** - (optional, string|array) [3.6.1+] a custom section output. [3.8.0+] Supports an array to be passed for nested and inline-mixed fields. If an array holding field definitions is set, those fields will be nested. |
|
425 | - * <h4>Example</h4> |
|
426 | - * <pre><code> |
|
427 | - * $this->addSettingFields( |
|
428 | - * 'my_section_id', // the target section ID - pass dimensional keys of the section |
|
429 | - * array( |
|
430 | - * 'field_id' => 'Y', |
|
431 | - * 'title' => __( 'Y', 'admin-page-framework-loader' ), |
|
432 | - * 'description' => __( 'By passing an array of field definition to the <code>content</code> argument, you can nest fields.', 'admin-page-framework-loader' ) |
|
433 | - * . ' ' . __( 'Also the <code>type</code> argument can be omitted.', 'admin-page-framework-loader' ), |
|
434 | - * 'content' => array( |
|
435 | - * array( |
|
436 | - * 'field_id' => 'i', |
|
437 | - * 'title' => __( 'i', 'admin-page-framework-loader' ), |
|
438 | - * 'type' => 'textarea', |
|
439 | - * ), |
|
440 | - * array( |
|
441 | - * 'field_id' => 'ii', |
|
442 | - * 'title' => __( 'ii', 'admin-page-framework-loader' ), |
|
443 | - * 'type' => 'color', |
|
444 | - * ), |
|
445 | - * array( |
|
446 | - * 'field_id' => 'iii', |
|
447 | - * 'title' => __( 'iii', 'admin-page-framework-loader' ), |
|
448 | - * 'repeatable' => true, |
|
449 | - * 'sortable' => true, |
|
450 | - * 'content' => array( |
|
451 | - * array( |
|
452 | - * 'field_id' => 'a', |
|
453 | - * 'title' => __( 'a', 'admin-page-framework-loader' ), |
|
454 | - * 'type' => 'image', |
|
455 | - * 'attributes' => array( |
|
456 | - * 'preview' => array( |
|
457 | - * 'style' => 'max-width: 200px;', |
|
458 | - * ), |
|
459 | - * ), |
|
460 | - * ), |
|
461 | - * array( |
|
462 | - * 'field_id' => 'b', |
|
463 | - * 'title' => __( 'b', 'admin-page-framework-loader' ), |
|
464 | - * 'content' => array( |
|
465 | - * array( |
|
466 | - * 'field_id' => 'first', |
|
467 | - * 'title' => __( '1st', 'admin-page-framework-loader' ), |
|
468 | - * 'type' => 'color', |
|
469 | - * 'repeatable' => true, |
|
470 | - * 'sortable' => true, |
|
471 | - * ), |
|
472 | - * array( |
|
473 | - * 'field_id' => 'second', |
|
474 | - * 'title' => __( '2nd', 'admin-page-framework-loader' ), |
|
475 | - * 'type' => 'size', |
|
476 | - * ), |
|
477 | - * array( |
|
478 | - * 'field_id' => 'third', |
|
479 | - * 'title' => __( '3rd', 'admin-page-framework-loader' ), |
|
480 | - * 'type' => 'select', |
|
481 | - * 'label' => array( |
|
482 | - * 'x' => 'X', |
|
483 | - * 'y' => 'Y', |
|
484 | - * 'z' => 'Z', |
|
485 | - * ), |
|
486 | - * ), |
|
487 | - * ), |
|
488 | - * // 'description' => '', |
|
489 | - * ), |
|
490 | - * array( |
|
491 | - * 'field_id' => 'c', |
|
492 | - * 'title' => __( 'c', 'admin-page-framework-loader' ), |
|
493 | - * 'type' => 'radio', |
|
494 | - * 'label' => array( |
|
495 | - * 'a' => __( 'Apple', 'admin-page-framework-loader' ), |
|
496 | - * 'b' => __( 'Banana', 'admin-page-framework-loader' ), |
|
497 | - * 'c' => __( 'Cherry', 'admin-page-framework-loader' ), |
|
498 | - * ), |
|
499 | - * 'default' => 'b', |
|
500 | - * ), |
|
501 | - * ) |
|
502 | - * ), |
|
503 | - * ), |
|
504 | - * ) |
|
505 | - * ); |
|
506 | - * </code></pre> |
|
507 | - * </li> |
|
508 | - * <li>**placement** - [3.8.0+] (optional, string) Specifies where the field is rendered. Either `normal` `section_title` or `field_title` is accepted. `field_title` can only be used by nested fields defined in the `content` argument. Default: `normal`</li> |
|
509 | - * <li>**show_debug_info** - (optional, boolean) [3.8.8+] Whether to show debug information such as field definition tool-tips. Default: `true`.</li> |
|
510 | - * </ul> |
|
511 | - */ |
|
410 | + * </ul> |
|
411 | + * </li> |
|
412 | + * <li>**sortable** - [3.0.0+] (optional, boolean) whether the fields should be sortable. If it yields true, the fields will be enclosed in a draggable box. |
|
413 | + * <li>**attributes** - [3.0.0+] (optional, array) holds key-value pairs representing the attribute and its property. Note that some field types have specific keys in the first dimensions. e.g. `array( 'class' => 'my_custom_class_selector', 'style' => 'background-color:#777', 'size' => 20, )` Every field holds the following nested attribute definition arrays. |
|
414 | + * <ul> |
|
415 | + * <li>**fieldrow** - the `td` tag element containing the field output.</li> |
|
416 | + * <li>**fieldset** - the `fieldset` tag element containing the field output.</li> |
|
417 | + * <li>**fields** - the `div` tag element containing the sub-fields and the main field.</li> |
|
418 | + * <li>**field** - the `div` tag element containing each field.</li> |
|
419 | + * </ul> |
|
420 | + * </li> |
|
421 | + * <li>**show_title_column** - [3.0.0+] (optional, boolean) If true, the field title column will be omitted from the output.</li> |
|
422 | + * <li>**hidden** - [3.0.0+] (optional, boolean) If true, the entire field row output will be invisible with the inline style attribute of `style="display:none"`.</li> |
|
423 | + * <li>**save** - [3.6.0+] (optional, boolean) If `false`, the field value will not be saved. Default: `true`</li> |
|
424 | + * <li>**content** - (optional, string|array) [3.6.1+] a custom section output. [3.8.0+] Supports an array to be passed for nested and inline-mixed fields. If an array holding field definitions is set, those fields will be nested. |
|
425 | + * <h4>Example</h4> |
|
426 | + * <pre><code> |
|
427 | + * $this->addSettingFields( |
|
428 | + * 'my_section_id', // the target section ID - pass dimensional keys of the section |
|
429 | + * array( |
|
430 | + * 'field_id' => 'Y', |
|
431 | + * 'title' => __( 'Y', 'admin-page-framework-loader' ), |
|
432 | + * 'description' => __( 'By passing an array of field definition to the <code>content</code> argument, you can nest fields.', 'admin-page-framework-loader' ) |
|
433 | + * . ' ' . __( 'Also the <code>type</code> argument can be omitted.', 'admin-page-framework-loader' ), |
|
434 | + * 'content' => array( |
|
435 | + * array( |
|
436 | + * 'field_id' => 'i', |
|
437 | + * 'title' => __( 'i', 'admin-page-framework-loader' ), |
|
438 | + * 'type' => 'textarea', |
|
439 | + * ), |
|
440 | + * array( |
|
441 | + * 'field_id' => 'ii', |
|
442 | + * 'title' => __( 'ii', 'admin-page-framework-loader' ), |
|
443 | + * 'type' => 'color', |
|
444 | + * ), |
|
445 | + * array( |
|
446 | + * 'field_id' => 'iii', |
|
447 | + * 'title' => __( 'iii', 'admin-page-framework-loader' ), |
|
448 | + * 'repeatable' => true, |
|
449 | + * 'sortable' => true, |
|
450 | + * 'content' => array( |
|
451 | + * array( |
|
452 | + * 'field_id' => 'a', |
|
453 | + * 'title' => __( 'a', 'admin-page-framework-loader' ), |
|
454 | + * 'type' => 'image', |
|
455 | + * 'attributes' => array( |
|
456 | + * 'preview' => array( |
|
457 | + * 'style' => 'max-width: 200px;', |
|
458 | + * ), |
|
459 | + * ), |
|
460 | + * ), |
|
461 | + * array( |
|
462 | + * 'field_id' => 'b', |
|
463 | + * 'title' => __( 'b', 'admin-page-framework-loader' ), |
|
464 | + * 'content' => array( |
|
465 | + * array( |
|
466 | + * 'field_id' => 'first', |
|
467 | + * 'title' => __( '1st', 'admin-page-framework-loader' ), |
|
468 | + * 'type' => 'color', |
|
469 | + * 'repeatable' => true, |
|
470 | + * 'sortable' => true, |
|
471 | + * ), |
|
472 | + * array( |
|
473 | + * 'field_id' => 'second', |
|
474 | + * 'title' => __( '2nd', 'admin-page-framework-loader' ), |
|
475 | + * 'type' => 'size', |
|
476 | + * ), |
|
477 | + * array( |
|
478 | + * 'field_id' => 'third', |
|
479 | + * 'title' => __( '3rd', 'admin-page-framework-loader' ), |
|
480 | + * 'type' => 'select', |
|
481 | + * 'label' => array( |
|
482 | + * 'x' => 'X', |
|
483 | + * 'y' => 'Y', |
|
484 | + * 'z' => 'Z', |
|
485 | + * ), |
|
486 | + * ), |
|
487 | + * ), |
|
488 | + * // 'description' => '', |
|
489 | + * ), |
|
490 | + * array( |
|
491 | + * 'field_id' => 'c', |
|
492 | + * 'title' => __( 'c', 'admin-page-framework-loader' ), |
|
493 | + * 'type' => 'radio', |
|
494 | + * 'label' => array( |
|
495 | + * 'a' => __( 'Apple', 'admin-page-framework-loader' ), |
|
496 | + * 'b' => __( 'Banana', 'admin-page-framework-loader' ), |
|
497 | + * 'c' => __( 'Cherry', 'admin-page-framework-loader' ), |
|
498 | + * ), |
|
499 | + * 'default' => 'b', |
|
500 | + * ), |
|
501 | + * ) |
|
502 | + * ), |
|
503 | + * ), |
|
504 | + * ) |
|
505 | + * ); |
|
506 | + * </code></pre> |
|
507 | + * </li> |
|
508 | + * <li>**placement** - [3.8.0+] (optional, string) Specifies where the field is rendered. Either `normal` `section_title` or `field_title` is accepted. `field_title` can only be used by nested fields defined in the `content` argument. Default: `normal`</li> |
|
509 | + * <li>**show_debug_info** - (optional, boolean) [3.8.8+] Whether to show debug information such as field definition tool-tips. Default: `true`.</li> |
|
510 | + * </ul> |
|
511 | + */ |
|
512 | 512 | public function addSettingField( $asFieldset ) { |
513 | 513 | if ( method_exists( $this->oForm, 'addField' ) ) { |
514 | 514 | $this->oForm->addField( $asFieldset ); |
@@ -572,28 +572,28 @@ discard block |
||
572 | 572 | } |
573 | 573 | |
574 | 574 | /** |
575 | - * Sets the given message to be displayed in the next page load. |
|
576 | - * |
|
577 | - * This is used to inform users about the submitted input data, such as "Updated successfully." or "Problem occurred." etc. |
|
578 | - * and normally used in validation callback methods. |
|
579 | - * |
|
580 | - * <h4>Example</h4> |
|
581 | - * ` |
|
582 | - * if ( ! $bVerified ) { |
|
583 | - * $this->setFieldErrors( $aErrors ); |
|
584 | - * $this->setSettingNotice( 'There was an error in your input.' ); |
|
585 | - * return $aOldPageOptions; |
|
586 | - * } |
|
587 | - * ` |
|
588 | - * |
|
589 | - * @since 3.0.4 |
|
590 | - * @access public |
|
591 | - * @param string $sMessage the text message to be displayed. |
|
592 | - * @param string $sType (optional) the type of the message, either "error" or "updated" is used. |
|
593 | - * @param array $asAttributes (optional) the tag attribute array applied to the message container HTML element. If a string is given, it is used as the ID attribute value. |
|
594 | - * @param boolean $bOverride (optional) If true, only one message will be shown in the next page load. false: do not override when there is a message of the same id. true: override the previous one. |
|
595 | - * @return void |
|
596 | - */ |
|
575 | + * Sets the given message to be displayed in the next page load. |
|
576 | + * |
|
577 | + * This is used to inform users about the submitted input data, such as "Updated successfully." or "Problem occurred." etc. |
|
578 | + * and normally used in validation callback methods. |
|
579 | + * |
|
580 | + * <h4>Example</h4> |
|
581 | + * ` |
|
582 | + * if ( ! $bVerified ) { |
|
583 | + * $this->setFieldErrors( $aErrors ); |
|
584 | + * $this->setSettingNotice( 'There was an error in your input.' ); |
|
585 | + * return $aOldPageOptions; |
|
586 | + * } |
|
587 | + * ` |
|
588 | + * |
|
589 | + * @since 3.0.4 |
|
590 | + * @access public |
|
591 | + * @param string $sMessage the text message to be displayed. |
|
592 | + * @param string $sType (optional) the type of the message, either "error" or "updated" is used. |
|
593 | + * @param array $asAttributes (optional) the tag attribute array applied to the message container HTML element. If a string is given, it is used as the ID attribute value. |
|
594 | + * @param boolean $bOverride (optional) If true, only one message will be shown in the next page load. false: do not override when there is a message of the same id. true: override the previous one. |
|
595 | + * @return void |
|
596 | + */ |
|
597 | 597 | public function setSettingNotice( $sMessage, $sType='error', $asAttributes=array(), $bOverride=true ) { |
598 | 598 | $this->oForm->setSubmitNotice( |
599 | 599 | $sMessage, |
@@ -110,7 +110,6 @@ |
||
110 | 110 | * Retrieves the settings error array set by the user in the validation callback. |
111 | 111 | * |
112 | 112 | * @since 3.7.8 |
113 | - * @param boolean $bDelete whether or not the transient should be deleted after retrieving it. |
|
114 | 113 | * @return array |
115 | 114 | */ |
116 | 115 | public function get() { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $_sPageSlug = $this->getElement( $_GET, 'page', '' ); |
57 | 57 | $_sTabSlug = $this->getElement( $_GET, 'tab', '' ); |
58 | 58 | $_sUserID = get_current_user_id(); |
59 | - return "apf_li_" . md5( |
|
59 | + return "apf_li_".md5( |
|
60 | 60 | $_sPageNow |
61 | 61 | . $_sPageSlug |
62 | 62 | . $_sTabSlug |
@@ -94,13 +94,13 @@ discard block |
||
94 | 94 | * @return void |
95 | 95 | */ |
96 | 96 | public function _replyToSave() { |
97 | - if ( ! isset( self::$_aLastInputs ) ) { |
|
97 | + if ( !isset( self::$_aLastInputs ) ) { |
|
98 | 98 | return; |
99 | 99 | } |
100 | 100 | $this->setTransient( |
101 | 101 | $this->sTransientKey, |
102 | 102 | self::$_aLastInputs, |
103 | - 60*60 // store it for 1 hour |
|
103 | + 60 * 60 // store it for 1 hour |
|
104 | 104 | ); |
105 | 105 | } |
106 | 106 | |
@@ -120,9 +120,9 @@ discard block |
||
120 | 120 | $_aLastInputs = self::$_aCaches[ $this->sTransientKey ]; |
121 | 121 | } else { |
122 | 122 | $_aLastInputs = $this->getTransient( $this->sTransientKey ); |
123 | - self::$_aCaches[ $this->sTransientKey ] = $_aLastInputs; |
|
123 | + self::$_aCaches[ $this->sTransientKey ] = $_aLastInputs; |
|
124 | 124 | if ( false !== $_aLastInputs ) { |
125 | - $this->delete(); // deletes at the end of the script. |
|
125 | + $this->delete(); // deletes at the end of the script. |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 |
@@ -94,7 +94,7 @@ |
||
94 | 94 | * @return void |
95 | 95 | */ |
96 | 96 | public function _replyToSave() { |
97 | - if ( ! isset( self::$_aLastInputs ) ) { |
|
97 | + if ( ! isset( self::$_aLastInputs ) ) { |
|
98 | 98 | return; |
99 | 99 | } |
100 | 100 | $this->setTransient( |