Completed
Branch dev (bc2253)
by
unknown
06:09
created
factory/_common/form/field_type/AdminPageFramework_FieldType_hidden.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
                     . ( $aField[ 'label' ]
68 68
                         ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" 
69 69
                             . $aField[ 'label' ]
70
-                          . "</span>"
70
+                            . "</span>"
71 71
                         : "" 
72 72
                     )
73 73
                     . "<input " . $this->getAttributes( $aField[ 'attributes' ] ) . " />" 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -60,21 +60,21 @@
 block discarded – undo
60 60
     protected function getField( $aField ) {
61 61
 
62 62
         return 
63
-            $aField['before_label']
63
+            $aField[ 'before_label' ]
64 64
             . "<div class='admin-page-framework-input-label-container'>"
65 65
                 . "<label for='{$aField[ 'input_id' ]}'>"
66 66
                     . $aField[ 'before_input' ]
67 67
                     . ( $aField[ 'label' ]
68
-                        ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" 
68
+                        ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" 
69 69
                             . $aField[ 'label' ]
70 70
                           . "</span>"
71 71
                         : "" 
72 72
                     )
73
-                    . "<input " . $this->getAttributes( $aField[ 'attributes' ] ) . " />" 
74
-                    . $aField['after_input']
73
+                    . "<input ".$this->getAttributes( $aField[ 'attributes' ] )." />" 
74
+                    . $aField[ 'after_input' ]
75 75
                 . "</label>"
76 76
             . "</div>"
77
-            . $aField['after_label'];
77
+            . $aField[ 'after_label' ];
78 78
         
79 79
     }
80 80
     
Please login to merge, or discard this patch.
factory/_common/form/field_type/AdminPageFramework_FieldType_color.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     protected function setUp() {
64 64
         
65 65
         // If the WordPress version is greater than or equal to 3.5, then load the new WordPress color picker.
66
-        if ( version_compare( $GLOBALS['wp_version'], '3.5', '>=' ) ) {
66
+        if ( version_compare( $GLOBALS[ 'wp_version' ], '3.5', '>=' ) ) {
67 67
             //Both the necessary css and javascript have been registered already by WordPress, so all we have to do is load them with their handle.
68 68
             wp_enqueue_style( 'wp-color-picker' );
69 69
             wp_enqueue_script( 'wp-color-picker' );
@@ -235,9 +235,9 @@  discard block
 block discarded – undo
235 235
     protected function getField( $aField ) {
236 236
 
237 237
         // If the value is not set, apply the default value, 'transparent'.
238
-        $aField['value'] = is_null( $aField['value'] ) 
238
+        $aField[ 'value' ] = is_null( $aField[ 'value' ] ) 
239 239
             ? 'transparent' 
240
-            : $aField['value'];    
240
+            : $aField[ 'value' ];    
241 241
             
242 242
         $aField[ 'attributes' ] = $this->_getInputAttributes( $aField );
243 243
         
@@ -246,20 +246,20 @@  discard block
 block discarded – undo
246 246
             . "<div class='admin-page-framework-input-label-container'>"
247 247
                 . "<label for='{$aField[ 'input_id' ]}'>"
248 248
                     . $aField[ 'before_input' ]
249
-                    . ( $aField[ 'label' ] && ! $aField[ 'repeatable' ]
250
-                        ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" 
251
-                                . $aField['label'] 
249
+                    . ( $aField[ 'label' ] && !$aField[ 'repeatable' ]
250
+                        ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" 
251
+                                . $aField[ 'label' ] 
252 252
                             . "</span>"
253 253
                         : "" 
254 254
                     )
255
-                    . "<input " . $this->getAttributes( $aField[ 'attributes' ] ) . " />" 
255
+                    . "<input ".$this->getAttributes( $aField[ 'attributes' ] )." />" 
256 256
                     . $aField[ 'after_input' ]
257 257
                     . "<div class='repeatable-field-buttons'></div>" // the repeatable field buttons will be replaced with this element.
258 258
                 . "</label>"
259 259
                 . "<div class='colorpicker' id='color_{$aField[ 'input_id' ]}'></div>" // this div element with this class selector becomes a farbtastic color picker. ( below 3.4.x ) // rel='{$aField['input_id']}'
260 260
                 . $this->_getColorPickerEnablerScript( "{$aField[ 'input_id' ]}" )
261 261
             . "</div>"
262
-            . $aField['after_label'];
262
+            . $aField[ 'after_label' ];
263 263
         
264 264
     }
265 265
         /**
@@ -271,13 +271,13 @@  discard block
 block discarded – undo
271 271
         private function _getInputAttributes( array $aField ) {
272 272
                                
273 273
             return array(
274
-                'color'        => $aField['value'],    
275
-                'value'        => $aField['value'],
274
+                'color'        => $aField[ 'value' ],    
275
+                'value'        => $aField[ 'value' ],
276 276
                 'data-default' => isset( $aField[ 'default' ] )
277 277
                     ? $aField[ 'default' ]
278 278
                     : 'transparent', // used by the repeatable script
279 279
                 'type'         => 'text', // it must be text
280
-                'class'        => trim( 'input_color ' . $aField['attributes']['class'] ),
280
+                'class'        => trim( 'input_color '.$aField[ 'attributes' ][ 'class' ] ),
281 281
             ) + $aField[ 'attributes' ];
282 282
             
283 283
         }    
Please login to merge, or discard this patch.
factory/_common/form/field_type/AdminPageFramework_FieldType_system.php 1 patch
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      * </code>
74 74
      * @var         array
75 75
      */
76
-    public $aFieldTypeSlugs = array( 'system', );
76
+    public $aFieldTypeSlugs = array( 'system',);
77 77
     
78 78
     /**
79 79
      * Defines the default key-values of this field type. 
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
      * @remark          `$_aDefaultKeys` holds shared default key-values defined in the base class.
94 94
      */
95 95
     protected $aDefaultKeys = array(
96
-        'data'          =>  array(),        // [3.2.0+] Stores the data to be displayed
97
-        'print_type'    =>  1,              // [3.4.6+] 1: readable representation of array. 2: print_r()
96
+        'data'          =>  array(), // [3.2.0+] Stores the data to be displayed
97
+        'print_type'    =>  1, // [3.4.6+] 1: readable representation of array. 2: print_r()
98 98
         'attributes'    =>    array(
99 99
             'rows'          => 60,
100 100
             'autofocus'     => null,
@@ -233,13 +233,13 @@  discard block
 block discarded – undo
233 233
             . "<div class='admin-page-framework-input-label-container'>"
234 234
                 . "<label for='{$aField[ 'input_id' ]}'>"
235 235
                     . $aField[ 'before_input' ]
236
-                    . ( $aField[ 'label' ] && ! $aField[ 'repeatable' ]
237
-                        ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" 
236
+                    . ( $aField[ 'label' ] && !$aField[ 'repeatable' ]
237
+                        ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" 
238 238
                                 . $aField[ 'label' ] 
239 239
                             . "</span>"
240 240
                         : "" 
241 241
                     )
242
-                    . "<textarea " . $this->getAttributes( $_aInputAttributes ) . " >"    
242
+                    . "<textarea ".$this->getAttributes( $_aInputAttributes )." >"    
243 243
                         . esc_textarea( $this->_getSystemInfomation( $aField[ 'value' ], $aField[ 'data' ], $aField[ 'print_type' ] ) )
244 244
                     . "</textarea>"
245 245
                     . $aField[ 'after_input' ]
@@ -254,15 +254,15 @@  discard block
 block discarded – undo
254 254
          * @return      string      The human readable system information.
255 255
          * @internal
256 256
          */
257
-        private function _getSystemInfomation( $asValue=null, $asCustomData=null, $iPrintType=1 ) {
257
+        private function _getSystemInfomation( $asValue = null, $asCustomData = null, $iPrintType = 1 ) {
258 258
 
259 259
             if ( isset( $asValue ) ) {
260 260
                 return $asValue;
261 261
             }
262 262
 
263
-            $_aOutput   = array();
264
-            foreach( $this->_getFormattedSystemInformation( $asCustomData ) as $_sSection => $_aInfo ) {
265
-                $_aOutput[] = $this->_getSystemInfoBySection( $_sSection, $_aInfo, $iPrintType );
263
+            $_aOutput = array();
264
+            foreach ( $this->_getFormattedSystemInformation( $asCustomData ) as $_sSection => $_aInfo ) {
265
+                $_aOutput[ ] = $this->_getSystemInfoBySection( $_sSection, $_aInfo, $iPrintType );
266 266
             }
267 267
             return implode( PHP_EOL, $_aOutput );
268 268
             
@@ -277,18 +277,18 @@  discard block
 block discarded – undo
277 277
                 
278 278
                 $_aData = $this->getAsArray( $asCustomData );
279 279
                 $_aData = $_aData + array(
280
-                    'Admin Page Framework'  => isset( $_aData['Admin Page Framework'] )
280
+                    'Admin Page Framework'  => isset( $_aData[ 'Admin Page Framework' ] )
281 281
                         ? null
282 282
                         : AdminPageFramework_Registry::getInfo(),
283
-                    'WordPress'             => $this->_getSiteInfoWithCache( ! isset( $_aData['WordPress'] ) ),
284
-                    'PHP'                   => $this->_getPHPInfo( ! isset( $_aData['PHP'] ) ),
285
-                    'PHP Error Log'         => $this->_getErrorLogByType( 'php', ! isset( $_aData['PHP Error Log'] ) ),
286
-                    'MySQL'                 => isset( $_aData['MySQL'] )
283
+                    'WordPress'             => $this->_getSiteInfoWithCache( !isset( $_aData[ 'WordPress' ] ) ),
284
+                    'PHP'                   => $this->_getPHPInfo( !isset( $_aData[ 'PHP' ] ) ),
285
+                    'PHP Error Log'         => $this->_getErrorLogByType( 'php', !isset( $_aData[ 'PHP Error Log' ] ) ),
286
+                    'MySQL'                 => isset( $_aData[ 'MySQL' ] )
287 287
                         ? null
288
-                        : $this->getMySQLInfo(),    // defined in the utility class.
289
-                    'MySQL Error Log'       => $this->_getErrorLogByType( 'mysql', ! isset( $_aData['MySQL Error Log'] ) ),
290
-                    'Server'                => $this->_getWebServerInfo( ! isset( $_aData['Server'] ) ),
291
-                    'Browser'               => $this->_getClientInfo( ! isset( $_aData['Browser'] ) ),
288
+                        : $this->getMySQLInfo(), // defined in the utility class.
289
+                    'MySQL Error Log'       => $this->_getErrorLogByType( 'mysql', !isset( $_aData[ 'MySQL Error Log' ] ) ),
290
+                    'Server'                => $this->_getWebServerInfo( !isset( $_aData[ 'Server' ] ) ),
291
+                    'Browser'               => $this->_getClientInfo( !isset( $_aData[ 'Browser' ] ) ),
292 292
                 );
293 293
                 
294 294
                 // Dropping empty elements allows the user to remove a section by setting an empty section.
@@ -305,10 +305,10 @@  discard block
 block discarded – undo
305 305
                 switch ( $iPrintType ) {
306 306
                     default:
307 307
                     case 1: // use the framework readable representation of arrays.
308
-                        return $this->getReadableArrayContents( $sSectionName, $aData, 32 ) . PHP_EOL;
308
+                        return $this->getReadableArrayContents( $sSectionName, $aData, 32 ).PHP_EOL;
309 309
                     case 2: // use print_r()
310
-                        return "[{$sSectionName}]" . PHP_EOL
311
-                            . print_r( $aData, true ) . PHP_EOL;
310
+                        return "[{$sSectionName}]".PHP_EOL
311
+                            . print_r( $aData, true ).PHP_EOL;
312 312
                 }                      
313 313
             }
314 314
             /**
@@ -318,17 +318,17 @@  discard block
 block discarded – undo
318 318
              * @since       3.4.6
319 319
              * @since       3.5.3       Added the $bGenerateInfo paramter. This is to reduce conditional statment in the caller method.
320 320
              */
321
-            private function _getClientInfo( $bGenerateInfo=true ) {
321
+            private function _getClientInfo( $bGenerateInfo = true ) {
322 322
                  
323
-                if ( ! $bGenerateInfo ) {
323
+                if ( !$bGenerateInfo ) {
324 324
                     return '';
325 325
                 }
326 326
                  
327 327
                 // Check the browscap value in the ini file first to prevent warnings from being populated
328 328
                 $_aBrowser = @ini_get( 'browscap' ) 
329
-                    ? get_browser( $_SERVER['HTTP_USER_AGENT'], true )
329
+                    ? get_browser( $_SERVER[ 'HTTP_USER_AGENT' ], true )
330 330
                     : array();
331
-                unset( $_aBrowser['browser_name_regex'] );  // this element causes output to be blank
331
+                unset( $_aBrowser[ 'browser_name_regex' ] ); // this element causes output to be blank
332 332
                 return empty( $_aBrowser ) 
333 333
                     ? __( 'No browser information found.', 'admin-page-framework' )
334 334
                     : $_aBrowser;
@@ -344,9 +344,9 @@  discard block
 block discarded – undo
344 344
              * @param       string      $sType          The error log type. Either 'php' or 'mysql' is accepted.
345 345
              * @param       boolean     $bGenerateInfo  Whether to generate a log. This is for the caller method to reduce a conditinal statement.
346 346
              */
347
-            private function _getErrorLogByType( $sType, $bGenerateInfo=true ) {
347
+            private function _getErrorLogByType( $sType, $bGenerateInfo = true ) {
348 348
 
349
-                if ( ! $bGenerateInfo ) {
349
+                if ( !$bGenerateInfo ) {
350 350
                     return '';
351 351
                 }
352 352
                 switch ( $sType ) {
@@ -378,9 +378,9 @@  discard block
 block discarded – undo
378 378
              * @since       3.5.3       Added the $bGenerateInfo paramter. This is to reduce conditional statment in the caller method.
379 379
              * @return      array      The generated site information array.
380 380
              */
381
-            private function _getSiteInfoWithCache( $bGenerateInfo=true ) {
381
+            private function _getSiteInfoWithCache( $bGenerateInfo = true ) {
382 382
                 
383
-                if ( ! $bGenerateInfo || isset( self::$_aSiteInfo ) ) {
383
+                if ( !$bGenerateInfo || isset( self::$_aSiteInfo ) ) {
384 384
                     return self::$_aSiteInfo;
385 385
                 }
386 386
                 self::$_aSiteInfo = self::_getSiteInfo();
@@ -414,8 +414,8 @@  discard block
 block discarded – undo
414 414
                         'wp_remote_get()'                                           => $this->_getWPRemoteGetStatus(),
415 415
                         __( 'Multibite String Extension', 'admin-page-framework' )  => $this->getAOrB( function_exists( 'mb_detect_encoding' ), $this->oMsg->get( 'enabled' ), $this->oMsg->get( 'disabled' ) ),
416 416
                         __( 'WP_CONTENT_DIR Writeable', 'admin-page-framework' )    => $this->getAOrB( is_writable( WP_CONTENT_DIR ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), 
417
-                        __( 'Active Plugins', 'admin-page-framework' )              => PHP_EOL . $this->_getActivePlugins(),
418
-                        __( 'Network Active Plugins', 'admin-page-framework' )      => PHP_EOL . $this->_getNetworkActivePlugins(),
417
+                        __( 'Active Plugins', 'admin-page-framework' )              => PHP_EOL.$this->_getActivePlugins(),
418
+                        __( 'Network Active Plugins', 'admin-page-framework' )      => PHP_EOL.$this->_getNetworkActivePlugins(),
419 419
                         __( 'Constants', 'admin-page-framework' )                   => $this->_getDefinedConstants( 'user' ),
420 420
                     );                        
421 421
                 }
@@ -425,9 +425,9 @@  discard block
 block discarded – undo
425 425
                      * @return      string|array
426 426
                      * @internal
427 427
                      */
428
-                    private function _getDefinedConstants( $asCategories=null, $asRemovingCategories=null ) {
428
+                    private function _getDefinedConstants( $asCategories = null, $asRemovingCategories = null ) {
429 429
                         $_asConstants = $this->getDefinedConstants( $asCategories, $asRemovingCategories );
430
-                        if ( ! is_array( $_asConstants ) ) {
430
+                        if ( !is_array( $_asConstants ) ) {
431 431
                             return $_asConstants;
432 432
                         }
433 433
                         if ( isset( $_asConstants[ 'user' ] ) ) {
@@ -463,13 +463,13 @@  discard block
 block discarded – undo
463 463
                 private function _getActiveThemeName() {
464 464
                     
465 465
                     // If the WordPress version is less than 3.4,
466
-                    if ( version_compare( $GLOBALS['wp_version'], '3.4', '<' ) ) {
467
-                        $_aThemeData = get_theme_data( get_stylesheet_directory() . '/style.css' );
468
-                        return $_aThemeData['Name'] . ' ' . $_aThemeData['Version'];
466
+                    if ( version_compare( $GLOBALS[ 'wp_version' ], '3.4', '<' ) ) {
467
+                        $_aThemeData = get_theme_data( get_stylesheet_directory().'/style.css' );
468
+                        return $_aThemeData[ 'Name' ].' '.$_aThemeData[ 'Version' ];
469 469
                     } 
470 470
                     
471 471
                     $_oThemeData = wp_get_theme();
472
-                    return $_oThemeData->Name . ' ' . $_oThemeData->Version;
472
+                    return $_oThemeData->Name.' '.$_oThemeData->Version;
473 473
                     
474 474
                 }   
475 475
                 /**
@@ -483,10 +483,10 @@  discard block
 block discarded – undo
483 483
                     $_aPluginList       = array();
484 484
                     $_aActivePlugins    = get_option( 'active_plugins', array() );
485 485
                     foreach ( get_plugins() as $_sPluginPath => $_aPlugin ) {
486
-                        if ( ! in_array( $_sPluginPath, $_aActivePlugins ) ) {
486
+                        if ( !in_array( $_sPluginPath, $_aActivePlugins ) ) {
487 487
                             continue;
488 488
                         }
489
-                        $_aPluginList[] = '    ' . $_aPlugin['Name'] . ': ' . $_aPlugin['Version'];
489
+                        $_aPluginList[ ] = '    '.$_aPlugin[ 'Name' ].': '.$_aPlugin[ 'Version' ];
490 490
                     }
491 491
                     return implode( PHP_EOL, $_aPluginList );
492 492
                     
@@ -498,17 +498,17 @@  discard block
 block discarded – undo
498 498
                  */
499 499
                 private function _getNetworkActivePlugins() {
500 500
                     
501
-                    if ( ! is_multisite() ) {
501
+                    if ( !is_multisite() ) {
502 502
                         return '';
503 503
                     }
504 504
                     $_aPluginList       = array();
505 505
                     $_aActivePlugins    = get_site_option( 'active_sitewide_plugins', array() );
506 506
                     foreach ( wp_get_active_network_plugins() as $_sPluginPath ) {
507
-                        if ( ! array_key_exists( plugin_basename( $_sPluginPath ), $_aActivePlugins ) ) {
507
+                        if ( !array_key_exists( plugin_basename( $_sPluginPath ), $_aActivePlugins ) ) {
508 508
                             continue;
509 509
                         }
510 510
                         $_aPlugin       = get_plugin_data( $_sPluginPath );
511
-                        $_aPluginList[] = '    ' . $_aPlugin['Name'] . ' :' . $_aPlugin['Version'];
511
+                        $_aPluginList[ ] = '    '.$_aPlugin[ 'Name' ].' :'.$_aPlugin[ 'Version' ];
512 512
                     }
513 513
                     return implode( PHP_EOL, $_aPluginList );
514 514
                     
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
                     $_vResponse = false === $_vResponse
527 527
                         ? wp_remote_post( 
528 528
                             // 'https://www.paypal.com/cgi-bin/webscr', 
529
-                            add_query_arg( $_GET, admin_url( $GLOBALS['pagenow'] ) ),
529
+                            add_query_arg( $_GET, admin_url( $GLOBALS[ 'pagenow' ] ) ),
530 530
                             array(
531 531
                                 'sslverify'     => false,
532 532
                                 'timeout'       => 60,
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
                     $_vResponse = $this->getTransient( 'apf_rg_check' );
550 550
                     $_vResponse = false === $_vResponse
551 551
                         ? wp_remote_get( 
552
-                            add_query_arg( $_GET + array( 'apf_remote_request_test' => '_testing' ), admin_url( $GLOBALS['pagenow'] ) ),
552
+                            add_query_arg( $_GET + array( 'apf_remote_request_test' => '_testing' ), admin_url( $GLOBALS[ 'pagenow' ] ) ),
553 553
                             array(
554 554
                                 'sslverify'     => false,
555 555
                                 'timeout'       => 60,
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
                         if ( is_wp_error( $mResponse ) ) {
575 575
                             return true;
576 576
                         }
577
-                        if ( $mResponse[ 'response'][ 'code' ] < 200 ) {
577
+                        if ( $mResponse[ 'response' ][ 'code' ] < 200 ) {
578 578
                             return true;
579 579
                         }
580 580
                         if ( $mResponse[ 'response' ][ 'code' ] >= 300 ) {
@@ -597,13 +597,13 @@  discard block
 block discarded – undo
597 597
              * @since       3.4.6
598 598
              * @since       3.5.3       Added the $bGenerateInfo parameter. This is to reduce conditional statement in the caller method.
599 599
              */
600
-            private function _getPHPInfo( $bGenerateInfo=true ) {
600
+            private function _getPHPInfo( $bGenerateInfo = true ) {
601 601
                 
602
-                if ( ! $bGenerateInfo || isset( self::$_aPHPInfo ) ) {
602
+                if ( !$bGenerateInfo || isset( self::$_aPHPInfo ) ) {
603 603
                     return self::$_aPHPInfo;
604 604
                 }
605 605
                 
606
-                $_oErrorReporting   = new AdminPageFramework_ErrorReporting;
606
+                $_oErrorReporting = new AdminPageFramework_ErrorReporting;
607 607
                 self::$_aPHPInfo = array(
608 608
                     __( 'Version', 'admin-page-framework' )                 => phpversion(),
609 609
                     __( 'Safe Mode', 'admin-page-framework' )               => $this->getAOrB( @ini_get( 'safe_mode' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), 
@@ -614,16 +614,16 @@  discard block
 block discarded – undo
614 614
                     __( 'Max Execution Time', 'admin-page-framework' )      => @ini_get( 'max_execution_time' ),
615 615
                     __( 'Max Input Vars', 'admin-page-framework' )          => @ini_get( 'max_input_vars' ),
616 616
                     __( 'Argument Separator', 'admin-page-framework' )      => @ini_get( 'arg_separator.output' ),
617
-                    __( 'Allow URL File Open', 'admin-page-framework' )     => $this->getAOrB( @ini_get( 'allow_url_fopen' ),    $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ),
618
-                    __( 'Display Errors', 'admin-page-framework' )          => $this->getAOrB( @ini_get( 'display_errors' ),     $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ),
619
-                    __( 'Log Errors', 'admin-page-framework' )              => $this->getAOrB( @ini_get( 'log_errors' ),         $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ),
617
+                    __( 'Allow URL File Open', 'admin-page-framework' )     => $this->getAOrB( @ini_get( 'allow_url_fopen' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ),
618
+                    __( 'Display Errors', 'admin-page-framework' )          => $this->getAOrB( @ini_get( 'display_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ),
619
+                    __( 'Log Errors', 'admin-page-framework' )              => $this->getAOrB( @ini_get( 'log_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ),
620 620
                     __( 'Error log location', 'admin-page-framework' )      => @ini_get( 'error_log' ),
621 621
                     __( 'Error Reporting Level', 'admin-page-framework' )   => $_oErrorReporting->getErrorLevel(),
622
-                    __( 'FSOCKOPEN', 'admin-page-framework' )               => $this->getAOrB( function_exists( 'fsockopen' ),   $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
623
-                    __( 'cURL', 'admin-page-framework' )                    => $this->getAOrB( function_exists( 'curl_init' ),   $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
624
-                    __( 'SOAP', 'admin-page-framework' )                    => $this->getAOrB( class_exists( 'SoapClient' ),     $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
625
-                    __( 'SUHOSIN', 'admin-page-framework' )                 => $this->getAOrB( extension_loaded( 'suhosin' ),    $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
626
-                    'ini_set()'                                             => $this->getAOrB( function_exists( 'ini_set' ),     $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
622
+                    __( 'FSOCKOPEN', 'admin-page-framework' )               => $this->getAOrB( function_exists( 'fsockopen' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
623
+                    __( 'cURL', 'admin-page-framework' )                    => $this->getAOrB( function_exists( 'curl_init' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
624
+                    __( 'SOAP', 'admin-page-framework' )                    => $this->getAOrB( class_exists( 'SoapClient' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
625
+                    __( 'SUHOSIN', 'admin-page-framework' )                 => $this->getAOrB( extension_loaded( 'suhosin' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
626
+                    'ini_set()'                                             => $this->getAOrB( function_exists( 'ini_set' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ),
627 627
                 ) 
628 628
                 + $this->getPHPInfo()
629 629
                 + array( 
@@ -642,11 +642,11 @@  discard block
 block discarded – undo
642 642
              * @since       3.5.3       Added the $bGenerateInfo paramter. This is to reduce conditional statment in the caller method.
643 643
              * @return      array|string
644 644
              */                      
645
-            private function _getWebServerInfo( $bGenerateInfo=true ) {
645
+            private function _getWebServerInfo( $bGenerateInfo = true ) {
646 646
                         
647 647
                 return $bGenerateInfo 
648 648
                     ? array(
649
-                        __( 'Web Server', 'admin-page-framework' )                  => $_SERVER['SERVER_SOFTWARE'],
649
+                        __( 'Web Server', 'admin-page-framework' )                  => $_SERVER[ 'SERVER_SOFTWARE' ],
650 650
                         'SSL'                                                       => $this->getAOrB( is_ssl(), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ),
651 651
                         __( 'Session', 'admin-page-framework' )                     => $this->getAOrB( isset( $_SESSION ), $this->oMsg->get( 'enabled' ), $this->oMsg->get( 'disabled' ) ),
652 652
                         __( 'Session Name', 'admin-page-framework' )                => esc_html( @ini_get( 'session.name' ) ),
Please login to merge, or discard this patch.
factory/_common/form/field_type/AdminPageFramework_FieldType_submit.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
     /**
188 188
      * Defines the field type slugs used for this field type.
189 189
      */
190
-    public $aFieldTypeSlugs = array( 'submit', );
190
+    public $aFieldTypeSlugs = array( 'submit',);
191 191
     
192 192
     /**
193 193
      * Defines the default key-values of this field type. 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         'redirect_url'  => null,
199 199
         'href'          => null,
200 200
         'reset'         => null, 
201
-        'email'         => null,    // [3.3.0+] string of an email address to send to or it can be an array with the following keys.
201
+        'email'         => null, // [3.3.0+] string of an email address to send to or it can be an array with the following keys.
202 202
         /* 
203 203
             array(
204 204
                 'to'            => null,    // string|array     The email address to send to or an array representing the key structure of the submitted form data holding the value. The first key should be the section ID and the second key is the the field ID.
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
                 'attachments'   => null,    // string|array     The file path(s) or an array representing the key structure of the submitted form data holding the value. The first key should be the section ID and the second key is the the field ID.
209 209
             )
210 210
         */
211
-        'skip_confirmation' => false,   // 3.7.6+ For emails.
211
+        'skip_confirmation' => false, // 3.7.6+ For emails.
212 212
         'attributes'    => array(
213 213
             'class' => 'button button-primary',
214 214
         ),    
@@ -248,16 +248,16 @@  discard block
 block discarded – undo
248 248
 
249 249
         return 
250 250
             $aField[ 'before_label' ]
251
-            . "<div " . $this->getAttributes( $_aLabelContainerAttributes ) . ">"
251
+            . "<div ".$this->getAttributes( $_aLabelContainerAttributes ).">"
252 252
                 . $this->_getExtraFieldsBeforeLabel( $aField ) // this is for the import field type that cannot place file input tag inside the label tag.
253
-                . "<label " . $this->getAttributes( $_aLabelAttributes ) . ">"
253
+                . "<label ".$this->getAttributes( $_aLabelAttributes ).">"
254 254
                     . $aField[ 'before_input' ]
255 255
                     . $this->_getExtraInputFields( $aField )
256
-                    . "<input " . $this->getAttributes( $_aInputAttributes ) . " />" // this method is defined in the base class
256
+                    . "<input ".$this->getAttributes( $_aInputAttributes )." />" // this method is defined in the base class
257 257
                     . $aField[ 'after_input' ]
258 258
                 . "</label>"
259 259
             . "</div>"
260
-            . $aField['after_label'];
260
+            . $aField[ 'after_label' ];
261 261
         
262 262
     }
263 263
         /**
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
         private function _getLabelAttributes( array $aField, array $aInputAttributes ) {
290 290
             return array(
291 291
                 'style' => $aField[ 'label_min_width' ] 
292
-                    ? "min-width:" . $this->getLengthSanitized( $aField[ 'label_min_width' ] ) . ";" 
292
+                    ? "min-width:".$this->getLengthSanitized( $aField[ 'label_min_width' ] ).";" 
293 293
                     : null,
294 294
                 'for'   => $aInputAttributes[ 'id' ],
295 295
                 'class' => $aInputAttributes[ 'disabled' ] 
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
         private function _getLabelContainerAttributes( array $aField ) {           
308 308
             return array(
309 309
                 'style' => $aField[ 'label_min_width' ] 
310
-                    ? "min-width:" . $this->getLengthSanitized( $aField[ 'label_min_width' ] ) . ";" 
310
+                    ? "min-width:".$this->getLengthSanitized( $aField[ 'label_min_width' ] ).";" 
311 311
                     : null,
312 312
                 'class' => 'admin-page-framework-input-label-container'
313 313
                     . ' admin-page-framework-input-button-container'
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
     protected function _getExtraInputFields( &$aField ) {
359 359
         
360 360
         $_aOutput   = array();
361
-        $_aOutput[] = $this->getHTMLTag( 
361
+        $_aOutput[ ] = $this->getHTMLTag( 
362 362
             'input',
363 363
             array(
364 364
                 'type'  => 'hidden',
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
                 'value' => $aField[ 'input_id' ],
367 367
             )
368 368
         );
369
-        $_aOutput[] = $this->getHTMLTag( 
369
+        $_aOutput[ ] = $this->getHTMLTag( 
370 370
             'input',
371 371
             array(
372 372
                 'type'  => 'hidden',
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
                 'value' => $aField[ 'field_id' ],
375 375
             ) 
376 376
         );            
377
-        $_aOutput[] = $this->getHTMLTag( 
377
+        $_aOutput[ ] = $this->getHTMLTag( 
378 378
             'input',
379 379
             array(
380 380
                 'type'  => 'hidden',
@@ -382,11 +382,11 @@  discard block
 block discarded – undo
382 382
                 'value' => $aField[ '_input_name_flat' ],
383 383
             ) 
384 384
         );         
385
-        $_aOutput[] = $this->_getHiddenInput_SectionID( $aField );
386
-        $_aOutput[] = $this->_getHiddenInputByKey( $aField, 'redirect_url' );       
387
-        $_aOutput[] = $this->_getHiddenInputByKey( $aField, 'href' );       
388
-        $_aOutput[] = $this->_getHiddenInput_Reset( $aField );
389
-        $_aOutput[] = $this->_getHiddenInput_Email( $aField );
385
+        $_aOutput[ ] = $this->_getHiddenInput_SectionID( $aField );
386
+        $_aOutput[ ] = $this->_getHiddenInputByKey( $aField, 'redirect_url' );       
387
+        $_aOutput[ ] = $this->_getHiddenInputByKey( $aField, 'href' );       
388
+        $_aOutput[ ] = $this->_getHiddenInput_Reset( $aField );
389
+        $_aOutput[ ] = $this->_getHiddenInput_Email( $aField );
390 390
         return implode( PHP_EOL, array_filter( $_aOutput ) );  
391 391
         
392 392
     }
@@ -402,9 +402,9 @@  discard block
 block discarded – undo
402 402
                 'input',
403 403
                 array(
404 404
                     'type'  => 'hidden',
405
-                    'name'  => "__submit[{$aField['input_id']}][section_id]",
406
-                    'value' => isset( $aField['section_id'] ) && '_default' !== $aField['section_id'] 
407
-                        ? $aField['section_id'] 
405
+                    'name'  => "__submit[{$aField[ 'input_id' ]}][section_id]",
406
+                    'value' => isset( $aField[ 'section_id' ] ) && '_default' !== $aField[ 'section_id' ] 
407
+                        ? $aField[ 'section_id' ] 
408 408
                         : '',
409 409
                 ) 
410 410
             );                  
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
                     'input',
423 423
                     array(
424 424
                         'type'  => 'hidden',
425
-                        'name'  => "__submit[{$aField['input_id']}][{$sKey}]",
425
+                        'name'  => "__submit[{$aField[ 'input_id' ]}][{$sKey}]",
426 426
                         'value' => $aField[ $sKey ],
427 427
                     ) 
428 428
                 )
@@ -436,15 +436,15 @@  discard block
 block discarded – undo
436 436
          * @return      string      the HTML input tag output for the 'reset' argument.
437 437
          */        
438 438
         private function _getHiddenInput_Reset( array $aField ) {
439
-            if ( ! $aField['reset'] ) {
439
+            if ( !$aField[ 'reset' ] ) {
440 440
                 return '';
441 441
             }
442
-            return ! $this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'reset' )
442
+            return !$this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'reset' )
443 443
                 ? $this->getHTMLTag( 
444 444
                     'input',
445 445
                     array(
446 446
                         'type'  => 'hidden',
447
-                        'name'  => "__submit[{$aField['input_id']}][is_reset]",
447
+                        'name'  => "__submit[{$aField[ 'input_id' ]}][is_reset]",
448 448
                         'value' => '1',
449 449
                     ) 
450 450
                 )
@@ -452,10 +452,10 @@  discard block
 block discarded – undo
452 452
                     'input',
453 453
                     array(
454 454
                         'type'  => 'hidden',
455
-                        'name'  => "__submit[{$aField['input_id']}][reset_key]",
456
-                        'value' => is_array( $aField['reset'] )   // set the option array key to delete.
457
-                            ? implode( '|', $aField['reset'] )
458
-                            : $aField['reset'],
455
+                        'name'  => "__submit[{$aField[ 'input_id' ]}][reset_key]",
456
+                        'value' => is_array( $aField[ 'reset' ] )   // set the option array key to delete.
457
+                            ? implode( '|', $aField[ 'reset' ] )
458
+                            : $aField[ 'reset' ],
459 459
                     )
460 460
                 );      
461 461
         }
@@ -472,10 +472,10 @@  discard block
 block discarded – undo
472 472
                 return '';
473 473
             }
474 474
             $this->setTransient( 
475
-                'apf_em_' . md5( $aField[ '_input_name_flat' ] . get_current_user_id() ), 
475
+                'apf_em_'.md5( $aField[ '_input_name_flat' ].get_current_user_id() ), 
476 476
                 $aField[ 'email' ] 
477 477
             );
478
-            return ! $this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'email' )
478
+            return !$this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'email' )
479 479
                 ? $this->getHTMLTag( 
480 480
                     'input',
481 481
                     array(
@@ -500,19 +500,19 @@  discard block
 block discarded – undo
500 500
          * @return      boolean
501 501
          * @internal
502 502
          */
503
-        private function _checkConfirmationDisplayed( $aField, $sFlatFieldName, $sType='reset' ) {
503
+        private function _checkConfirmationDisplayed( $aField, $sFlatFieldName, $sType = 'reset' ) {
504 504
                             
505
-            switch( $sType ) {
505
+            switch ( $sType ) {
506 506
                 default:
507 507
                 case 'reset':       // admin page framework _ reset confirmation
508
-                    $_sTransientKey = 'apf_rc_' . md5( $sFlatFieldName . get_current_user_id() );
508
+                    $_sTransientKey = 'apf_rc_'.md5( $sFlatFieldName.get_current_user_id() );
509 509
                     break;
510 510
                 case 'email':       // admin page framework _ email confirmation
511
-                    $_sTransientKey = 'apf_ec_' . md5( $sFlatFieldName . get_current_user_id() );   
511
+                    $_sTransientKey = 'apf_ec_'.md5( $sFlatFieldName.get_current_user_id() );   
512 512
                     break;
513 513
             }
514 514
             
515
-            $_bConfirmed = false === $this->getTransient( $_sTransientKey ) && ! $aField[ 'skip_confirmation' ]
515
+            $_bConfirmed = false === $this->getTransient( $_sTransientKey ) && !$aField[ 'skip_confirmation' ]
516 516
                 ? false
517 517
                 : true;
518 518
             
Please login to merge, or discard this patch.
factory/_common/form/field_type/AdminPageFramework_FieldType_textarea.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -554,8 +554,8 @@  discard block
 block discarded – undo
554 554
     protected function getField( $aField ) {
555 555
 
556 556
         $_aOutput = array();
557
-        foreach( ( array ) $aField[ 'label' ] as $_sKey => $_sLabel ) {
558
-            $_aOutput[] = $this->_getFieldOutputByLabel( 
557
+        foreach ( ( array ) $aField[ 'label' ] as $_sKey => $_sLabel ) {
558
+            $_aOutput[ ] = $this->_getFieldOutputByLabel( 
559 559
                 $_sKey, 
560 560
                 $_sLabel, 
561 561
                 $aField
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
         }
564 564
         
565 565
         // the repeatable field buttons will be replaced with this element.
566
-        $_aOutput[] = "<div class='repeatable-field-buttons'></div>";
566
+        $_aOutput[ ] = "<div class='repeatable-field-buttons'></div>";
567 567
         return implode( '', $_aOutput );
568 568
         
569 569
     }
@@ -584,27 +584,27 @@  discard block
 block discarded – undo
584 584
             $aField[ 'rich' ]       = $this->getElementByLabel( $aField[ 'rich' ], $sKey, $aField[ 'label' ] );
585 585
             $aField[ 'attributes' ] = $_bIsArray
586 586
                 ? array(
587
-                        'name'  => $aField[ 'attributes' ][ 'name' ] . "[{$sKey}]",
588
-                        'id'    => $aField[ 'attributes' ][ 'id' ] . "_{$sKey}",
587
+                        'name'  => $aField[ 'attributes' ][ 'name' ]."[{$sKey}]",
588
+                        'id'    => $aField[ 'attributes' ][ 'id' ]."_{$sKey}",
589 589
                         'value' => $aField[ 'value' ],
590 590
                     ) 
591 591
                     + $aField[ 'attributes' ]
592 592
                 : $aField[ 'attributes' ];        
593
-            $_aOutput           = array(
594
-                $this->getElementByLabel( $aField['before_label'], $sKey, $aField[ 'label' ] ),
593
+            $_aOutput = array(
594
+                $this->getElementByLabel( $aField[ 'before_label' ], $sKey, $aField[ 'label' ] ),
595 595
                 "<div class='admin-page-framework-input-label-container {$_sClassSelector}'>",
596
-                    "<label for='" . $aField[ 'attributes' ][ 'id' ] . "'>",
597
-                        $this->getElementByLabel( $aField['before_input'], $sKey, $aField[ 'label' ] ),
596
+                    "<label for='".$aField[ 'attributes' ][ 'id' ]."'>",
597
+                        $this->getElementByLabel( $aField[ 'before_input' ], $sKey, $aField[ 'label' ] ),
598 598
                         $_sLabel 
599
-                            ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" 
599
+                            ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" 
600 600
                                     . $_sLabel
601 601
                                 . "</span>"
602 602
                             : '',
603 603
                         $this->_getEditor( $aField ),
604
-                        $this->getElementByLabel( $aField['after_input'], $sKey, $aField[ 'label' ] ),
604
+                        $this->getElementByLabel( $aField[ 'after_input' ], $sKey, $aField[ 'label' ] ),
605 605
                     "</label>",
606 606
                 "</div>",
607
-                $this->getElementByLabel( $aField['after_label'], $sKey, $aField[ 'label' ] ),
607
+                $this->getElementByLabel( $aField[ 'after_label' ], $sKey, $aField[ 'label' ] ),
608 608
             );
609 609
             return implode( '', $_aOutput );
610 610
   
@@ -619,31 +619,31 @@  discard block
 block discarded – undo
619 619
          */
620 620
         private function _getEditor( $aField ) {
621 621
                         
622
-            unset( $aField['attributes']['value'] );
622
+            unset( $aField[ 'attributes' ][ 'value' ] );
623 623
             
624 624
             // For no TinyMCE
625
-            if ( empty( $aField['rich'] ) || ! $this->isTinyMCESupported() ) {
626
-                return "<textarea " . $this->getAttributes( $aField['attributes'] ) . " >" // this method is defined in the base class
627
-                            . esc_textarea( $aField['value'] )
625
+            if ( empty( $aField[ 'rich' ] ) || !$this->isTinyMCESupported() ) {
626
+                return "<textarea ".$this->getAttributes( $aField[ 'attributes' ] )." >" // this method is defined in the base class
627
+                            . esc_textarea( $aField[ 'value' ] )
628 628
                         . "</textarea>";
629 629
             }
630 630
 
631 631
             // Rich editor
632 632
             ob_start();
633 633
             wp_editor( 
634
-                $aField['value'],
635
-                $aField['attributes']['id'],  
634
+                $aField[ 'value' ],
635
+                $aField[ 'attributes' ][ 'id' ],  
636 636
                 $this->uniteArrays( 
637
-                    ( array ) $aField['rich'],
637
+                    ( array ) $aField[ 'rich' ],
638 638
                     array(
639 639
                         'wpautop'           => true, // use wpautop?
640 640
                         'media_buttons'     => true, // show insert/upload button(s)
641
-                        'textarea_name'     => $aField['attributes']['name'],
642
-                        'textarea_rows'     => $aField['attributes']['rows'],
641
+                        'textarea_name'     => $aField[ 'attributes' ][ 'name' ],
642
+                        'textarea_rows'     => $aField[ 'attributes' ][ 'rows' ],
643 643
                         'tabindex'          => '',
644 644
                         'tabfocus_elements' => ':prev,:next', // the previous and next element ID to move the focus to when pressing the Tab key in TinyMCE
645 645
                         'editor_css'        => '', // intended for extra styles for both visual and Text editors buttons, needs to include the <style> tags, can use "scoped".
646
-                        'editor_class'      => $aField['attributes']['class'], // add extra class(es) to the editor textarea
646
+                        'editor_class'      => $aField[ 'attributes' ][ 'class' ], // add extra class(es) to the editor textarea
647 647
                         'teeny'             => false, // output the minimal editor config used in Press This
648 648
                         'dfw'               => false, // replace the default fullscreen with DFW (needs specific DOM elements and css)
649 649
                         'tinymce'           => true, // load TinyMCE, can be used to pass settings directly to TinyMCE using an array()
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
             ob_end_clean();
656 656
             
657 657
             return $_sContent
658
-                . $this->_getScriptForRichEditor( $aField['attributes']['id'] );
658
+                . $this->_getScriptForRichEditor( $aField[ 'attributes' ][ 'id' ] );
659 659
             
660 660
         }
661 661
     
Please login to merge, or discard this patch.
factory/_common/form/field_type/AdminPageFramework_FieldType_default.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,21 +37,21 @@
 block discarded – undo
37 37
      */
38 38
     public function _replyToGetField( $aField ) {
39 39
         return 
40
-            $aField['before_label']
40
+            $aField[ 'before_label' ]
41 41
             . "<div class='admin-page-framework-input-label-container'>"
42
-                . "<label for='{$aField['input_id']}'>"
43
-                    . $aField['before_input']
44
-                    . ( $aField['label'] && ! $aField['repeatable']
45
-                        ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" 
42
+                . "<label for='{$aField[ 'input_id' ]}'>"
43
+                    . $aField[ 'before_input' ]
44
+                    . ( $aField[ 'label' ] && !$aField[ 'repeatable' ]
45
+                        ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" 
46 46
                                 . $aField[ 'label' ]
47 47
                             . "</span>"
48 48
                         : "" 
49 49
                     )
50
-                    . $aField['value']
51
-                    . $aField['after_input']
50
+                    . $aField[ 'value' ]
51
+                    . $aField[ 'after_input' ]
52 52
                 . "</label>"
53 53
             . "</div>"
54
-            . $aField['after_label']
54
+            . $aField[ 'after_label' ]
55 55
         ;     
56 56
     }
57 57
 
Please login to merge, or discard this patch.
factory/_common/form/field_type/AdminPageFramework_FieldType_radio.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
      */
108 108
     protected function getField( $aField ) {
109 109
         
110
-        $_aOutput   = array();
111
-        foreach( $this->getAsArray( $aField['label'] ) as $_sKey => $_sLabel ) {            
112
-            $_aOutput[] = $this->_getEachRadioButtonOutput( $aField, $_sKey, $_sLabel );
110
+        $_aOutput = array();
111
+        foreach ( $this->getAsArray( $aField[ 'label' ] ) as $_sKey => $_sLabel ) {            
112
+            $_aOutput[ ] = $this->_getEachRadioButtonOutput( $aField, $_sKey, $_sLabel );
113 113
         }
114
-        $_aOutput[] = $this->_getUpdateCheckedScript( $aField['input_id'] );
114
+        $_aOutput[ ] = $this->_getUpdateCheckedScript( $aField[ 'input_id' ] );
115 115
         return implode( PHP_EOL, $_aOutput );
116 116
             
117 117
     }
@@ -127,12 +127,12 @@  discard block
 block discarded – undo
127 127
             $_aAttributes = $aField[ 'attributes' ] + $this->getElementAsArray( $aField, array( 'attributes', $sKey ) );
128 128
             $_oRadio      = new AdminPageFramework_Input_radio( $_aAttributes );
129 129
             $_oRadio->setAttributesByKey( $sKey );
130
-            $_oRadio->setAttribute( 'data-default', $aField['default'] ); // refered by the repeater script
130
+            $_oRadio->setAttribute( 'data-default', $aField[ 'default' ] ); // refered by the repeater script
131 131
            
132 132
             // Output
133 133
             return $this->getElementByLabel( $aField[ 'before_label' ], $sKey, $aField[ 'label' ] )
134
-                . "<div " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-radio-label' ) . ">" 
135
-                    . "<label " . $this->getAttributes( 
134
+                . "<div ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-radio-label' ).">" 
135
+                    . "<label ".$this->getAttributes( 
136 136
                             array(
137 137
                                 'for'   => $_oRadio->getAttribute( 'id' ),
138 138
                                 'class' => $_oRadio->getAttribute( 'disabled' )
Please login to merge, or discard this patch.
factory/_common/form/field_type/AdminPageFramework_FieldType_checkbox.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
      * Defines the default key-values of this field type. 
77 77
      */
78 78
     protected $aDefaultKeys = array(
79
-        'select_all_button'     => false,        // 3.3.0+   to change the label, set the label here
80
-        'select_none_button'    => false,        // 3.3.0+   to change the label, set the label here
79
+        'select_all_button'     => false, // 3.3.0+   to change the label, set the label here
80
+        'select_none_button'    => false, // 3.3.0+   to change the label, set the label here
81 81
     );
82 82
         
83 83
     /**
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
      */ 
90 90
     protected function getScripts() {
91 91
         new AdminPageFramework_Form_View___Script_CheckboxSelector;
92
-        $_sClassSelectorSelectAll  = $this->_getSelectButtonClassSelectors( 
92
+        $_sClassSelectorSelectAll = $this->_getSelectButtonClassSelectors( 
93 93
             $this->aFieldTypeSlugs, 
94 94
             'select_all_button' // data attribute
95 95
         );
@@ -116,14 +116,14 @@  discard block
 block discarded – undo
116 116
          * @return      string
117 117
          * @internal
118 118
          */
119
-        private function _getSelectButtonClassSelectors( array $aFieldTypeSlugs, $sDataAttribute='select_all_button' ) {
119
+        private function _getSelectButtonClassSelectors( array $aFieldTypeSlugs, $sDataAttribute = 'select_all_button' ) {
120 120
             
121 121
             $_aClassSelectors = array();
122 122
             foreach ( $aFieldTypeSlugs as $_sSlug ) {
123
-                if ( ! is_scalar( $_sSlug ) ) {
123
+                if ( !is_scalar( $_sSlug ) ) {
124 124
                     continue;
125 125
                 }
126
-                $_aClassSelectors[] = '.admin-page-framework-checkbox-container-' . $_sSlug . "[data-{$sDataAttribute}]";
126
+                $_aClassSelectors[ ] = '.admin-page-framework-checkbox-container-'.$_sSlug."[data-{$sDataAttribute}]";
127 127
             }
128 128
             return implode( ',', $_aClassSelectors );
129 129
             
@@ -184,8 +184,8 @@  discard block
 block discarded – undo
184 184
 
185 185
         $_aOutput       = array();
186 186
         $_bIsMultiple   = is_array( $aField[ 'label' ] );
187
-        foreach( $this->getAsArray( $aField[ 'label' ], true ) as $_sKey => $_sLabel ) {
188
-            $_aOutput[] = $this->_getEachCheckboxOutput( 
187
+        foreach ( $this->getAsArray( $aField[ 'label' ], true ) as $_sKey => $_sLabel ) {
188
+            $_aOutput[ ] = $this->_getEachCheckboxOutput( 
189 189
                 $aField, 
190 190
                 $_bIsMultiple 
191 191
                     ? $_sKey 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
                 $_sLabel
194 194
             );
195 195
         }        
196
-        return "<div " . $this->getAttributes( $this->_getCheckboxContainerAttributes( $aField ) ) . ">"
196
+        return "<div ".$this->getAttributes( $this->_getCheckboxContainerAttributes( $aField ) ).">"
197 197
                 . "<div class='repeatable-field-buttons'></div>" // the repeatable field buttons will be replaced with this element.
198 198
                 . implode( PHP_EOL, $_aOutput )
199 199
             . "</div>";
@@ -208,12 +208,12 @@  discard block
 block discarded – undo
208 208
          */
209 209
         protected function _getCheckboxContainerAttributes( array $aField ) {
210 210
             return array(
211
-                'class'                     => 'admin-page-framework-checkbox-container-' . $aField[ 'type' ],
211
+                'class'                     => 'admin-page-framework-checkbox-container-'.$aField[ 'type' ],
212 212
                 'data-select_all_button'    => $aField[ 'select_all_button' ] 
213
-                    ? ( ! is_string( $aField[ 'select_all_button' ] ) ? $this->oMsg->get( 'select_all' ) : $aField[ 'select_all_button' ] )
213
+                    ? ( !is_string( $aField[ 'select_all_button' ] ) ? $this->oMsg->get( 'select_all' ) : $aField[ 'select_all_button' ] )
214 214
                     : null,
215 215
                 'data-select_none_button'   => $aField[ 'select_none_button' ] 
216
-                    ? ( ! is_string( $aField[ 'select_none_button' ] ) ? $this->oMsg->get( 'select_none' ) : $aField[ 'select_none_button' ] )
216
+                    ? ( !is_string( $aField[ 'select_none_button' ] ) ? $this->oMsg->get( 'select_none' ) : $aField[ 'select_none_button' ] )
217 217
                     : null,
218 218
             );            
219 219
         }
@@ -231,8 +231,8 @@  discard block
 block discarded – undo
231 231
             $_oCheckbox->setAttributesByKey( $sKey );
232 232
             $_oCheckbox->addClass( $this->_sCheckboxClassSelector );
233 233
             return $this->getElementByLabel( $aField[ 'before_label' ], $sKey, $aField[ 'label' ] )
234
-                . "<div " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-checkbox-label' ) . ">" 
235
-                    . "<label " . $this->getAttributes( 
234
+                . "<div ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-checkbox-label' ).">" 
235
+                    . "<label ".$this->getAttributes( 
236 236
                         array(
237 237
                             'for'   => $_oCheckbox->getAttribute( 'id' ),
238 238
                             'class' => $_oCheckbox->getAttribute( 'disabled' )
Please login to merge, or discard this patch.
development/factory/admin_page/_view/AdminPageFramework_View__Resource.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
                  */
69 69
                 public function _appendInternalAssets( $sInternal, &$aContainer ) {
70 70
                     $_aInternals = array_unique( $aContainer );
71
-                    $sInternal   = PHP_EOL . $sInternal;
72
-                    foreach( $_aInternals as $_iIndex => $_sInternal ) {
73
-                        $sInternal .= $_sInternal . PHP_EOL;
71
+                    $sInternal   = PHP_EOL.$sInternal;
72
+                    foreach ( $_aInternals as $_iIndex => $_sInternal ) {
73
+                        $sInternal .= $_sInternal.PHP_EOL;
74 74
                         unset( $_aInternals[ $_iIndex ] );
75 75
                     }
76 76
                     $aContainer = $_aInternals; // update the container array.
@@ -84,23 +84,23 @@  discard block
 block discarded – undo
84 84
         private function _parseAssets( $oFactory ) {
85 85
             
86 86
             // page
87
-            $_aPageStyles      = $this->getElementAsArray(
87
+            $_aPageStyles = $this->getElementAsArray(
88 88
                 $oFactory->oProp->aPages,
89 89
                 array( $this->sCurrentPageSlug, 'style' )
90 90
             );               
91 91
             $this->_enqueuePageAssets( $_aPageStyles, 'style' );
92 92
             
93
-            $_aPageScripts     = $this->getElementAsArray(
93
+            $_aPageScripts = $this->getElementAsArray(
94 94
                 $oFactory->oProp->aPages,
95 95
                 array( $this->sCurrentPageSlug, 'script' )
96 96
             );
97 97
             $this->_enqueuePageAssets( $_aPageScripts, 'script' );
98 98
             
99 99
             // In-page tabs 
100
-            if ( ! $this->sCurrentTabSlug ) {
100
+            if ( !$this->sCurrentTabSlug ) {
101 101
                 return;
102 102
             }        
103
-            $_aInPageTabStyles  = $this->getElementAsArray(
103
+            $_aInPageTabStyles = $this->getElementAsArray(
104 104
                 $oFactory->oProp->aInPageTabs,
105 105
                 array( $this->sCurrentPageSlug, $this->sCurrentTabSlug, 'style' )
106 106
             );              
@@ -117,10 +117,10 @@  discard block
 block discarded – undo
117 117
              * @since       3.6.3
118 118
              * @return      void
119 119
              */    
120
-            private function _enqueuePageAssets( array $aPageAssets, $sType='style' ) {
121
-                $_sMathodName = "_enqueueAsset_" . $sType;
122
-                foreach( $aPageAssets as $_asPageAsset ) {
123
-                    $this->{$_sMathodName}( $_asPageAsset);
120
+            private function _enqueuePageAssets( array $aPageAssets, $sType = 'style' ) {
121
+                $_sMathodName = "_enqueueAsset_".$sType;
122
+                foreach ( $aPageAssets as $_asPageAsset ) {
123
+                    $this->{$_sMathodName}( $_asPageAsset );
124 124
                 }
125 125
             }
126 126
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
                     }
146 146
                     
147 147
                     // Insert the CSS rule in the head tag.
148
-                    $this->aCSSRules[] = $_sSRC;
148
+                    $this->aCSSRules[ ] = $_sSRC;
149 149
                     
150 150
                 }                    
151 151
      
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
                     }                
171 171
                     
172 172
                     // Insert the scripts in the head tag.                
173
-                    $this->aScripts[] = $_sSRC;
173
+                    $this->aScripts[ ] = $_sSRC;
174 174
                     
175 175
                 }        
176 176
                 
Please login to merge, or discard this patch.