Completed
Branch master (163d15)
by
unknown
18:50 queued 09:36
created
_common/form/field_type/AdminPageFramework_FieldType_section_title.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
     /**
26 26
      * Defines the field type slugs used for this field type.
27 27
      */
28
-    public $aFieldTypeSlugs = array( 'section_title', );
28
+    public $aFieldTypeSlugs = array( 'section_title',);
29 29
     
30 30
     /**
31 31
      * Defines the default key-values of this field type. 
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-2016 Michael Uno; Licensed MIT
7
- * 
8
- */
3
+         * Admin Page Framework
4
+         * 
5
+         * http://en.michaeluno.jp/admin-page-framework/
6
+         * Copyright (c) 2013-2016 Michael Uno; Licensed MIT
7
+         * 
8
+         */
9 9
 
10 10
 /**
11 11
  * Provides utility methods which can be accessed among different components of the framework.
Please login to merge, or discard this patch.
factory/_common/form/field_type/AdminPageFramework_FieldType_media.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     /**
22 22
      * Defines the field type slugs used for this field type.
23 23
      */
24
-    public $aFieldTypeSlugs = array( 'media', );
24
+    public $aFieldTypeSlugs = array( 'media',);
25 25
     
26 26
     /**
27 27
      * Defines the default key-values of this field type. 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         return 
54 54
             $this->_getScript_MediaUploader(
55 55
                 "admin_page_framework"
56
-            ) . PHP_EOL
56
+            ).PHP_EOL
57 57
             . $this->_getScript_RegisterCallbacks();
58 58
     }    
59 59
     
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             $_sInsertFromURL         = esc_js( $this->oMsg->get( 'insert_from_url' ) );
149 149
             
150 150
             // If the WordPress version is 3.4.x or below
151
-            if ( ! function_exists( 'wp_enqueue_media' ) ) {
151
+            if ( !function_exists( 'wp_enqueue_media' ) ) {
152 152
                 return <<<JAVASCRIPTS
153 153
                     /**
154 154
                      * Bind/rebinds the thickbox script the given selector element.
@@ -388,8 +388,8 @@  discard block
 block discarded – undo
388 388
             // Do not include the escaping character (backslash) in the heredoc variable declaration 
389 389
             // because the minifier script will parse it and the <<<JAVASCRIPTS and JAVASCRIPTS; parts are converted to double quotes (")
390 390
             // which causes the PHP syntax error.
391
-            $_sButtonHTML = '"' . $this->_getUploaderButtonHTML_Media( $sInputID, $aButtonAttributes, $bExternalSource ) . '"';
392
-            $_sScript                = <<<JAVASCRIPTS
391
+            $_sButtonHTML = '"'.$this->_getUploaderButtonHTML_Media( $sInputID, $aButtonAttributes, $bExternalSource ).'"';
392
+            $_sScript = <<<JAVASCRIPTS
393 393
 if ( jQuery( 'a#select_media_{$sInputID}' ).length == 0 ) {
394 394
     jQuery( 'input#{$sInputID}' ).after( $_sButtonHTML );
395 395
 }
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
                     
401 401
             return "<script type='text/javascript' class='admin-page-framework-media-uploader-button'>" 
402 402
                     . $_sScript 
403
-                . "</script>". PHP_EOL;
403
+                . "</script>".PHP_EOL;
404 404
 
405 405
         }
406 406
             /**
@@ -410,19 +410,19 @@  discard block
 block discarded – undo
410 410
              */
411 411
             private function _getUploaderButtonHTML_Media( $sInputID, array $aButtonAttributes, $bExternalSource ) {
412 412
                     
413
-                $_bIsLabelSet = isset( $aButtonAttributes['data-label'] ) && $aButtonAttributes['data-label'];
413
+                $_bIsLabelSet = isset( $aButtonAttributes[ 'data-label' ] ) && $aButtonAttributes[ 'data-label' ];
414 414
                 $_aAttributes = $this->_getFormattedUploadButtonAttributes_Media( 
415 415
                     $sInputID, 
416 416
                     $aButtonAttributes, 
417 417
                     $_bIsLabelSet, 
418 418
                     $bExternalSource 
419 419
                 );
420
-                return "<a " . $this->getAttributes( $_aAttributes ) . ">"
420
+                return "<a ".$this->getAttributes( $_aAttributes ).">"
421 421
                         . $this->getAOrB( 
422 422
                             $_bIsLabelSet,
423
-                            $_aAttributes['data-label'],
423
+                            $_aAttributes[ 'data-label' ],
424 424
                             $this->getAOrB(
425
-                                strrpos( $_aAttributes['class'], 'dashicons' ),
425
+                                strrpos( $_aAttributes[ 'class' ], 'dashicons' ),
426 426
                                 '',
427 427
                                 $this->oMsg->get( 'select_file' )
428 428
                             )
@@ -437,26 +437,26 @@  discard block
 block discarded – undo
437 437
                  */
438 438
                 private function _getFormattedUploadButtonAttributes_Media( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $bExternalSource ) {
439 439
                    
440
-                    $_aAttributes           = array(
440
+                    $_aAttributes = array(
441 441
                             'id'        => "select_media_{$sInputID}",
442 442
                             'href'      => '#',            
443
-                            'data-uploader_type'            => ( string ) function_exists( 'wp_enqueue_media' ),    //  ? 1 : 0,
444
-                            'data-enable_external_source'   => ( string ) ( bool ) $bExternalSource,    //  ? 1 : 0, 
443
+                            'data-uploader_type'            => ( string ) function_exists( 'wp_enqueue_media' ), //  ? 1 : 0,
444
+                            'data-enable_external_source'   => ( string ) ( bool ) $bExternalSource, //  ? 1 : 0, 
445 445
                         ) 
446 446
                         + $aButtonAttributes
447 447
                         + array(
448 448
                             'title'     => $_bIsLabelSet 
449
-                                ? $aButtonAttributes['data-label'] 
449
+                                ? $aButtonAttributes[ 'data-label' ] 
450 450
                                 : $this->oMsg->get( 'select_file' ),
451 451
                             'data-label' => null,
452 452
                         );
453
-                    $_aAttributes['class']  = $this->getClassAttribute( 
453
+                    $_aAttributes[ 'class' ] = $this->getClassAttribute( 
454 454
                         'select_media button button-small ',
455 455
                         $this->getAOrB(
456
-                            trim( $aButtonAttributes['class'] ),
457
-                            $aButtonAttributes['class'],
456
+                            trim( $aButtonAttributes[ 'class' ] ),
457
+                            $aButtonAttributes[ 'class' ],
458 458
                             $this->getAOrB( 
459
-                                ! $_bIsLabelSet && version_compare( $GLOBALS['wp_version'], '3.8', '>=' ),
459
+                                !$_bIsLabelSet && version_compare( $GLOBALS[ 'wp_version' ], '3.8', '>=' ),
460 460
                                 'dashicons dashicons-portfolio',
461 461
                                 ''
462 462
                             )
Please login to merge, or discard this patch.
factory/_common/form/field_type/AdminPageFramework_FieldType_radio.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
      */
76 76
     protected function getField( $aField ) {
77 77
         
78
-        $_aOutput   = array();
79
-        foreach( $this->getAsArray( $aField['label'] ) as $_sKey => $_sLabel ) {            
80
-            $_aOutput[] = $this->_getEachRadioButtonOutput( $aField, $_sKey, $_sLabel );
78
+        $_aOutput = array();
79
+        foreach ( $this->getAsArray( $aField[ 'label' ] ) as $_sKey => $_sLabel ) {            
80
+            $_aOutput[ ] = $this->_getEachRadioButtonOutput( $aField, $_sKey, $_sLabel );
81 81
         }
82
-        $_aOutput[] = $this->_getUpdateCheckedScript( $aField['input_id'] );
82
+        $_aOutput[ ] = $this->_getUpdateCheckedScript( $aField[ 'input_id' ] );
83 83
         return implode( PHP_EOL, $_aOutput );
84 84
             
85 85
     }
@@ -93,12 +93,12 @@  discard block
 block discarded – undo
93 93
             $_aAttributes = $aField[ 'attributes' ] + $this->getElementAsArray( $aField, array( 'attributes', $sKey ) );
94 94
             $_oRadio      = new AdminPageFramework_Input_radio( $_aAttributes );
95 95
             $_oRadio->setAttributesByKey( $sKey );
96
-            $_oRadio->setAttribute( 'data-default', $aField['default'] ); // refered by the repeater script
96
+            $_oRadio->setAttribute( 'data-default', $aField[ 'default' ] ); // refered by the repeater script
97 97
            
98 98
             // Output
99 99
             return $this->getElementByLabel( $aField[ 'before_label' ], $sKey, $aField[ 'label' ] )
100
-                . "<div class='admin-page-framework-input-label-container admin-page-framework-radio-label' style='min-width: " . $this->sanitizeLength( $aField['label_min_width'] ) . ";'>"
101
-                    . "<label " . $this->getAttributes( 
100
+                . "<div class='admin-page-framework-input-label-container admin-page-framework-radio-label' style='min-width: ".$this->sanitizeLength( $aField[ 'label_min_width' ] ).";'>"
101
+                    . "<label ".$this->getAttributes( 
102 102
                             array(
103 103
                                 'for'   => $_oRadio->getAttribute( 'id' ),
104 104
                                 'class' => $_oRadio->getAttribute( 'disabled' )
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
     protected function getField( $aField ) {
77 77
         
78 78
         $_aOutput   = array();
79
-        foreach( $this->getAsArray( $aField['label'] ) as $_sKey => $_sLabel ) {            
79
+        foreach( $this->getAsArray( $aField['label'] ) as $_sKey => $_sLabel ) {
80 80
             $_aOutput[] = $this->_getEachRadioButtonOutput( $aField, $_sKey, $_sLabel );
81 81
         }
82 82
         $_aOutput[] = $this->_getUpdateCheckedScript( $aField['input_id'] );
Please login to merge, or discard this patch.
factory/_common/form/field_type/AdminPageFramework_FieldType.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
      * </code>
72 72
      * @access       public      This must be public as accessed from outside.
73 73
      */    
74
-    public $aFieldTypeSlugs = array( 'default', );
74
+    public $aFieldTypeSlugs = array( 'default',);
75 75
     
76 76
     /**
77 77
      * Defines the default key-values of this field type. 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
      * @since       3.5.0     
39 39
      * @callback    fieldtype   hfDoOnRegistration
40 40
      */
41
-    public function _replyToDoOnFieldRegistration( array $aField ) { 
41
+    public function _replyToDoOnFieldRegistration( array $aField ) {
42 42
         return $this->doOnFieldRegistration( $aField ); 
43 43
     }
44 44
    
Please login to merge, or discard this patch.
factory/_common/form/field_type/AdminPageFramework_FieldType_select.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     /**
22 22
      * Defines the field type slugs used for this field type.
23 23
      */
24
-    public $aFieldTypeSlugs = array( 'select', );
24
+    public $aFieldTypeSlugs = array( 'select',);
25 25
     
26 26
     /**
27 27
      * Defines the default key-values of this field type. 
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
             'select'    => array(
34 34
                 'size'          => 1,
35 35
                 'autofocusNew'  => null,
36
-                'multiple'      => null,    // set 'multiple' for multiple selections. If 'is_multiple' is set, it takes the precedence.
36
+                'multiple'      => null, // set 'multiple' for multiple selections. If 'is_multiple' is set, it takes the precedence.
37 37
                 'required'      => null,     
38 38
             ),
39 39
             'optgroup'  => array(),
@@ -72,12 +72,12 @@  discard block
 block discarded – undo
72 72
     protected function getField( $aField ) {
73 73
             
74 74
         $_oSelectInput = new AdminPageFramework_Input_select( $aField[ 'attributes' ] );
75
-        if ( $aField[ 'is_multiple' ]  ) {            
75
+        if ( $aField[ 'is_multiple' ] ) {            
76 76
             $_oSelectInput->setAttribute( array( 'select', 'multiple' ), 'multiple' );
77 77
         }
78 78
         return
79 79
             $aField[ 'before_label' ]
80
-            . "<div class='admin-page-framework-input-label-container admin-page-framework-select-label' style='min-width: " . $this->sanitizeLength( $aField[ 'label_min_width' ] ) . ";'>"
80
+            . "<div class='admin-page-framework-input-label-container admin-page-framework-select-label' style='min-width: ".$this->sanitizeLength( $aField[ 'label_min_width' ] ).";'>"
81 81
                 . "<label for='{$aField[ 'input_id' ]}'>"
82 82
                     . $aField[ 'before_input' ]
83 83
                     . $_oSelectInput->get( $aField[ 'label' ] )
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
     protected function getField( $aField ) {
73 73
             
74 74
         $_oSelectInput = new AdminPageFramework_Input_select( $aField[ 'attributes' ] );
75
-        if ( $aField[ 'is_multiple' ]  ) {            
75
+        if ( $aField[ 'is_multiple' ]  ) {
76 76
             $_oSelectInput->setAttribute( array( 'select', 'multiple' ), 'multiple' );
77 77
         }
78 78
         return
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,19 +37,19 @@
 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 class='admin-page-framework-input-label-string' style='min-width:" .  $this->sanitizeLength( $aField['label_min_width'] ) . ";'>" . $aField['label'] . "</span>"
42
+                . "<label for='{$aField[ 'input_id' ]}'>"
43
+                    . $aField[ 'before_input' ]
44
+                    . ( $aField[ 'label' ] && !$aField[ 'repeatable' ]
45
+                        ? "<span class='admin-page-framework-input-label-string' style='min-width:".$this->sanitizeLength( $aField[ 'label_min_width' ] ).";'>".$aField[ 'label' ]."</span>"
46 46
                         : "" 
47 47
                     )
48
-                    . $aField['value']
49
-                    . $aField['after_input']
48
+                    . $aField[ 'value' ]
49
+                    . $aField[ 'after_input' ]
50 50
                 . "</label>"
51 51
             . "</div>"
52
-            . $aField['after_label']
52
+            . $aField[ 'after_label' ]
53 53
         ;     
54 54
     }
55 55
 
Please login to merge, or discard this patch.
factory/_common/form/field_type/AdminPageFramework_FieldType_import.php 2 patches
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     /**
21 21
      * Defines the field type slugs used for this field type.
22 22
      */
23
-    public $aFieldTypeSlugs = array( 'import', );
23
+    public $aFieldTypeSlugs = array( 'import',);
24 24
     
25 25
     /**
26 26
      * Defines the default key-values of this field type. 
@@ -91,9 +91,9 @@  discard block
 block discarded – undo
91 91
     protected function getField( $aField ) {
92 92
         
93 93
         /* Set some required values */
94
-        $aField['attributes']['name']   = "__import[submit][{$aField['input_id']}]";
95
-        $aField['label']                = $aField['label'] 
96
-            ? $aField['label'] 
94
+        $aField[ 'attributes' ][ 'name' ]   = "__import[submit][{$aField[ 'input_id' ]}]";
95
+        $aField[ 'label' ]                = $aField[ 'label' ] 
96
+            ? $aField[ 'label' ] 
97 97
             : $this->oMsg->get( 'import' );
98 98
         return parent::getField( $aField );     
99 99
     }    
@@ -106,13 +106,13 @@  discard block
 block discarded – undo
106 106
      * @since 3.0.0
107 107
      */    
108 108
     protected function _getExtraFieldsBeforeLabel( &$aField ) {
109
-        return "<input " . $this->getAttributes( 
109
+        return "<input ".$this->getAttributes( 
110 110
                 array(
111
-                    'id' => "{$aField['input_id']}_file",
111
+                    'id' => "{$aField[ 'input_id' ]}_file",
112 112
                     'type' => 'file',
113
-                    'name' => "__import[{$aField['input_id']}]",
114
-                ) + $aField['attributes']['file']     
115
-            ) . " />";
113
+                    'name' => "__import[{$aField[ 'input_id' ]}]",
114
+                ) + $aField[ 'attributes' ][ 'file' ]     
115
+            )." />";
116 116
     }    
117 117
     
118 118
     /**
@@ -121,44 +121,44 @@  discard block
 block discarded – undo
121 121
      */
122 122
     protected function _getExtraInputFields( &$aField ) {
123 123
 
124
-        $aHiddenAttributes = array( 'type' => 'hidden', );     
124
+        $aHiddenAttributes = array( 'type' => 'hidden',);     
125 125
         return    
126
-            "<input " . $this->getAttributes( 
126
+            "<input ".$this->getAttributes( 
127 127
                 array(
128
-                    'name' => "__import[{$aField['input_id']}][input_id]",
129
-                    'value' => $aField['input_id'],
128
+                    'name' => "__import[{$aField[ 'input_id' ]}][input_id]",
129
+                    'value' => $aField[ 'input_id' ],
130 130
                 ) + $aHiddenAttributes
131
-            ) . "/>"
132
-            . "<input " . $this->getAttributes( 
131
+            )."/>"
132
+            . "<input ".$this->getAttributes( 
133 133
                 array(
134
-                    'name' => "__import[{$aField['input_id']}][field_id]",
135
-                    'value' => $aField['field_id'],
134
+                    'name' => "__import[{$aField[ 'input_id' ]}][field_id]",
135
+                    'value' => $aField[ 'field_id' ],
136 136
                 ) + $aHiddenAttributes
137
-            ) . "/>"
138
-            . "<input " . $this->getAttributes( 
137
+            )."/>"
138
+            . "<input ".$this->getAttributes( 
139 139
                 array(
140
-                    'name' => "__import[{$aField['input_id']}][section_id]",
141
-                    'value' => isset( $aField['section_id'] ) && $aField['section_id'] != '_default' ? $aField['section_id'] : '',
140
+                    'name' => "__import[{$aField[ 'input_id' ]}][section_id]",
141
+                    'value' => isset( $aField[ 'section_id' ] ) && $aField[ 'section_id' ] != '_default' ? $aField[ 'section_id' ] : '',
142 142
                 ) + $aHiddenAttributes
143
-            ) . "/>"     
144
-            . "<input " . $this->getAttributes( 
143
+            )."/>"     
144
+            . "<input ".$this->getAttributes( 
145 145
                 array(
146
-                    'name' => "__import[{$aField['input_id']}][is_merge]",
147
-                    'value' => $aField['is_merge'],
146
+                    'name' => "__import[{$aField[ 'input_id' ]}][is_merge]",
147
+                    'value' => $aField[ 'is_merge' ],
148 148
                 ) + $aHiddenAttributes
149
-            ) . "/>"    
150
-            . "<input " . $this->getAttributes( 
149
+            )."/>"    
150
+            . "<input ".$this->getAttributes( 
151 151
                 array(
152
-                    'name' => "__import[{$aField['input_id']}][option_key]",
153
-                    'value' => $aField['option_key'],
152
+                    'name' => "__import[{$aField[ 'input_id' ]}][option_key]",
153
+                    'value' => $aField[ 'option_key' ],
154 154
                 ) + $aHiddenAttributes
155
-            ) . "/>"
156
-            . "<input " . $this->getAttributes( 
155
+            )."/>"
156
+            . "<input ".$this->getAttributes( 
157 157
                 array(
158
-                    'name' => "__import[{$aField['input_id']}][format]",
159
-                    'value' => $aField['format'],
158
+                    'name' => "__import[{$aField[ 'input_id' ]}][format]",
159
+                    'value' => $aField[ 'format' ],
160 160
                 ) + $aHiddenAttributes
161
-            ) . "/>"
161
+            )."/>"
162 162
             ;
163 163
     }
164 164
         
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
      * @since       2.1.5
44 44
      * @since       3.3.1       Changed from `_replyToGetStyles()`.
45 45
      */        
46
-    protected function getStyles() { 
46
+    protected function getStyles() {
47 47
         return <<<CSSRULES
48 48
 /* Text Field Type */
49 49
 .admin-page-framework-field.admin-page-framework-field-text > .admin-page-framework-input-label-container {
Please login to merge, or discard this patch.
factory/_common/form/field_type/AdminPageFramework_FieldType_export.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     /**
21 21
      * Defines the field type slugs used for this field type.
22 22
      */
23
-    public $aFieldTypeSlugs = array( 'export', );
23
+    public $aFieldTypeSlugs = array( 'export',);
24 24
     
25 25
     /**
26 26
      * Defines the default key-values of this field type. 
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
      * @remark $_aDefaultKeys holds shared default key-values defined in the base class.
29 29
      */
30 30
     protected $aDefaultKeys = array(
31
-        'data'          => null,        // ( array|string|object ) This is for the export field type. Do not set a value here.     
32
-        'format'        => 'json',      // ( string ) for the export field type. Do not set a default value here. Currently array, json, and text are supported.
33
-        'file_name'     => null,        // ( string ) for the export field type. Do not set a default value here.    
31
+        'data'          => null, // ( array|string|object ) This is for the export field type. Do not set a value here.     
32
+        'format'        => 'json', // ( string ) for the export field type. Do not set a default value here. Currently array, json, and text are supported.
33
+        'file_name'     => null, // ( string ) for the export field type. Do not set a default value here.    
34 34
         'attributes'    => array(
35 35
             'class' => 'button button-primary',
36 36
         ),    
@@ -71,14 +71,14 @@  discard block
 block discarded – undo
71 71
     protected function getField( $aField ) {
72 72
             
73 73
         /* Set the transient data to export - If the value is not an array and the export data is set. */
74
-        if ( isset( $aField['data'] ) ) {
75
-            $this->setTransient( md5( "{$aField['class_name']}_{$aField['input_id']}" ), $aField['data'], 60*2 ); // 2 minutes.
74
+        if ( isset( $aField[ 'data' ] ) ) {
75
+            $this->setTransient( md5( "{$aField[ 'class_name' ]}_{$aField[ 'input_id' ]}" ), $aField[ 'data' ], 60 * 2 ); // 2 minutes.
76 76
         } 
77 77
         
78 78
         /* Set some required values */
79
-        $aField['attributes']['name']   = "__export[submit][{$aField['input_id']}]";
80
-        $aField['file_name']            = $aField['file_name'] ? $aField['file_name'] : $this->_generateExportFileName( $aField['option_key'] ? $aField['option_key'] : $aField['class_name'], $aField['format'] );
81
-        $aField['label']                = $aField['label'] ? $aField['label'] : $this->oMsg->get( 'export' );
79
+        $aField[ 'attributes' ][ 'name' ]   = "__export[submit][{$aField[ 'input_id' ]}]";
80
+        $aField[ 'file_name' ]            = $aField[ 'file_name' ] ? $aField[ 'file_name' ] : $this->_generateExportFileName( $aField[ 'option_key' ] ? $aField[ 'option_key' ] : $aField[ 'class_name' ], $aField[ 'format' ] );
81
+        $aField[ 'label' ]                = $aField[ 'label' ] ? $aField[ 'label' ] : $this->oMsg->get( 'export' );
82 82
         
83 83
         return parent::getField( $aField );
84 84
         
@@ -93,42 +93,42 @@  discard block
 block discarded – undo
93 93
 
94 94
         $_aAttributes = array( 'type' => 'hidden' );
95 95
         return
96
-            "<input " . $this->getAttributes( 
96
+            "<input ".$this->getAttributes( 
97 97
                 array(
98
-                    'name' => "__export[{$aField['input_id']}][input_id]",
99
-                    'value' => $aField['input_id'],
98
+                    'name' => "__export[{$aField[ 'input_id' ]}][input_id]",
99
+                    'value' => $aField[ 'input_id' ],
100 100
                 ) + $_aAttributes
101
-            ) . "/>"
102
-            . "<input " . $this->getAttributes( 
101
+            )."/>"
102
+            . "<input ".$this->getAttributes( 
103 103
                 array(
104
-                    'name' => "__export[{$aField['input_id']}][field_id]",
105
-                    'value' => $aField['field_id'],
104
+                    'name' => "__export[{$aField[ 'input_id' ]}][field_id]",
105
+                    'value' => $aField[ 'field_id' ],
106 106
                 ) + $_aAttributes
107
-            ) . "/>"
108
-            . "<input " . $this->getAttributes( 
107
+            )."/>"
108
+            . "<input ".$this->getAttributes( 
109 109
                 array(
110
-                    'name' => "__export[{$aField['input_id']}][section_id]",
111
-                    'value' => isset( $aField['section_id'] ) && $aField['section_id'] != '_default' ? $aField['section_id'] : '',
110
+                    'name' => "__export[{$aField[ 'input_id' ]}][section_id]",
111
+                    'value' => isset( $aField[ 'section_id' ] ) && $aField[ 'section_id' ] != '_default' ? $aField[ 'section_id' ] : '',
112 112
                 ) + $_aAttributes
113
-            ) . "/>"
114
-            . "<input " . $this->getAttributes( 
113
+            )."/>"
114
+            . "<input ".$this->getAttributes( 
115 115
                 array(
116
-                    'name' => "__export[{$aField['input_id']}][file_name]",
117
-                    'value' => $aField['file_name'],
116
+                    'name' => "__export[{$aField[ 'input_id' ]}][file_name]",
117
+                    'value' => $aField[ 'file_name' ],
118 118
                 ) + $_aAttributes
119
-            ) . "/>"
120
-            . "<input " . $this->getAttributes( 
119
+            )."/>"
120
+            . "<input ".$this->getAttributes( 
121 121
                 array(
122
-                    'name' => "__export[{$aField['input_id']}][format]",
123
-                    'value' => $aField['format'],
122
+                    'name' => "__export[{$aField[ 'input_id' ]}][format]",
123
+                    'value' => $aField[ 'format' ],
124 124
                 ) + $_aAttributes
125
-            ) . "/>"
126
-            . "<input " . $this->getAttributes( 
125
+            )."/>"
126
+            . "<input ".$this->getAttributes( 
127 127
                 array(
128
-                    'name' => "__export[{$aField['input_id']}][transient]",
129
-                    'value' => isset( $aField['data'] ),
128
+                    'name' => "__export[{$aField[ 'input_id' ]}][transient]",
129
+                    'value' => isset( $aField[ 'data' ] ),
130 130
                 ) + $_aAttributes
131
-            ) . "/>"
131
+            )."/>"
132 132
             ;
133 133
     }
134 134
             
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
          * @since 2.0.0
142 142
          * @since 2.1.5 Moved from the AdminPageFramework_FormField class.
143 143
          */ 
144
-        private function _generateExportFileName( $sOptionKey, $sExportFormat='json' ) {
144
+        private function _generateExportFileName( $sOptionKey, $sExportFormat = 'json' ) {
145 145
                 
146 146
             switch ( trim( strtolower( $sExportFormat ) ) ) {
147 147
                 case 'text': // for plain text.
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
                     break;
157 157
             }     
158 158
                 
159
-            return $sOptionKey . '_' . date("Ymd") . '.' . $sExt;
159
+            return $sOptionKey.'_'.date( "Ymd" ).'.'.$sExt;
160 160
             
161 161
         }
162 162
 
Please login to merge, or discard this patch.
factory/_common/form/field_type/AdminPageFramework_FieldType_posttype.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     /**
21 21
      * Defines the field type slugs used for this field type.
22 22
      */
23
-    public $aFieldTypeSlugs = array( 'posttype', );
23
+    public $aFieldTypeSlugs = array( 'posttype',);
24 24
     
25 25
     /**
26 26
      * Defines the default key-values of this field type. 
@@ -28,19 +28,19 @@  discard block
 block discarded – undo
28 28
      * @remark $_aDefaultKeys holds shared default key-values defined in the base class.
29 29
      */
30 30
     protected $aDefaultKeys = array(
31
-        'slugs_to_remove'       => null,    // the default array will be assigned in the rendering method.
31
+        'slugs_to_remove'       => null, // the default array will be assigned in the rendering method.
32 32
         /** 
33 33
          * Accepts query arguments. For the specification, see the arg parameter of get_post_types() function.
34 34
          * See: http://codex.wordpress.org/Function_Reference/get_post_types#Parameters
35 35
          */
36
-        'query'                 => array(),  // 3.2.1+
37
-        'operator'              => 'and',    // 3.2.1+ either 'and' or 'or'
36
+        'query'                 => array(), // 3.2.1+
37
+        'operator'              => 'and', // 3.2.1+ either 'and' or 'or'
38 38
         'attributes'            => array(
39 39
             'size'      => 30,
40 40
             'maxlength' => 400,
41 41
         ),    
42
-        'select_all_button'     => true,     // 3.3.0+   to change the label, set the label here
43
-        'select_none_button'    => true,     // 3.3.0+   to change the label, set the label here        
42
+        'select_all_button'     => true, // 3.3.0+   to change the label, set the label here
43
+        'select_none_button'    => true, // 3.3.0+   to change the label, set the label here        
44 44
     );
45 45
     protected $aDefaultRemovingPostTypeSlugs = array(
46 46
         'revision', 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      */ 
56 56
     protected function getStyles() {
57 57
         $_sParentStyles = parent::getStyles();
58
-        return $_sParentStyles . <<<CSSRULES
58
+        return $_sParentStyles.<<<CSSRULES
59 59
 /* Posttype Field Type */
60 60
 .admin-page-framework-field input[type='checkbox'] {
61 61
     margin-right: 0.5em;
@@ -80,13 +80,13 @@  discard block
 block discarded – undo
80 80
      */
81 81
     protected function getField( $aField ) {
82 82
         
83
-        $this->_sCheckboxClassSelector = '';    // disable the checkbox class selector.
84
-        $aField['label'] = $this->_getPostTypeArrayForChecklist( 
85
-            isset( $aField['slugs_to_remove'] ) 
86
-                ? $this->getAsArray( $aField['slugs_to_remove'] ) 
87
-                : $this->aDefaultRemovingPostTypeSlugs,    // slugs to remove
88
-            $aField['query'],
89
-            $aField['operator']
83
+        $this->_sCheckboxClassSelector = ''; // disable the checkbox class selector.
84
+        $aField[ 'label' ] = $this->_getPostTypeArrayForChecklist( 
85
+            isset( $aField[ 'slugs_to_remove' ] ) 
86
+                ? $this->getAsArray( $aField[ 'slugs_to_remove' ] ) 
87
+                : $this->aDefaultRemovingPostTypeSlugs, // slugs to remove
88
+            $aField[ 'query' ],
89
+            $aField[ 'operator' ]
90 90
         );
91 91
         return parent::getField( $aField );
92 92
             
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
          * @param   $sOperator          array   The query operator.
105 105
          * @return  array   The array holding the elements of installed post types' labels and their slugs except the specified expluding post types.
106 106
          */ 
107
-        private function _getPostTypeArrayForChecklist( $aSlugsToRemove, $asQueryArgs=array(), $sOperator='and' ) {
107
+        private function _getPostTypeArrayForChecklist( $aSlugsToRemove, $asQueryArgs = array(), $sOperator = 'and' ) {
108 108
             
109 109
             $_aPostTypes = array();
110
-            foreach( get_post_types( $asQueryArgs, 'objects' ) as $_oPostType ) {
111
-                if (  isset( $_oPostType->name, $_oPostType->label ) ) {
110
+            foreach ( get_post_types( $asQueryArgs, 'objects' ) as $_oPostType ) {
111
+                if ( isset( $_oPostType->name, $_oPostType->label ) ) {
112 112
                     $_aPostTypes[ $_oPostType->name ] = $_oPostType->label;
113 113
                 }
114 114
             }
Please login to merge, or discard this patch.