Completed
Branch master (b13b1d)
by Michael
19:31
created
development/factory/admin_page/_controller/AdminPageFramework_Link_Page.php 3 patches
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      */
37 37
     public function _replyToSetFooterInfo() {
38 38
 
39
-        if ( ! $this->oProp->isPageAdded() ) { 
39
+        if ( !$this->oProp->isPageAdded() ) { 
40 40
             return; 
41 41
         }
42 42
         parent::_replyToSetFooterInfo();
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public function _addLinkToPluginDescription( $asLinks ) {
57 57
         
58
-        if ( ! is_array( $asLinks ) ) {
59
-            $this->oProp->aPluginDescriptionLinks[] = $asLinks;
58
+        if ( !is_array( $asLinks ) ) {
59
+            $this->oProp->aPluginDescriptionLinks[ ] = $asLinks;
60 60
         } else {
61
-            $this->oProp->aPluginDescriptionLinks = array_merge( $this->oProp->aPluginDescriptionLinks , $asLinks );
61
+            $this->oProp->aPluginDescriptionLinks = array_merge( $this->oProp->aPluginDescriptionLinks, $asLinks );
62 62
         }
63 63
 
64 64
         if ( 'plugins.php' !== $this->oProp->sPageNow ) {
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
      */    
78 78
     public function _addLinkToPluginTitle( $asLinks ) {
79 79
         
80
-        if ( ! is_array( $asLinks ) ) {
81
-            $this->oProp->aPluginTitleLinks[] = $asLinks;
80
+        if ( !is_array( $asLinks ) ) {
81
+            $this->oProp->aPluginTitleLinks[ ] = $asLinks;
82 82
         } else {
83 83
             $this->oProp->aPluginTitleLinks = array_merge( 
84 84
                 $this->oProp->aPluginTitleLinks, 
@@ -113,9 +113,9 @@  discard block
 block discarded – undo
113 113
             if ( isset( $_sPluginBaseName ) ) {
114 114
                 return;
115 115
             }
116
-            $_sPluginBaseName = plugin_basename( $this->oProp->aScriptInfo['sPath'] );
116
+            $_sPluginBaseName = plugin_basename( $this->oProp->aScriptInfo[ 'sPath' ] );
117 117
             add_filter( 
118
-                $this->_sFilterSuffix_PluginActionLinks . $_sPluginBaseName, 
118
+                $this->_sFilterSuffix_PluginActionLinks.$_sPluginBaseName, 
119 119
                 array( $this, '_replyToAddLinkToPluginTitle' ) 
120 120
             );            
121 121
         }
@@ -127,14 +127,14 @@  discard block
 block discarded – undo
127 127
      * @callback    filter      admin_footer_text
128 128
      * @return      string
129 129
      */ 
130
-    public function _replyToAddInfoInFooterLeft( $sLinkHTML='' ) {
130
+    public function _replyToAddInfoInFooterLeft( $sLinkHTML = '' ) {
131 131
 
132
-        if ( ! $this->_isPageAdded() ) {
132
+        if ( !$this->_isPageAdded() ) {
133 133
             return $sLinkHTML; // $sLinkHTML is given by the hook.
134 134
         }
135
-        $sLinkHTML  = empty( $this->oProp->aScriptInfo['sName'] )
135
+        $sLinkHTML = empty( $this->oProp->aScriptInfo[ 'sName' ] )
136 136
             ? $sLinkHTML
137
-            : $this->oProp->aFooterInfo['sLeft'];     
137
+            : $this->oProp->aFooterInfo[ 'sLeft' ];     
138 138
             
139 139
         $_sPageSlug = $this->oProp->getCurrentPageSlug();
140 140
         $_sTabSlug  = $this->oProp->getCurrentTabSlug();        
@@ -145,11 +145,11 @@  discard block
 block discarded – undo
145 145
             array(                 
146 146
                 $this->getAOrB( 
147 147
                     $_sTabSlug,
148
-                    'footer_left_' . $_sPageSlug . '_' . $_sTabSlug,
148
+                    'footer_left_'.$_sPageSlug.'_'.$_sTabSlug,
149 149
                     null    // will be ignored
150 150
                 ),
151
-                'footer_left_' . $_sPageSlug,
152
-                'footer_left_' . $this->oProp->sClassName
151
+                'footer_left_'.$_sPageSlug,
152
+                'footer_left_'.$this->oProp->sClassName
153 153
             ),
154 154
             $sLinkHTML
155 155
         );        
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
      * @callback    filter      update_footer
163 163
      * @return      string
164 164
      */
165
-    public function _replyToAddInfoInFooterRight( $sLinkHTML='' ) {
165
+    public function _replyToAddInfoInFooterRight( $sLinkHTML = '' ) {
166 166
 
167
-        if ( ! $this->_isPageAdded() ) {
167
+        if ( !$this->_isPageAdded() ) {
168 168
             return $sLinkHTML; // $sLinkTHML is given by the hook.
169 169
         }
170 170
             
@@ -177,13 +177,13 @@  discard block
 block discarded – undo
177 177
             array(                 
178 178
                 $this->getAOrB( 
179 179
                     $_sTabSlug,
180
-                    'footer_right_' . $_sPageSlug . '_' . $_sTabSlug,
180
+                    'footer_right_'.$_sPageSlug.'_'.$_sTabSlug,
181 181
                     null    // will be ignored
182 182
                 ),
183
-                'footer_right_' . $_sPageSlug,
184
-                'footer_right_' . $this->oProp->sClassName
183
+                'footer_right_'.$_sPageSlug,
184
+                'footer_right_'.$this->oProp->sClassName
185 185
             ),
186
-            $this->oProp->aFooterInfo['sRight']
186
+            $this->oProp->aFooterInfo[ 'sRight' ]
187 187
         );             
188 188
             
189 189
     }
@@ -195,10 +195,10 @@  discard block
 block discarded – undo
195 195
          */
196 196
         private function _isPageAdded() {
197 197
             
198
-            if ( ! isset( $_GET['page'] ) ) {
198
+            if ( !isset( $_GET[ 'page' ] ) ) {
199 199
                 return false;
200 200
             }            
201
-            return ( bool ) $this->oProp->isPageAdded( $_GET['page'] );
201
+            return ( bool ) $this->oProp->isPageAdded( $_GET[ 'page' ] );
202 202
 
203 203
         }
204 204
     /**
@@ -219,17 +219,17 @@  discard block
 block discarded – undo
219 219
             : $this->oProp->sLabelPluginSettingsLink;        
220 220
 
221 221
         // If the user disables the settings link, the label property is empty. If so, do not add it.
222
-        if ( ! $this->oProp->sLabelPluginSettingsLink ) {
222
+        if ( !$this->oProp->sLabelPluginSettingsLink ) {
223 223
             return $aLinks;
224 224
         }
225 225
         
226 226
         // For a custom root slug,
227
-        $_sLinkURL = preg_match( '/^.+\.php/', $this->oProp->aRootMenu['sPageSlug'] ) 
227
+        $_sLinkURL = preg_match( '/^.+\.php/', $this->oProp->aRootMenu[ 'sPageSlug' ] ) 
228 228
             ? add_query_arg( 
229 229
                 array( 
230 230
                     'page' => $this->oProp->sDefaultPageSlug 
231 231
                 ), 
232
-                admin_url( $this->oProp->aRootMenu['sPageSlug'] )
232
+                admin_url( $this->oProp->aRootMenu[ 'sPageSlug' ] )
233 233
             )
234 234
             : "admin.php?page={$this->oProp->sDefaultPageSlug}";
235 235
         
@@ -237,13 +237,13 @@  discard block
 block discarded – undo
237 237
         array_unshift(    
238 238
             $aLinks,
239 239
             // '<a href="' . esc_url( $_sLinkURL ) . '">' 
240
-            '<a ' . $this->getAttributes(
240
+            '<a '.$this->getAttributes(
241 241
                 array(
242 242
                     'href'      => esc_url( $_sLinkURL ),
243 243
                     // 3.5.7+ Added for acceptance testing
244 244
                     'class'     => 'apf-plugin-title-action-link apf-post-type',
245 245
                 )
246
-            ) . '>' 
246
+            ).'>' 
247 247
                 . $this->oProp->sLabelPluginSettingsLink 
248 248
             . '</a>'
249 249
         ); 
@@ -259,22 +259,22 @@  discard block
 block discarded – undo
259 259
      */
260 260
     public function _replyToAddLinkToPluginDescription( $aLinks, $sFile ) {
261 261
 
262
-        if ( $sFile != plugin_basename( $this->oProp->aScriptInfo['sPath'] ) ) { 
262
+        if ( $sFile != plugin_basename( $this->oProp->aScriptInfo[ 'sPath' ] ) ) { 
263 263
             return $aLinks; 
264 264
         }
265 265
         
266 266
         // Backward compatibility sanitisation.
267 267
         $_aAddingLinks = array();
268
-        foreach( array_filter( $this->oProp->aPluginDescriptionLinks ) as $_sLLinkHTML ) {
268
+        foreach ( array_filter( $this->oProp->aPluginDescriptionLinks ) as $_sLLinkHTML ) {
269 269
             
270
-            if ( ! $_sLLinkHTML ) {
270
+            if ( !$_sLLinkHTML ) {
271 271
                 continue;
272 272
             }
273 273
             if ( is_array( $_sLLinkHTML ) ) {  // should not be an array
274 274
                 $_aAddingLinks = array_merge( $_sLLinkHTML, $_aAddingLinks );
275 275
                 continue;
276 276
             } 
277
-            $_aAddingLinks[] = ( string ) $_sLLinkHTML;
277
+            $_aAddingLinks[ ] = ( string ) $_sLLinkHTML;
278 278
             
279 279
         }
280 280
         return array_merge( $aLinks, $_aAddingLinks );
@@ -288,16 +288,16 @@  discard block
 block discarded – undo
288 288
     public function _replyToAddLinkToPluginTitle( $aLinks ) {
289 289
 
290 290
         $_aAddingLinks = array();
291
-        foreach( array_filter( $this->oProp->aPluginTitleLinks ) as $_sLinkHTML ) {
291
+        foreach ( array_filter( $this->oProp->aPluginTitleLinks ) as $_sLinkHTML ) {
292 292
             
293
-            if ( ! $_sLinkHTML ) {
293
+            if ( !$_sLinkHTML ) {
294 294
                 continue;
295 295
             }
296 296
             if ( is_array( $_sLinkHTML ) ) {
297 297
                 $_aAddingLinks = array_merge( $_sLinkHTML, $aAddingLinks );
298 298
                 continue;
299 299
             } 
300
-            $_aAddingLinks[] = ( string ) $_sLinkHTML;
300
+            $_aAddingLinks[ ] = ( string ) $_sLinkHTML;
301 301
             
302 302
         }
303 303
         return array_merge( $aLinks, $_aAddingLinks );
Please login to merge, or discard this patch.
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      */
37 37
     public function _replyToSetFooterInfo() {
38 38
 
39
-        if ( ! $this->oProp->isPageAdded() ) { 
39
+        if ( ! $this->oProp->isPageAdded() ) {
40 40
             return; 
41 41
         }
42 42
         parent::_replyToSetFooterInfo();
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
     public function _replyToAddSettingsLinkInPluginListingPage( $aLinks ) {
211 211
          
212 212
         // If the sub-pages are not added, do nothing.
213
-        if ( count( $this->oProp->aPages ) < 1 ) { 
213
+        if ( count( $this->oProp->aPages ) < 1 ) {
214 214
             return $aLinks; 
215 215
         }    
216 216
         
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
      */
260 260
     public function _replyToAddLinkToPluginDescription( $aLinks, $sFile ) {
261 261
 
262
-        if ( $sFile != plugin_basename( $this->oProp->aScriptInfo['sPath'] ) ) { 
262
+        if ( $sFile != plugin_basename( $this->oProp->aScriptInfo['sPath'] ) ) {
263 263
             return $aLinks; 
264 264
         }
265 265
         
@@ -270,7 +270,8 @@  discard block
 block discarded – undo
270 270
             if ( ! $_sLLinkHTML ) {
271 271
                 continue;
272 272
             }
273
-            if ( is_array( $_sLLinkHTML ) ) {  // should not be an array
273
+            if ( is_array( $_sLLinkHTML ) ) {
274
+// should not be an array
274 275
                 $_aAddingLinks = array_merge( $_sLLinkHTML, $_aAddingLinks );
275 276
                 continue;
276 277
             } 
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
                 array( $this, '_replyToAddPostTypeQueryInEditPostLink' ), 
34 34
                 10, 
35 35
                 3 
36
-           );
36
+            );
37 37
         }        
38 38
     }
39 39
 
Please login to merge, or discard this patch.
factory/admin_page/_controller/AdminPageFramework_Resource_Page.php 3 patches
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         
46 46
         // tab 
47 47
         if ( $_sPageSlug && $_sTabSlug ) {
48
-            $this->oProp->sStyle     = $this->addAndApplyFilters( 
48
+            $this->oProp->sStyle = $this->addAndApplyFilters( 
49 49
                 $_oCaller, 
50 50
                 "style_{$_sPageSlug}_{$_sTabSlug}", 
51 51
                 $this->oProp->sStyle 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         
55 55
         // page
56 56
         if ( $_sPageSlug ) {
57
-            $this->oProp->sStyle     = $this->addAndApplyFilters( 
57
+            $this->oProp->sStyle = $this->addAndApplyFilters( 
58 58
                 $_oCaller, 
59 59
                 "style_{$_sPageSlug}", 
60 60
                 $this->oProp->sStyle 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
          * @return      string      The tab slug if the tab has been added.
89 89
          */
90 90
         private function _getCurrentTabSlugForFilter( $sPageSlug ) {
91
-            $_sTabSlug  = $this->oProp->getCurrentTabSlug( $sPageSlug ); 
91
+            $_sTabSlug = $this->oProp->getCurrentTabSlug( $sPageSlug ); 
92 92
             return isset( $this->oProp->aInPageTabs[ $sPageSlug ][ $_sTabSlug ] )
93 93
                 ? $_sTabSlug
94 94
                 : '';          
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         
117 117
         // tab 
118 118
         if ( $_sPageSlug && $_sTabSlug ) {
119
-            $this->oProp->sScript     = $this->addAndApplyFilters( 
119
+            $this->oProp->sScript = $this->addAndApplyFilters( 
120 120
                 $_oCaller, 
121 121
                 "script_{$_sPageSlug}_{$_sTabSlug}", 
122 122
                 $this->oProp->sScript 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         
126 126
         // page
127 127
         if ( $_sPageSlug ) {
128
-            $this->oProp->sScript     = $this->addAndApplyFilters( 
128
+            $this->oProp->sScript = $this->addAndApplyFilters( 
129 129
                 $_oCaller, 
130 130
                 "script_{$_sPageSlug}", 
131 131
                 $this->oProp->sScript 
@@ -143,11 +143,11 @@  discard block
 block discarded – undo
143 143
      * @since 2.1.5
144 144
      * @internal
145 145
      */
146
-    public function _enqueueStyles( $aSRCs, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) {
146
+    public function _enqueueStyles( $aSRCs, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) {
147 147
         
148 148
         $_aHandleIDs = array();
149
-        foreach( ( array ) $aSRCs as $_sSRC ) {
150
-            $_aHandleIDs[] = $this->_enqueueStyle( $_sSRC, $sPageSlug, $sTabSlug, $aCustomArgs );
149
+        foreach ( ( array ) $aSRCs as $_sSRC ) {
150
+            $_aHandleIDs[ ] = $this->_enqueueStyle( $_sSRC, $sPageSlug, $sTabSlug, $aCustomArgs );
151 151
         }
152 152
         return $_aHandleIDs;
153 153
         
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
      * @return      string  The script handle ID. If the passed url is not a valid url string, an empty string will be returned.
174 174
      * @internal
175 175
      */    
176
-    public function _enqueueStyle( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) {
176
+    public function _enqueueStyle( $sSRC, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) {
177 177
         return $this->_enqueueResourceByType( $sSRC, $sPageSlug, $sTabSlug, $aCustomArgs, 'style' );        
178 178
     }
179 179
     
@@ -182,11 +182,11 @@  discard block
 block discarded – undo
182 182
      * 
183 183
      * @since 2.1.5
184 184
      */
185
-    public function _enqueueScripts( $aSRCs, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) {
185
+    public function _enqueueScripts( $aSRCs, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) {
186 186
         
187 187
         $_aHandleIDs = array();
188
-        foreach( ( array ) $aSRCs as $_sSRC ) {
189
-            $_aHandleIDs[] = $this->_enqueueScript( $_sSRC, $sPageSlug, $sTabSlug, $aCustomArgs );
188
+        foreach ( ( array ) $aSRCs as $_sSRC ) {
189
+            $_aHandleIDs[ ] = $this->_enqueueScript( $_sSRC, $sPageSlug, $sTabSlug, $aCustomArgs );
190 190
         }
191 191
         return $_aHandleIDs;
192 192
         
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
      * @return      string      The script handle ID. If the passed url is not a valid url string, an empty string will be returned.
214 214
      * @internal
215 215
      */
216
-    public function _enqueueScript( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) {
216
+    public function _enqueueScript( $sSRC, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) {
217 217
         return $this->_enqueueResourceByType( $sSRC, $sPageSlug, $sTabSlug, $aCustomArgs, 'script' );
218 218
     }
219 219
         /**
@@ -226,20 +226,20 @@  discard block
 block discarded – undo
226 226
          * @param       array       $aCustomArgs    A custom argument array.
227 227
          * @param       string      $sType          Accepts 'style' or 'script'
228 228
          */
229
-        private function _enqueueResourceByType( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array(), $sType='style' ) {
229
+        private function _enqueueResourceByType( $sSRC, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array(), $sType = 'style' ) {
230 230
             
231
-            $sSRC       = trim( $sSRC );
231
+            $sSRC = trim( $sSRC );
232 232
             if ( empty( $sSRC ) ) { 
233 233
                 return ''; 
234 234
             }
235
-            $sSRC       = $this->getResolvedSRC( $sSRC );
235
+            $sSRC = $this->getResolvedSRC( $sSRC );
236 236
 
237 237
             // Get the property name for the type
238 238
             $_sContainerPropertyName     = $this->_getContainerPropertyNameByType( $sType );
239 239
             $_sEnqueuedIndexPropertyName = $this->_getEnqueuedIndexPropertyNameByType( $sType );
240 240
             
241 241
             // setting the key based on the url prevents duplicate items
242
-            $_sSRCHash  = md5( $sSRC );
242
+            $_sSRCHash = md5( $sSRC );
243 243
             if ( isset( $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ] ) ) { 
244 244
                 return ''; 
245 245
             } 
@@ -250,13 +250,13 @@  discard block
 block discarded – undo
250 250
                     'sTabSlug'  => $sTabSlug,
251 251
                     'sSRC'      => $sSRC,
252 252
                     'sType'     => $sType,
253
-                    'handle_id' => $sType . '_' . $this->oProp->sClassName . '_' .  ( ++$this->oProp->{$_sEnqueuedIndexPropertyName} ),
253
+                    'handle_id' => $sType.'_'.$this->oProp->sClassName.'_'.( ++$this->oProp->{$_sEnqueuedIndexPropertyName} ),
254 254
                 )
255 255
                 + self::$_aStructure_EnqueuingResources
256 256
                 ;
257 257
 
258 258
             // Store the attributes in another container by url.
259
-            $this->oProp->aResourceAttributes[ $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ]['handle_id'] ] = $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ]['attributes'];
259
+            $this->oProp->aResourceAttributes[ $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ][ 'attributes' ];
260 260
             
261 261
             return $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ][ 'handle_id' ];
262 262
             
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
      * @since       3.0.0
297 297
      * @internal
298 298
      */
299
-    public function _forceToEnqueueStyle( $sSRC, $aCustomArgs=array() ) {
299
+    public function _forceToEnqueueStyle( $sSRC, $aCustomArgs = array() ) {
300 300
         return $this->_enqueueStyle( $sSRC, '', '', $aCustomArgs );
301 301
     }
302 302
     /**
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
      * @since       3.0.0
307 307
      * @internal
308 308
      */    
309
-    public function _forceToEnqueueScript( $sSRC, $aCustomArgs=array() ) {
309
+    public function _forceToEnqueueScript( $sSRC, $aCustomArgs = array() ) {
310 310
         return $this->_enqueueScript( $sSRC, '', '', $aCustomArgs );
311 311
     }
312 312
     
@@ -323,11 +323,11 @@  discard block
 block discarded – undo
323 323
 
324 324
         $sCurrentPageSlug   = $this->oProp->getCurrentPageSlug();
325 325
         $sCurrentTabSlug    = $this->oProp->getCurrentTabSlug( $sCurrentPageSlug );
326
-        $sPageSlug          = $aEnqueueItem['sPageSlug'];
327
-        $sTabSlug           = $aEnqueueItem['sTabSlug'];
326
+        $sPageSlug          = $aEnqueueItem[ 'sPageSlug' ];
327
+        $sTabSlug           = $aEnqueueItem[ 'sTabSlug' ];
328 328
 
329 329
         // If the page slug is not specified and the currently loading page is one of the pages that is added by the framework,
330
-        if ( ! $sPageSlug && $this->oProp->isPageAdded( $sCurrentPageSlug ) ) { // means script-global(among pages added by the framework)
330
+        if ( !$sPageSlug && $this->oProp->isPageAdded( $sCurrentPageSlug ) ) { // means script-global(among pages added by the framework)
331 331
             return $this->_enqueueSRC( $aEnqueueItem );
332 332
         }
333 333
                 
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
         // If the tab slug is not specified and the page slug is specified, 
343 343
         // and if the current loading page slug and the specified one matches,
344 344
         if ( 
345
-            ( $sPageSlug && ! $sTabSlug )
345
+            ( $sPageSlug && !$sTabSlug )
346 346
             && ( $sCurrentPageSlug == $sPageSlug )
347 347
         ) {
348 348
             return $this->_enqueueSRC( $aEnqueueItem );
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
         private function _enqueueResourceByType( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array(), $sType='style' ) {
230 230
             
231 231
             $sSRC       = trim( $sSRC );
232
-            if ( empty( $sSRC ) ) { 
232
+            if ( empty( $sSRC ) ) {
233 233
                 return ''; 
234 234
             }
235 235
             $sSRC       = $this->getResolvedSRC( $sSRC );
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
             
241 241
             // setting the key based on the url prevents duplicate items
242 242
             $_sSRCHash  = md5( $sSRC );
243
-            if ( isset( $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ] ) ) { 
243
+            if ( isset( $this->oProp->{$_sContainerPropertyName}[ $_sSRCHash ] ) ) {
244 244
                 return ''; 
245 245
             } 
246 246
             
@@ -327,7 +327,8 @@  discard block
 block discarded – undo
327 327
         $sTabSlug           = $aEnqueueItem['sTabSlug'];
328 328
 
329 329
         // If the page slug is not specified and the currently loading page is one of the pages that is added by the framework,
330
-        if ( ! $sPageSlug && $this->oProp->isPageAdded( $sCurrentPageSlug ) ) { // means script-global(among pages added by the framework)
330
+        if ( ! $sPageSlug && $this->oProp->isPageAdded( $sCurrentPageSlug ) ) {
331
+// means script-global(among pages added by the framework)
331 332
             return $this->_enqueueSRC( $aEnqueueItem );
332 333
         }
333 334
                 
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Admin Page Framework
4
- * 
5
- * http://en.michaeluno.jp/admin-page-framework/
6
- * Copyright (c) 2013-2015 Michael Uno; Licensed MIT
7
- * 
8
- */
3
+     * Admin Page Framework
4
+     * 
5
+     * http://en.michaeluno.jp/admin-page-framework/
6
+     * Copyright (c) 2013-2015 Michael Uno; Licensed MIT
7
+     * 
8
+     */
9 9
 
10 10
 /**
11 11
  * Provides methods for creating fields in the taxonomy page (edit-tags.php).
Please login to merge, or discard this patch.
factory/admin_page/_model/AdminPageFramework_CustomSubmitFields.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     public function __construct( array $aPostElement ) {
36 36
             
37 37
         $this->aPost    = $aPostElement;
38
-        $this->sInputID = $this->getInputID( $aPostElement['submit'] ); // the submit element must be set by the field type.
38
+        $this->sInputID = $this->getInputID( $aPostElement[ 'submit' ] ); // the submit element must be set by the field type.
39 39
     
40 40
     }
41 41
     
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
      * @since   2.0.0
48 48
      * @since   3.4.0   Changed the name from `getElement()`.
49 49
      */ 
50
-    protected function getSubmitValueByType( $aElement, $sInputID, $sElementKey='format' ) {
50
+    protected function getSubmitValueByType( $aElement, $sInputID, $sElementKey = 'format' ) {
51 51
             
52 52
         return $this->getElement( 
53
-            $aElement,  // subject array
53
+            $aElement, // subject array
54 54
             array( $sInputID, $sElementKey ), // dimensional keys
55 55
             null    // default
56 56
         );
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         // Only the pressed element will be stored in the array.
81 81
         // The input tag: name="__import[submit][my_section_my_import_field_the_index]" value="Import Button"
82 82
         // The array structure:  array( 'my_section_my_import_field_the_index' => 'Import Button' )
83
-        foreach( $aSubmitElement as $sInputID => $v ) { // $aSubmitElement should have been set in the constructor.
83
+        foreach ( $aSubmitElement as $sInputID => $v ) { // $aSubmitElement should have been set in the constructor.
84 84
             $this->sInputID = $sInputID;
85 85
             return $this->sInputID;
86 86
         }     
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      * 
63 63
      * @since 2.1.5
64 64
      */
65
-    public function getSiblingValue( $sKey ) {    
65
+    public function getSiblingValue( $sKey ) {
66 66
         return $this->getSubmitValueByType( $this->aPost, $this->sInputID, $sKey );
67 67
     }
68 68
     
@@ -80,7 +80,8 @@  discard block
 block discarded – undo
80 80
         // Only the pressed element will be stored in the array.
81 81
         // The input tag: name="__import[submit][my_section_my_import_field_the_index]" value="Import Button"
82 82
         // The array structure:  array( 'my_section_my_import_field_the_index' => 'Import Button' )
83
-        foreach( $aSubmitElement as $sInputID => $v ) { // $aSubmitElement should have been set in the constructor.
83
+        foreach( $aSubmitElement as $sInputID => $v ) {
84
+// $aSubmitElement should have been set in the constructor.
84 85
             $this->sInputID = $sInputID;
85 86
             return $this->sInputID;
86 87
         }     
Please login to merge, or discard this patch.
development/factory/admin_page/_model/AdminPageFramework_ExportOptions.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -94,9 +94,9 @@  discard block
 block discarded – undo
94 94
      * @since       2.0.0
95 95
      * @since       3.5.4       Added the `$aHeader` parameter. Deprecated the `$sFileName` parameter as it is included in the $aHeader definition.
96 96
      */ 
97
-    public function doExport( $vData, $sFormatType=null, array $aHeader=array() ) {
97
+    public function doExport( $vData, $sFormatType = null, array $aHeader = array() ) {
98 98
 
99
-        $sFormatType    = isset( $sFormatType ) 
99
+        $sFormatType = isset( $sFormatType ) 
100 100
             ? $sFormatType 
101 101
             : $this->sFormatType;
102 102
 
@@ -122,9 +122,9 @@  discard block
 block discarded – undo
122 122
          * @since       3.5.4
123 123
          * @return      void
124 124
          */
125
-        private function _outputHTTPHeader( array $aHeader, $sKey='' ) {
125
+        private function _outputHTTPHeader( array $aHeader, $sKey = '' ) {
126 126
             
127
-            foreach( $aHeader as $_sKey => $_asValue ) {
127
+            foreach ( $aHeader as $_sKey => $_asValue ) {
128 128
                 
129 129
                 // Nested items. Set the key to overrider array keys.
130 130
                 if ( is_array( $_asValue ) ) {
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
                     return;
165 165
                 case 'json': // for json.
166 166
                     echo json_encode( ( array ) $vData );
167
-                    return ;
167
+                    return;
168 168
                 case 'array': // for serialized PHP array.
169 169
                 default: // for anything else, 
170 170
                     echo serialize( ( array ) $vData );
Please login to merge, or discard this patch.
_model/delegate/AdminPageFramework_Model__FormRedirectHandler.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public function __construct( $oFactory ) {
30 30
        
31
-        $this->oFactory         = $oFactory;        
31
+        $this->oFactory = $oFactory;        
32 32
         
33 33
         // wp_mail() will be loaded by the time 'after_setup_theme' is loaded.
34 34
         // @deprecated      DEVVER
@@ -52,18 +52,18 @@  discard block
 block discarded – undo
52 52
      */
53 53
     public function _replyToCheckRedirects() {
54 54
   
55
-        if ( ! $this->_shouldProceed() ) {
55
+        if ( !$this->_shouldProceed() ) {
56 56
             return;
57 57
         }
58 58
 
59 59
         // The redirect transient key.
60
-        $_sTransient = 'apf_rurl' . md5( 
61
-            trim( "redirect_{$this->oFactory->oProp->sClassName}_{$_GET['page']}" )
60
+        $_sTransient = 'apf_rurl'.md5( 
61
+            trim( "redirect_{$this->oFactory->oProp->sClassName}_{$_GET[ 'page' ]}" )
62 62
         );
63 63
         
64 64
         // Check the settings error transient.
65 65
         $_aError = $this->oFactory->_getFieldErrors( $_GET[ 'page' ], false );
66
-        if ( ! empty( $_aError ) ) {
66
+        if ( !empty( $_aError ) ) {
67 67
             $this->deleteTransient( $_sTransient ); // we don't need it any more.
68 68
             return;
69 69
         }
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         private function _shouldProceed() {
91 91
 
92 92
             // Check if it's one of the plugin's added page. If not, do nothing.
93
-            if ( ! $this->oFactory->_isInThePage() ) {
93
+            if ( !$this->oFactory->_isInThePage() ) {
94 94
                 return false;
95 95
             }
96 96
             
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
                 'settings-updated',
104 104
                 false
105 105
             );            
106
-            if ( ! $_bsSettingsUpdatedFlag ) {
106
+            if ( !$_bsSettingsUpdatedFlag ) {
107 107
                 return false;
108 108
             }
109 109
             
Please login to merge, or discard this patch.
delegate/validaor/AdminPageFramework_Model__FormSubmission__Validator.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         $this->oFactory = $oFactory;
31 31
         
32 32
         add_filter(
33
-            "validation_pre_" . $this->oFactory->oProp->sClassName,
33
+            "validation_pre_".$this->oFactory->oProp->sClassName,
34 34
             array( $this, '_replyToValiateUserFormInputs' ),
35 35
             10,
36 36
             4
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
             $_sSubmitSectionID  = $this->_getPressedSubmitButtonData( $_aSubmits, 'section_id' );
62 62
             
63 63
             // Submit Information - [3.5.0+] this will be passed to validation callback methods.
64
-            $_aSubmitsInformation        = array(
64
+            $_aSubmitsInformation = array(
65 65
                 'page_slug'     => $_sPageSlug,
66 66
                 'tab_slug'      => $_sTabSlug,
67 67
                 'input_id'      => $this->_getPressedSubmitButtonData( $_aSubmits, 'input_id' ), 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
                 'AdminPageFramework_Model__FormSubmission__Validator__ContactFormConfirm',
86 86
                 
87 87
             );
88
-            foreach( $_aClassNames as $_sClassName ) {
88
+            foreach ( $_aClassNames as $_sClassName ) {
89 89
                 new $_sClassName( $this->oFactory );
90 90
             }
91 91
             
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
                 
95 95
                 $this->addAndDoActions(
96 96
                     $this->oFactory,
97
-                    'try_validation_before_' . $this->oFactory->oProp->sClassName,
97
+                    'try_validation_before_'.$this->oFactory->oProp->sClassName,
98 98
                     $aInputs,
99 99
                     $aRawInputs,
100 100
                     $_aSubmits,
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
                 $this->addAndDoActions(
115 115
                     $this->oFactory,
116
-                    'try_validation_after_' . $this->oFactory->oProp->sClassName,
116
+                    'try_validation_after_'.$this->oFactory->oProp->sClassName,
117 117
                     $aInputs,
118 118
                     $aRawInputs,
119 119
                     $_aSubmits,
Please login to merge, or discard this patch.
validaor/AdminPageFramework_Model__FormSubmission__Validator_Base.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
             : 'add_filter';
37 37
             
38 38
         $_sFunctionName(
39
-            $this->sActionHookPrefix . $this->oFactory->oProp->sClassName,
39
+            $this->sActionHookPrefix.$this->oFactory->oProp->sClassName,
40 40
             array( $this, $this->sCallbackName ),
41 41
             $this->iHookPriority,
42 42
             $this->iCallbackParameters
@@ -56,17 +56,17 @@  discard block
 block discarded – undo
56 56
      * @since   3.6.3       Moved from `AdminPageFramework_Validation`.
57 57
      * @return  array       The intact stored options.
58 58
      */
59
-    protected function _confirmSubmitButtonAction( $sPressedInputName, $sSectionID, $sType='reset' ) {
59
+    protected function _confirmSubmitButtonAction( $sPressedInputName, $sSectionID, $sType = 'reset' ) {
60 60
         
61
-        switch( $sType ) {
61
+        switch ( $sType ) {
62 62
             default:
63 63
             case 'reset':
64 64
                 $_sFieldErrorMessage = $this->oFactory->oMsg->get( 'reset_options' );
65
-                $_sTransientKey      =  'apf_rc_' . md5( $sPressedInputName . get_current_user_id() );
65
+                $_sTransientKey      = 'apf_rc_'.md5( $sPressedInputName.get_current_user_id() );
66 66
                 break;
67 67
             case 'email':
68 68
                 $_sFieldErrorMessage = $this->oFactory->oMsg->get( 'send_email' );
69
-                $_sTransientKey      =  'apf_ec_' . md5( $sPressedInputName . get_current_user_id() );
69
+                $_sTransientKey      = 'apf_ec_'.md5( $sPressedInputName.get_current_user_id() );
70 70
                 break;                
71 71
         }
72 72
         
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
         $this->oFactory->setFieldErrors( $_aErrors );
89 89
             
90 90
         // Set a flag that the confirmation is displayed
91
-        $this->setTransient( $_sTransientKey, $sPressedInputName, 60*2 );
91
+        $this->setTransient( $_sTransientKey, $sPressedInputName, 60 * 2 );
92 92
         
93 93
         // Set the admin notice
94 94
         $this->oFactory->setSettingNotice( $this->oFactory->oMsg->get( 'confirm_perform_task' ), 'error confirmation' );
Please login to merge, or discard this patch.
AdminPageFramework_Model__FormSubmission__Validator__ContactForm.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
     public function _replyToCallback( $aInputs, $aRawInputs, array $aSubmits, $aSubmitInformation, $oFactory ) {
35 35
                 
36 36
         // Check whether sending an email has been confirmed by the user or not.
37
-        $_bConfirmedToSendEmail     = ( bool ) $this->_getPressedSubmitButtonData( 
37
+        $_bConfirmedToSendEmail = ( bool ) $this->_getPressedSubmitButtonData( 
38 38
             $aSubmits, 
39 39
             'confirmed_sending_email' 
40 40
         );
41
-        if ( ! $_bConfirmedToSendEmail ) {
41
+        if ( !$_bConfirmedToSendEmail ) {
42 42
             return;
43 43
         }
44 44
         
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
             $this->getElement( $aSubmitInformation, 'section_id' )
50 50
         );
51 51
         $this->oFactory->oProp->_bDisableSavingOptions = true;
52
-        $this->deleteTransient( 'apf_tfd' . md5( 'temporary_form_data_' . $this->oFactory->oProp->sClassName . get_current_user_id() ) );
52
+        $this->deleteTransient( 'apf_tfd'.md5( 'temporary_form_data_'.$this->oFactory->oProp->sClassName.get_current_user_id() ) );
53 53
         
54 54
         // Schedule to remove the confirmation url query key.
55 55
         add_action( "setting_update_url_{$this->oFactory->oProp->sClassName}", array( $this, '_replyToRemoveConfirmationQueryKey' ) );
56 56
         
57 57
         // Go to the catch clause.
58
-        $_oException = new Exception( 'aReturn' );  // the property name to return from the catch clasue.
58
+        $_oException = new Exception( 'aReturn' ); // the property name to return from the catch clasue.
59 59
         $_oException->aReturn = $aInputs;
60 60
         throw $_oException;
61 61
     
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
          */
74 74
         private function _sendEmailInBackground( $aInputs, $sPressedInputNameFlat, $sSubmitSectionID ) {
75 75
             
76
-            $_sTranskentKey = 'apf_em_' . md5( $sPressedInputNameFlat . get_current_user_id() );
76
+            $_sTranskentKey = 'apf_em_'.md5( $sPressedInputNameFlat.get_current_user_id() );
77 77
             $_aEmailOptions = $this->getTransient( $_sTranskentKey );
78 78
             $this->deleteTransient( $_sTranskentKey );
79 79
 
@@ -88,13 +88,13 @@  discard block
 block discarded – undo
88 88
                 'name'          => '',
89 89
             );
90 90
 
91
-            $_sTransientKey  = 'apf_emd_' . md5( $sPressedInputNameFlat . get_current_user_id() );
91
+            $_sTransientKey  = 'apf_emd_'.md5( $sPressedInputNameFlat.get_current_user_id() );
92 92
             $_aFormEmailData = array(
93 93
                 'email_options' => $_aEmailOptions,
94 94
                 'input'         => $aInputs,
95 95
                 'section_id'    => $sSubmitSectionID,
96 96
             );
97
-            $_bIsSet = $this->setTransient( $_sTransientKey,  $_aFormEmailData, 100 );
97
+            $_bIsSet = $this->setTransient( $_sTransientKey, $_aFormEmailData, 100 );
98 98
             
99 99
             // Send the email in the background.
100 100
             wp_remote_get( 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             );  
113 113
             
114 114
             // @remark      Not possible to tell whether it is sent or not at the moment because it is performed in the background.
115
-            $_bSent      = $_bIsSet;    
115
+            $_bSent = $_bIsSet;    
116 116
             $this->oFactory->setSettingNotice( 
117 117
                 $this->oFactory->oMsg->get( 
118 118
                     $this->getAOrB( 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
          * @return      string
135 135
          */
136 136
         public function _replyToRemoveConfirmationQueryKey( $sSettingUpdateURL ) {
137
-            return remove_query_arg( array( 'confirmation', ), $sSettingUpdateURL );
137
+            return remove_query_arg( array( 'confirmation',), $sSettingUpdateURL );
138 138
         }      
139 139
         
140 140
 }
141 141
\ No newline at end of file
Please login to merge, or discard this patch.
AdminPageFramework_Model__FormSubmission__Validator__ContactFormConfirm.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,11 +36,11 @@  discard block
 block discarded – undo
36 36
         if ( $this->oFactory->hasFieldError() ) {
37 37
             return;
38 38
         }
39
-        $_bConfirmingToSendEmail    = ( bool ) $this->_getPressedSubmitButtonData( 
39
+        $_bConfirmingToSendEmail = ( bool ) $this->_getPressedSubmitButtonData( 
40 40
             $aSubmits, 
41 41
             'confirming_sending_email' 
42 42
         );
43
-        if ( ! $_bConfirmingToSendEmail ) {
43
+        if ( !$_bConfirmingToSendEmail ) {
44 44
             return;
45 45
         }
46 46
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         );            
54 54
         
55 55
         // Go to the catch clause.
56
-        $_oException = new Exception( 'aReturn' );  // the property name to return from the catch clasue.
56
+        $_oException = new Exception( 'aReturn' ); // the property name to return from the catch clasue.
57 57
         $_oException->aReturn = $this->_confirmSubmitButtonAction( 
58 58
             $this->getElement( $aSubmitInformation, 'input_name' ), 
59 59
             $this->getElement( $aSubmitInformation, 'section_id' ), 
Please login to merge, or discard this patch.