Completed
Branch dev (f2c8d5)
by
unknown
10:38
created
development/admin-page-framework.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Admin Page Framework
4
- *
5
- * Facilitates WordPress plugin and theme development.
6
- *
7
- * @author      Michael Uno <[email protected]>
8
- * @copyright   2013-2016 (c) Michael Uno
9
- * @license     MIT <http://opensource.org/licenses/MIT>
10
- * @package     AdminPageFramework
11
- */
3
+     * Admin Page Framework
4
+     *
5
+     * Facilitates WordPress plugin and theme development.
6
+     *
7
+     * @author      Michael Uno <[email protected]>
8
+     * @copyright   2013-2016 (c) Michael Uno
9
+     * @license     MIT <http://opensource.org/licenses/MIT>
10
+     * @package     AdminPageFramework
11
+     */
12 12
 
13 13
 if ( ! class_exists( 'AdminPageFramework_Registry', false ) ) :
14 14
 /**
Please login to merge, or discard this patch.
development/factory/admin_page/AdminPageFramework_Router.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      * 
27 27
      * @since       3.3.0
28 28
      */
29
-    public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_options', $sTextDomain='admin-page-framework' ) {
29
+    public function __construct( $sOptionKey = null, $sCallerPath = null, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) {
30 30
 
31 31
         $this->oProp = isset( $this->oProp ) 
32 32
             ? $this->oProp // for the AdminPageFramework_NetworkAdmin class
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         if ( $this->oProp->bIsAdminAjax ) {
45 45
             return;
46 46
         }     
47
-        if ( ! $this->oProp->bIsAdmin ) {
47
+        if ( !$this->oProp->bIsAdmin ) {
48 48
             return;
49 49
         }
50 50
         
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      * @since       3.3.1       Moved from `AdminPageFramework_Base`.
89 89
      * @internal
90 90
      */
91
-    public function __call( $sMethodName, $aArgs=null ) {     
91
+    public function __call( $sMethodName, $aArgs = null ) {     
92 92
 
93 93
         $_sPageSlug             = $this->oProp->getCurrentPageSlug();
94 94
         $_sTabSlug              = $this->oProp->getCurrentTabSlug( $_sPageSlug );
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
             'load_pre_',
100 100
         );        
101 101
         
102
-        switch( $this->_getCallbackName( $sMethodName, $_sPageSlug, $_aKnownMethodPrefixes ) ) {
102
+        switch ( $this->_getCallbackName( $sMethodName, $_sPageSlug, $_aKnownMethodPrefixes ) ) {
103 103
                 
104 104
             // A callback of the call_page_{page slug} action hook
105 105
             // @deprecated  3.7.10
@@ -108,11 +108,11 @@  discard block
 block discarded – undo
108 108
              
109 109
             // add_settings_section() callback 
110 110
             case 'section_pre_':
111
-                return $this->_renderSectionDescription( $sMethodName );    // defined in AdminPageFramework_Setting
111
+                return $this->_renderSectionDescription( $sMethodName ); // defined in AdminPageFramework_Setting
112 112
                 
113 113
             // add_settings_field() callback - 
114 114
             case 'field_pre_':
115
-                return $this->_renderSettingField( $_mFirstArg, $_sPageSlug );  // defined in AdminPageFramework_Setting
115
+                return $this->_renderSettingField( $_mFirstArg, $_sPageSlug ); // defined in AdminPageFramework_Setting
116 116
             
117 117
             // load-{page} callback            
118 118
             case 'load_pre_':
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
          * @since       3.5.3
130 130
          * @return      string      The found callback method name or the prefix of a known callback method name. An empty string if not found.
131 131
          */
132
-        private function _getCallbackName( $sMethodName, $sPageSlug, array $aKnownMethodPrefixes=array() ) {
132
+        private function _getCallbackName( $sMethodName, $sPageSlug, array $aKnownMethodPrefixes = array() ) {
133 133
             
134 134
             // @deprecated      3.7.10
135 135
             // if ( in_array( 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
                 // return $sMethodName;
143 143
             // }
144 144
             
145
-            foreach( $aKnownMethodPrefixes as $_sMethodPrefix ) {
145
+            foreach ( $aKnownMethodPrefixes as $_sMethodPrefix ) {
146 146
                 if ( $this->oUtil->hasPrefix( $_sMethodPrefix, $sMethodName ) ) {
147 147
                     return $_sMethodPrefix;
148 148
                 }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
          */ 
167 167
         protected function _doPageLoadCall( $sMethodName, $sPageSlug, $sTabSlug, $oScreen ) {
168 168
             
169
-            if ( ! $this->_isPageLoadCall( $sMethodName, $sPageSlug, $oScreen->id ) ) {
169
+            if ( !$this->_isPageLoadCall( $sMethodName, $sPageSlug, $oScreen->id ) ) {
170 170
                 return;
171 171
             }
172 172
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
             $this->oForm->aSections[ '_default' ][ 'tab_slug' ]   = $sTabSlug ? $sTabSlug : null;
176 176
         
177 177
             // Do actions, class ->  page -> in-page tab
178
-            $this->load();  // 3.7.12+
178
+            $this->load(); // 3.7.12+
179 179
             $this->oUtil->addAndDoActions( 
180 180
                 $this, // the caller object
181 181
                 array( 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
             
190 190
             $this->oUtil->addAndDoActions( 
191 191
                 $this, // the caller object
192
-                array( "load_{$sPageSlug}_" . $this->oProp->getCurrentTabSlug( $sPageSlug ) ),
192
+                array( "load_{$sPageSlug}_".$this->oProp->getCurrentTabSlug( $sPageSlug ) ),
193 193
                 $this // the admin page object - this lets third-party scripts use the framework methods.
194 194
             );         
195 195
             
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
                 if ( substr( $sMethodName, strlen( 'load_pre_' ) ) !== $sPageSlug ) {
218 218
                     return false;
219 219
                 }
220
-                if ( ! isset( $this->oProp->aPageHooks[ $sPageSlug ] ) ) {
220
+                if ( !isset( $this->oProp->aPageHooks[ $sPageSlug ] ) ) {
221 221
                     return false;
222 222
                 }
223 223
                 if ( $sScreenID !== $this->oProp->aPageHooks[ $sPageSlug ] ) {
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
         }
245 245
         
246 246
         // Nothing to do in the network admin area.
247
-        return ! is_network_admin();
247
+        return !is_network_admin();
248 248
         
249 249
     }
250 250
     
@@ -259,11 +259,11 @@  discard block
 block discarded – undo
259 259
     public function _isInThePage() {
260 260
         
261 261
         // If the setUp method is not loaded yet,
262
-        if ( ! did_action( 'set_up_' . $this->oProp->sClassName ) ) {
262
+        if ( !did_action( 'set_up_'.$this->oProp->sClassName ) ) {
263 263
             return true;
264 264
         }    
265 265
 
266
-        if ( ! isset( $_GET[ 'page' ] ) ) { 
266
+        if ( !isset( $_GET[ 'page' ] ) ) { 
267 267
             return false; 
268 268
         }        
269 269
         
Please login to merge, or discard this patch.
admin-page-framework-loader.php 2 patches
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -16,15 +16,15 @@  discard block
 block discarded – undo
16 16
  */
17 17
 class AdminPageFrameworkLoader_Registry_Base {
18 18
 
19
-	const VERSION        = '3.7.12b01';    // <--- DON'T FORGET TO CHANGE THIS AS WELL!!
20
-	const NAME           = 'Admin Page Framework - Loader'; // the name is not 'Admin Page Framework' because warning messages gets confusing.
19
+    const VERSION        = '3.7.12b01';    // <--- DON'T FORGET TO CHANGE THIS AS WELL!!
20
+    const NAME           = 'Admin Page Framework - Loader'; // the name is not 'Admin Page Framework' because warning messages gets confusing.
21 21
     const SHORTNAME      = 'Admin Page Framework';  // used for a menu title etc.
22
-	const DESCRIPTION    = 'Loads Admin Page Framework which facilitates WordPress plugin and theme development.';
23
-	const URI            = 'http://admin-page-framework.michaeluno.jp/';
24
-	const AUTHOR         = 'miunosoft (Michael Uno)';
25
-	const AUTHOR_URI     = 'http://en.michaeluno.jp/';
26
-	const COPYRIGHT      = 'Copyright (c) 2015-2016, Michael Uno';
27
-	const LICENSE        = 'GPL v2 or later';
22
+    const DESCRIPTION    = 'Loads Admin Page Framework which facilitates WordPress plugin and theme development.';
23
+    const URI            = 'http://admin-page-framework.michaeluno.jp/';
24
+    const AUTHOR         = 'miunosoft (Michael Uno)';
25
+    const AUTHOR_URI     = 'http://en.michaeluno.jp/';
26
+    const COPYRIGHT      = 'Copyright (c) 2015-2016, Michael Uno';
27
+    const LICENSE        = 'GPL v2 or later';
28 28
     const CONTRIBUTORS   = '';
29 29
 	
30 30
 }
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      * @remark      This is also accessed from `uninstall.php` so do not remove.
56 56
      * @remark      Do not exceed 8 characters as a transient name allows 45 characters or less ( 40 for site transients ) so that md5 (32 characters) can be added.
57 57
      */
58
-	const TRANSIENT_PREFIX         = 'APFL_';
58
+    const TRANSIENT_PREFIX         = 'APFL_';
59 59
     
60 60
     /**
61 61
      * The hook slug used for the prefix of action and filter hook names.
@@ -70,12 +70,12 @@  discard block
 block discarded – undo
70 70
      * 
71 71
      * These will be accessed from the bootstrap script.
72 72
      */
73
-	const TEXT_DOMAIN              = 'admin-page-framework-loader';
74
-	const TEXT_DOMAIN_PATH         = '/language';    
73
+    const TEXT_DOMAIN              = 'admin-page-framework-loader';
74
+    const TEXT_DOMAIN_PATH         = '/language';    
75 75
     	    
76
-	// These properties will be defined in the setUp() method.
77
-	static public $sFilePath = '';
78
-	static public $sDirPath  = '';
76
+    // These properties will be defined in the setUp() method.
77
+    static public $sFilePath = '';
78
+    static public $sDirPath  = '';
79 79
 	
80 80
     /**
81 81
      * Requirements.
@@ -136,34 +136,34 @@  discard block
 block discarded – undo
136 136
     static public $aTaxonomies = array(
137 137
     );
138 138
     
139
-	/**
140
-	 * Sets up static properties.
139
+    /**
140
+     * Sets up static properties.
141 141
      * @return      void
142
-	 */
143
-	static public function setUp( $sPluginFilePath ) {
142
+     */
143
+    static public function setUp( $sPluginFilePath ) {
144 144
 	                    
145
-		self::$sFilePath = $sPluginFilePath;
146
-		self::$sDirPath  = dirname( self::$sFilePath );
145
+        self::$sFilePath = $sPluginFilePath;
146
+        self::$sDirPath  = dirname( self::$sFilePath );
147 147
 	    
148
-	}    
148
+    }    
149 149
 	
150
-	/**
151
-	 * Returns the URL with the given relative path to the plugin path.
152
-	 * 
153
-	 * <h3>Example</h3>
150
+    /**
151
+     * Returns the URL with the given relative path to the plugin path.
152
+     * 
153
+     * <h3>Example</h3>
154 154
      * <code>
155 155
      * AdminPageFrameworkLoader_Registry::getPluginURL( 'asset/css/meta_box.css' );
156 156
      * </code>
157 157
      * @since       3.5.0
158 158
      * @return      string
159
-	 */
160
-	public static function getPluginURL( $sRelativePath='' ) {
159
+     */
160
+    public static function getPluginURL( $sRelativePath='' ) {
161 161
         if ( isset( self::$_sPluginURLCache ) ) {
162 162
             return self::$_sPluginURLCache . $sRelativePath;
163 163
         }
164 164
         self::$_sPluginURLCache = trailingslashit( plugins_url( '', self::$sFilePath ) );
165 165
         return self::$_sPluginURLCache . $sRelativePath;
166
-	}
166
+    }
167 167
         /**
168 168
          * @since       3.7.9
169 169
          */
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -16,16 +16,16 @@  discard block
 block discarded – undo
16 16
  */
17 17
 class AdminPageFrameworkLoader_Registry_Base {
18 18
 
19
-	const VERSION        = '3.7.12b01';    // <--- DON'T FORGET TO CHANGE THIS AS WELL!!
19
+	const VERSION        = '3.7.12b01'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!!
20 20
 	const NAME           = 'Admin Page Framework - Loader'; // the name is not 'Admin Page Framework' because warning messages gets confusing.
21
-    const SHORTNAME      = 'Admin Page Framework';  // used for a menu title etc.
21
+    const SHORTNAME = 'Admin Page Framework'; // used for a menu title etc.
22 22
 	const DESCRIPTION    = 'Loads Admin Page Framework which facilitates WordPress plugin and theme development.';
23 23
 	const URI            = 'http://admin-page-framework.michaeluno.jp/';
24 24
 	const AUTHOR         = 'miunosoft (Michael Uno)';
25 25
 	const AUTHOR_URI     = 'http://en.michaeluno.jp/';
26 26
 	const COPYRIGHT      = 'Copyright (c) 2015-2016, Michael Uno';
27 27
 	const LICENSE        = 'GPL v2 or later';
28
-    const CONTRIBUTORS   = '';
28
+    const CONTRIBUTORS = '';
29 29
 	
30 30
 }
31 31
 /**
@@ -55,14 +55,14 @@  discard block
 block discarded – undo
55 55
      * @remark      This is also accessed from `uninstall.php` so do not remove.
56 56
      * @remark      Do not exceed 8 characters as a transient name allows 45 characters or less ( 40 for site transients ) so that md5 (32 characters) can be added.
57 57
      */
58
-	const TRANSIENT_PREFIX         = 'APFL_';
58
+	const TRANSIENT_PREFIX = 'APFL_';
59 59
     
60 60
     /**
61 61
      * The hook slug used for the prefix of action and filter hook names.
62 62
      * 
63 63
      * @remark      The ending underscore is not necessary.
64 64
      */
65
-    const HOOK_SLUG                = 'admin_page_framework_loader';
65
+    const HOOK_SLUG = 'admin_page_framework_loader';
66 66
         
67 67
     
68 68
     /**
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      */
118 118
     static public $aAdminPages = array(
119 119
         // key => 'page slug'
120
-        'about'     => 'apfl_about',        // the welcome page
120
+        'about'     => 'apfl_about', // the welcome page
121 121
         'addon'     => 'apfl_addons',
122 122
         'tool'      => 'apfl_tools',
123 123
         'help'      => 'apfl_contact',
@@ -157,12 +157,12 @@  discard block
 block discarded – undo
157 157
      * @since       3.5.0
158 158
      * @return      string
159 159
 	 */
160
-	public static function getPluginURL( $sRelativePath='' ) {
160
+	public static function getPluginURL( $sRelativePath = '' ) {
161 161
         if ( isset( self::$_sPluginURLCache ) ) {
162
-            return self::$_sPluginURLCache . $sRelativePath;
162
+            return self::$_sPluginURLCache.$sRelativePath;
163 163
         }
164 164
         self::$_sPluginURLCache = trailingslashit( plugins_url( '', self::$sFilePath ) );
165
-        return self::$_sPluginURLCache . $sRelativePath;
165
+        return self::$_sPluginURLCache.$sRelativePath;
166 166
 	}
167 167
         /**
168 168
          * @since       3.7.9
@@ -192,13 +192,13 @@  discard block
 block discarded – undo
192 192
      * @since       3.5.0
193 193
      * @return      void
194 194
      */ 
195
-    static public function setAdminNotice( $sMessage, $sClassAttribute='error' ) {
196
-        if ( ! is_admin() ) {  
195
+    static public function setAdminNotice( $sMessage, $sClassAttribute = 'error' ) {
196
+        if ( !is_admin() ) {  
197 197
             return; 
198 198
         }
199
-        self::$_aAdminNotices[] = array(
199
+        self::$_aAdminNotices[ ] = array(
200 200
             'message'           => $sMessage,
201
-            'class_attribute'   => trim( $sClassAttribute ) . ' notice is-dismissible',
201
+            'class_attribute'   => trim( $sClassAttribute ).' notice is-dismissible',
202 202
         );
203 203
         add_action( 'admin_notices', array( __CLASS__, '_replyToSetAdminNotice' ) );
204 204
     }
@@ -208,12 +208,12 @@  discard block
 block discarded – undo
208 208
          * @return      void
209 209
          */
210 210
         static public function _replyToSetAdminNotice() {
211
-            foreach( self::$_aAdminNotices as $_aAdminNotice ) {                
212
-                echo "<div class='" . esc_attr( $_aAdminNotice['class_attribute'] ) . " notice is-dismissible'>"
211
+            foreach ( self::$_aAdminNotices as $_aAdminNotice ) {                
212
+                echo "<div class='".esc_attr( $_aAdminNotice[ 'class_attribute' ] )." notice is-dismissible'>"
213 213
                         ."<p>" 
214 214
                             . sprintf( 
215
-                                '<strong>%1$s</strong>: ' . $_aAdminNotice['message'],
216
-                                self::NAME . ' ' . self::VERSION
215
+                                '<strong>%1$s</strong>: '.$_aAdminNotice[ 'message' ],
216
+                                self::NAME.' '.self::VERSION
217 217
                             )
218 218
                         . "</p>"
219 219
                     . "</div>";
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 AdminPageFrameworkLoader_Registry::setUp( __FILE__ );
226 226
 
227 227
 // Initial checks. - Do no load if accessed directly, not exiting because the 'uninstall.php' and inclusion list generator will load this file.
228
-if ( ! defined( 'ABSPATH' ) ) { 
228
+if ( !defined( 'ABSPATH' ) ) { 
229 229
     return; 
230 230
 }
231 231
 if ( defined( 'DOING_UNINSTALL' ) ) { 
@@ -237,8 +237,8 @@  discard block
 block discarded – undo
237 237
     
238 238
     $_bFrameworkLoaded = class_exists( 'AdminPageFramework_Registry', false );
239 239
     if ( 
240
-        ! $_bFrameworkLoaded
241
-        || ! defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility
240
+        !$_bFrameworkLoaded
241
+        || !defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility
242 242
         || version_compare( AdminPageFramework_Registry::VERSION, AdminPageFrameworkLoader_Registry::VERSION, '<' )
243 243
     ) {
244 244
         AdminPageFrameworkLoader_Registry::setAdminNotice(
@@ -256,18 +256,18 @@  discard block
 block discarded – undo
256 256
 add_action( 'admin_init', 'AdminPageFrameworkLoader_Warning' );
257 257
 
258 258
 // Include the library file - the development version will be available if you cloned the GitHub repository.
259
-$_sDevelopmentVersionPath = AdminPageFrameworkLoader_Registry::$sDirPath . '/development/admin-page-framework.php';
259
+$_sDevelopmentVersionPath = AdminPageFrameworkLoader_Registry::$sDirPath.'/development/admin-page-framework.php';
260 260
 $_bDebugMode              = defined( 'WP_DEBUG' ) && WP_DEBUG;
261 261
 $_bLoadDevelopmentVersion = $_bDebugMode && file_exists( $_sDevelopmentVersionPath );
262 262
 include( 
263 263
     $_bLoadDevelopmentVersion
264 264
         ? $_sDevelopmentVersionPath
265
-        : AdminPageFrameworkLoader_Registry::$sDirPath . '/library/apf/admin-page-framework.php'
265
+        : AdminPageFrameworkLoader_Registry::$sDirPath.'/library/apf/admin-page-framework.php'
266 266
 );
267 267
 
268 268
 // Include the framework loader plugin components.
269 269
 include( AdminPageFramework_Registry::$aClassFiles[ 'AdminPageFramework_PluginBootstrap' ] );
270
-include( AdminPageFrameworkLoader_Registry::$sDirPath . '/include/class/AdminPageFrameworkLoader_Bootstrap.php' );
270
+include( AdminPageFrameworkLoader_Registry::$sDirPath.'/include/class/AdminPageFrameworkLoader_Bootstrap.php' );
271 271
 new AdminPageFrameworkLoader_Bootstrap( 
272 272
     AdminPageFrameworkLoader_Registry::$sFilePath,
273 273
     AdminPageFrameworkLoader_Registry::HOOK_SLUG    // hook prefix
Please login to merge, or discard this patch.