@@ -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' ), |
@@ -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,13 +106,13 @@ discard block |
||
106 | 106 | |
107 | 107 | // Let third-party scripts add custom field types. |
108 | 108 | $this->aCustomFieldTypes = apply_filters( |
109 | - AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_generator_custom_field_types', |
|
109 | + AdminPageFrameworkLoader_Registry::HOOK_SLUG.'_filter_generator_custom_field_types', |
|
110 | 110 | $this->aCustomFieldTypes |
111 | 111 | ); |
112 | 112 | |
113 | - foreach( $this->aCustomFieldTypes as $_sKey => $_aCustomFieldType ) { |
|
113 | + foreach ( $this->aCustomFieldTypes as $_sKey => $_aCustomFieldType ) { |
|
114 | 114 | $this->aCustomFieldTypeLabels[ $_sKey ] = $_aCustomFieldType[ 'label' ] |
115 | - . ' - <span class="description">' . $_aCustomFieldType[ 'description' ] . '</span>'; |
|
115 | + . ' - <span class="description">'.$_aCustomFieldType[ 'description' ].'</span>'; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | } |
@@ -128,10 +128,10 @@ discard block |
||
128 | 128 | |
129 | 129 | // Check the file extension. |
130 | 130 | $_aAllowedExtensions = apply_filters( |
131 | - AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_generator_allowed_file_extensions', |
|
131 | + AdminPageFrameworkLoader_Registry::HOOK_SLUG.'_filter_generator_allowed_file_extensions', |
|
132 | 132 | array( 'php', 'css', 'js' ) |
133 | 133 | ); |
134 | - if ( ! in_array( pathinfo( $sPathInArchive, PATHINFO_EXTENSION ), $_aAllowedExtensions ) ) { |
|
134 | + if ( !in_array( pathinfo( $sPathInArchive, PATHINFO_EXTENSION ), $_aAllowedExtensions ) ) { |
|
135 | 135 | return $sFileContents; |
136 | 136 | } |
137 | 137 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | private function _getModifiedInclusionList( $sFileContents ) { |
162 | 162 | return str_replace( |
163 | 163 | ');', // search |
164 | - $this->_getClassListOfCustomFieldTypes() . ');', // replace - @todo insert the selected class list here |
|
164 | + $this->_getClassListOfCustomFieldTypes().');', // replace - @todo insert the selected class list here |
|
165 | 165 | $sFileContents // subject |
166 | 166 | ); |
167 | 167 | } |
@@ -178,18 +178,18 @@ discard block |
||
178 | 178 | $_POST, |
179 | 179 | array( |
180 | 180 | $this->oFactory->oProp->sOptionKey, |
181 | - 'generator', // section id |
|
181 | + 'generator', // section id |
|
182 | 182 | 'class_prefix' // field id |
183 | 183 | ), |
184 | 184 | '' |
185 | 185 | ); |
186 | 186 | $_aOutput = array(); |
187 | - foreach( $_aCheckedCustomFieldTypes as $_sClassName => $_aCustomFieldType ) { |
|
188 | - $_aOutput[] = ' "' . $_sClassPrefix . $_sClassName . '"' |
|
187 | + foreach ( $_aCheckedCustomFieldTypes as $_sClassName => $_aCustomFieldType ) { |
|
188 | + $_aOutput[ ] = ' "'.$_sClassPrefix.$_sClassName.'"' |
|
189 | 189 | . ' => ' |
190 | - . 'AdminPageFramework_Registry::$sDirPath . ' . '"/' . ltrim( $_aCustomFieldType[ 'archive_file_path' ], '/' ) . '",'; |
|
190 | + . 'AdminPageFramework_Registry::$sDirPath . '.'"/'.ltrim( $_aCustomFieldType[ 'archive_file_path' ], '/' ).'",'; |
|
191 | 191 | } |
192 | - return implode( PHP_EOL, $_aOutput ) . PHP_EOL; |
|
192 | + return implode( PHP_EOL, $_aOutput ).PHP_EOL; |
|
193 | 193 | |
194 | 194 | } |
195 | 195 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | $this->aCustomFieldTypes // ArchiveFilePaths |
208 | 208 | ); |
209 | 209 | $_aArchiveFilePaths = array(); |
210 | - foreach( $_aSelectedCustomFieldTypes as $_sClassName => $_aCustomFieldType ) { |
|
210 | + foreach ( $_aSelectedCustomFieldTypes as $_sClassName => $_aCustomFieldType ) { |
|
211 | 211 | $_aArchiveFilePaths[ $_sClassName ] = $this->oFactory->oUtil->getElement( |
212 | 212 | $_aCustomFieldType, |
213 | 213 | 'archive_file_path', |
@@ -275,17 +275,17 @@ discard block |
||
275 | 275 | array( $sParsingClassName, 'text_domain' ) |
276 | 276 | ); |
277 | 277 | if ( $_sFieldTypeTextDomain ) { |
278 | - $_aSearches[] = $_sFieldTypeTextDomain; |
|
279 | - $_aReplaces[] = $_sUserTextDomain; |
|
278 | + $_aSearches[ ] = $_sFieldTypeTextDomain; |
|
279 | + $_aReplaces[ ] = $_sUserTextDomain; |
|
280 | 280 | } |
281 | 281 | |
282 | - $_aSearches[] = 'admin-page-framework'; |
|
283 | - $_aReplaces[] = $_sUserTextDomain; |
|
282 | + $_aSearches[ ] = 'admin-page-framework'; |
|
283 | + $_aReplaces[ ] = $_sUserTextDomain; |
|
284 | 284 | |
285 | 285 | // Return the converted string. |
286 | 286 | return str_replace( |
287 | - $_aSearches, // search |
|
288 | - $_aReplaces, // replace |
|
287 | + $_aSearches, // search |
|
288 | + $_aReplaces, // replace |
|
289 | 289 | $sFileContents // subject |
290 | 290 | ); |
291 | 291 | |
@@ -295,8 +295,8 @@ discard block |
||
295 | 295 | * @callback function array_walk |
296 | 296 | * @return string |
297 | 297 | */ |
298 | - public function _replyToSetPrefix( &$sClassName, $sKey, $sPrefix='' ) { |
|
299 | - $sClassName = $sPrefix . $sClassName; |
|
298 | + public function _replyToSetPrefix( &$sClassName, $sKey, $sPrefix = '' ) { |
|
299 | + $sClassName = $sPrefix.$sClassName; |
|
300 | 300 | } |
301 | 301 | |
302 | 302 | |
@@ -317,12 +317,12 @@ discard block |
||
317 | 317 | */ |
318 | 318 | public function replyToSetAdditionalDirectoriesForGenerator( $aDirPaths ) { |
319 | 319 | |
320 | - $_aCheckedCustomFieldTypes = $this->_getSelectedCustomFieldTypes( |
|
320 | + $_aCheckedCustomFieldTypes = $this->_getSelectedCustomFieldTypes( |
|
321 | 321 | $this->aCustomFieldTypes |
322 | 322 | ); |
323 | 323 | |
324 | 324 | $_aDirPathInfo = array(); |
325 | - foreach( $_aCheckedCustomFieldTypes as $_sKey => $_aCheckedCustomFieldType ) { |
|
325 | + foreach ( $_aCheckedCustomFieldTypes as $_sKey => $_aCheckedCustomFieldType ) { |
|
326 | 326 | |
327 | 327 | $_sArchiveDirPath = $this->oFactory->oUtil->getElement( $_aCheckedCustomFieldType, 'archive_dir_path' ); |
328 | 328 | $_sSourceDirPath = $this->oFactory->oUtil->getElement( $_aCheckedCustomFieldType, 'directory_path' ); |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | * @return array The array keys of the checked items. |
339 | 339 | * @since 3.6.0 |
340 | 340 | */ |
341 | - private function _getSelectedCustomFieldTypes( array $aSubject=array() ) { |
|
341 | + private function _getSelectedCustomFieldTypes( array $aSubject = array() ) { |
|
342 | 342 | |
343 | 343 | $_aCheckedCustomFieldTypes = $this->oFactory->oUtil->getElementAsArray( |
344 | 344 | $_POST, |
@@ -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 | } |
@@ -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( |
@@ -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,7 +52,7 @@ 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 |
@@ -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 ); |