@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | public function getClasses() { |
32 | 32 | |
33 | 33 | // Include the include lists. The including file reassigns the list(array) to the $_aClassFiles variable. |
34 | - $_aClassFiles = array(); |
|
35 | - include( dirname( $this->sFilePath ) . '/include/loader-class-list.php' ); |
|
34 | + $_aClassFiles = array(); |
|
35 | + include( dirname( $this->sFilePath ).'/include/loader-class-list.php' ); |
|
36 | 36 | $this->_aClassFiles = $_aClassFiles; |
37 | 37 | return $_aClassFiles; |
38 | 38 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | if ( $_oRequirementCheck->check() ) { |
61 | 61 | $_oRequirementCheck->deactivatePlugin( |
62 | 62 | $this->sFilePath, |
63 | - __( 'Deactivating the plugin', 'admin-page-framework-loader' ), // additional message |
|
63 | + __( 'Deactivating the plugin', 'admin-page-framework-loader' ), // additional message |
|
64 | 64 | true // is in the activation hook. This will exit the script. |
65 | 65 | ); |
66 | 66 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | public function setLocalization() { |
76 | 76 | |
77 | 77 | // This plugin does not have messages to be displayed in the front end. |
78 | - if ( ! $this->bIsAdmin ) { |
|
78 | + if ( !$this->bIsAdmin ) { |
|
79 | 79 | return; |
80 | 80 | } |
81 | 81 | |
@@ -83,13 +83,13 @@ discard block |
||
83 | 83 | load_plugin_textdomain( |
84 | 84 | AdminPageFrameworkLoader_Registry::TEXT_DOMAIN, |
85 | 85 | false, |
86 | - $_sPluginBaseNameDirName . '/' . AdminPageFrameworkLoader_Registry::TEXT_DOMAIN_PATH |
|
86 | + $_sPluginBaseNameDirName.'/'.AdminPageFrameworkLoader_Registry::TEXT_DOMAIN_PATH |
|
87 | 87 | ); |
88 | 88 | |
89 | 89 | load_plugin_textdomain( |
90 | 90 | 'admin-page-framework', |
91 | 91 | false, |
92 | - $_sPluginBaseNameDirName . '/' . AdminPageFrameworkLoader_Registry::TEXT_DOMAIN_PATH |
|
92 | + $_sPluginBaseNameDirName.'/'.AdminPageFrameworkLoader_Registry::TEXT_DOMAIN_PATH |
|
93 | 93 | ); |
94 | 94 | |
95 | 95 | } |
@@ -112,14 +112,14 @@ 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 | // Network admin pages. |
120 | 120 | if ( is_network_admin() ) { |
121 | 121 | new AdminPageFrameworkLoader_NetworkAdmin( |
122 | - AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ], // the option key |
|
122 | + AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ], // the option key |
|
123 | 123 | $this->sFilePath // caller script path |
124 | 124 | ); |
125 | 125 | } |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | private function _shouldShowAdminPages() { |
141 | 141 | |
142 | - if ( ! $this->bIsAdmin ) { |
|
142 | + if ( !$this->bIsAdmin ) { |
|
143 | 143 | return false; |
144 | 144 | } |
145 | 145 | if ( AdminPageFrameworkLoader_Utility::isSilentMode() ) { |
@@ -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 |
@@ -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->_goToWelcomePage(); // will exit |
53 | 53 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | private function _goToWelcomePage() { |
74 | 74 | |
75 | 75 | $_sWelcomePageURL = apply_filters( |
76 | - AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_admin_welcome_redirect_url', |
|
76 | + AdminPageFrameworkLoader_Registry::HOOK_SLUG.'_filter_admin_welcome_redirect_url', |
|
77 | 77 | add_query_arg( |
78 | 78 | array( 'page' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ] ), |
79 | 79 | admin_url( 'index.php' ) // Dashboard |
@@ -93,11 +93,11 @@ discard block |
||
93 | 93 | public function setUp() { |
94 | 94 | |
95 | 95 | $_oOption = AdminPageFrameworkLoader_Option::getInstance(); |
96 | - if ( ! $_oOption->get( 'enable_admin_pages' ) ) { |
|
96 | + if ( !$_oOption->get( 'enable_admin_pages' ) ) { |
|
97 | 97 | return; |
98 | 98 | } |
99 | 99 | |
100 | - $this->sPageSlug = AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ]; |
|
100 | + $this->sPageSlug = AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ]; |
|
101 | 101 | |
102 | 102 | // Root page |
103 | 103 | $this->setRootMenuPage( |
@@ -108,12 +108,12 @@ discard block |
||
108 | 108 | $this->addSubMenuItems( |
109 | 109 | array( |
110 | 110 | 'title' => AdminPageFrameworkLoader_Registry::SHORTNAME, |
111 | - 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ], // page slug |
|
111 | + 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ], // page slug |
|
112 | 112 | 'show_in_menu' => false, |
113 | 113 | 'style' => array( |
114 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/about.css', |
|
115 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/column.css', |
|
116 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/javascript/flip/jquery.m.flip.css', |
|
114 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/about.css', |
|
115 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/column.css', |
|
116 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/javascript/flip/jquery.m.flip.css', |
|
117 | 117 | version_compare( $GLOBALS[ 'wp_version' ], '3.8', '<' ) |
118 | 118 | ? ".about-wrap .introduction h2 { |
119 | 119 | padding: 1em; |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | }", |
128 | 128 | ), |
129 | 129 | 'script' => array( |
130 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/javascript/flip/jquery.m.flip.js', |
|
130 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/javascript/flip/jquery.m.flip.js', |
|
131 | 131 | "jQuery( document ).ready( function() { |
132 | 132 | jQuery( '.apf-badge-image' ).mflip(); |
133 | 133 | } );", |
@@ -138,8 +138,8 @@ discard block |
||
138 | 138 | $this->setPluginSettingsLinkLabel( '' ); // pass an empty string to disable it. |
139 | 139 | |
140 | 140 | // Hook |
141 | - add_action( "load_" . $this->oProp->sClassName, array( $this, 'replyToLoadClassPages' ) ); |
|
142 | - add_action( "load_" . AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ], array( $this, 'replyToLoadPage' ) ); |
|
141 | + add_action( "load_".$this->oProp->sClassName, array( $this, 'replyToLoadClassPages' ) ); |
|
142 | + add_action( "load_".AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ], array( $this, 'replyToLoadPage' ) ); |
|
143 | 143 | |
144 | 144 | } |
145 | 145 | |
@@ -165,14 +165,14 @@ discard block |
||
165 | 165 | |
166 | 166 | $_sPageSlug = AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ]; |
167 | 167 | new AdminPageFrameworkLoader_AdminPageWelcome_Welcome( |
168 | - $this, // factory object |
|
169 | - $_sPageSlug, // page slug |
|
168 | + $this, // factory object |
|
169 | + $_sPageSlug, // page slug |
|
170 | 170 | array( |
171 | 171 | 'tab_slug' => 'welcome', |
172 | 172 | // 'title' => __( "What's New", 'admin-page-framework-loader' ), // ' |
173 | 173 | 'style' => array( |
174 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/admin.css', |
|
175 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/code.css', |
|
174 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/admin.css', |
|
175 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/code.css', |
|
176 | 176 | ), |
177 | 177 | ) |
178 | 178 | ); |
@@ -201,24 +201,24 @@ discard block |
||
201 | 201 | */ |
202 | 202 | public function replyToFilterContentTop( $sContent ) { |
203 | 203 | |
204 | - $_sVersion = '- ' . AdminPageFrameworkLoader_Registry::VERSION; |
|
205 | - $_sPluginName = AdminPageFrameworkLoader_Registry::SHORTNAME . ' ' . $_sVersion; |
|
204 | + $_sVersion = '- '.AdminPageFrameworkLoader_Registry::VERSION; |
|
205 | + $_sPluginName = AdminPageFrameworkLoader_Registry::SHORTNAME.' '.$_sVersion; |
|
206 | 206 | |
207 | 207 | $_sBadgeURL = esc_url( AdminPageFrameworkLoader_Registry::getPluginURL( 'asset/image/icon-128x128.png' ) ); |
208 | 208 | |
209 | 209 | $_aOutput = array(); |
210 | - $_aOutput[] = "<h1>" |
|
210 | + $_aOutput[ ] = "<h1>" |
|
211 | 211 | . sprintf( __( 'Welcome to %1$s', 'admin-page-framework-loader' ), $_sPluginName ) |
212 | 212 | . "</h1>"; |
213 | - $_aOutput[] = "<div class='about-text'>" |
|
213 | + $_aOutput[ ] = "<div class='about-text'>" |
|
214 | 214 | . 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 ) |
215 | 215 | . "</div>"; |
216 | - $_aOutput[] = '' |
|
216 | + $_aOutput[ ] = '' |
|
217 | 217 | . "<div class='apf-badge'>" |
218 | 218 | . "<div class='apf-badge-image m-flip'>" |
219 | 219 | . "<img src='{$_sBadgeURL}' />" |
220 | 220 | . "</div>" |
221 | - . "<span class='label'>" . sprintf( __( 'Version %1$s', 'admin-page-framework-loader' ), $_sVersion ) . "</span>" |
|
221 | + . "<span class='label'>".sprintf( __( 'Version %1$s', 'admin-page-framework-loader' ), $_sVersion )."</span>" |
|
222 | 222 | . "</div>"; |
223 | 223 | |
224 | 224 | return implode( PHP_EOL, $_aOutput ) |
@@ -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->_goToWelcomePage(); // will exit |
53 | 53 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | } |
72 | 72 | |
73 | - private function _goToWelcomePage() { |
|
73 | + private function _goToWelcomePage() { |
|
74 | 74 | |
75 | 75 | $_sWelcomePageURL = apply_filters( |
76 | 76 | AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_admin_welcome_redirect_url', |
@@ -18,12 +18,12 @@ 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 | 29 | $_oOption = AdminPageFrameworkLoader_Option::getInstance( AdminPageFrameworkLoader_Registry::$aOptionKeys[ 'main' ] ); |
@@ -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 | |
@@ -86,19 +86,19 @@ discard block |
||
86 | 86 | 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'tool' ], |
87 | 87 | 'title' => __( 'Tools', 'admin-page-framework-loader' ), |
88 | 88 | 'style' => array( |
89 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/code.css', |
|
90 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/admin.css' |
|
89 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/code.css', |
|
90 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/admin.css' |
|
91 | 91 | ), |
92 | 92 | ) |
93 | 93 | ); |
94 | 94 | new AdminPageFrameworkLoader_AdminPage_Addon( |
95 | 95 | $this, |
96 | 96 | array( |
97 | - 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'addon' ], // page slug |
|
97 | + 'page_slug' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'addon' ], // page slug |
|
98 | 98 | 'title' => __( 'Add Ons', 'admin-page-framework-loader' ), |
99 | 99 | 'style' => array( |
100 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/code.css', |
|
101 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/admin.css' |
|
100 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/code.css', |
|
101 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/admin.css' |
|
102 | 102 | ), |
103 | 103 | ) |
104 | 104 | ); |
@@ -109,13 +109,13 @@ discard block |
||
109 | 109 | 'title' => __( 'Help', 'admin-page-framework-loader' ), |
110 | 110 | 'order' => 1000, // to be the last menu item |
111 | 111 | 'style' => array( |
112 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/code.css', |
|
113 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/admin.css' |
|
112 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/code.css', |
|
113 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/admin.css' |
|
114 | 114 | ), |
115 | 115 | ) |
116 | 116 | ); |
117 | 117 | |
118 | - add_action( 'load_' . $this->oProp->sClassName, array( $this, 'replyToDoPageSettings' ) ); |
|
118 | + add_action( 'load_'.$this->oProp->sClassName, array( $this, 'replyToDoPageSettings' ) ); |
|
119 | 119 | |
120 | 120 | } |
121 | 121 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | */ |
129 | 129 | private function _addActionLinks( $_bAdminPageEnabled, $_aOptions ) { |
130 | 130 | |
131 | - if ( 'plugins.php' !== $this->oProp->sPageNow ) { |
|
131 | + if ( 'plugins.php' !== $this->oProp->sPageNow ) { |
|
132 | 132 | return; |
133 | 133 | } |
134 | 134 | |
@@ -152,24 +152,24 @@ discard block |
||
152 | 152 | * @return string |
153 | 153 | */ |
154 | 154 | private function _getAdminURLTools( $_bAdminPageEnabled ) { |
155 | - if ( ! $_bAdminPageEnabled ) { |
|
155 | + if ( !$_bAdminPageEnabled ) { |
|
156 | 156 | return; |
157 | 157 | } |
158 | - $_sLink = esc_url( |
|
158 | + $_sLink = esc_url( |
|
159 | 159 | add_query_arg( |
160 | 160 | array( |
161 | - 'page' => AdminPageFrameworkLoader_Registry::$aAdminPages['tool'], |
|
161 | + 'page' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'tool' ], |
|
162 | 162 | ), |
163 | 163 | admin_url( 'admin.php' ) |
164 | 164 | ) |
165 | 165 | ); |
166 | - return "<a href='{$_sLink}'>" . __( 'Tools', 'admin-page-framework-loader' ) . "</a>"; |
|
166 | + return "<a href='{$_sLink}'>".__( 'Tools', 'admin-page-framework-loader' )."</a>"; |
|
167 | 167 | } |
168 | 168 | /** |
169 | 169 | * Returns the Enable /Disable Admin Pages link. |
170 | 170 | */ |
171 | 171 | private function _getAdminPageSwitchLink( $bEnabled ) { |
172 | - $_sLink = esc_url( |
|
172 | + $_sLink = esc_url( |
|
173 | 173 | add_query_arg( |
174 | 174 | array( |
175 | 175 | 'enable_apfl_admin_pages' => $bEnabled ? 0 : 1, |
@@ -177,19 +177,19 @@ discard block |
||
177 | 177 | ) |
178 | 178 | ); |
179 | 179 | return $bEnabled |
180 | - ? "<a href='{$_sLink}'>" . __( 'Disable Admin Pages', 'admin-page-framework-loader' ) . "</a>" |
|
181 | - : "<a href='{$_sLink}'>" . __( 'Enable Admin Pages', 'admin-page-framework-loader' ) . "</a>"; |
|
180 | + ? "<a href='{$_sLink}'>".__( 'Disable Admin Pages', 'admin-page-framework-loader' )."</a>" |
|
181 | + : "<a href='{$_sLink}'>".__( 'Enable Admin Pages', 'admin-page-framework-loader' )."</a>"; |
|
182 | 182 | } |
183 | 183 | /** |
184 | 184 | * Returns the switch link of the demo pages. |
185 | 185 | */ |
186 | - private function _getDemoSwitcherLink( $_bAdminPageEnabled, $mOptions=array() ) { |
|
186 | + private function _getDemoSwitcherLink( $_bAdminPageEnabled, $mOptions = array() ) { |
|
187 | 187 | |
188 | - if ( ! $_bAdminPageEnabled ) { |
|
188 | + if ( !$_bAdminPageEnabled ) { |
|
189 | 189 | return ''; |
190 | 190 | } |
191 | - $_bEnabled = isset( $mOptions['enable_demo'] ) && $mOptions['enable_demo']; |
|
192 | - $_sLink = esc_url( |
|
191 | + $_bEnabled = isset( $mOptions[ 'enable_demo' ] ) && $mOptions[ 'enable_demo' ]; |
|
192 | + $_sLink = esc_url( |
|
193 | 193 | add_query_arg( |
194 | 194 | array( |
195 | 195 | 'enable_apfl_demo_pages' => $_bEnabled ? 0 : 1, |
@@ -197,8 +197,8 @@ discard block |
||
197 | 197 | ) |
198 | 198 | ); |
199 | 199 | return $_bEnabled |
200 | - ? "<a href='{$_sLink}'>" . __( 'Disable Demo', 'admin-page-framework-loader' ) . "</a>" |
|
201 | - : "<a href='{$_sLink}'><strong id='activate-demo-action-link' style='font-size: 1em;'>" . __( 'Enable Demo', 'admin-page-framework-loader' ) . "</strong></a>"; |
|
200 | + ? "<a href='{$_sLink}'>".__( 'Disable Demo', 'admin-page-framework-loader' )."</a>" |
|
201 | + : "<a href='{$_sLink}'><strong id='activate-demo-action-link' style='font-size: 1em;'>".__( 'Enable Demo', 'admin-page-framework-loader' )."</strong></a>"; |
|
202 | 202 | |
203 | 203 | } |
204 | 204 | |
@@ -214,14 +214,14 @@ discard block |
||
214 | 214 | |
215 | 215 | // Page meta boxes |
216 | 216 | new AdminPageFrameworkLoader_AdminPageMetaBox_Notification( |
217 | - null, // meta box id - passing null will make it auto generate |
|
217 | + null, // meta box id - passing null will make it auto generate |
|
218 | 218 | __( 'Notification', 'admin-page-framework-loader' ), // title |
219 | 219 | array( // page slugs |
220 | 220 | AdminPageFrameworkLoader_Registry::$aAdminPages[ 'tool' ], |
221 | 221 | AdminPageFrameworkLoader_Registry::$aAdminPages[ 'addon' ], |
222 | 222 | AdminPageFrameworkLoader_Registry::$aAdminPages[ 'help' ], |
223 | 223 | ), |
224 | - 'side', // context |
|
224 | + 'side', // context |
|
225 | 225 | 'default' // priority |
226 | 226 | ); |
227 | 227 |
@@ -19,8 +19,8 @@ |
||
19 | 19 | public function replyToLoadPage( $oFactory ) { |
20 | 20 | |
21 | 21 | new AdminPageFrameworkLoader_AdminPage_Addon_Top( |
22 | - $oFactory, // factory object |
|
23 | - $this->sPageSlug, // page slug |
|
22 | + $oFactory, // factory object |
|
23 | + $this->sPageSlug, // page slug |
|
24 | 24 | array( // tab definition |
25 | 25 | 'tab_slug' => 'top', |
26 | 26 | 'title' => __( 'Add Ons', 'admin-page-framework-loader' ), |
@@ -274,7 +274,7 @@ |
||
274 | 274 | $this->aCustomFieldTypes, |
275 | 275 | array( $sParsingClassName, 'text_domain' ) |
276 | 276 | ); |
277 | - if ( $_sFieldTypeTextDomain ) { |
|
277 | + if ( $_sFieldTypeTextDomain ) { |
|
278 | 278 | $_aSearches[] = $_sFieldTypeTextDomain; |
279 | 279 | $_aReplaces[] = $_sUserTextDomain; |
280 | 280 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | 'class_name' => 'AceCustomFieldType', |
89 | 89 | 'label' => __( 'ACE', 'admin-page-framework-loader' ), |
90 | 90 | 'description' => __( 'provides code syntax highlighting in a text area field.', 'admin-page-framework-loader' ), |
91 | - 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath . '/example/library/ace-custom-field-type', |
|
91 | + 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath.'/example/library/ace-custom-field-type', |
|
92 | 92 | 'archive_file_path' => 'custom-field-types/ace-custom-field-type/AceCustomFieldType.php', |
93 | 93 | 'archive_dir_path' => 'custom-field-types/ace-custom-field-type', |
94 | 94 | 'text_domain' => 'admin-page-framework', |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | 'class_name' => 'GitHubCustomFieldType', |
98 | 98 | 'label' => __( 'GitHub Buttons', 'admin-page-framework-loader' ), |
99 | 99 | 'description' => __( 'allows you to display GitHub buttons in a field.', 'admin-page-framework-loader' ), |
100 | - 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath . '/include/library/github-custom-field-type', |
|
100 | + 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath.'/include/library/github-custom-field-type', |
|
101 | 101 | 'archive_file_path' => 'custom-field-types/github-custom-field-type/GitHubCustomFieldType.php', |
102 | 102 | 'archive_dir_path' => 'custom-field-types/github-custom-field-type', |
103 | 103 | 'text_domain' => 'admin-page-framework', |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | 'class_name' => 'PathCustomFieldType', |
107 | 107 | 'label' => __( 'Path', 'admin-page-framework-loader' ), |
108 | 108 | 'description' => __( 'allows you to display GitHub buttons in a field.', 'admin-page-framework-loader' ), |
109 | - 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath . '/example/library/path-custom-field-type', |
|
109 | + 'directory_path' => AdminPageFrameworkLoader_Registry::$sDirPath.'/example/library/path-custom-field-type', |
|
110 | 110 | 'archive_file_path' => 'custom-field-types/path-custom-field-type/PathCustomFieldType.php', |
111 | 111 | 'archive_dir_path' => 'custom-field-types/path-custom-field-type', |
112 | 112 | 'text_domain' => 'admin-page-framework', |
@@ -115,13 +115,13 @@ discard block |
||
115 | 115 | |
116 | 116 | // Let third-party scripts add custom field types. |
117 | 117 | $this->aCustomFieldTypes = apply_filters( |
118 | - AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_generator_custom_field_types', |
|
118 | + AdminPageFrameworkLoader_Registry::HOOK_SLUG.'_filter_generator_custom_field_types', |
|
119 | 119 | $this->aCustomFieldTypes |
120 | 120 | ); |
121 | 121 | |
122 | - foreach( $this->aCustomFieldTypes as $_sKey => $_aCustomFieldType ) { |
|
122 | + foreach ( $this->aCustomFieldTypes as $_sKey => $_aCustomFieldType ) { |
|
123 | 123 | $this->aCustomFieldTypeLabels[ $_sKey ] = $_aCustomFieldType[ 'label' ] |
124 | - . ' - <span class="description">' . $_aCustomFieldType[ 'description' ] . '</span>'; |
|
124 | + . ' - <span class="description">'.$_aCustomFieldType[ 'description' ].'</span>'; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | } |
@@ -137,10 +137,10 @@ discard block |
||
137 | 137 | |
138 | 138 | // Check the file extension. |
139 | 139 | $_aAllowedExtensions = apply_filters( |
140 | - AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_generator_allowed_file_extensions', |
|
140 | + AdminPageFrameworkLoader_Registry::HOOK_SLUG.'_filter_generator_allowed_file_extensions', |
|
141 | 141 | array( 'php', 'css', 'js' ) |
142 | 142 | ); |
143 | - if ( ! in_array( pathinfo( $sPathInArchive, PATHINFO_EXTENSION ), $_aAllowedExtensions ) ) { |
|
143 | + if ( !in_array( pathinfo( $sPathInArchive, PATHINFO_EXTENSION ), $_aAllowedExtensions ) ) { |
|
144 | 144 | return $sFileContents; |
145 | 145 | } |
146 | 146 | |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | private function _getModifiedInclusionList( $sFileContents ) { |
171 | 171 | return str_replace( |
172 | 172 | ');', // search |
173 | - $this->_getClassListOfCustomFieldTypes() . ');', // replace - @todo insert the selected class list here |
|
173 | + $this->_getClassListOfCustomFieldTypes().');', // replace - @todo insert the selected class list here |
|
174 | 174 | $sFileContents // subject |
175 | 175 | ); |
176 | 176 | } |
@@ -187,18 +187,18 @@ discard block |
||
187 | 187 | $_POST, |
188 | 188 | array( |
189 | 189 | $this->oFactory->oProp->sOptionKey, |
190 | - 'generator', // section id |
|
190 | + 'generator', // section id |
|
191 | 191 | 'class_prefix' // field id |
192 | 192 | ), |
193 | 193 | '' |
194 | 194 | ); |
195 | 195 | $_aOutput = array(); |
196 | - foreach( $_aCheckedCustomFieldTypes as $_sClassName => $_aCustomFieldType ) { |
|
197 | - $_aOutput[] = ' "' . $_sClassPrefix . $_sClassName . '"' |
|
196 | + foreach ( $_aCheckedCustomFieldTypes as $_sClassName => $_aCustomFieldType ) { |
|
197 | + $_aOutput[ ] = ' "'.$_sClassPrefix.$_sClassName.'"' |
|
198 | 198 | . ' => ' |
199 | - . 'AdminPageFramework_Registry::$sDirPath . ' . '"/' . ltrim( $_aCustomFieldType[ 'archive_file_path' ], '/' ) . '",'; |
|
199 | + . 'AdminPageFramework_Registry::$sDirPath . '.'"/'.ltrim( $_aCustomFieldType[ 'archive_file_path' ], '/' ).'",'; |
|
200 | 200 | } |
201 | - return implode( PHP_EOL, $_aOutput ) . PHP_EOL; |
|
201 | + return implode( PHP_EOL, $_aOutput ).PHP_EOL; |
|
202 | 202 | |
203 | 203 | } |
204 | 204 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $this->aCustomFieldTypes // ArchiveFilePaths |
217 | 217 | ); |
218 | 218 | $_aArchiveFilePaths = array(); |
219 | - foreach( $_aSelectedCustomFieldTypes as $_sClassName => $_aCustomFieldType ) { |
|
219 | + foreach ( $_aSelectedCustomFieldTypes as $_sClassName => $_aCustomFieldType ) { |
|
220 | 220 | $_aArchiveFilePaths[ $_sClassName ] = $this->oFactory->oUtil->getElement( |
221 | 221 | $_aCustomFieldType, |
222 | 222 | 'archive_file_path', |
@@ -268,17 +268,17 @@ discard block |
||
268 | 268 | array( $sParsingClassName, 'text_domain' ) |
269 | 269 | ); |
270 | 270 | if ( $_sFieldTypeTextDomain ) { |
271 | - $_aSearches[] = $_sFieldTypeTextDomain; |
|
272 | - $_aReplaces[] = $_sUserTextDomain; |
|
271 | + $_aSearches[ ] = $_sFieldTypeTextDomain; |
|
272 | + $_aReplaces[ ] = $_sUserTextDomain; |
|
273 | 273 | } |
274 | 274 | |
275 | - $_aSearches[] = 'admin-page-framework'; |
|
276 | - $_aReplaces[] = $_sUserTextDomain; |
|
275 | + $_aSearches[ ] = 'admin-page-framework'; |
|
276 | + $_aReplaces[ ] = $_sUserTextDomain; |
|
277 | 277 | |
278 | 278 | // Return the converted string. |
279 | 279 | return str_replace( |
280 | - $_aSearches, // search |
|
281 | - $_aReplaces, // replace |
|
280 | + $_aSearches, // search |
|
281 | + $_aReplaces, // replace |
|
282 | 282 | $sFileContents // subject |
283 | 283 | ); |
284 | 284 | |
@@ -296,8 +296,8 @@ discard block |
||
296 | 296 | ); |
297 | 297 | |
298 | 298 | return preg_replace( |
299 | - $this->_getClassPrefixRegexPatterns( $_aSelectedFieldTypeClassNames ), // search |
|
300 | - $this->_getClassPrefixRegexReplacements( $_aSelectedFieldTypeClassNames ), // replace |
|
299 | + $this->_getClassPrefixRegexPatterns( $_aSelectedFieldTypeClassNames ), // search |
|
300 | + $this->_getClassPrefixRegexReplacements( $_aSelectedFieldTypeClassNames ), // replace |
|
301 | 301 | $sFileContents // subject |
302 | 302 | ); |
303 | 303 | |
@@ -310,8 +310,8 @@ discard block |
||
310 | 310 | private function _getClassPrefixRegexPatterns( array $aSelectedFieldTypeClassNames ) { |
311 | 311 | |
312 | 312 | $_aPregSearches = array(); |
313 | - foreach( $aSelectedFieldTypeClassNames as $_sClassName ) { |
|
314 | - $_aPregSearches[] = '/(?<=[^a-zA-Z0-9])(' . $_sClassName . ')/'; |
|
313 | + foreach ( $aSelectedFieldTypeClassNames as $_sClassName ) { |
|
314 | + $_aPregSearches[ ] = '/(?<=[^a-zA-Z0-9])('.$_sClassName.')/'; |
|
315 | 315 | } |
316 | 316 | return $_aPregSearches; |
317 | 317 | |
@@ -323,9 +323,9 @@ discard block |
||
323 | 323 | */ |
324 | 324 | private function _getClassPrefixRegexReplacements( array $aSelectedFieldTypeClassNames ) { |
325 | 325 | |
326 | - $_aPrefixedClassNames = $aSelectedFieldTypeClassNames; |
|
326 | + $_aPrefixedClassNames = $aSelectedFieldTypeClassNames; |
|
327 | 327 | array_walk( |
328 | - $_aPrefixedClassNames, // passed by reference |
|
328 | + $_aPrefixedClassNames, // passed by reference |
|
329 | 329 | array( $this, '_replyToSetPrefix' ), |
330 | 330 | $this->oFactory->oUtil->getElement( |
331 | 331 | $_POST, |
@@ -346,8 +346,8 @@ discard block |
||
346 | 346 | * @callback function array_walk |
347 | 347 | * @return string |
348 | 348 | */ |
349 | - public function _replyToSetPrefix( &$sClassName, $sKey, $sPrefix='' ) { |
|
350 | - $sClassName = $sPrefix . '$0'; |
|
349 | + public function _replyToSetPrefix( &$sClassName, $sKey, $sPrefix = '' ) { |
|
350 | + $sClassName = $sPrefix.'$0'; |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | |
@@ -368,12 +368,12 @@ discard block |
||
368 | 368 | */ |
369 | 369 | public function replyToSetAdditionalDirectoriesForGenerator( $aDirPaths ) { |
370 | 370 | |
371 | - $_aCheckedCustomFieldTypes = $this->_getSelectedCustomFieldTypes( |
|
371 | + $_aCheckedCustomFieldTypes = $this->_getSelectedCustomFieldTypes( |
|
372 | 372 | $this->aCustomFieldTypes |
373 | 373 | ); |
374 | 374 | |
375 | 375 | $_aDirPathInfo = array(); |
376 | - foreach( $_aCheckedCustomFieldTypes as $_sKey => $_aCheckedCustomFieldType ) { |
|
376 | + foreach ( $_aCheckedCustomFieldTypes as $_sKey => $_aCheckedCustomFieldType ) { |
|
377 | 377 | |
378 | 378 | $_sArchiveDirPath = $this->oFactory->oUtil->getElement( $_aCheckedCustomFieldType, 'archive_dir_path' ); |
379 | 379 | $_sSourceDirPath = $this->oFactory->oUtil->getElement( $_aCheckedCustomFieldType, 'directory_path' ); |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | * @return array The array keys of the checked items. |
390 | 390 | * @since 3.6.0 |
391 | 391 | */ |
392 | - private function _getSelectedCustomFieldTypes( array $aSubject=array() ) { |
|
392 | + private function _getSelectedCustomFieldTypes( array $aSubject = array() ) { |
|
393 | 393 | |
394 | 394 | $_aCheckedCustomFieldTypes = $this->oFactory->oUtil->getElementAsArray( |
395 | 395 | $_POST, |
@@ -21,8 +21,8 @@ |
||
21 | 21 | public function replyToDoTab( /* $oFactory */ ) { |
22 | 22 | |
23 | 23 | echo $this->_getReadmeContents( |
24 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/text/about.txt', |
|
25 | - '', // no TOC |
|
24 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/text/about.txt', |
|
25 | + '', // no TOC |
|
26 | 26 | array( 'Support' ) |
27 | 27 | ); |
28 | 28 |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | |
26 | 26 | // Tabs |
27 | 27 | new AdminPageFrameworkLoader_AdminPage_Help_Information( |
28 | - $oFactory, // factory object |
|
29 | - $this->sPageSlug, // page slug |
|
28 | + $oFactory, // factory object |
|
29 | + $this->sPageSlug, // page slug |
|
30 | 30 | array( // tab definition |
31 | 31 | 'tab_slug' => 'information', |
32 | 32 | 'title' => __( 'Support', 'admin-page-framework-loader' ), |
@@ -40,11 +40,11 @@ discard block |
||
40 | 40 | 'title' => __( 'Getting Started', 'admin-page-framework-loader' ), |
41 | 41 | 'url' => add_query_arg( |
42 | 42 | array( |
43 | - 'page' => AdminPageFrameworkLoader_Registry::$aAdminPages['about'], |
|
43 | + 'page' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ], |
|
44 | 44 | // 'tab' => 'guide', |
45 | 45 | ), |
46 | 46 | admin_url( 'index.php' ) // Dashboard |
47 | - ) . '#section-getting_started__' |
|
47 | + ).'#section-getting_started__' |
|
48 | 48 | ) |
49 | 49 | ); |
50 | 50 | new AdminPageFrameworkLoader_AdminPage_Help_FAQ( |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | 'title' => __( 'About', 'admin-page-framework-loader' ), |
88 | 88 | 'url' => add_query_arg( |
89 | 89 | array( |
90 | - 'page' => AdminPageFrameworkLoader_Registry::$aAdminPages['about'] |
|
90 | + 'page' => AdminPageFrameworkLoader_Registry::$aAdminPages[ 'about' ] |
|
91 | 91 | ), |
92 | 92 | admin_url( 'index.php' ) // Dashboard |
93 | 93 | ) |
@@ -105,17 +105,17 @@ discard block |
||
105 | 105 | |
106 | 106 | // Page meta boxes |
107 | 107 | new AdminPageFrameworkLoader_AdminPageMetaBox_ExternalLinks( |
108 | - null, // meta box id - passing null will make it auto generate |
|
108 | + null, // meta box id - passing null will make it auto generate |
|
109 | 109 | __( 'Resources', 'admin-page-framework-loader' ), // title |
110 | 110 | array( // page slugs |
111 | 111 | AdminPageFrameworkLoader_Registry::$aAdminPages[ 'help' ], |
112 | 112 | ), |
113 | - 'side', // context |
|
113 | + 'side', // context |
|
114 | 114 | 'default' // priority |
115 | 115 | ); |
116 | 116 | |
117 | 117 | $oFactory->enqueueStyle( |
118 | - AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/help.css', |
|
118 | + AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/help.css', |
|
119 | 119 | $this->sPageSlug |
120 | 120 | ); |
121 | 121 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $this->sTabSlug = $aSectionDefinition[ 'tab_slug' ]; |
48 | 48 | $this->sSectionID = $aSectionDefinition[ 'section_id' ]; |
49 | 49 | |
50 | - if ( ! $this->sSectionID ) { |
|
50 | + if ( !$this->sSectionID ) { |
|
51 | 51 | return; |
52 | 52 | } |
53 | 53 | $this->_addSection( $oFactory, $sPageSlug, $aSectionDefinition ); |
@@ -60,14 +60,14 @@ discard block |
||
60 | 60 | |
61 | 61 | add_action( |
62 | 62 | // 'validation_' . $this->sPageSlug . '_' . $this->sTabSlug, |
63 | - 'validation_' . $oFactory->oProp->sClassName . '_' . $this->sSectionID, |
|
63 | + 'validation_'.$oFactory->oProp->sClassName.'_'.$this->sSectionID, |
|
64 | 64 | array( $this, 'validate' ), |
65 | 65 | 10, |
66 | 66 | 4 |
67 | 67 | ); |
68 | 68 | |
69 | 69 | $oFactory->addSettingSections( |
70 | - $sPageSlug, // target page slug |
|
70 | + $sPageSlug, // target page slug |
|
71 | 71 | $aSectionDefinition |
72 | 72 | ); |
73 | 73 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $_aErrors = array(); |
97 | 97 | |
98 | 98 | // An invalid value is found. Set a field error array and an admin notice and return the old values. |
99 | - if ( ! $_bVerified ) { |
|
99 | + if ( !$_bVerified ) { |
|
100 | 100 | $oFactory->setFieldErrors( $_aErrors ); |
101 | 101 | $oFactory->setSettingNotice( __( 'There was something wrong with your input.', 'admin-page-framework-loader' ) ); |
102 | 102 | return $aOldInput; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | ? $aTabDefinition[ 'tab_slug' ] |
50 | 50 | : ''; |
51 | 51 | |
52 | - if ( ! $this->sTabSlug ) { |
|
52 | + if ( !$this->sTabSlug ) { |
|
53 | 53 | return; |
54 | 54 | } |
55 | 55 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | if ( $aTabDefinition[ 'tab_slug' ] ) { |
74 | 74 | add_action( |
75 | - "load_{$sPageSlug}_{$aTabDefinition['tab_slug']}", |
|
75 | + "load_{$sPageSlug}_{$aTabDefinition[ 'tab_slug' ]}", |
|
76 | 76 | array( $this, 'replyToLoadTab' ) |
77 | 77 | ); |
78 | 78 | add_action( |