@@ -104,9 +104,9 @@ |
||
104 | 104 | * Sets up properties. |
105 | 105 | * @since DEVVER |
106 | 106 | */ |
107 | - public function __construct( $oCaller, $sCallerPath, $sClassName, $sCapability='manage_options', $sTextDomain='admin-page-framework', $sStructureType ) { |
|
107 | + public function __construct( $oCaller, $sCallerPath, $sClassName, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework', $sStructureType ) { |
|
108 | 108 | |
109 | - $this->_sFormRegistrationHook = 'load_' . $sClassName; // DEVVER+ |
|
109 | + $this->_sFormRegistrationHook = 'load_'.$sClassName; // DEVVER+ |
|
110 | 110 | // $this->_sFormRegistrationHook = 'current_screen'; |
111 | 111 | |
112 | 112 | parent::__construct( |
@@ -18,16 +18,16 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function start() { |
20 | 20 | |
21 | - if ( ! $this->oProp->bIsAdmin ) { |
|
21 | + if ( !$this->oProp->bIsAdmin ) { |
|
22 | 22 | return; |
23 | 23 | } |
24 | 24 | |
25 | 25 | // Allows the user to switch the menu visibility. |
26 | - if ( isset( $_GET['enable_apfl_admin_pages'] ) ) { |
|
26 | + if ( isset( $_GET[ 'enable_apfl_admin_pages' ] ) ) { |
|
27 | 27 | |
28 | 28 | // Update the options and reload the page |
29 | - $_oOption = AdminPageFrameworkLoader_Option::getInstance( AdminPageFrameworkLoader_Registry::$aOptionKeys['main'] ); |
|
30 | - $_oOption->update( 'enable_admin_pages', $_GET['enable_apfl_admin_pages'] ); |
|
29 | + $_oOption = AdminPageFrameworkLoader_Option::getInstance( AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ] ); |
|
30 | + $_oOption->update( 'enable_admin_pages', $_GET[ 'enable_apfl_admin_pages' ] ); |
|
31 | 31 | |
32 | 32 | $this->oUtil->goToLocalURL( |
33 | 33 | remove_query_arg( 'enable_apfl_admin_pages' ), |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | // Enable / disable the demo pages |
40 | - if ( isset( $_GET['enable_apfl_demo_pages'] ) ) { |
|
40 | + if ( isset( $_GET[ 'enable_apfl_demo_pages' ] ) ) { |
|
41 | 41 | |
42 | 42 | // Update the options and reload the page |
43 | - $_oOption = AdminPageFrameworkLoader_Option::getInstance( AdminPageFrameworkLoader_Registry::$aOptionKeys['main'] ); |
|
44 | - $_oOption->update( 'enable_demo', $_GET['enable_apfl_demo_pages'] ); |
|
43 | + $_oOption = AdminPageFrameworkLoader_Option::getInstance( AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ] ); |
|
44 | + $_oOption->update( 'enable_demo', $_GET[ 'enable_apfl_demo_pages' ] ); |
|
45 | 45 | |
46 | 46 | if ( $_GET[ 'enable_apfl_demo_pages' ] ) { |
47 | 47 | $this->setSettingNotice( |
@@ -67,15 +67,15 @@ discard block |
||
67 | 67 | public function setUp() { |
68 | 68 | |
69 | 69 | $_aOptions = $this->oProp->aOptions; |
70 | - $_bAdminPageEnabled = ! is_array( $_aOptions ) // for the first time of loading, the option is not set and it is not an array. |
|
71 | - || ( isset( $_aOptions['enable_admin_pages'] ) && $_aOptions['enable_admin_pages'] ); |
|
70 | + $_bAdminPageEnabled = !is_array( $_aOptions ) // for the first time of loading, the option is not set and it is not an array. |
|
71 | + || ( isset( $_aOptions[ 'enable_admin_pages' ] ) && $_aOptions[ 'enable_admin_pages' ] ); |
|
72 | 72 | |
73 | 73 | // Set up pages |
74 | 74 | if ( $_bAdminPageEnabled ) { |
75 | 75 | |
76 | 76 | $this->setRootMenuPage( |
77 | - AdminPageFrameworkLoader_Registry::SHORTNAME, // menu slug |
|
78 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/image/wp-logo_16x16.png', // menu icon |
|
77 | + AdminPageFrameworkLoader_Registry::SHORTNAME, // menu slug |
|
78 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/image/wp-logo_16x16.png', // menu icon |
|
79 | 79 | 4 // menu position |
80 | 80 | ); |
81 | 81 | |
@@ -83,21 +83,21 @@ discard block |
||
83 | 83 | new AdminPageFrameworkLoader_AdminPage_Tool( |
84 | 84 | $this, |
85 | 85 | array( |
86 | - 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages['tool'], |
|
86 | + 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'tool' ], |
|
87 | 87 | 'title' => __( 'Tools', 'admin-page-framework-loader' ), |
88 | 88 | ) |
89 | 89 | ); |
90 | 90 | new AdminPageFrameworkLoader_AdminPage_Addon( |
91 | 91 | $this, |
92 | 92 | array( |
93 | - 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages['addon'], // page slug |
|
93 | + 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'addon' ], // page slug |
|
94 | 94 | 'title' => __( 'Add Ons', 'admin-page-framework-loader' ), |
95 | 95 | ) |
96 | 96 | ); |
97 | 97 | new AdminPageFrameworkLoader_AdminPage_Help( |
98 | 98 | $this, |
99 | 99 | array( |
100 | - 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages['help'], |
|
100 | + 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'help' ], |
|
101 | 101 | 'title' => __( 'Help', 'admin-page-framework-loader' ), |
102 | 102 | 'order' => 1000, // to be the last menu item |
103 | 103 | ) |
@@ -120,8 +120,8 @@ discard block |
||
120 | 120 | $this->setPluginSettingsLinkLabel( '' ); // pass an empty string to disable it. |
121 | 121 | |
122 | 122 | // Styles |
123 | - $this->enqueueStyle( AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/code.css' ); |
|
124 | - $this->enqueueStyle( AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/admin.css' ); |
|
123 | + $this->enqueueStyle( AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/code.css' ); |
|
124 | + $this->enqueueStyle( AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/admin.css' ); |
|
125 | 125 | |
126 | 126 | // Action Links (plugin.php) |
127 | 127 | $this->addLinkToPluginTitle( |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $this->_getDemoSwitcherLink( $_bAdminPageEnabled, $_aOptions ) |
131 | 131 | ); |
132 | 132 | $this->addLinkToPluginDescription( |
133 | - "<a href='https://wordpress.org/support/plugin/admin-page-framework' target='_blank'>" . __( 'Support', 'admin-page-framework-loader' ) . "</a>" |
|
133 | + "<a href='https://wordpress.org/support/plugin/admin-page-framework' target='_blank'>".__( 'Support', 'admin-page-framework-loader' )."</a>" |
|
134 | 134 | ); |
135 | 135 | |
136 | 136 | } |
@@ -138,24 +138,24 @@ discard block |
||
138 | 138 | * Returns the Tools admin page link. |
139 | 139 | */ |
140 | 140 | private function _getAdminURLTools( $_bAdminPageEnabled ) { |
141 | - if ( ! $_bAdminPageEnabled ) { |
|
141 | + if ( !$_bAdminPageEnabled ) { |
|
142 | 142 | return; |
143 | 143 | } |
144 | - $_sLink = esc_url( |
|
144 | + $_sLink = esc_url( |
|
145 | 145 | add_query_arg( |
146 | 146 | array( |
147 | - 'page' => AdminPageFrameworkLoader_Registry::$aAdminPages['tool'], |
|
147 | + 'page' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'tool' ], |
|
148 | 148 | ), |
149 | 149 | admin_url( 'admin.php' ) |
150 | 150 | ) |
151 | 151 | ); |
152 | - return "<a href='{$_sLink}'>" . __( 'Tools', 'admin-page-framework-loader' ) . "</a>"; |
|
152 | + return "<a href='{$_sLink}'>".__( 'Tools', 'admin-page-framework-loader' )."</a>"; |
|
153 | 153 | } |
154 | 154 | /** |
155 | 155 | * Returns the Enable /Disable Admin Pages link. |
156 | 156 | */ |
157 | 157 | private function _getAdminPageSwitchLink( $bEnabled ) { |
158 | - $_sLink = esc_url( |
|
158 | + $_sLink = esc_url( |
|
159 | 159 | add_query_arg( |
160 | 160 | array( |
161 | 161 | 'enable_apfl_admin_pages' => $bEnabled ? 0 : 1, |
@@ -163,19 +163,19 @@ discard block |
||
163 | 163 | ) |
164 | 164 | ); |
165 | 165 | return $bEnabled |
166 | - ? "<a href='{$_sLink}'>" . __( 'Disable Admin Pages', 'admin-page-framework-loader' ) . "</a>" |
|
167 | - : "<a href='{$_sLink}'>" . __( 'Enable Admin Pages', 'admin-page-framework-loader' ) . "</a>"; |
|
166 | + ? "<a href='{$_sLink}'>".__( 'Disable Admin Pages', 'admin-page-framework-loader' )."</a>" |
|
167 | + : "<a href='{$_sLink}'>".__( 'Enable Admin Pages', 'admin-page-framework-loader' )."</a>"; |
|
168 | 168 | } |
169 | 169 | /** |
170 | 170 | * Returns the switch link of the demo pages. |
171 | 171 | */ |
172 | - private function _getDemoSwitcherLink( $_bAdminPageEnabled, $mOptions=array() ) { |
|
172 | + private function _getDemoSwitcherLink( $_bAdminPageEnabled, $mOptions = array() ) { |
|
173 | 173 | |
174 | - if ( ! $_bAdminPageEnabled ) { |
|
174 | + if ( !$_bAdminPageEnabled ) { |
|
175 | 175 | return ''; |
176 | 176 | } |
177 | - $_bEnabled = isset( $mOptions['enable_demo'] ) && $mOptions['enable_demo']; |
|
178 | - $_sLink = esc_url( |
|
177 | + $_bEnabled = isset( $mOptions[ 'enable_demo' ] ) && $mOptions[ 'enable_demo' ]; |
|
178 | + $_sLink = esc_url( |
|
179 | 179 | add_query_arg( |
180 | 180 | array( |
181 | 181 | 'enable_apfl_demo_pages' => $_bEnabled ? 0 : 1, |
@@ -183,8 +183,8 @@ discard block |
||
183 | 183 | ) |
184 | 184 | ); |
185 | 185 | return $_bEnabled |
186 | - ? "<a href='{$_sLink}'>" . __( 'Disable Demo', 'admin-page-framework-loader' ) . "</a>" |
|
187 | - : "<a href='{$_sLink}'><strong id='activate-demo-action-link' style='font-size: 1em;'>" . __( 'Enable Demo', 'admin-page-framework-loader' ) . "</strong></a>"; |
|
186 | + ? "<a href='{$_sLink}'>".__( 'Disable Demo', 'admin-page-framework-loader' )."</a>" |
|
187 | + : "<a href='{$_sLink}'><strong id='activate-demo-action-link' style='font-size: 1em;'>".__( 'Enable Demo', 'admin-page-framework-loader' )."</strong></a>"; |
|
188 | 188 | |
189 | 189 | } |
190 | 190 |
@@ -19,7 +19,7 @@ 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 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | do_action( 'admin_page_framework_loader_action_before_loading_demo' ); |
31 | 31 | |
32 | 32 | // Include example components. |
33 | - include( AdminPageFrameworkLoader_Registry::$sDirPath . '/example/admin-page-framework-demo-bootstrap.php' ); |
|
33 | + include( AdminPageFrameworkLoader_Registry::$sDirPath.'/example/admin-page-framework-demo-bootstrap.php' ); |
|
34 | 34 | |
35 | 35 | do_action( 'admin_page_framework_loader_action_after_loading_demo' ); |
36 | 36 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | // Check if the demo is enabled. |
49 | 49 | $_oOption = AdminPageFrameworkLoader_Option::getInstance(); |
50 | - if ( ! $_oOption->get( 'enable_demo' ) ) { |
|
50 | + if ( !$_oOption->get( 'enable_demo' ) ) { |
|
51 | 51 | $this->_setPointerToolTips(); |
52 | 52 | return false; |
53 | 53 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | 'options' => array( |
77 | 77 | 'content' => sprintf( '<h3> %1$s </h3> <p> %2$s </p>', |
78 | 78 | AdminPageFrameworkLoader_Registry::NAME, |
79 | - __( 'Check out the functionality of Admin Page Framework by enabling the demo.','admin-page-framework-loader' ) |
|
79 | + __( 'Check out the functionality of Admin Page Framework by enabling the demo.', 'admin-page-framework-loader' ) |
|
80 | 80 | ), |
81 | 81 | 'position' => array( 'edge' => 'left', 'align' => 'middle' ) |
82 | 82 | ) |
@@ -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() { |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | // Property object |
134 | 134 | $this->oProp = $oProp; |
135 | 135 | |
136 | - if ( $this->oProp->bIsAdmin && ! $this->oProp->bIsAdminAjax ) { |
|
136 | + if ( $this->oProp->bIsAdmin && !$this->oProp->bIsAdminAjax ) { |
|
137 | 137 | if ( did_action( 'current_screen' ) ) { |
138 | 138 | $this->_replyToLoadComponents(); |
139 | 139 | } else { |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $this->oLink = $this->oLink; |
161 | 161 | } |
162 | 162 | |
163 | - if ( ! $this->_isInThePage() ) { |
|
163 | + if ( !$this->_isInThePage() ) { |
|
164 | 164 | return; |
165 | 165 | } |
166 | 166 | |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | 'network_admin_page' => 'AdminPageFramework_HelpPane_Page', |
267 | 267 | 'post_meta_box' => 'AdminPageFramework_HelpPane_MetaBox', |
268 | 268 | 'page_meta_box' => 'AdminPageFramework_HelpPane_MetaBox_Page', |
269 | - 'post_type' => null, // no help pane class for the post type factory class. |
|
269 | + 'post_type' => null, // no help pane class for the post type factory class. |
|
270 | 270 | 'taxonomy_field' => 'AdminPageFramework_HelpPane_TaxonomyField', |
271 | 271 | 'widget' => 'AdminPageFramework_HelpPane_Widget', |
272 | 272 | 'user_meta' => 'AdminPageFramework_HelpPane_UserMeta', |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | */ |
328 | 328 | protected function _getPageLoadInfoInstance( $oProp, $oMsg ) { |
329 | 329 | |
330 | - if ( ! isset( $this->_aPageLoadClassNameMap[ $oProp->sStructureType ] ) ) { |
|
330 | + if ( !isset( $this->_aPageLoadClassNameMap[ $oProp->sStructureType ] ) ) { |
|
331 | 331 | return null; |
332 | 332 | } |
333 | 333 | $_sClassName = $this->_aPageLoadClassNameMap[ $oProp->sStructureType ]; |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | $_aClassNameMap = array_shift( $_aParams ); |
350 | 350 | $_sKey = array_shift( $_aParams ); |
351 | 351 | |
352 | - if ( ! isset( $_aClassNameMap[ $_sKey ] ) ) { |
|
352 | + if ( !isset( $_aClassNameMap[ $_sKey ] ) ) { |
|
353 | 353 | return null; |
354 | 354 | } |
355 | 355 | |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | */ |
414 | 414 | public function __get( $sPropertyName ) { |
415 | 415 | |
416 | - switch( $sPropertyName ) { |
|
416 | + switch ( $sPropertyName ) { |
|
417 | 417 | case 'oHeadTag': // 3.3.0+ for backward compatibility |
418 | 418 | $sPropertyName = 'oResource'; |
419 | 419 | break; |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | // Set and return the sub class object instance. |
423 | 423 | if ( in_array( $sPropertyName, $this->_aSubClassNames ) ) { |
424 | 424 | return call_user_func( |
425 | - array( $this, "_replyTpSetAndGetInstance_{$sPropertyName}" ) |
|
425 | + array( $this, "_replyTpSetAndGetInstance_{$sPropertyName}" ) |
|
426 | 426 | ); |
427 | 427 | } |
428 | 428 | |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | * |
504 | 504 | * @internal |
505 | 505 | */ |
506 | - public function __call( $sMethodName, $aArguments=null ) { |
|
506 | + public function __call( $sMethodName, $aArguments = null ) { |
|
507 | 507 | |
508 | 508 | $_mFirstArg = $this->oUtil->getElement( $aArguments, 0 ); |
509 | 509 | |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | |
543 | 543 | // Check if the method name contains a backslash. |
544 | 544 | if ( false === strpos( $sMethodName, "\\" ) ) { |
545 | - return $this->oUtil->getElement( $aArguments, 0 ); // the first element - the filter value |
|
545 | + return $this->oUtil->getElement( $aArguments, 0 ); // the first element - the filter value |
|
546 | 546 | } |
547 | 547 | |
548 | 548 | // if the method name contains a backslash, the user may be using a name space. |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | array( $this, $_sAutoCallbackClassName ), |
554 | 554 | $aArguments |
555 | 555 | ) |
556 | - : $this->oUtil->getElement( $aArguments, 0 ); // the first argument |
|
556 | + : $this->oUtil->getElement( $aArguments, 0 ); // the first argument |
|
557 | 557 | |
558 | 558 | } |
559 | 559 | |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | */ |
564 | 564 | private function _triggerUndefinedMethodWarning( $sMethodName ) { |
565 | 565 | trigger_error( |
566 | - AdminPageFramework_Registry::NAME . ': ' |
|
566 | + AdminPageFramework_Registry::NAME.': ' |
|
567 | 567 | . sprintf( |
568 | 568 | __( 'The method is not defined: %1$s', $this->oProp->sTextDomain ), |
569 | 569 | $sMethodName |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | if ( $this->oProp->bIsAdmin && ! $this->oProp->bIsAdminAjax ) { |
137 | 137 | if ( did_action( 'current_screen' ) ) { |
138 | 138 | $this->_replyToLoadComponents(); |
139 | - } else { |
|
139 | + } else { |
|
140 | 140 | add_action( 'current_screen', array( $this, '_replyToLoadComponents' ) ); |
141 | 141 | } |
142 | 142 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $this->oLink = $this->oLink; |
161 | 161 | } |
162 | 162 | |
163 | - if ( ! $this->_isInThePage() ) { |
|
163 | + if ( ! $this->_isInThePage() ) { |
|
164 | 164 | return; |
165 | 165 | } |
166 | 166 | |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * @since 3.1.0 |
198 | 198 | * @internal |
199 | 199 | */ |
200 | - protected function _isInstantiatable() { |
|
200 | + protected function _isInstantiatable() { |
|
201 | 201 | return true; |
202 | 202 | } |
203 | 203 | |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | * @since 3.2.0 Changed the scope to public from protected as the head tag object will access it. |
211 | 211 | * @internal |
212 | 212 | */ |
213 | - public function _isInThePage() { |
|
213 | + public function _isInThePage() { |
|
214 | 214 | return true; |
215 | 215 | } |
216 | 216 | |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | } |
421 | 421 | |
422 | 422 | // Set and return the sub class object instance. |
423 | - if ( in_array( $sPropertyName, $this->_aSubClassNames ) ) { |
|
423 | + if ( in_array( $sPropertyName, $this->_aSubClassNames ) ) { |
|
424 | 424 | return call_user_func( |
425 | 425 | array( $this, "_replyTpSetAndGetInstance_{$sPropertyName}" ) |
426 | 426 | ); |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | * |
504 | 504 | * @internal |
505 | 505 | */ |
506 | - public function __call( $sMethodName, $aArguments=null ) { |
|
506 | + public function __call( $sMethodName, $aArguments=null ) { |
|
507 | 507 | |
508 | 508 | $_mFirstArg = $this->oUtil->getElement( $aArguments, 0 ); |
509 | 509 |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Admin Page Framework |
|
4 | - * |
|
5 | - * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | - * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | - * |
|
8 | - */ |
|
3 | + * Admin Page Framework |
|
4 | + * |
|
5 | + * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | + * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | + * |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Provides methods to handle importing options. |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Admin Page Framework |
|
4 | - * |
|
5 | - * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | - * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | - * |
|
8 | - */ |
|
3 | + * Admin Page Framework |
|
4 | + * |
|
5 | + * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | + * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | + * |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Provides methods to handle importing options. |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @param object $oForm |
30 | 30 | * @param string $sHeadActionHook The action hook triggered inside the `<head>` tag. For front-end forms, use `wp_head`. |
31 | 31 | */ |
32 | - public function __construct( $oForm, $sHeadActionHook='admin_head' ) { |
|
32 | + public function __construct( $oForm, $sHeadActionHook = 'admin_head' ) { |
|
33 | 33 | |
34 | 34 | $this->oForm = $oForm; |
35 | 35 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * as multiple instances of the factory class is loaded among separate pages, |
54 | 54 | * one gets denied here and if it can load earlier than the one which should insert the below script. |
55 | 55 | */ |
56 | - if ( ! $this->oForm->isInThePage() ) { |
|
56 | + if ( !$this->oForm->isInThePage() ) { |
|
57 | 57 | return; |
58 | 58 | } |
59 | 59 | |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | private function _getScripts_RequiredInHead() { |
77 | 77 | return 'document.write( "<style class=\'admin-page-framework-js-embedded-inline-style\'>' |
78 | 78 | . str_replace( |
79 | - '\\n', // search |
|
80 | - '', // replace |
|
79 | + '\\n', // search |
|
80 | + '', // replace |
|
81 | 81 | esc_js( $this->_getInlineCSS() ) // subject |
82 | 82 | ) |
83 | 83 | . '</style>" );'; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | $this->oForm = $oForm; |
35 | 35 | |
36 | - if ( in_array( $this->oForm->aArguments[ 'structure_type' ], array( 'widget' ) ) ) { |
|
36 | + if ( in_array( $this->oForm->aArguments[ 'structure_type' ], array( 'widget' ) ) ) { |
|
37 | 37 | return; |
38 | 38 | } |
39 | 39 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * @return string |
98 | 98 | * @since DEVVER |
99 | 99 | */ |
100 | - private function _getScriptElementConcealerCSSRules() { |
|
100 | + private function _getScriptElementConcealerCSSRules() { |
|
101 | 101 | |
102 | 102 | // Avoid hiding framework forms in widgets. In some cases, the user sets a form in any page, |
103 | 103 | // which causes a different structure form type including `admin_page` gets loaded even in widgets.php (or any page builder pages dealing with widgets) |
@@ -103,10 +103,10 @@ discard block |
||
103 | 103 | * @since DEVVER |
104 | 104 | */ |
105 | 105 | public function _replyToEnqueueScripts() { |
106 | - if ( ! $this->oForm->isInThePage() ) { |
|
106 | + if ( !$this->oForm->isInThePage() ) { |
|
107 | 107 | return; |
108 | 108 | } |
109 | - foreach( $this->oForm->getResources( 'src_scripts' ) as $_asEnqueue ) { |
|
109 | + foreach ( $this->oForm->getResources( 'src_scripts' ) as $_asEnqueue ) { |
|
110 | 110 | $this->_enqueueScript( $_asEnqueue ); |
111 | 111 | } |
112 | 112 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | private function _getFormattedEnqueueScript( $asEnqueue ) { |
155 | 155 | static $_iCallCount = 1; |
156 | 156 | $_aEnqueueItem = $this->getAsArray( $asEnqueue ) + array( |
157 | - 'handle_id' => 'script_' . $this->oForm->aArguments[ 'caller_id' ] . '_' . $_iCallCount, |
|
157 | + 'handle_id' => 'script_'.$this->oForm->aArguments[ 'caller_id' ].'_'.$_iCallCount, |
|
158 | 158 | 'src' => null, |
159 | 159 | 'dependencies' => null, |
160 | 160 | 'version' => null, |
@@ -177,10 +177,10 @@ discard block |
||
177 | 177 | */ |
178 | 178 | public function _replyToEnqueueStyles() { |
179 | 179 | |
180 | - if ( ! $this->oForm->isInThePage() ) { |
|
180 | + if ( !$this->oForm->isInThePage() ) { |
|
181 | 181 | return; |
182 | 182 | } |
183 | - foreach( $this->oForm->getResources( 'src_styles' ) as $_asEnqueueItem ) { |
|
183 | + foreach ( $this->oForm->getResources( 'src_styles' ) as $_asEnqueueItem ) { |
|
184 | 184 | $this->_enqueueStyle( $_asEnqueueItem ); |
185 | 185 | } |
186 | 186 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | private function _getFormattedEnqueueStyle( $asEnqueue ) { |
202 | 202 | static $_iCallCount = 1; |
203 | 203 | $_aEnqueueItem = $this->getAsArray( $asEnqueue ) + array( |
204 | - 'handle_id' => 'style_' . $this->oForm->aArguments[ 'caller_id' ] . '_' . $_iCallCount, |
|
204 | + 'handle_id' => 'style_'.$this->oForm->aArguments[ 'caller_id' ].'_'.$_iCallCount, |
|
205 | 205 | 'src' => null, |
206 | 206 | 'dependencies' => null, |
207 | 207 | 'version' => null, |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | */ |
223 | 223 | public function _replyToAddStyle() { |
224 | 224 | |
225 | - if ( ! $this->oForm->isInThePage() ) { |
|
225 | + if ( !$this->oForm->isInThePage() ) { |
|
226 | 226 | return; |
227 | 227 | } |
228 | 228 | $_sCSSRules = $this->_getFormattedInlineStyles( |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | */ |
268 | 268 | public function _replyToAddScript() { |
269 | 269 | |
270 | - if ( ! $this->oForm->isInThePage() ) { |
|
270 | + if ( !$this->oForm->isInThePage() ) { |
|
271 | 271 | return; |
272 | 272 | } |
273 | 273 |
@@ -230,7 +230,7 @@ |
||
230 | 230 | ); |
231 | 231 | |
232 | 232 | $_sID = $this->sanitizeSlug( strtolower( $this->oForm->aArguments[ 'caller_id' ] ) ); |
233 | - if ( $_sCSSRules ) { |
|
233 | + if ( $_sCSSRules ) { |
|
234 | 234 | echo "<style type='text/css' id='inline-style-{$_sID}' class='admin-page-framework-form-style'>" |
235 | 235 | . $_sCSSRules |
236 | 236 | . "</style>"; |
@@ -82,11 +82,11 @@ discard block |
||
82 | 82 | 'confirm_perform_task' => 'Please confirm your action.', |
83 | 83 | 'specified_option_been_deleted' => 'The specified options have been deleted.', |
84 | 84 | 'nonce_verification_failed' => 'A problem occurred while processing the form data. Please try again.', |
85 | - 'check_max_input_vars' => 'Not all form fields could not be sent. Please check your server settings of PHP <code>max_input_vars</code> and consult the server administrator to increase the value. <code>max input vars</code>: %1$s. <code>$_POST</code> count: %2$s', // 3.5.11+ |
|
86 | - 'send_email' => 'Is it okay to send the email?', // 3.3.0+ |
|
87 | - 'email_sent' => 'The email has been sent.', // 3.3.0+, 3.3.5+ deprecated |
|
85 | + 'check_max_input_vars' => 'Not all form fields could not be sent. Please check your server settings of PHP <code>max_input_vars</code> and consult the server administrator to increase the value. <code>max input vars</code>: %1$s. <code>$_POST</code> count: %2$s', // 3.5.11+ |
|
86 | + 'send_email' => 'Is it okay to send the email?', // 3.3.0+ |
|
87 | + 'email_sent' => 'The email has been sent.', // 3.3.0+, 3.3.5+ deprecated |
|
88 | 88 | 'email_scheduled' => 'The email has been scheduled.', // 3.3.5+ |
89 | - 'email_could_not_send' => 'There was a problem sending the email', // 3.3.0+ |
|
89 | + 'email_could_not_send' => 'There was a problem sending the email', // 3.3.0+ |
|
90 | 90 | |
91 | 91 | // AdminPageFramework_PostType |
92 | 92 | 'title' => 'Title', |
@@ -112,14 +112,14 @@ discard block |
||
112 | 112 | 'upload_file' => 'Upload File', |
113 | 113 | 'use_this_file' => 'Use This File', |
114 | 114 | 'select_file' => 'Select File', |
115 | - 'remove_value' => 'Remove Value', // 3.2.0+ |
|
116 | - 'select_all' => 'Select All', // 3.3.0+ |
|
117 | - 'select_none' => 'Select None', // 3.3.0+ |
|
115 | + 'remove_value' => 'Remove Value', // 3.2.0+ |
|
116 | + 'select_all' => 'Select All', // 3.3.0+ |
|
117 | + 'select_none' => 'Select None', // 3.3.0+ |
|
118 | 118 | 'no_term_found' => 'No term found.', // 3.3.2+ |
119 | 119 | |
120 | 120 | // AdminPageFramework_Form_View___Script_{...} |
121 | 121 | 'select' => 'Select', // 3.4.2+ |
122 | - 'insert' => 'Insert', // 3.4.2+ |
|
122 | + 'insert' => 'Insert', // 3.4.2+ |
|
123 | 123 | 'use_this' => 'Use This', // 3.4.2+ |
124 | 124 | 'return_to_library' => 'Return to Library', // 3.4.2+ |
125 | 125 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | * @since 3.2.0 Changed it to create an instance per text domain basis. |
197 | 197 | * @remark This class should be instantiated via this method. |
198 | 198 | */ |
199 | - public static function getInstance( $sTextDomain='admin-page-framework' ) { |
|
199 | + public static function getInstance( $sTextDomain = 'admin-page-framework' ) { |
|
200 | 200 | |
201 | 201 | $_oInstance = isset( self::$_aInstancesByTextDomain[ $sTextDomain ] ) && ( self::$_aInstancesByTextDomain[ $sTextDomain ] instanceof AdminPageFramework_Message ) |
202 | 202 | ? self::$_aInstancesByTextDomain[ $sTextDomain ] |
@@ -209,21 +209,21 @@ discard block |
||
209 | 209 | * Ensures that only one instance of this class object exists. ( no multiple instances of this object ) |
210 | 210 | * @deprecated 3.2.0 |
211 | 211 | */ |
212 | - public static function instantiate( $sTextDomain='admin-page-framework' ) { |
|
212 | + public static function instantiate( $sTextDomain = 'admin-page-framework' ) { |
|
213 | 213 | return self::getInstance( $sTextDomain ); |
214 | 214 | } |
215 | 215 | |
216 | 216 | /** |
217 | 217 | * Sets up properties. |
218 | 218 | */ |
219 | - public function __construct( $sTextDomain='admin-page-framework' ) { |
|
219 | + public function __construct( $sTextDomain = 'admin-page-framework' ) { |
|
220 | 220 | |
221 | 221 | $this->_sTextDomain = $sTextDomain; |
222 | 222 | |
223 | 223 | // Fill the $aMessages property with the keys extracted from the $aDefaults property |
224 | 224 | // with the value of null. The null is set to let it trigger the __get() method |
225 | 225 | // so that each translation item gets processed individually. |
226 | - $this->aMessages = array_fill_keys( |
|
226 | + $this->aMessages = array_fill_keys( |
|
227 | 227 | array_keys( $this->aDefaults ), |
228 | 228 | null |
229 | 229 | ); |
@@ -257,13 +257,13 @@ discard block |
||
257 | 257 | * @since DEVVER If no key is specified, return the entire mesage array. |
258 | 258 | * @return string|array |
259 | 259 | */ |
260 | - public function get( $sKey='' ) { |
|
261 | - if ( ! $sKey ) { |
|
260 | + public function get( $sKey = '' ) { |
|
261 | + if ( !$sKey ) { |
|
262 | 262 | return $this->_getAllMessages(); |
263 | 263 | } |
264 | 264 | return isset( $this->aMessages[ $sKey ] ) |
265 | 265 | ? __( $this->aMessages[ $sKey ], $this->_sTextDomain ) |
266 | - : __( $this->{$sKey}, $this->_sTextDomain ); // triggers __get() |
|
266 | + : __( $this->{$sKey}, $this->_sTextDomain ); // triggers __get() |
|
267 | 267 | } |
268 | 268 | /** |
269 | 269 | * Returns the all registered messag items. |