@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | // When newly installed, the 'welcomed' value is not set. |
49 | 49 | $_oOption = AdminPageFrameworkLoader_Option::getInstance(); |
50 | - if ( ! $_oOption->get( 'welcomed' ) ) { |
|
50 | + if ( ! $_oOption->get( 'welcomed' ) ) { |
|
51 | 51 | $this->_setInitialOptions( $_oOption, AdminPageFrameworkLoader_Registry::VERSION ); |
52 | 52 | $this->_gotToWelcomePage(); // will exit |
53 | 53 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | } |
72 | 72 | |
73 | - private function _gotToWelcomePage() { |
|
73 | + private function _gotToWelcomePage() { |
|
74 | 74 | $_sWelcomePageURL = apply_filters( |
75 | 75 | AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_admin_welcome_redirect_url', |
76 | 76 | add_query_arg( |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function start() { |
27 | 27 | |
28 | - if ( ! is_admin() ) { |
|
28 | + if ( !is_admin() ) { |
|
29 | 29 | return; |
30 | 30 | } |
31 | 31 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | // When newly installed, the 'welcomed' value is not set. |
49 | 49 | $_oOption = AdminPageFrameworkLoader_Option::getInstance(); |
50 | - if ( ! $_oOption->get( 'welcomed' ) ) { |
|
50 | + if ( !$_oOption->get( 'welcomed' ) ) { |
|
51 | 51 | $this->_setInitialOptions( $_oOption, AdminPageFrameworkLoader_Registry::VERSION ); |
52 | 52 | $this->_gotToWelcomePage(); // will exit |
53 | 53 | } |
@@ -72,9 +72,9 @@ discard block |
||
72 | 72 | |
73 | 73 | private function _gotToWelcomePage() { |
74 | 74 | $_sWelcomePageURL = apply_filters( |
75 | - AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_admin_welcome_redirect_url', |
|
75 | + AdminPageFrameworkLoader_Registry::HOOK_SLUG.'_filter_admin_welcome_redirect_url', |
|
76 | 76 | add_query_arg( |
77 | - array( 'page' => AdminPageFrameworkLoader_Registry::$aAdminPages['about'] ), |
|
77 | + array( 'page' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ] ), |
|
78 | 78 | admin_url( 'index.php' ) // Dashboard |
79 | 79 | ) |
80 | 80 | ); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function setUp() { |
92 | 92 | |
93 | - $this->sPageSlug = AdminPageFrameworkLoader_Registry::$aAdminPages['about']; |
|
93 | + $this->sPageSlug = AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ]; |
|
94 | 94 | |
95 | 95 | // Root page |
96 | 96 | $this->setRootMenuPage( |
@@ -101,20 +101,20 @@ discard block |
||
101 | 101 | $this->addSubMenuItems( |
102 | 102 | array( |
103 | 103 | 'title' => AdminPageFrameworkLoader_Registry::SHORTNAME, |
104 | - 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ], // page slug |
|
104 | + 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ], // page slug |
|
105 | 105 | 'show_in_menu' => false, |
106 | 106 | 'style' => array( |
107 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/about.css', |
|
108 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/column.css', |
|
109 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/javascript/flip/jquery.m.flip.css', |
|
110 | - version_compare( $GLOBALS['wp_version'], '3.8', '<' ) |
|
107 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/about.css', |
|
108 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/column.css', |
|
109 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/javascript/flip/jquery.m.flip.css', |
|
110 | + version_compare( $GLOBALS[ 'wp_version' ], '3.8', '<' ) |
|
111 | 111 | ? ".about-wrap .introduction h2 { |
112 | 112 | padding: 1em; |
113 | 113 | }" |
114 | 114 | : "", |
115 | 115 | ), |
116 | 116 | 'script' => array( |
117 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/javascript/flip/jquery.m.flip.js', |
|
117 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/javascript/flip/jquery.m.flip.js', |
|
118 | 118 | "jQuery( document ).ready( function() { |
119 | 119 | jQuery( '.apf-badge-image' ).mflip(); |
120 | 120 | } );", |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | $this->setPluginSettingsLinkLabel( '' ); // pass an empty string to disable it. |
130 | 130 | |
131 | 131 | // Hook |
132 | - add_action( "load_" . AdminPageFrameworkLoader_Registry::$aAdminPages['about'], array( $this, 'replyToLoadPage' ) ); |
|
132 | + add_action( "load_".AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ], array( $this, 'replyToLoadPage' ) ); |
|
133 | 133 | |
134 | 134 | } |
135 | 135 | |
@@ -140,16 +140,16 @@ discard block |
||
140 | 140 | */ |
141 | 141 | public function replyToLoadPage( $oFactory ) { |
142 | 142 | |
143 | - $_sPageSlug = AdminPageFrameworkLoader_Registry::$aAdminPages['about']; |
|
143 | + $_sPageSlug = AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ]; |
|
144 | 144 | new AdminPageFrameworkLoader_AdminPageWelcome_Welcome( |
145 | - $this, // factory object |
|
146 | - $_sPageSlug, // page slug |
|
145 | + $this, // factory object |
|
146 | + $_sPageSlug, // page slug |
|
147 | 147 | array( |
148 | 148 | 'tab_slug' => 'welcome', |
149 | 149 | // 'title' => __( "What's New", 'admin-page-framework-loader' ), // ' |
150 | 150 | 'style' => array( |
151 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/admin.css', |
|
152 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/code.css', |
|
151 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/admin.css', |
|
152 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/code.css', |
|
153 | 153 | ' .main-image, .main-image img { text-align: center; max-width: 90%; margin-left: auto; margin-right: auto; } ', |
154 | 154 | ), |
155 | 155 | ) |
@@ -179,24 +179,24 @@ discard block |
||
179 | 179 | */ |
180 | 180 | public function replyToFilterContentTop( $sContent ) { |
181 | 181 | |
182 | - $_sVersion = '- ' . AdminPageFrameworkLoader_Registry::VERSION; |
|
183 | - $_sPluginName = AdminPageFrameworkLoader_Registry::SHORTNAME . ' ' . $_sVersion; |
|
182 | + $_sVersion = '- '.AdminPageFrameworkLoader_Registry::VERSION; |
|
183 | + $_sPluginName = AdminPageFrameworkLoader_Registry::SHORTNAME.' '.$_sVersion; |
|
184 | 184 | |
185 | 185 | $_sBadgeURL = esc_url( AdminPageFrameworkLoader_Registry::getPluginURL( 'asset/image/icon-128x128.png' ) ); |
186 | 186 | |
187 | 187 | $_aOutput = array(); |
188 | - $_aOutput[] = "<h1>" |
|
188 | + $_aOutput[ ] = "<h1>" |
|
189 | 189 | . sprintf( __( 'Welcome to %1$s', 'admin-page-framework-loader' ), $_sPluginName ) |
190 | 190 | . "</h1>"; |
191 | - $_aOutput[] = "<div class='about-text'>" |
|
191 | + $_aOutput[ ] = "<div class='about-text'>" |
|
192 | 192 | . sprintf( __( 'Thank you for updating to the latest version! %1$s is ready to make your plugin or theme development faster, more organized and better!', 'admin-page-framework-loader' ), $_sPluginName ) |
193 | 193 | . "</div>"; |
194 | - $_aOutput[] = '' |
|
194 | + $_aOutput[ ] = '' |
|
195 | 195 | . "<div class='apf-badge'>" |
196 | 196 | . "<div class='apf-badge-image m-flip'>" |
197 | 197 | . "<img src='{$_sBadgeURL}' />" |
198 | 198 | . "</div>" |
199 | - . "<span class='label'>" . sprintf( __( 'Version %1$s', 'admin-page-framework-loader' ), $_sVersion ) . "</span>" |
|
199 | + . "<span class='label'>".sprintf( __( 'Version %1$s', 'admin-page-framework-loader' ), $_sVersion )."</span>" |
|
200 | 200 | . "</div>"; |
201 | 201 | |
202 | 202 | return implode( PHP_EOL, $_aOutput ) |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | 'tab_slug' => $this->sTabSlug, |
30 | 30 | 'section_id' => $this->sTabSlug, |
31 | 31 | 'section_tab_slug' => 'welcome', |
32 | - 'title' => __( "What's New", 'admin-page-framework-loader' ), // ' |
|
32 | + 'title' => __( "What's New", 'admin-page-framework-loader' ), // ' |
|
33 | 33 | 'content' => $this->_getReadmeContents( |
34 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/text/about.txt', |
|
34 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/text/about.txt', |
|
35 | 35 | '', // TOC title |
36 | 36 | array( 'New Features' ) // section |
37 | 37 | ) |
@@ -40,10 +40,10 @@ discard block |
||
40 | 40 | 'tab_slug' => $this->sTabSlug, |
41 | 41 | 'section_tab_slug' => $this->sTabSlug, |
42 | 42 | 'section_id' => 'getting_started', |
43 | - 'title' => __( "Getting Started", 'admin-page-framework-loader' ), // ' |
|
43 | + 'title' => __( "Getting Started", 'admin-page-framework-loader' ), // ' |
|
44 | 44 | 'content' => $this->_getReadmeContents( |
45 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/text/about.txt', |
|
46 | - "<h3>" . __( 'Contents', 'admin-page-framework-loader' ) . "</h3>", |
|
45 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/text/about.txt', |
|
46 | + "<h3>".__( 'Contents', 'admin-page-framework-loader' )."</h3>", |
|
47 | 47 | array( 'Getting Started', 'Tutorials' ) |
48 | 48 | ), |
49 | 49 | ), |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | 'tab_slug' => $this->sTabSlug, |
52 | 52 | 'section_tab_slug' => $this->sTabSlug, |
53 | 53 | 'section_id' => 'change_log', |
54 | - 'title' => __( "Change Log", 'admin-page-framework-loader' ), // ' |
|
54 | + 'title' => __( "Change Log", 'admin-page-framework-loader' ), // ' |
|
55 | 55 | 'content' => $this->_getChangeLog(), |
56 | 56 | ) |
57 | 57 | ); |
@@ -87,13 +87,13 @@ discard block |
||
87 | 87 | array( |
88 | 88 | 'field_id' => 'github_star', |
89 | 89 | 'type' => 'github', |
90 | - 'user_name' => 'michaeluno', // the GitHub account ID |
|
91 | - 'button_type' => 'star', // either of the followings: follow, star, watch, fork, issue |
|
90 | + 'user_name' => 'michaeluno', // the GitHub account ID |
|
91 | + 'button_type' => 'star', // either of the followings: follow, star, watch, fork, issue |
|
92 | 92 | 'count' => false, |
93 | 93 | 'repository' => 'admin-page-framework', |
94 | 94 | 'size' => 'mega', |
95 | 95 | 'attributes' => array( |
96 | - 'data-text' => ' ' . AdminPageFramework_Registry::NAME . ' ' . AdminPageFramework_Registry::getVersion() . ' ', |
|
96 | + 'data-text' => ' '.AdminPageFramework_Registry::NAME.' '.AdminPageFramework_Registry::getVersion().' ', |
|
97 | 97 | // 'data-icon' => 'octicon-mark-github', |
98 | 98 | ), |
99 | 99 | 'description' => __( 'Star the repository and get Involved!', 'admin-page-framework-loader' ), |
@@ -133,26 +133,26 @@ discard block |
||
133 | 133 | * @since 3.6.1 |
134 | 134 | * @return void |
135 | 135 | */ |
136 | - private function _getChangeLog( $sSection='Changelog' ) { |
|
136 | + private function _getChangeLog( $sSection = 'Changelog' ) { |
|
137 | 137 | |
138 | - $_aReplacements = array( |
|
138 | + $_aReplacements = array( |
|
139 | 139 | '%PLUGIN_DIR_URL%' => AdminPageFrameworkLoader_Registry::getPluginURL(), |
140 | 140 | '%WP_ADMIN_URL%' => admin_url(), |
141 | 141 | ); |
142 | 142 | $_oWPReadmeParser = new AdminPageFramework_WPReadmeParser( |
143 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/readme.txt', |
|
143 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/readme.txt', |
|
144 | 144 | $_aReplacements |
145 | 145 | ); |
146 | 146 | $_sChangeLog = $_oWPReadmeParser->getSection( $sSection ); |
147 | 147 | $_oWPReadmeParser = new AdminPageFramework_WPReadmeParser( |
148 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/changelog.md', |
|
148 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/changelog.md', |
|
149 | 149 | $_aReplacements |
150 | 150 | ); |
151 | 151 | $_sChangeLog .= $_oWPReadmeParser->getSection( $sSection ); |
152 | 152 | |
153 | 153 | $_sChangeLog = $_sChangeLog |
154 | 154 | ? $_sChangeLog |
155 | - : '<p>' . __( 'No valid changlog was found.', 'admin-page-framework-loader' ) . '</p>'; |
|
155 | + : '<p>'.__( 'No valid changlog was found.', 'admin-page-framework-loader' ).'</p>'; |
|
156 | 156 | return "<div class='changelog'>" |
157 | 157 | . $_sChangeLog |
158 | 158 | . "</div>"; |
@@ -183,18 +183,18 @@ discard block |
||
183 | 183 | return ''; |
184 | 184 | } |
185 | 185 | |
186 | - $_aOutput = array(); |
|
186 | + $_aOutput = array(); |
|
187 | 187 | foreach ( $_aContributors as $_oContributor ) { |
188 | - $_aOutput[] = '<li class="wp-person">'; |
|
189 | - $_aOutput[] .= sprintf( '<a href="%s" title="%s">', |
|
190 | - esc_url( 'https://github.com/' . $_oContributor->login ), |
|
188 | + $_aOutput[ ] = '<li class="wp-person">'; |
|
189 | + $_aOutput[ ] .= sprintf( '<a href="%s" title="%s">', |
|
190 | + esc_url( 'https://github.com/'.$_oContributor->login ), |
|
191 | 191 | esc_html( sprintf( __( 'View %s', 'admin-page-framework-loader' ), $_oContributor->login ) ) |
192 | 192 | ); |
193 | - $_aOutput[] .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $_oContributor->avatar_url ), esc_html( $_oContributor->login ) ); |
|
194 | - $_aOutput[] .= '</a>'; |
|
195 | - $_aOutput[] .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/' . $_oContributor->login ), esc_html( $_oContributor->login ) ); |
|
196 | - $_aOutput[] .= '</a>'; |
|
197 | - $_aOutput[] .= '</li>'; |
|
193 | + $_aOutput[ ] .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $_oContributor->avatar_url ), esc_html( $_oContributor->login ) ); |
|
194 | + $_aOutput[ ] .= '</a>'; |
|
195 | + $_aOutput[ ] .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/'.$_oContributor->login ), esc_html( $_oContributor->login ) ); |
|
196 | + $_aOutput[ ] .= '</a>'; |
|
197 | + $_aOutput[ ] .= '</li>'; |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | return '<ul class="wp-people-group">' |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | return $_aContributors; |
219 | 219 | } |
220 | 220 | |
221 | - $_mResponse = wp_remote_get( $sRepositoryURL . '/contributors', array( 'sslverify' => false ) ); |
|
221 | + $_mResponse = wp_remote_get( $sRepositoryURL.'/contributors', array( 'sslverify' => false ) ); |
|
222 | 222 | |
223 | 223 | if ( is_wp_error( $_mResponse ) || 200 != wp_remote_retrieve_response_code( $_mResponse ) ) { |
224 | 224 | return array(); |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | |
227 | 227 | $_aContributors = json_decode( wp_remote_retrieve_body( $_mResponse ) ); |
228 | 228 | |
229 | - if ( ! is_array( $_aContributors ) ) |
|
229 | + if ( !is_array( $_aContributors ) ) |
|
230 | 230 | return array(); |
231 | 231 | |
232 | 232 | set_transient( 'apfl_contributors', $_aContributors, 3600 ); |
@@ -226,8 +226,9 @@ |
||
226 | 226 | |
227 | 227 | $_aContributors = json_decode( wp_remote_retrieve_body( $_mResponse ) ); |
228 | 228 | |
229 | - if ( ! is_array( $_aContributors ) ) |
|
230 | - return array(); |
|
229 | + if ( ! is_array( $_aContributors ) ) { |
|
230 | + return array(); |
|
231 | + } |
|
231 | 232 | |
232 | 233 | set_transient( 'apfl_contributors', $_aContributors, 3600 ); |
233 | 234 |
@@ -1,20 +1,20 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Loads the demo components. |
|
4 | - * |
|
5 | - * @package Admin Page Framework Loader |
|
6 | - * @copyright Copyright (c) 2014, Michael Uno |
|
7 | - * @author Michael Uno |
|
8 | - * @authorurl http://michaeluno.jp |
|
9 | - * @since 3.5.0 |
|
10 | - */ |
|
3 | + * Loads the demo components. |
|
4 | + * |
|
5 | + * @package Admin Page Framework Loader |
|
6 | + * @copyright Copyright (c) 2014, Michael Uno |
|
7 | + * @author Michael Uno |
|
8 | + * @authorurl http://michaeluno.jp |
|
9 | + * @since 3.5.0 |
|
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,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 | return false; |
52 | 52 | } |
53 | 53 |
@@ -18,19 +18,19 @@ 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 | - if ( ! is_network_admin() ) { |
|
24 | + if ( !is_network_admin() ) { |
|
25 | 25 | return; |
26 | 26 | } |
27 | 27 | |
28 | 28 | // Enable / disable the demo pages |
29 | - if ( isset( $_GET['enable_apfl_demo_pages'] ) ) { |
|
29 | + if ( isset( $_GET[ 'enable_apfl_demo_pages' ] ) ) { |
|
30 | 30 | |
31 | 31 | // Update the options and reload the page |
32 | - $_oOption = AdminPageFrameworkLoader_Option::getInstance( AdminPageFrameworkLoader_Registry::$aOptionKeys['main'] ); |
|
33 | - $_oOption->update( 'enable_demo', $_GET['enable_apfl_demo_pages'] ); |
|
32 | + $_oOption = AdminPageFrameworkLoader_Option::getInstance( AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ] ); |
|
33 | + $_oOption->update( 'enable_demo', $_GET[ 'enable_apfl_demo_pages' ] ); |
|
34 | 34 | exit( wp_safe_redirect( remove_query_arg( 'enable_apfl_demo_pages' ) ) ); |
35 | 35 | |
36 | 36 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $this->_getDemoSwitcherLink( $this->oProp->aOptions ) |
50 | 50 | ); |
51 | 51 | $this->addLinkToPluginDescription( |
52 | - "<a href='https://wordpress.org/support/plugin/admin-page-framework' target='_blank'>" . __( 'Support', 'admin-page-framework-loader' ) . "</a>" |
|
52 | + "<a href='https://wordpress.org/support/plugin/admin-page-framework' target='_blank'>".__( 'Support', 'admin-page-framework-loader' )."</a>" |
|
53 | 53 | ); |
54 | 54 | |
55 | 55 | } |
@@ -57,10 +57,10 @@ discard block |
||
57 | 57 | /** |
58 | 58 | * Returns the switch link of the demo pages. |
59 | 59 | */ |
60 | - private function _getDemoSwitcherLink( $mOptions=array() ) { |
|
60 | + private function _getDemoSwitcherLink( $mOptions = array() ) { |
|
61 | 61 | |
62 | - $_bEnabled = isset( $mOptions['enable_demo'] ) && $mOptions['enable_demo']; |
|
63 | - $_sLink = esc_url( |
|
62 | + $_bEnabled = isset( $mOptions[ 'enable_demo' ] ) && $mOptions[ 'enable_demo' ]; |
|
63 | + $_sLink = esc_url( |
|
64 | 64 | add_query_arg( |
65 | 65 | array( |
66 | 66 | 'enable_apfl_demo_pages' => $_bEnabled ? 0 : 1, |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | ) |
69 | 69 | ); |
70 | 70 | return $_bEnabled |
71 | - ? "<a href='{$_sLink}'>" . __( 'Disable Demo', 'admin-page-framework-loader' ) . "</a>" |
|
72 | - : "<a href='{$_sLink}'><strong style='font-size: 1em;'>" . __( 'Enable Demo', 'admin-page-framework-loader' ) . "</strong></a>"; |
|
71 | + ? "<a href='{$_sLink}'>".__( 'Disable Demo', 'admin-page-framework-loader' )."</a>" |
|
72 | + : "<a href='{$_sLink}'><strong style='font-size: 1em;'>".__( 'Enable Demo', 'admin-page-framework-loader' )."</strong></a>"; |
|
73 | 73 | |
74 | 74 | } |
75 | 75 |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | * |
11 | 11 | */ |
12 | 12 | |
13 | -if ( ! class_exists( 'AdminPageFramework_PluginBootstrap' ) ) { |
|
13 | +if ( !class_exists( 'AdminPageFramework_PluginBootstrap' ) ) { |
|
14 | 14 | return; |
15 | 15 | } |
16 | 16 | |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | |
32 | 32 | // Include the include lists. The including file reassigns the list(array) to the $_aClassFiles variable. |
33 | 33 | $_aClassFiles = array(); |
34 | - $_bLoaded = include( dirname( $this->sFilePath ) . '/include/admin-page-framework-loader-include-class-file-list.php' ); |
|
35 | - if ( ! $_bLoaded ) { |
|
34 | + $_bLoaded = include( dirname( $this->sFilePath ).'/include/admin-page-framework-loader-include-class-file-list.php' ); |
|
35 | + if ( !$_bLoaded ) { |
|
36 | 36 | return $_aClassFiles; |
37 | 37 | } |
38 | 38 | return $_aClassFiles; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | if ( $_oRequirementCheck->check() ) { |
62 | 62 | $_oRequirementCheck->deactivatePlugin( |
63 | 63 | $this->sFilePath, |
64 | - __( 'Deactivating the plugin', 'admin-page-framework-loader' ), // additional message |
|
64 | + __( 'Deactivating the plugin', 'admin-page-framework-loader' ), // additional message |
|
65 | 65 | true // is in the activation hook. This will exit the script. |
66 | 66 | ); |
67 | 67 | } |
@@ -76,20 +76,20 @@ discard block |
||
76 | 76 | public function setLocalization() { |
77 | 77 | |
78 | 78 | // This plugin does not have messages to be displayed in the front end. |
79 | - if ( ! $this->bIsAdmin ) { |
|
79 | + if ( !$this->bIsAdmin ) { |
|
80 | 80 | return; |
81 | 81 | } |
82 | 82 | |
83 | 83 | load_plugin_textdomain( |
84 | 84 | AdminPageFrameworkLoader_Registry::TEXT_DOMAIN, |
85 | 85 | false, |
86 | - dirname( plugin_basename( $this->sFilePath ) ) . '/' . AdminPageFrameworkLoader_Registry::TEXT_DOMAIN_PATH |
|
86 | + dirname( plugin_basename( $this->sFilePath ) ).'/'.AdminPageFrameworkLoader_Registry::TEXT_DOMAIN_PATH |
|
87 | 87 | ); |
88 | 88 | |
89 | 89 | load_plugin_textdomain( |
90 | 90 | 'admin-page-framework', |
91 | 91 | false, |
92 | - dirname( plugin_basename( $this->sFilePath ) ) . '/' . AdminPageFrameworkLoader_Registry::TEXT_DOMAIN_PATH |
|
92 | + dirname( plugin_basename( $this->sFilePath ) ).'/'.AdminPageFrameworkLoader_Registry::TEXT_DOMAIN_PATH |
|
93 | 93 | ); |
94 | 94 | |
95 | 95 | } |
@@ -112,33 +112,33 @@ discard block |
||
112 | 112 | |
113 | 113 | // Loader plugin admin pages. |
114 | 114 | new AdminPageFrameworkLoader_AdminPage( |
115 | - AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ], // the option key |
|
115 | + AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ], // the option key |
|
116 | 116 | $this->sFilePath // caller script path |
117 | 117 | ); |
118 | 118 | |
119 | 119 | new AdminPageFrameworkLoader_AdminPageMetaBox_Notification( |
120 | - null, // meta box id - passing null will make it auto generate |
|
120 | + null, // meta box id - passing null will make it auto generate |
|
121 | 121 | __( 'Notification', 'admin-page-framework-loader' ), // title |
122 | 122 | array( // page slugs |
123 | 123 | AdminPageFrameworkLoader_Registry::$aAdminPages[ 'tool' ], |
124 | 124 | AdminPageFrameworkLoader_Registry::$aAdminPages[ 'addon' ], |
125 | 125 | AdminPageFrameworkLoader_Registry::$aAdminPages[ 'help' ], |
126 | 126 | ), |
127 | - 'side', // context |
|
127 | + 'side', // context |
|
128 | 128 | 'default' // priority |
129 | 129 | ); |
130 | 130 | new AdminPageFrameworkLoader_AdminPageMetaBox_ExternalLinks( |
131 | - null, // meta box id - passing null will make it auto generate |
|
131 | + null, // meta box id - passing null will make it auto generate |
|
132 | 132 | __( 'Resources', 'admin-page-framework-loader' ), // title |
133 | 133 | array( // page slugs |
134 | 134 | AdminPageFrameworkLoader_Registry::$aAdminPages[ 'help' ], |
135 | 135 | ), |
136 | - 'side', // context |
|
136 | + 'side', // context |
|
137 | 137 | 'default' // priority |
138 | 138 | ); |
139 | 139 | |
140 | 140 | new AdminPageFrameworkLoader_NetworkAdmin( |
141 | - AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ], // the option key |
|
141 | + AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ], // the option key |
|
142 | 142 | $this->sFilePath // caller script path |
143 | 143 | ); |
144 | 144 | |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | */ |
158 | 158 | private function _shouldShowAdminPages() { |
159 | 159 | |
160 | - if ( ! $this->bIsAdmin ) { |
|
160 | + if ( !$this->bIsAdmin ) { |
|
161 | 161 | return false; |
162 | 162 | } |
163 | 163 | if ( defined( 'APFL_SILENT_MODE' ) && APFL_SILENT_MODE ) { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | AdminPageFrameworkLoader_Registry::NAME |
59 | 59 | ); |
60 | 60 | |
61 | - if ( $_oRequirementCheck->check() ) { |
|
61 | + if ( $_oRequirementCheck->check() ) { |
|
62 | 62 | $_oRequirementCheck->deactivatePlugin( |
63 | 63 | $this->sFilePath, |
64 | 64 | __( 'Deactivating the plugin', 'admin-page-framework-loader' ), // additional message |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | public function setLocalization() { |
77 | 77 | |
78 | 78 | // This plugin does not have messages to be displayed in the front end. |
79 | - if ( ! $this->bIsAdmin ) { |
|
79 | + if ( ! $this->bIsAdmin ) { |
|
80 | 80 | return; |
81 | 81 | } |
82 | 82 |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | * Stores the option values. |
29 | 29 | */ |
30 | 30 | public $aOptions = array( |
31 | - 'welcomed' => false, // if the welcome screen is displayed, this will be true. |
|
32 | - 'enable_admin_pages' => true, // whether or not to enable the admin pages of the loader plugin. |
|
31 | + 'welcomed' => false, // if the welcome screen is displayed, this will be true. |
|
32 | + 'enable_admin_pages' => true, // whether or not to enable the admin pages of the loader plugin. |
|
33 | 33 | 'enable_demo' => false, |
34 | - 'version_upgraded_from' => null, // the version number that the user has upgraded from |
|
35 | - 'version_saved' => null, // represents the option version. |
|
34 | + 'version_upgraded_from' => null, // the version number that the user has upgraded from |
|
35 | + 'version_saved' => null, // represents the option version. |
|
36 | 36 | ); |
37 | 37 | |
38 | 38 | /** |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @since 3.5.0 |
54 | 54 | */ |
55 | - static public function getInstance( $sOptionKey='' ) { |
|
55 | + static public function getInstance( $sOptionKey = '' ) { |
|
56 | 56 | |
57 | 57 | $sOptionKey = $sOptionKey |
58 | 58 | ? $sOptionKey |
59 | - : AdminPageFrameworkLoader_Registry::$aOptionKeys['main']; |
|
59 | + : AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ]; |
|
60 | 60 | |
61 | 61 | if ( isset( self::$aInstances[ $sOptionKey ] ) ) { |
62 | 62 | return self::$aInstances[ $sOptionKey ]; |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function __construct( $sOptionKey ) { |
75 | 75 | |
76 | - $this->bIsNetworkAdmin = is_network_admin(); // must be done first |
|
76 | + $this->bIsNetworkAdmin = is_network_admin(); // must be done first |
|
77 | 77 | $this->sOptionKey = $sOptionKey; |
78 | 78 | $this->aOptions = $this->_getFormattedOptions( $sOptionKey ); |
79 | 79 | |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | */ |
99 | 99 | public function hasUpgraded() { |
100 | 100 | |
101 | - $_sOptionVersion = $this->get( 'version_saved' ); |
|
102 | - if ( ! $_sOptionVersion ) { |
|
101 | + $_sOptionVersion = $this->get( 'version_saved' ); |
|
102 | + if ( !$_sOptionVersion ) { |
|
103 | 103 | return false; |
104 | 104 | } |
105 | 105 | $_sOptionVersion = $this->_getVersionByDepth( $_sOptionVersion ); |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | * Returns a stating part of version by the given depth. |
112 | 112 | * @since 3.5.0 |
113 | 113 | */ |
114 | - private function _getVersionByDepth( $sVersion, $iDepth=2 ) { |
|
115 | - if ( ! $iDepth ) { |
|
114 | + private function _getVersionByDepth( $sVersion, $iDepth = 2 ) { |
|
115 | + if ( !$iDepth ) { |
|
116 | 116 | return $sVersion; |
117 | 117 | } |
118 | 118 | $_aParts = explode( '.', $sVersion ); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | /** |
124 | 124 | * Deletes the option from the database. |
125 | 125 | */ |
126 | - public function delete() { |
|
126 | + public function delete() { |
|
127 | 127 | return $this->bIsNetworkAdmin |
128 | 128 | ? delete_site_option( $this->sOptionKey ) |
129 | 129 | : delete_option( $this->sOptionKey ); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | /** |
133 | 133 | * Saves the options. |
134 | 134 | */ |
135 | - public function save( $aOptions=null ) { |
|
135 | + public function save( $aOptions = null ) { |
|
136 | 136 | |
137 | 137 | $_aOptions = $aOptions ? $aOptions : $this->aOptions; |
138 | 138 | return $this->bIsNetworkAdmin |
@@ -151,15 +151,15 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function set( /* $asKeys, $mValue */ ) { |
153 | 153 | |
154 | - $_aParameters = func_get_args(); |
|
155 | - if ( ! isset( $_aParameters[ 0 ], $_aParameters[ 1 ] ) ) { |
|
154 | + $_aParameters = func_get_args(); |
|
155 | + if ( !isset( $_aParameters[ 0 ], $_aParameters[ 1 ] ) ) { |
|
156 | 156 | return; |
157 | 157 | } |
158 | 158 | $_asKeys = $_aParameters[ 0 ]; |
159 | 159 | $_mValue = $_aParameters[ 1 ]; |
160 | 160 | |
161 | 161 | // string, integer, float, boolean |
162 | - if ( ! is_array( $_asKeys ) ) { |
|
162 | + if ( !is_array( $_asKeys ) ) { |
|
163 | 163 | $this->aOptions[ $_asKeys ] = $_mValue; |
164 | 164 | return; |
165 | 165 | } |
@@ -174,8 +174,8 @@ discard block |
||
174 | 174 | */ |
175 | 175 | public function update( /* $asKeys, $mValue */ ) { |
176 | 176 | |
177 | - $_aParameters = func_get_args(); |
|
178 | - call_user_func_array( array( $this, 'set' ), $_aParameters ); |
|
177 | + $_aParameters = func_get_args(); |
|
178 | + call_user_func_array( array( $this, 'set' ), $_aParameters ); |
|
179 | 179 | $this->save(); |
180 | 180 | |
181 | 181 | } |
@@ -189,11 +189,11 @@ discard block |
||
189 | 189 | |
190 | 190 | $_mDefault = null; |
191 | 191 | $_aKeys = func_get_args(); |
192 | - if ( ! isset( $_aKeys[ 0 ] ) ) { |
|
192 | + if ( !isset( $_aKeys[ 0 ] ) ) { |
|
193 | 193 | return null; |
194 | 194 | } |
195 | 195 | if ( is_array( $_aKeys[ 0 ] ) ) { |
196 | - $_aKeys = $_aKeys[ 0 ]; |
|
196 | + $_aKeys = $_aKeys[ 0 ]; |
|
197 | 197 | $_mDefault = isset( $_aKeys[ 1 ] ) |
198 | 198 | ? $_aKeys[ 1 ] |
199 | 199 | : null; |
@@ -123,7 +123,7 @@ |
||
123 | 123 | /** |
124 | 124 | * Deletes the option from the database. |
125 | 125 | */ |
126 | - public function delete() { |
|
126 | + public function delete() { |
|
127 | 127 | return $this->bIsNetworkAdmin |
128 | 128 | ? delete_site_option( $this->sOptionKey ) |
129 | 129 | : delete_option( $this->sOptionKey ); |
@@ -24,7 +24,7 @@ |
||
24 | 24 | public function __construct() { |
25 | 25 | |
26 | 26 | new AdminPageFrameworkLoader_Event_Action_GetDevelopmentVersion( |
27 | - AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_action_get_development_version' // action name |
|
27 | + AdminPageFrameworkLoader_Registry::HOOK_SLUG.'_action_get_development_version' // action name |
|
28 | 28 | ); |
29 | 29 | |
30 | 30 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function replyToDoAction() { |
41 | 41 | AdminPageFramework_WPUtility::setTransient( |
42 | - AdminPageFrameworkLoader_Registry::TRANSIENT_PREFIX . 'devver', |
|
42 | + AdminPageFrameworkLoader_Registry::TRANSIENT_PREFIX.'devver', |
|
43 | 43 | $this->_getVersion(), // data - if an error occurs, an empty string will be given |
44 | 44 | 604800 // for one week |
45 | 45 | ); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $_sPageBody = $this->_getPageBody(); |
56 | 56 | $_aHeaders = $_oUtil->getScriptData( |
57 | 57 | $_sPageBody, |
58 | - '', /// context |
|
58 | + '', /// context |
|
59 | 59 | array( 'version' => 'Version' ) |
60 | 60 | ); |
61 | 61 | return $_oUtil->getElement( |
@@ -26,7 +26,7 @@ |
||
26 | 26 | * |
27 | 27 | * @since 3.6.2 |
28 | 28 | */ |
29 | - public function __construct( $sActionName ) { |
|
29 | + public function __construct( $sActionName ) { |
|
30 | 30 | add_action( |
31 | 31 | $sActionName, |
32 | 32 | array( $this, 'replyToDoAction' ) |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * |
48 | 48 | * @return array |
49 | 49 | */ |
50 | - public function get( $iItems=0 ) { |
|
50 | + public function get( $iItems = 0 ) { |
|
51 | 51 | |
52 | 52 | $_aOutput = array(); |
53 | 53 | $_aURLs = $this->_aURLs; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | return $_aOutput; |
57 | 57 | } |
58 | 58 | |
59 | - $_oFeed = fetch_feed( $_aURLs ); |
|
59 | + $_oFeed = fetch_feed( $_aURLs ); |
|
60 | 60 | foreach ( $_oFeed->get_items() as $_oItem ) { |
61 | 61 | $_aOutput[ $_oItem->get_title() ] = array( |
62 | 62 | 'content' => $_oItem->get_content(), |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | 'title' => $_oItem->get_title(), |
65 | 65 | 'date' => $_oItem->get_date( 'j F Y, g:i a' ), |
66 | 66 | 'author' => $_oItem->get_author(), |
67 | - 'link' => $_oItem->get_permalink(), // get_link() may be used as well |
|
67 | + 'link' => $_oItem->get_permalink(), // get_link() may be used as well |
|
68 | 68 | ); |
69 | 69 | } |
70 | 70 |