Completed
Branch master (a559c4)
by
unknown
05:07
created
_abstract/view/field_type/AdminPageFramework_WalkerTaxonomyChecklist.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -63,15 +63,15 @@  discard block
 block discarded – undo
63 63
      *  - use_desc_for_title    (boolean|int) default is 1 - Whether to use the category description as the title attribute. side note: the framework enables this by default.
64 64
      * @param       integer     $iCurrentObjectID
65 65
      */
66
-    function start_el( &$sOutput, $oTerm, $iDepth=0, $aArgs=array(), $iCurrentObjectID=0 ) {
66
+    function start_el( &$sOutput, $oTerm, $iDepth = 0, $aArgs = array(), $iCurrentObjectID = 0 ) {
67 67
        
68 68
         $aArgs = $aArgs + array(
69 69
             '_name_prefix'      => null,
70 70
             '_input_id_prefix'  => null,
71 71
             '_attributes'       => array(),
72 72
             '_selected_items'   => array(),
73
-            'taxonomy'          => null,    // parsed by the core function to perform the database query.
74
-            'disabled'          => null,    // not sure what this was for
73
+            'taxonomy'          => null, // parsed by the core function to perform the database query.
74
+            'disabled'          => null, // not sure what this was for
75 75
         );
76 76
         
77 77
         // Local variables
@@ -79,22 +79,22 @@  discard block
 block discarded – undo
79 79
         $_sTaxonomySlug  = empty( $aArgs[ 'taxonomy' ] ) 
80 80
             ? 'category' 
81 81
             : $aArgs[ 'taxonomy' ];
82
-        $_sID            = "{$aArgs['_input_id_prefix']}_{$_sTaxonomySlug}_{$_iID}";
82
+        $_sID            = "{$aArgs[ '_input_id_prefix' ]}_{$_sTaxonomySlug}_{$_iID}";
83 83
 
84 84
         // Post count
85
-        $_sPostCount     = $aArgs['show_post_count'] 
86
-            ? " <span class='font-lighter'>(" . $oTerm->count . ")</span>" 
85
+        $_sPostCount     = $aArgs[ 'show_post_count' ] 
86
+            ? " <span class='font-lighter'>(".$oTerm->count.")</span>" 
87 87
             : '';
88 88
         
89 89
         // Attributes
90 90
         $_aInputAttributes = isset( $_aInputAttributes[ $_iID ] ) 
91
-            ? $_aInputAttributes[ $_iID ] + $aArgs['_attributes']
92
-            : $aArgs['_attributes'];
91
+            ? $_aInputAttributes[ $_iID ] + $aArgs[ '_attributes' ]
92
+            : $aArgs[ '_attributes' ];
93 93
         $_aInputAttributes = array(
94 94
             'id'        => $_sID,
95 95
             'value'     => 1, // must be 1 because the index of zero exists so the index value cannot be assigned here.
96 96
             'type'      => 'checkbox',
97
-            'name'      => "{$aArgs['_name_prefix']}[{$_iID}]",
97
+            'name'      => "{$aArgs[ '_name_prefix' ]}[{$_iID}]",
98 98
             'checked'   => in_array( $_iID, ( array ) $aArgs[ '_selected_items' ] )
99 99
                 ? 'checked' 
100 100
                 : null,
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
           + array(
103 103
             'class'     => null,
104 104
         );
105
-        $_aInputAttributes['class'] .= ' apf_checkbox';
105
+        $_aInputAttributes[ 'class' ] .= ' apf_checkbox';
106 106
         
107 107
         $_aLiTagAttributes = array(
108 108
             'id'        => "list-{$_sID}",
@@ -112,10 +112,10 @@  discard block
 block discarded – undo
112 112
         
113 113
         // Output - the variable is by reference so the modification takes effect
114 114
         $sOutput .= "\n"
115
-            . "<li " . AdminPageFramework_WPUtility::getAttributes( $_aLiTagAttributes ) . ">" 
115
+            . "<li ".AdminPageFramework_WPUtility::getAttributes( $_aLiTagAttributes ).">" 
116 116
                 . "<label for='{$_sID}' class='taxonomy-checklist-label'>"
117
-                    . "<input value='0' type='hidden' name='" . $_aInputAttributes[ 'name' ] . "' class='apf_checkbox' />"
118
-                    . "<input " . AdminPageFramework_WPUtility::getAttributes( $_aInputAttributes ) . " />"
117
+                    . "<input value='0' type='hidden' name='".$_aInputAttributes[ 'name' ]."' class='apf_checkbox' />"
118
+                    . "<input ".AdminPageFramework_WPUtility::getAttributes( $_aInputAttributes )." />"
119 119
                     . esc_html( apply_filters( 'the_category', $oTerm->name ) ) 
120 120
                     . $_sPostCount
121 121
                 . "</label>";    
Please login to merge, or discard this patch.
factory/_abstract/view/form_part/AdminPageFramework_FormPart_Base.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Admin Page Framework
4
- * 
5
- * http://en.michaeluno.jp/admin-page-framework/
6
- * Copyright (c) 2013-2015 Michael Uno; Licensed MIT
7
- * 
8
- */
3
+     * Admin Page Framework
4
+     * 
5
+     * http://en.michaeluno.jp/admin-page-framework/
6
+     * Copyright (c) 2013-2015 Michael Uno; Licensed MIT
7
+     * 
8
+     */
9 9
 
10 10
 /**
11 11
  * Provides methods for creating fields in the taxonomy page (edit-tags.php).
Please login to merge, or discard this patch.
view/form_part/AdminPageFramework_FormPart_CollapsibleSectionTitle.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
          * @param       array|boolean   $aCollapsible       The collapsible argument.
78 78
          * @param       string          $sContainer          The position context. Accepts either 'sections' or 'section'. If the set position in the argument array does not match this value, the method will return an empty string.
79 79
          */
80
-        private function _getCollapsibleSectionTitleBlock( array $aCollapsible, $sContainer='sections', array $aFields=array(), $hfFieldCallback=null, $iSectionIndex=null ) {
80
+        private function _getCollapsibleSectionTitleBlock( array $aCollapsible, $sContainer = 'sections', array $aFields = array(), $hfFieldCallback = null, $iSectionIndex = null ) {
81 81
 
82 82
             if ( empty( $aCollapsible ) ) { 
83 83
                 return ''; 
@@ -95,13 +95,13 @@  discard block
 block discarded – undo
95 95
             );
96 96
             
97 97
             return $this->_getCollapsibleSectionsEnablerScript()
98
-                . "<div " . $this->getAttributes(
98
+                . "<div ".$this->getAttributes(
99 99
                     array(
100 100
                         'class' => $this->getClassAttribute( 
101 101
                             'admin-page-framework-section-title',
102 102
                             'accordion-section-title',
103 103
                             'admin-page-framework-collapsible-title',
104
-                            'sections' === $aCollapsible['container']
104
+                            'sections' === $aCollapsible[ 'container' ]
105 105
                                 ? 'admin-page-framework-collapsible-sections-title'
106 106
                                 : 'admin-page-framework-collapsible-section-title',
107 107
                             $aCollapsible[ 'is_collapsed' ] 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
                         ),
111 111
                     ) 
112 112
                     + $this->getDataAttributeArray( $aCollapsible )
113
-                ) . ">"  
113
+                ).">"  
114 114
                         . $_sSectionTitle
115 115
                     . "</div>";
116 116
             
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,10 +79,10 @@
 block discarded – undo
79 79
          */
80 80
         private function _getCollapsibleSectionTitleBlock( array $aCollapsible, $sContainer='sections', array $aFields=array(), $hfFieldCallback=null, $iSectionIndex=null ) {
81 81
 
82
-            if ( empty( $aCollapsible ) ) { 
82
+            if ( empty( $aCollapsible ) ) {
83 83
                 return ''; 
84 84
             }
85
-            if ( $sContainer !== $aCollapsible[ 'container' ] ) { 
85
+            if ( $sContainer !== $aCollapsible[ 'container' ] ) {
86 86
                 return ''; 
87 87
             }
88 88
               
Please login to merge, or discard this patch.
factory/_abstract/view/form_part/AdminPageFramework_FormPart_DebugInfo.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  */
18 18
 class AdminPageFramework_FormPart_DebugInfo extends AdminPageFramework_FormPart_Base {            
19 19
 
20
-    public $sFieldsType   = '';
20
+    public $sFieldsType = '';
21 21
     
22 22
     /**
23 23
      * Sets up properties.
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         $_aParameters = func_get_args() + array( 
29 29
             $this->sFieldsType, 
30 30
         );
31
-        $this->sFieldsType    =  $_aParameters[ 0 ];
31
+        $this->sFieldsType = $_aParameters[ 0 ];
32 32
 
33 33
     }
34 34
 
@@ -40,17 +40,17 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public function get() {
42 42
         
43
-        if ( ! $this->isDebugModeEnabled() ) {
43
+        if ( !$this->isDebugModeEnabled() ) {
44 44
             return '';
45 45
         }
46 46
         // For the generic admin pages, do no show debug information for each section.
47
-        if ( ! in_array( $this->sFieldsType, array( 'widget', 'post_meta_box', 'page_meta_box', 'user_meta' ) ) ) {
47
+        if ( !in_array( $this->sFieldsType, array( 'widget', 'post_meta_box', 'page_meta_box', 'user_meta' ) ) ) {
48 48
             return '';
49 49
         }
50 50
         
51 51
         // @todo    Use the message object to display the words 'Debug Info'.
52 52
         return "<div class='admin-page-framework-info'>" 
53
-                . 'Debug Info: ' . AdminPageFramework_Registry::NAME . ' '. AdminPageFramework_Registry::getVersion() 
53
+                . 'Debug Info: '.AdminPageFramework_Registry::NAME.' '.AdminPageFramework_Registry::getVersion() 
54 54
             . "</div>";
55 55
         
56 56
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
  * @since       3.6.0
16 16
  * @internal
17 17
  */
18
-class AdminPageFramework_FormPart_DebugInfo extends AdminPageFramework_FormPart_Base {            
18
+class AdminPageFramework_FormPart_DebugInfo extends AdminPageFramework_FormPart_Base {
19 19
 
20 20
     public $sFieldsType   = '';
21 21
     
Please login to merge, or discard this patch.
_abstract/view/form_part/AdminPageFramework_FormPart_Description.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,8 @@
 block discarded – undo
50 50
         }
51 51
         
52 52
         $_aOutput = array();
53
-        foreach( $this->aDescriptions as $_sDescription ) {
54
-            $_aOutput[] = "<p class='" . esc_attr( $this->sClassAttribute ) . "'>"
53
+        foreach ( $this->aDescriptions as $_sDescription ) {
54
+            $_aOutput[ ] = "<p class='".esc_attr( $this->sClassAttribute )."'>"
55 55
                     . "<span class='description'>"
56 56
                         . $_sDescription
57 57
                     . "</span>"
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
  * @since       3.6.0
16 16
  * @internal
17 17
  */
18
-class AdminPageFramework_FormPart_Description extends AdminPageFramework_FormPart_Base {            
18
+class AdminPageFramework_FormPart_Description extends AdminPageFramework_FormPart_Base {
19 19
 
20 20
     public $aDescriptions   = array();
21 21
     
Please login to merge, or discard this patch.
_abstract/view/form_part/AdminPageFramework_FormPart_FieldsetRow.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      * @since       3.0.0
27 27
      * @since       3.6.0       Moved from `AdminPageFramework_FormTable_Row`. Changed the name from `_getFieldset()`.
28 28
      */
29
-    protected function _getRow( array $aFieldset, $hfCallback )  {
29
+    protected function _getRow( array $aFieldset, $hfCallback ) {
30 30
         
31 31
         if ( 'section_title' === $aFieldset[ 'type' ] ) { 
32 32
             return ''; 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
             $aFieldset, 
39 39
             $hfCallback,
40 40
             array(
41
-                'open_main'     => "<div " . $_oFieldrowAttribute->get() . ">",
41
+                'open_main'     => "<div ".$_oFieldrowAttribute->get().">",
42 42
                 'close_main'    => "</div>",
43 43
             )
44 44
         );    
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  * @since       3.6.0
18 18
  * @internal
19 19
  */
20
-class AdminPageFramework_FormPart_FieldsetRow extends AdminPageFramework_FormPart_TableRow {            
20
+class AdminPageFramework_FormPart_FieldsetRow extends AdminPageFramework_FormPart_TableRow {
21 21
     
22 22
     /**
23 23
      * Returns the given field output without a table row tag.
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
      * @since       3.0.0
27 27
      * @since       3.6.0       Moved from `AdminPageFramework_FormTable_Row`. Changed the name from `_getFieldset()`.
28 28
      */
29
-    protected function _getRow( array $aFieldset, $hfCallback )  {
29
+    protected function _getRow( array $aFieldset, $hfCallback ) {
30 30
         
31
-        if ( 'section_title' === $aFieldset[ 'type' ] ) { 
31
+        if ( 'section_title' === $aFieldset[ 'type' ] ) {
32 32
             return ''; 
33 33
         }
34 34
         
Please login to merge, or discard this patch.
_abstract/view/form_part/AdminPageFramework_FormPart_TableCaption.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
          */
81 81
         private function _getCaption( array $aSection, $hfSectionCallback, $iSectionIndex, $aFields, $hfFieldCallback, $aFieldErrors, $aFieldTypeDefinitions, $oMsg ) {
82 82
             
83
-            if ( ! $aSection['description'] && ! $aSection['title'] ) {
83
+            if ( !$aSection[ 'description' ] && !$aSection[ 'title' ] ) {
84 84
                 return "<caption class='admin-page-framework-section-caption' style='display:none;'></caption>";
85 85
             }    
86 86
 
@@ -96,24 +96,24 @@  discard block
 block discarded – undo
96 96
                     ? $_abCollapsible[ 'title' ]
97 97
                     : $aSection[ 'title' ],
98 98
                 'h3',
99
-                $aFields,  // fields
100
-                $hfFieldCallback,  // field callback
101
-                $iSectionIndex,  // section index
99
+                $aFields, // fields
100
+                $hfFieldCallback, // field callback
101
+                $iSectionIndex, // section index
102 102
                 $aFieldTypeDefinitions,                
103 103
                 $_abCollapsible, 
104 104
                 'section',
105 105
                 $oMsg
106 106
             );            
107 107
             
108
-            $_bShowTitle    = empty( $_abCollapsible ) && ! $aSection[ 'section_tab_slug' ];
108
+            $_bShowTitle = empty( $_abCollapsible ) && !$aSection[ 'section_tab_slug' ];
109 109
             return 
110
-                "<caption " . $this->getAttributes( 
110
+                "<caption ".$this->getAttributes( 
111 111
                     array(
112 112
                         'class'             => 'admin-page-framework-section-caption',
113 113
                         // data-section_tab is referred by the repeater script to hide/show the title and the description
114
-                        'data-section_tab'  => $aSection['section_tab_slug'],
114
+                        'data-section_tab'  => $aSection[ 'section_tab_slug' ],
115 115
                     ) 
116
-                ) . ">"
116
+                ).">"
117 117
                     . $_oCollapsibleSectionTitle->get()
118 118
                     . $this->getAOrB(
119 119
                         $_bShowTitle,
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
                     $iSectionIndex, 
168 168
                     $aFieldTypeDefinitions
169 169
                 );
170
-                return "<div " . $this->getAttributes(
170
+                return "<div ".$this->getAttributes(
171 171
                         array(
172 172
                             'class' => 'admin-page-framework-section-title',
173 173
                             'style' => $this->getAOrB(
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
                                 'display: none;'
177 177
                             ),
178 178
                         )
179
-                    ). ">" 
179
+                    ).">" 
180 180
                         . $_oSectionTitle->get()
181 181
                     . "</div>";                
182 182
             }
@@ -188,10 +188,10 @@  discard block
 block discarded – undo
188 188
              */
189 189
             private function _getCaptionDescription( $aSection, $hfSectionCallback ) {
190 190
                 
191
-                if ( $aSection['collapsible'] ) {
191
+                if ( $aSection[ 'collapsible' ] ) {
192 192
                     return '';
193 193
                 }
194
-                if ( ! is_callable( $hfSectionCallback ) ) {
194
+                if ( !is_callable( $hfSectionCallback ) ) {
195 195
                     return '';
196 196
                 }
197 197
                 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
                 // @todo        Use a different selector name other than 'admin-page-framework-section-description' as it is used in the inner <p> tag element as well.
200 200
                 // Descriptions
201 201
                 $_oSectionDescription = new AdminPageFramework_FormPart_Description(
202
-                    $aSection['description'],
202
+                    $aSection[ 'description' ],
203 203
                     'admin-page-framework-section-description'    // class selector
204 204
                 );            
205 205
                 return "<div class='admin-page-framework-section-description'>"     
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
              */
223 223
             private function _shouldShowCaptionTitle( $aSection, $iSectionIndex ) {
224 224
                 
225
-                if ( ! $aSection[ 'title' ] ){
225
+                if ( !$aSection[ 'title' ] ) {
226 226
                     return false;
227 227
                 }
228 228
                 if ( $aSection[ 'collapsible' ] ) {
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
  * @since       3.6.0
16 16
  * @internal
17 17
  */
18
-class AdminPageFramework_FormPart_TableCaption extends AdminPageFramework_FormPart_Base {            
18
+class AdminPageFramework_FormPart_TableCaption extends AdminPageFramework_FormPart_Base {
19 19
 
20 20
     public $aSection                = array();
21 21
     public $hfSectionCallback       = null;
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
              */
223 223
             private function _shouldShowCaptionTitle( $aSection, $iSectionIndex ) {
224 224
                 
225
-                if ( ! $aSection[ 'title' ] ){
225
+                if ( ! $aSection[ 'title' ] ) {
226 226
                     return false;
227 227
                 }
228 228
                 if ( $aSection[ 'collapsible' ] ) {
Please login to merge, or discard this patch.
factory/_abstract/view/form_part/AdminPageFramework_FormPart_TableRow.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
60 60
                 return ''; 
61 61
             }
62 62
             
63
-            $_oFieldrowAttribute   = new AdminPageFramework_Attribute_Fieldrow( 
63
+            $_oFieldrowAttribute = new AdminPageFramework_Attribute_Fieldrow( 
64 64
                 $aFieldset,
65 65
                 array( 
66
-                    'id'        => 'fieldrow-' . $aFieldset[ 'tag_id' ],
66
+                    'id'        => 'fieldrow-'.$aFieldset[ 'tag_id' ],
67 67
                     'valign'    => 'top',
68 68
                     'class'     => 'admin-page-framework-fieldrow',
69 69
                 )                
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
                 $aFieldset, 
74 74
                 $hfCallback,
75 75
                 array(
76
-                    'open_container'    => "<tr " . $_oFieldrowAttribute->get() . ">",
76
+                    'open_container'    => "<tr ".$_oFieldrowAttribute->get().">",
77 77
                     'close_container'   => "</tr>",
78 78
                     'open_title'        => "<th>",
79 79
                     'close_title'       => "</th>",
@@ -113,13 +113,13 @@  discard block
 block discarded – undo
113 113
                     'close_main'        => '',
114 114
                 );
115 115
                 
116
-                $_aOutput   = array();
116
+                $_aOutput = array();
117 117
                 if ( $aFieldset[ 'show_title_column' ] ) {
118
-                    $_aOutput[] = $aOpenCloseTags[ 'open_title' ]
118
+                    $_aOutput[ ] = $aOpenCloseTags[ 'open_title' ]
119 119
                             . $this->_getFieldTitle( $aFieldset )
120 120
                         . $aOpenCloseTags[ 'close_title' ];
121 121
                 }
122
-                $_aOutput[] = $aOpenCloseTags[ 'open_main' ]
122
+                $_aOutput[ ] = $aOpenCloseTags[ 'open_main' ]
123 123
                         . call_user_func_array( $hfCallback, array( $aFieldset ) )
124 124
                     . $aOpenCloseTags[ 'close_main' ];
125 125
                     
@@ -142,22 +142,22 @@  discard block
 block discarded – undo
142 142
                         $aField,
143 143
                         0   // the first item
144 144
                     );
145
-                    return "<label for='" . $_oInputTagIDGenerator->get() . "'>"
146
-                            . "<a id='{$aField['field_id']}'></a>"  // to allow the browser to link to the element.
145
+                    return "<label for='".$_oInputTagIDGenerator->get()."'>"
146
+                            . "<a id='{$aField[ 'field_id' ]}'></a>"  // to allow the browser to link to the element.
147 147
                             . "<span title='" 
148 148
                                     . esc_attr( strip_tags( 
149
-                                        isset( $aField['tip'] ) 
150
-                                            ? $aField['tip'] 
149
+                                        isset( $aField[ 'tip' ] ) 
150
+                                            ? $aField[ 'tip' ] 
151 151
                                             : ( 
152
-                                                is_array( $aField['description'] 
153
-                                                    ? implode( '&#10;', $aField['description'] )
154
-                                                    : $aField['description'] 
152
+                                                is_array( $aField[ 'description' ] 
153
+                                                    ? implode( '&#10;', $aField[ 'description' ] )
154
+                                                    : $aField[ 'description' ] 
155 155
                                                 ) 
156 156
                                             ) 
157 157
                                     ) ) 
158 158
                                 . "'>"
159
-                                    . $aField['title'] 
160
-                                . ( in_array( $aField[ '_fields_type' ], array( 'widget', 'post_meta_box', 'page_meta_box' ) ) && isset( $aField['title'] ) && '' !== $aField['title']
159
+                                    . $aField[ 'title' ] 
160
+                                . ( in_array( $aField[ '_fields_type' ], array( 'widget', 'post_meta_box', 'page_meta_box' ) ) && isset( $aField[ 'title' ] ) && '' !== $aField[ 'title' ]
161 161
                                     ? "<span class='title-colon'>:</span>" 
162 162
                                     : ''
163 163
                                 )
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
  * @since       3.6.0
16 16
  * @internal
17 17
  */
18
-class AdminPageFramework_FormPart_TableRow extends AdminPageFramework_FormPart_Base {            
18
+class AdminPageFramework_FormPart_TableRow extends AdminPageFramework_FormPart_Base {
19 19
 
20 20
     public $aFieldset               = array();
21 21
     public $hfCallback              = null;
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
          */
57 57
         protected function _getRow( array $aFieldset, $hfCallback ) {
58 58
             
59
-            if ( 'section_title' === $aFieldset[ 'type' ] ) { 
59
+            if ( 'section_title' === $aFieldset[ 'type' ] ) {
60 60
                 return ''; 
61 61
             }
62 62
             
Please login to merge, or discard this patch.
_abstract/view/form_part/fieldset/AdminPageFramework_FormFieldset.php 2 patches
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -32,13 +32,13 @@  discard block
 block discarded – undo
32 32
         $_aOutput = array(); 
33 33
 
34 34
         // 1. Prepend the field error message. 
35
-        $_sFieldError   = $this->_getFieldError( 
35
+        $_sFieldError = $this->_getFieldError( 
36 36
             $this->aErrors, 
37 37
             $this->aField[ 'section_id' ], 
38 38
             $this->aField[ 'field_id' ] 
39 39
         );
40 40
         if ( '' !== $_sFieldError ) {
41
-            $_aOutput[] = $_sFieldError;
41
+            $_aOutput[ ] = $_sFieldError;
42 42
         }
43 43
                         
44 44
         // 2. Construct fields array for sub-fields.
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         $_aFields = $_oFieldsFormatter->get();
50 50
         
51 51
         // 3. Get the field and its sub-fields output.
52
-        $_aOutput[] = $this->_getFieldsOutput( 
52
+        $_aOutput[ ] = $this->_getFieldsOutput( 
53 53
             $_aFields, 
54 54
             $this->aCallbacks 
55 55
         );
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
          * @since   3.1.0
81 81
          * @since   3.2.0   Added the $aCallbacks parameter.
82 82
          */ 
83
-        private function _getFieldsOutput( array $aFields, array $aCallbacks=array() ) {
83
+        private function _getFieldsOutput( array $aFields, array $aCallbacks = array() ) {
84 84
 
85 85
             $_aOutput = array();
86
-            foreach( $aFields as $_isIndex => $_aField ) {
87
-                $_aOutput[] = $this->_getEachFieldOutput( 
86
+            foreach ( $aFields as $_isIndex => $_aField ) {
87
+                $_aOutput[ ] = $this->_getEachFieldOutput( 
88 88
                     $_aField, 
89 89
                     $_isIndex, 
90 90
                     $aCallbacks,
@@ -101,11 +101,11 @@  discard block
 block discarded – undo
101 101
              * @since       3.5.3
102 102
              * @return      string      the HTML output of the given field.
103 103
              */
104
-            private function _getEachFieldOutput( array $aField, $isIndex, array $aCallbacks, $bIsLastElement=false ) {
104
+            private function _getEachFieldOutput( array $aField, $isIndex, array $aCallbacks, $bIsLastElement = false ) {
105 105
                 
106 106
                 // Field type definition - allows mixed field types in sub-fields 
107
-                $_aFieldTypeDefinition = $this->_getFieldTypeDefinition( $aField['type'] );
108
-                if ( ! is_callable( $_aFieldTypeDefinition['hfRenderField'] ) ) {
107
+                $_aFieldTypeDefinition = $this->_getFieldTypeDefinition( $aField[ 'type' ] );
108
+                if ( !is_callable( $_aFieldTypeDefinition[ 'hfRenderField' ] ) ) {
109 109
                     return '';
110 110
                 }     
111 111
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                 // Callback the registered function to output the field 
122 122
                 $_oFieldAttribute = new AdminPageFramework_Attribute_Field( $aField );
123 123
                 return $aField[ 'before_field' ]
124
-                    . "<div " . $_oFieldAttribute->get() . ">"
124
+                    . "<div ".$_oFieldAttribute->get().">"
125 125
                         . call_user_func_array(
126 126
                             $_aFieldTypeDefinition[ 'hfRenderField' ],
127 127
                             array( $aField )
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                         'input',
148 148
                         array(
149 149
                             'type'  => 'hidden',
150
-                            'name'  => '__unset_' . $aField[ '_fields_type' ] . '[' . $aField[ '_input_name_flat' ] . ']',
150
+                            'name'  => '__unset_'.$aField[ '_fields_type' ].'['.$aField[ '_input_name_flat' ].']',
151 151
                             'value' => $aField[ '_input_name_flat' ],
152 152
                             'class' => 'unset-element-names element-address',
153 153
                         )
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
                     return $this->getElement(
167 167
                         $this->aFieldTypeDefinitions,
168 168
                         $sFieldTypeSlug,
169
-                        $this->aFieldTypeDefinitions['default']
169
+                        $this->aFieldTypeDefinitions[ 'default' ]
170 170
                     );
171 171
                 }  
172 172
 
@@ -177,19 +177,19 @@  discard block
 block discarded – undo
177 177
                  * @return      string      the HTML output of delimiter
178 178
                  */
179 179
                 private function _getDelimiter( array $aField, $bIsLastElement ) {
180
-                    return $aField['delimiter']
181
-                        ? "<div " . $this->getAttributes( 
180
+                    return $aField[ 'delimiter' ]
181
+                        ? "<div ".$this->getAttributes( 
182 182
                                 array(
183 183
                                     'class' => 'delimiter',
184
-                                    'id'    => "delimiter-{$aField['input_id']}",
184
+                                    'id'    => "delimiter-{$aField[ 'input_id' ]}",
185 185
                                     'style' => $this->getAOrB(
186 186
                                         $bIsLastElement,
187 187
                                         "display:none;",
188 188
                                         ""
189 189
                                     ),
190 190
                                 ) 
191
-                            ) . ">"
192
-                                . $aField['delimiter']
191
+                            ).">"
192
+                                . $aField[ 'delimiter' ]
193 193
                             . "</div>"
194 194
                         : '';
195 195
                 }                
@@ -202,9 +202,9 @@  discard block
 block discarded – undo
202 202
          */
203 203
         private function _getFinalOutput( array $aFieldset, array $aFieldsOutput, $iFieldsCount ) {
204 204
                             
205
-            $_oFieldsetAttributes   = new AdminPageFramework_Attribute_Fieldset( $aFieldset );
205
+            $_oFieldsetAttributes = new AdminPageFramework_Attribute_Fieldset( $aFieldset );
206 206
             return $aFieldset[ 'before_fieldset' ]
207
-                . "<fieldset " . $_oFieldsetAttributes->get() . ">"
207
+                . "<fieldset ".$_oFieldsetAttributes->get().">"
208 208
                     . $this->_getFieldsetContent( $aFieldset, $aFieldsOutput, $iFieldsCount )
209 209
                     . $this->_getExtras( $aFieldset, $iFieldsCount )
210 210
                 . "</fieldset>"
@@ -221,13 +221,13 @@  discard block
 block discarded – undo
221 221
                     return $aFieldset[ 'content' ];
222 222
                 }
223 223
             
224
-                $_oFieldsAttributes     = new AdminPageFramework_Attribute_Fields( 
224
+                $_oFieldsAttributes = new AdminPageFramework_Attribute_Fields( 
225 225
                     $aFieldset, 
226
-                    array(),    // attribute array
226
+                    array(), // attribute array
227 227
                     $iFieldsCount
228 228
                 );            
229 229
             
230
-                return "<div " . $_oFieldsAttributes->get() . ">"
230
+                return "<div ".$_oFieldsAttributes->get().">"
231 231
                         . $aFieldset[ 'before_fields' ]
232 232
                             . implode( PHP_EOL, $aFieldsOutput )
233 233
                         . $aFieldset[ 'after_fields' ]
@@ -249,13 +249,13 @@  discard block
 block discarded – undo
249 249
                     $aField[ 'description' ],
250 250
                     'admin-page-framework-fields-description'   // class selector
251 251
                 );
252
-                $_aOutput[] = $_oFieldDescription->get();
252
+                $_aOutput[ ] = $_oFieldDescription->get();
253 253
                     
254 254
                 // Dimensional keys of repeatable and sortable fields
255
-                $_aOutput[] = $this->_getDynamicElementFlagFieldInputTag( $aField );
255
+                $_aOutput[ ] = $this->_getDynamicElementFlagFieldInputTag( $aField );
256 256
                     
257 257
                 // Repeatable and sortable scripts 
258
-                $_aOutput[] = $this->_getFieldScripts( $aField, $iFieldsCount );
258
+                $_aOutput[ ] = $this->_getFieldScripts( $aField, $iFieldsCount );
259 259
                 
260 260
                 return implode( PHP_EOL, array_filter( $_aOutput ) );
261 261
                 
@@ -296,8 +296,8 @@  discard block
 block discarded – undo
296 296
                             'input',
297 297
                             array(
298 298
                                 'type'                      => 'hidden',
299
-                                'name'                      => '__repeatable_elements_' . $aFieldset[ '_fields_type' ] 
300
-                                    . '[' . $aFieldset[ '_field_address' ] . ']',
299
+                                'name'                      => '__repeatable_elements_'.$aFieldset[ '_fields_type' ] 
300
+                                    . '['.$aFieldset[ '_field_address' ].']',
301 301
                                 'class'                     => 'element-address',
302 302
                                 'value'                     => $aFieldset[ '_field_address' ],
303 303
                                 'data-field_address_model'  => $aFieldset[ '_field_address_model' ],
@@ -313,8 +313,8 @@  discard block
 block discarded – undo
313 313
                             'input',
314 314
                             array(
315 315
                                 'type'                      => 'hidden',
316
-                                'name'                      => '__sortable_elements_' . $aFieldset[ '_fields_type' ] 
317
-                                    . '[' . $aFieldset[ '_field_address' ] . ']',
316
+                                'name'                      => '__sortable_elements_'.$aFieldset[ '_fields_type' ] 
317
+                                    . '['.$aFieldset[ '_field_address' ].']',
318 318
                                 'class'                     => 'element-address',
319 319
                                 'value'                     => $aFieldset[ '_field_address' ],
320 320
                                 'data-field_address_model'  => $aFieldset[ '_field_address_model' ],
@@ -333,14 +333,14 @@  discard block
 block discarded – undo
333 333
                     $_aOutput   = array();
334 334
                     
335 335
                     // Add the repeater script 
336
-                    $_aOutput[] = $aField['repeatable']
337
-                        ? $this->_getRepeaterFieldEnablerScript( 'fields-' . $aField['tag_id'], $iFieldsCount, $aField['repeatable'] )
336
+                    $_aOutput[ ] = $aField[ 'repeatable' ]
337
+                        ? $this->_getRepeaterFieldEnablerScript( 'fields-'.$aField[ 'tag_id' ], $iFieldsCount, $aField[ 'repeatable' ] )
338 338
                         : '';
339 339
 
340 340
                     // Add the sortable script - if the number of fields is only one, no need to sort the field. 
341 341
                     // Repeatable fields can make the number increase so here it checkes the repeatability.
342
-                    $_aOutput[] = $aField['sortable'] && ( $iFieldsCount > 1 || $aField['repeatable'] )
343
-                        ? $this->_getSortableFieldEnablerScript( 'fields-' . $aField['tag_id'] )
342
+                    $_aOutput[ ] = $aField[ 'sortable' ] && ( $iFieldsCount > 1 || $aField[ 'repeatable' ] )
343
+                        ? $this->_getSortableFieldEnablerScript( 'fields-'.$aField[ 'tag_id' ] )
344 344
                         : '';     
345 345
                     
346 346
                     return implode( PHP_EOL, $_aOutput );
@@ -357,14 +357,14 @@  discard block
 block discarded – undo
357 357
             
358 358
             // If this field has a section and the error element is set
359 359
             if ( $this->_hasFieldErrorsOfSection( $aErrors, $sSectionID, $sFieldID ) ) {   
360
-                return "<span class='field-error'>*&nbsp;{$this->aField['error_message']}"         
360
+                return "<span class='field-error'>*&nbsp;{$this->aField[ 'error_message' ]}"         
361 361
                         . $aErrors[ $sSectionID ][ $sFieldID ]
362 362
                     . "</span>";
363 363
             }             
364 364
             
365 365
             // if this field does not have a section and the error element is set,
366 366
             if ( $this->_hasFieldError( $aErrors, $sFieldID ) ) {
367
-                return "<span class='field-error'>*&nbsp;{$this->aField['error_message']}"                           
367
+                return "<span class='field-error'>*&nbsp;{$this->aField[ 'error_message' ]}"                           
368 368
                         . $aErrors[ $sFieldID ]
369 369
                     . "</span>";
370 370
             }  
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
                         $aErrors[ $sSectionID ][ $sFieldID ]
386 386
                     )
387 387
                     && is_array( $aErrors[ $sSectionID ] )
388
-                    && ! is_array( $aErrors[ $sSectionID ][ $sFieldID ] )
388
+                    && !is_array( $aErrors[ $sSectionID ][ $sFieldID ] )
389 389
                 );
390 390
             }
391 391
             /**
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
             private function _hasFieldError( $aErrors, $sFieldID ) {
398 398
                 return ( 
399 399
                     isset( $aErrors[ $sFieldID ] ) 
400
-                    && ! is_array( $aErrors[ $sFieldID ] )
400
+                    && !is_array( $aErrors[ $sFieldID ] )
401 401
                 );
402 402
             }
403 403
             
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
                  */
141 141
                 private function _getUnsetFlagFieldInputTag( array $aField ) {
142 142
                     
143
-                    if ( false !== $aField[ 'save' ] ) {                
143
+                    if ( false !== $aField[ 'save' ] ) {
144 144
                         return '';
145 145
                     }
146 146
                     return $this->getHTMLTag( 
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
         private function _getFieldError( $aErrors, $sSectionID, $sFieldID ) {
357 357
             
358 358
             // If this field has a section and the error element is set
359
-            if ( $this->_hasFieldErrorsOfSection( $aErrors, $sSectionID, $sFieldID ) ) {   
359
+            if ( $this->_hasFieldErrorsOfSection( $aErrors, $sSectionID, $sFieldID ) ) {
360 360
                 return "<span class='field-error'>*&nbsp;{$this->aField['error_message']}"         
361 361
                         . $aErrors[ $sSectionID ][ $sFieldID ]
362 362
                     . "</span>";
Please login to merge, or discard this patch.