Completed
Branch dev (a3767f)
by Michael
40:38
created
_abstract/form/_model/AdminPageFramework_Form_Model___SetFieldResources.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -89,16 +89,16 @@  discard block
 block discarded – undo
89 89
                 'AdminPageFramework_Form_View___CSS_CollapsibleSection',
90 90
                 'AdminPageFramework_Form_View___CSS_FieldError',
91 91
             );
92
-            foreach( $_aClassNames as $_sClassName ) {
92
+            foreach ( $_aClassNames as $_sClassName ) {
93 93
                 $_oCSS = new $_sClassName;
94
-                $this->aResources[ 'inline_styles' ][] = $_oCSS->get();
94
+                $this->aResources[ 'inline_styles' ][ ] = $_oCSS->get();
95 95
             }
96 96
             $_aClassNamesForIE = array(
97 97
                 'AdminPageFramework_Form_View___CSS_CollapsibleSectionIE',
98 98
             );
99
-            foreach( $_aClassNames as $_sClassName ) {
99
+            foreach ( $_aClassNames as $_sClassName ) {
100 100
                 $_oCSS = new $_sClassName;
101
-                $this->aResources[ 'inline_styles_ie' ][] = $_oCSS->get();
101
+                $this->aResources[ 'inline_styles_ie' ][ ] = $_oCSS->get();
102 102
             }
103 103
             
104 104
         }
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
 
119 119
             // Parse all added fieldsets and check associated resources.
120 120
 // @todo Find a way to retrieve the section id for nested sections and fields.            
121
-            foreach( $this->aFieldsets as $_sSecitonID => $_aFieldsets ) {
121
+            foreach ( $this->aFieldsets as $_sSecitonID => $_aFieldsets ) {
122 122
                 
123 123
                 $_bIsSubSectionLoaded = false;
124
-                foreach( $_aFieldsets as $_iSubSectionIndexOrFieldID => $_aSubSectionOrField )  {
124
+                foreach ( $_aFieldsets as $_iSubSectionIndexOrFieldID => $_aSubSectionOrField ) {
125 125
 // @todo Examine if this structure is correct or not. 
126 126
 // It may not be necessary to check the sub-section dimensions as this is not the saved options array.
127 127
                     // if it's a sub-section
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
                             continue;
133 133
                         }
134 134
                         $_bIsSubSectionLoaded = true;
135
-                        foreach( $_aSubSectionOrField as $_aField ) {
135
+                        foreach ( $_aSubSectionOrField as $_aField ) {
136 136
                             $this->_setFieldResources( $_aField );     
137 137
                         }
138 138
                         continue;
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
             private function _setFieldResources( array $aFieldset ) {
158 158
                                 
159 159
                 // Check the field conditions here.
160
-                if ( ! $this->_isFieldsetAllowed( $aFieldset ) ) {
160
+                if ( !$this->_isFieldsetAllowed( $aFieldset ) ) {
161 161
                     return;
162 162
                 }
163 163
                 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
                 $this->callBack(
186 186
                     $this->aCallbacks[ 'load_fieldset_resource' ], 
187 187
                     array(
188
-                        $aFieldset,   // 1st parameter 
188
+                        $aFieldset, // 1st parameter 
189 189
                     )
190 190
                 );
191 191
                 
@@ -218,10 +218,10 @@  discard block
 block discarded – undo
218 218
                  * @return      boolean
219 219
                  */
220 220
                 private function _isAlreadyRegistered( $sFieldtype, $sStructureType ) {
221
-                    if ( isset( self::$_aRegisteredFieldTypes[ $sFieldtype . '_' .$sStructureType ] ) ) {
221
+                    if ( isset( self::$_aRegisteredFieldTypes[ $sFieldtype.'_'.$sStructureType ] ) ) {
222 222
                         return true;
223 223
                     }
224
-                    self::$_aRegisteredFieldTypes[ $sFieldtype . '_' .$sStructureType ] = true;
224
+                    self::$_aRegisteredFieldTypes[ $sFieldtype.'_'.$sStructureType ] = true;
225 225
                     return false;
226 226
                 }
227 227
                     /**
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
             return $this->callBack(
241 241
                 $this->aCallbacks[ 'is_fieldset_registration_allowed' ], 
242 242
                 array(
243
-                    true,   // 1st parameter 
243
+                    true, // 1st parameter 
244 244
                     $aFieldset, // 2nd parameter
245 245
                 )
246 246
             );
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -121,14 +121,14 @@
 block discarded – undo
121 121
             foreach( $this->aFieldsets as $_sSecitonID => $_aFieldsets ) {
122 122
                 
123 123
                 $_bIsSubSectionLoaded = false;
124
-                foreach( $_aFieldsets as $_iSubSectionIndexOrFieldID => $_aSubSectionOrField )  {
124
+                foreach( $_aFieldsets as $_iSubSectionIndexOrFieldID => $_aSubSectionOrField ) {
125 125
 // @todo Examine if this structure is correct or not. 
126 126
 // It may not be necessary to check the sub-section dimensions as this is not the saved options array.
127 127
                     // if it's a sub-section
128 128
                     if ( $this->isNumericInteger( $_iSubSectionIndexOrFieldID ) ) {
129 129
 
130 130
                         // no need to repeat the same set of fields
131
-                        if ( $_bIsSubSectionLoaded ) { 
131
+                        if ( $_bIsSubSectionLoaded ) {
132 132
                             continue;
133 133
                         }
134 134
                         $_bIsSubSectionLoaded = true;
Please login to merge, or discard this patch.
element_definition/AdminPageFramework_Form_Model___FieldConditioner.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -60,18 +60,18 @@  discard block
 block discarded – undo
60 60
 
61 61
             // Drop keys of fields-array which do not exist in the sections-array. 
62 62
             // For this reasons, the sections-array should be conditioned first before applying this method.
63
-            $aFields    = $this->castArrayContents( $aSections, $aFields );
63
+            $aFields = $this->castArrayContents( $aSections, $aFields );
64 64
 
65 65
             $_aNewFields = array();
66
-            foreach( $aFields as $_sSectionID => $_aSubSectionOrFields ) {
66
+            foreach ( $aFields as $_sSectionID => $_aSubSectionOrFields ) {
67 67
                 
68 68
                 // This type check is important as the parsing field array is content-cast, which can set null value to elements.
69
-                if ( ! is_array( $_aSubSectionOrFields ) ) { 
69
+                if ( !is_array( $_aSubSectionOrFields ) ) { 
70 70
                     continue; 
71 71
                 }
72 72
                             
73 73
                 $this->_setConditionedFields( 
74
-                    $_aNewFields,   // by reference - gets updated in the method.
74
+                    $_aNewFields, // by reference - gets updated in the method.
75 75
                     $_aSubSectionOrFields, 
76 76
                     $_sSectionID
77 77
                 );
@@ -91,14 +91,14 @@  discard block
 block discarded – undo
91 91
              */
92 92
             private function _setConditionedFields( array &$_aNewFields, $_aSubSectionOrFields, $_sSectionID ) {
93 93
                 
94
-                foreach( $_aSubSectionOrFields as $_sIndexOrFieldID => $_aSubSectionOrField ) {
94
+                foreach ( $_aSubSectionOrFields as $_sIndexOrFieldID => $_aSubSectionOrField ) {
95 95
                     
96 96
                     // If it is a sub-section array.
97 97
                     if ( $this->isNumericInteger( $_sIndexOrFieldID ) ) {
98 98
                         $_sSubSectionIndex  = $_sIndexOrFieldID;
99 99
                         $_aFields           = $_aSubSectionOrField;
100
-                        foreach( $_aFields as $_aField ) {
101
-                            if ( ! $this->_isAllowed( $_aField ) ) {
100
+                        foreach ( $_aFields as $_aField ) {
101
+                            if ( !$this->_isAllowed( $_aField ) ) {
102 102
                                 continue;
103 103
                             }
104 104
                             $_aNewFields[ $_sSectionID ][ $_sSubSectionIndex ][ $_aField[ 'field_id' ] ] = $_aField;
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
                     
110 110
                     // Otherwise, insert the formatted field definition array.
111 111
                     $_aField = $_aSubSectionOrField;
112
-                    if ( ! $this->_isAllowed( $_aField ) ) {
112
+                    if ( !$this->_isAllowed( $_aField ) ) {
113 113
                         continue;
114 114
                     }
115 115
                     $_aNewFields[ $_sSectionID ][ $_aField[ 'field_id' ] ] = $_aField;
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
             foreach( $aFields as $_sSectionID => $_aSubSectionOrFields ) {
67 67
                 
68 68
                 // This type check is important as the parsing field array is content-cast, which can set null value to elements.
69
-                if ( ! is_array( $_aSubSectionOrFields ) ) { 
69
+                if ( ! is_array( $_aSubSectionOrFields ) ) {
70 70
                     continue; 
71 71
                 }
72 72
                             
Please login to merge, or discard this patch.
element_definition/AdminPageFramework_Form_Model___SectionConditioner.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  */
18 18
 class AdminPageFramework_Form_Model___SectionConditioner extends AdminPageFramework_WPUtility {
19 19
     
20
-    public $aSectionsets  = array();
20
+    public $aSectionsets = array();
21 21
 
22 22
     /**
23 23
      * Sets up hooks.
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         $_aParameters = func_get_args() + array( 
29 29
             $this->aSectionsets, 
30 30
         );
31
-        $this->aSectionsets  = $_aParameters[ 0 ];                    
31
+        $this->aSectionsets = $_aParameters[ 0 ];                    
32 32
         
33 33
     }
34 34
 
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
      * @since       DEVVER      Moved from `AdminPageFramework_FormDefinition`. Changed the name from `getConditionedSections()`.
51 51
      * @return      array       The conditioned sectionsets array.
52 52
      */
53
-    private function _getSectionsConditioned( array $aSections=array() ) {
53
+    private function _getSectionsConditioned( array $aSections = array() ) {
54 54
         
55
-        $_aNewSections  = array();
56
-        foreach( $aSections as $_sSectionID => $_aSection ) {
57
-            if ( ! $this->_isAllowed( $_aSection ) ) {
55
+        $_aNewSections = array();
56
+        foreach ( $aSections as $_sSectionID => $_aSection ) {
57
+            if ( !$this->_isAllowed( $_aSection ) ) {
58 58
                 continue;                
59 59
             }
60 60
             $_aNewSections[ $_sSectionID ] = $_aSection;
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     protected function _isAllowed( array $aDefinition ) {
74 74
         
75 75
         // Check capability. If the access level is not sufficient, skip.
76
-        if ( ! current_user_can( $aDefinition[ 'capability' ] ) ) { 
76
+        if ( !current_user_can( $aDefinition[ 'capability' ] ) ) { 
77 77
             return false;
78 78
         }
79 79
         return ( boolean ) $aDefinition[ 'if' ];
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
     protected function _isAllowed( array $aDefinition ) {
74 74
         
75 75
         // Check capability. If the access level is not sufficient, skip.
76
-        if ( ! current_user_can( $aDefinition[ 'capability' ] ) ) { 
76
+        if ( ! current_user_can( $aDefinition[ 'capability' ] ) ) {
77 77
             return false;
78 78
         }
79 79
         return ( boolean ) $aDefinition[ 'if' ];
Please login to merge, or discard this patch.
_model/formatter/AdminPageFramework_Form_Model___FormatDynamicElements.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
                 $aOptions // data source
69 69
             );
70 70
 
71
-            foreach( $aOptions as $_sSectionID => $_aSubSectionOrFields ) {
71
+            foreach ( $aOptions as $_sSectionID => $_aSubSectionOrFields ) {
72 72
                 
73 73
                 $_aSubSection = $this->_getSubSectionFromOptions(   
74 74
                     $_sSectionID,
@@ -105,10 +105,10 @@  discard block
 block discarded – undo
105 105
                 
106 106
                 $_aSubSection = array();
107 107
                 $_iPrevIndex  = null;
108
-                foreach( $_aSubSectionOrFields as $_isIndexOrFieldID => $_aSubSectionOrFieldOptions ) {
108
+                foreach ( $_aSubSectionOrFields as $_isIndexOrFieldID => $_aSubSectionOrFieldOptions ) {
109 109
                 
110 110
                     // If it is not a sub-section array, skip.
111
-                    if ( ! $this->isNumericInteger( $_isIndexOrFieldID ) ) { 
111
+                    if ( !$this->isNumericInteger( $_isIndexOrFieldID ) ) { 
112 112
                         continue; 
113 113
                     }
114 114
                     
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                     );
123 123
        
124 124
                     // Update the internal section index key
125
-                    foreach( $_aSubSection[ $_iIndex ] as &$_aField ) {
125
+                    foreach ( $_aSubSection[ $_iIndex ] as &$_aField ) {
126 126
                         $_aField[ '_section_index' ] = $_iIndex;
127 127
                     }
128 128
                     unset( $_aField ); // to be safe in PHP
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                  */
148 148
                 private function _getSubSectionItemsFromOptions( array $_aSubSection, $_sSectionID, $_iIndex, $_iPrevIndex ) {
149 149
                     
150
-                    if ( ! isset( $this->aFieldsets[ $_sSectionID ] ) ) {
150
+                    if ( !isset( $this->aFieldsets[ $_sSectionID ] ) ) {
151 151
                         return array();
152 152
                     }
153 153
                     
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
                         : $this->getNonIntegerKeyElements( $this->aFieldsets[ $_sSectionID ] );
157 157
                         
158 158
                     // if empty, merge with the previous element.
159
-                    return ! empty( $_aFields )
159
+                    return !empty( $_aFields )
160 160
                         ? $_aFields
161 161
                         : $this->getElementAsArray(
162 162
                             $_aSubSection,
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
                 foreach( $_aSubSectionOrFields as $_isIndexOrFieldID => $_aSubSectionOrFieldOptions ) {
109 109
                 
110 110
                     // If it is not a sub-section array, skip.
111
-                    if ( ! $this->isNumericInteger( $_isIndexOrFieldID ) ) { 
111
+                    if ( ! $this->isNumericInteger( $_isIndexOrFieldID ) ) {
112 112
                         continue; 
113 113
                     }
114 114
                     
Please login to merge, or discard this patch.
form/_model/formatter/AdminPageFramework_Form_Model___FormatSectionset.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -35,39 +35,39 @@  discard block
 block discarded – undo
35 35
         // Optional
36 36
         'page_slug'         => null,
37 37
         'tab_slug'          => null,
38
-        'section_tab_slug'  => null,    // 3.0.0+
38
+        'section_tab_slug'  => null, // 3.0.0+
39 39
         'title'             => null,
40 40
         'description'       => null,
41 41
         'capability'        => null,
42 42
         'if'                => true,    
43
-        'order'             => null,    // do not set the default number here because incremented numbers will be added when registering the sections.
43
+        'order'             => null, // do not set the default number here because incremented numbers will be added when registering the sections.
44 44
         'help'              => null,
45 45
         'help_aside'        => null,
46
-        'repeatable'        => false,   // (boolean|array) 3.0.0+
47
-        'sortable'          => false,   // (boolean|array) 3.6.0+
46
+        'repeatable'        => false, // (boolean|array) 3.0.0+
47
+        'sortable'          => false, // (boolean|array) 3.6.0+
48 48
         'attributes'        => array(   // 3.3.1+
49
-            'class'         => null,    // set null to avoid undefined index warnings.
50
-            'style'         => null,    // set null to avoid undefined index warnings.
49
+            'class'         => null, // set null to avoid undefined index warnings.
50
+            'style'         => null, // set null to avoid undefined index warnings.
51 51
             'tab'           => array(),
52 52
         ),
53 53
         'class'             => array(    // 3.3.1+
54 54
             'tab'           => array(),
55 55
         ),
56
-        'hidden'            => false,    // 3.3.1+
57
-        'collapsible'       => false,    // 3.4.0+ (boolean|array) For the array structure see the $aStructure_CollapsibleArguments property.
58
-        'save'              => true,     // 3.6.0+
56
+        'hidden'            => false, // 3.3.1+
57
+        'collapsible'       => false, // 3.4.0+ (boolean|array) For the array structure see the $aStructure_CollapsibleArguments property.
58
+        'save'              => true, // 3.6.0+
59 59
         
60
-        'content'           => null,     // 3.6.1+  (string) An overriding section-set output.
60
+        'content'           => null, // 3.6.1+  (string) An overriding section-set output.
61 61
         
62 62
         // Internal
63
-        '_fields_type'      => null,     // @deprecated DEVVER+ Use the `_structure_type` instead. 3.0.0+ - same as the one of the field definition array. Used to insert debug info at the bottom of sections.        
64
-        '_structure_type'   => null,     // DEVVER+
65
-        '_is_first_index'   => false,    // 3.4.0+ (boolean) indicates whether it is the first item of the sub-sections (for repeatable sections).
66
-        '_is_last_index'    => false,    // 3.4.0+ (boolean) indicates whether it is the last item of the sub-sections (for repeatable sections).
63
+        '_fields_type'      => null, // @deprecated DEVVER+ Use the `_structure_type` instead. 3.0.0+ - same as the one of the field definition array. Used to insert debug info at the bottom of sections.        
64
+        '_structure_type'   => null, // DEVVER+
65
+        '_is_first_index'   => false, // 3.4.0+ (boolean) indicates whether it is the first item of the sub-sections (for repeatable sections).
66
+        '_is_last_index'    => false, // 3.4.0+ (boolean) indicates whether it is the last item of the sub-sections (for repeatable sections).
67 67
         
68
-        '_section_path'         => '',       // DEVVER+ (string) e.g. my_section|nested_section       
69
-        '_section_path_array'   => '',       // DEVVER+ (array) an array version of the above section_path argument. Numerically indexed.
70
-        '_nested_depth'         => 0,        // DEVVER+ (integer) the nested level of the section
68
+        '_section_path'         => '', // DEVVER+ (string) e.g. my_section|nested_section       
69
+        '_section_path_array'   => '', // DEVVER+ (array) an array version of the above section_path argument. Numerically indexed.
70
+        '_nested_depth'         => 0, // DEVVER+ (integer) the nested level of the section
71 71
         
72 72
         // 3.6.0+ - (object) the caller framework factory object. This allows the framework to access the factory property when rendering the section.
73 73
         // DEVVER+  It no longer stores a factory object but a form object.
@@ -122,11 +122,11 @@  discard block
 block discarded – undo
122 122
         $_aSectionPath = explode( '|', $this->sSectionPath );
123 123
         $_aSectionset  = $this->uniteArrays(
124 124
             array( 
125
-                '_fields_type'          => $this->sStructureType,   // @deprecated  DEVVER+
126
-                '_structure_type'       => $this->sStructureType,   // DEVVER+
127
-                '_section_path'         => $this->sSectionPath,     // DEVVER+
125
+                '_fields_type'          => $this->sStructureType, // @deprecated  DEVVER+
126
+                '_structure_type'       => $this->sStructureType, // DEVVER+
127
+                '_section_path'         => $this->sSectionPath, // DEVVER+
128 128
                 '_section_path_array'   => $_aSectionPath,
129
-                '_nested_depth'         => count( $_aSectionPath ) - 1,    // DEVVER+ - zero base
129
+                '_nested_depth'         => count( $_aSectionPath ) - 1, // DEVVER+ - zero base
130 130
             ) 
131 131
             + $this->aSectionset
132 132
             + array(
Please login to merge, or discard this patch.
form/_model/formatter/AdminPageFramework_Form_Model___FormatSectionsets.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 class AdminPageFramework_Form_Model___FormatSectionsets extends AdminPageFramework_Form_Base {
18 18
     
19 19
     public $sStructureType = '';
20
-    public $aSectionsets  = array();
20
+    public $aSectionsets = array();
21 21
     public $sCapability = '';
22 22
     public $aCallbacks = array(
23 23
         'sectionset_before_output' => null
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
         }
63 63
 
64 64
         $_aSectionsets = $this->_getSectionsetsFormatted(
65
-            array(),                // sectionsets array to modify - new formatted items will be stored here
66
-            $this->aSectionsets,    // parsing sectionsets
67
-            array(),                // section path - empty for root 
65
+            array(), // sectionsets array to modify - new formatted items will be stored here
66
+            $this->aSectionsets, // parsing sectionsets
67
+            array(), // section path - empty for root 
68 68
             $this->sCapability      // capability
69 69
         );
70 70
 
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
          */
82 82
         private function _getSectionsetsFormatted( $_aNewSectionsets, $aSectionsetsToParse, $aSectionPath, $sCapability ) {
83 83
 
84
-            foreach( $aSectionsetsToParse as $_sSectionPath => $_aSectionset ) {
84
+            foreach ( $aSectionsetsToParse as $_sSectionPath => $_aSectionset ) {
85 85
 
86 86
                 // The '_default' section can be empty so do not check `if ( empty( $_aSectionset ) )` here.
87
-                if ( ! is_array( $_aSectionset ) ) { 
87
+                if ( !is_array( $_aSectionset ) ) { 
88 88
                     continue; 
89 89
                 }
90 90
                 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
                 
112 112
                 // DEVVER+ For nested sections         
113 113
                 $_aNewSectionsets = $this->_getNestedSections( 
114
-                    $_aNewSectionsets,  // sectionset array to modify
114
+                    $_aNewSectionsets, // sectionset array to modify
115 115
                     $_aSectionset, 
116 116
                     $_aSectionPath, // section path
117 117
                     $_aSectionset[ 'capability' ]
@@ -128,15 +128,15 @@  discard block
 block discarded – undo
128 128
              */
129 129
             private function _getNestedSections( $aSectionsetsToEdit, $aSectionset, $aSectionPath, $sCapability ) {
130 130
 
131
-                if ( ! $this->_hasNestedSections( $aSectionset ) ) {
131
+                if ( !$this->_hasNestedSections( $aSectionset ) ) {
132 132
                     return $aSectionsetsToEdit;
133 133
                 }
134 134
 
135 135
                 // Reccursive call
136 136
                 return $this->_getSectionsetsFormatted(
137
-                        $aSectionsetsToEdit,          // sectionsets array to modify - new formatted items will be stored here
138
-                        $aSectionset[ 'content' ],    // parsing sectionsets
139
-                        $aSectionPath,                // section path - empty for root 
137
+                        $aSectionsetsToEdit, // sectionsets array to modify - new formatted items will be stored here
138
+                        $aSectionset[ 'content' ], // parsing sectionsets
139
+                        $aSectionPath, // section path - empty for root 
140 140
                         $sCapability                  // capability
141 141
                     );                          
142 142
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
                 private function _hasNestedSections( $aSectionset ) {
150 150
                     
151 151
                     $aSectionset = $aSectionset + array( 'content' => null );
152
-                    if ( ! is_array( $aSectionset[ 'content' ] ) ) {
152
+                    if ( !is_array( $aSectionset[ 'content' ] ) ) {
153 153
                         return false;
154 154
                     }
155 155
                     $_aContents  = $aSectionset[ 'content' ];
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             foreach( $aSectionsetsToParse as $_sSectionPath => $_aSectionset ) {
85 85
 
86 86
                 // The '_default' section can be empty so do not check `if ( empty( $_aSectionset ) )` here.
87
-                if ( ! is_array( $_aSectionset ) ) { 
87
+                if ( ! is_array( $_aSectionset ) ) {
88 88
                     continue; 
89 89
                 }
90 90
                 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
                     $this->aCallbacks[ 'sectionset_before_output' ], 
104 104
                     array( $_aSectionsetFormatter->get() )
105 105
                 );
106
-                if ( empty( $_aSectionset ) ) { 
106
+                if ( empty( $_aSectionset ) ) {
107 107
                     continue; 
108 108
                 }
109 109
                 
Please login to merge, or discard this patch.
form/_model/formatter/AdminPageFramework_Form_Model___Format_EachField.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
      */
25 25
     static public $aStructure = array(
26 26
         '_is_sub_field'                 => false, // @todo change this key name as all the parsed field is technically a sub-field.
27
-        '_index'                        => 0,       // indicates the field index
27
+        '_index'                        => 0, // indicates the field index
28 28
         '_is_multiple_fields'           => false,
29 29
         '_saved_value'                  => null,
30 30
         '_is_value_set_by_user'         => false,
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
         '_fields_container_id'          => '',
40 40
         '_fieldset_container_id'        => '',
41 41
         
42
-        '_field_object'                 => null,        // 3.6.0+
43
-        '_parent_field_object'          => null,        // 3.6.0+ Stores the parent field object to be accessed from the nested fields to generate id and name attribute models.
42
+        '_field_object'                 => null, // 3.6.0+
43
+        '_parent_field_object'          => null, // 3.6.0+ Stores the parent field object to be accessed from the nested fields to generate id and name attribute models.
44 44
     );
45 45
     
46 46
     /**
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
         $_aField = $this->aField + self::$aStructure;
85 85
         
86
-        $_aField[ '_is_sub_field' ]            = is_numeric( $this->isIndex ) && 0 < $this->isIndex;      // 3.5.3+
86
+        $_aField[ '_is_sub_field' ]            = is_numeric( $this->isIndex ) && 0 < $this->isIndex; // 3.5.3+
87 87
         $_aField[ '_index' ]                   = $this->isIndex;
88 88
 
89 89
         // 'input_id' - something like ({section id}_){field_id}_{index} e.g. my_section_id_my_field_id_0
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         // ); 
128 128
                             
129 129
         // used in the attribute below plus it is also used in the sample custom field type.
130
-        $_aField[ '_field_container_id' ]      = "field-{$_aField[ 'input_id' ]}";
130
+        $_aField[ '_field_container_id' ] = "field-{$_aField[ 'input_id' ]}";
131 131
 
132 132
 // @todo for issue #158 https://github.com/michaeluno/admin-page-framework/issues/158               
133 133
 // These models are for generating ids and names dynamically.
@@ -165,8 +165,8 @@  discard block
 block discarded – undo
165 165
                     'value'             => $_aField[ 'value' ],
166 166
                     'type'              => $_aField[ 'type' ], // text, password, etc.
167 167
                     'disabled'          => null,
168
-                    'data-id_model'     => $_aField[ '_input_id_model' ],    // 3.3.1+
169
-                    'data-name_model'   => $_aField[ '_input_name_model' ],  // 3.3.1+
168
+                    'data-id_model'     => $_aField[ '_input_id_model' ], // 3.3.1+
169
+                    'data-name_model'   => $_aField[ '_input_name_model' ], // 3.3.1+
170 170
                 )
171 171
             ),
172 172
             // this allows sub-fields with different field types to set the default key-values for the sub-field.
Please login to merge, or discard this patch.
_model/formatter/AdminPageFramework_Form_Model___Format_EachSection.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     /**
44 44
      * Stores the section definition.
45 45
      */
46
-    public $aSection            = array();
46
+    public $aSection = array();
47 47
     
48 48
     /**
49 49
      * Indicates the sub section index.
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
         
92 92
         $_aSection[ '_is_collapsible' ]    = $_aSection[ 'collapsible' ] && 'section' === $_aSection[ 'collapsible' ][ 'container' ];
93 93
         
94
-        $_aSection[ '_tag_id' ]            = 'section-' . $_aSection[ 'section_id' ] . '__' . $this->iIndex;
95
-        $_aSection[ '_tag_id_model' ]      = 'section-' . $_aSection[ 'section_id' ] . '__' . '___i___';
94
+        $_aSection[ '_tag_id' ]            = 'section-'.$_aSection[ 'section_id' ].'__'.$this->iIndex;
95
+        $_aSection[ '_tag_id_model' ]      = 'section-'.$_aSection[ 'section_id' ].'__'.'___i___';
96 96
         
97 97
         return $_aSection;
98 98
         
Please login to merge, or discard this patch.
form/_model/formatter/AdminPageFramework_Form_Model___Format_Fields.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@
 block discarded – undo
96 96
             // $aSubFields gets updated in the method
97 97
             $this->_fillRepeatableElements( $aField, $aSubFields, $mSavedValue );
98 98
                             
99
-             // $aSubFields gets updated in the method
99
+                // $aSubFields gets updated in the method
100 100
             $this->_fillSubFields( $aSubFields, $aFirstField );
101 101
 
102 102
             // Put them together
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     public function get() {
54 54
 
55 55
         // Get the set value(s)
56
-        $_mSavedValue    = $this->_getStoredInputFieldValue( 
56
+        $_mSavedValue = $this->_getStoredInputFieldValue( 
57 57
             $this->aField, 
58 58
             $this->aOptions 
59 59
         );
@@ -113,9 +113,9 @@  discard block
 block discarded – undo
113 113
              * @return      void
114 114
              */
115 115
             private function _divideMainAndSubFields( array $aField, array &$aFirstField, array &$aSubFields ) {
116
-                foreach( $aField as $_nsIndex => $_mFieldElement ) {
116
+                foreach ( $aField as $_nsIndex => $_mFieldElement ) {
117 117
                     if ( is_numeric( $_nsIndex ) ) {
118
-                        $aSubFields[] = $_mFieldElement;
118
+                        $aSubFields[ ] = $_mFieldElement;
119 119
                     } else {
120 120
                         $aFirstField[ $_nsIndex ] = $_mFieldElement;
121 121
                     }
@@ -133,12 +133,12 @@  discard block
 block discarded – undo
133 133
              * @return      void
134 134
              */
135 135
             private function _fillRepeatableElements( array $aField, array &$aSubFields, $mSavedValue ) {
136
-                if ( ! $aField[ 'repeatable' ] ) {
136
+                if ( !$aField[ 'repeatable' ] ) {
137 137
                     return;
138 138
                 }
139 139
                 $_aSavedValues = ( array ) $mSavedValue;
140 140
                 unset( $_aSavedValues[ 0 ] );
141
-                foreach( $_aSavedValues as $_iIndex => $vValue ) {
141
+                foreach ( $_aSavedValues as $_iIndex => $vValue ) {
142 142
                     $aSubFields[ $_iIndex - 1 ] = isset( $aSubFields[ $_iIndex - 1 ] ) && is_array( $aSubFields[ $_iIndex - 1 ] ) 
143 143
                         ? $aSubFields[ $_iIndex - 1 ] 
144 144
                         : array();     
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
              */
154 154
             private function _fillSubFields( array &$aSubFields, array $aFirstField ) {
155 155
                         
156
-                foreach( $aSubFields as &$_aSubField ) {
156
+                foreach ( $aSubFields as &$_aSubField ) {
157 157
                     
158 158
                     // Evacuate the label element which should not be merged.
159 159
                     $_aLabel = $this->getElement( 
@@ -181,13 +181,13 @@  discard block
 block discarded – undo
181 181
          
182 182
             // Determine whether the elements are saved in an array.
183 183
             $_bHasSubFields = count( $aFields ) > 1 || $aField[ 'repeatable' ] || $aField[ 'sortable' ];
184
-            if ( ! $_bHasSubFields ) {
184
+            if ( !$_bHasSubFields ) {
185 185
                 $aFields[ 0 ][ '_saved_value' ] = $mSavedValue;
186 186
                 $aFields[ 0 ][ '_is_multiple_fields' ] = false;
187 187
                 return;                    
188 188
             }
189 189
      
190
-            foreach( $aFields as $_iIndex => &$_aThisField ) {
190
+            foreach ( $aFields as $_iIndex => &$_aThisField ) {
191 191
                 $_aThisField[ '_saved_value' ] = $this->getElement( $mSavedValue, $_iIndex, null );
192 192
                 $_aThisField[ '_is_multiple_fields' ] = true;
193 193
             }
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
          * @since       3.6.0       Moved from `AdminPageFramework_FieldDefinition`.
202 202
          */
203 203
         private function _setFieldsValue( array &$aFields ) {
204
-            foreach( $aFields as &$_aField ) {
204
+            foreach ( $aFields as &$_aField ) {
205 205
                 $_aField[ '_is_value_set_by_user' ] = isset( $_aField[ 'value' ] );
206 206
                 $_aField[ 'value' ]                 = $this->_getSetFieldValue( $_aField );
207 207
             }
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
         private function _getStoredInputFieldValue( $aField, $aOptions ) {    
243 243
 
244 244
             // If a section is not set, check the first dimension element.
245
-            if ( ! isset( $aField[ 'section_id' ] ) || '_default' === $aField[ 'section_id' ] ) {
245
+            if ( !isset( $aField[ 'section_id' ] ) || '_default' === $aField[ 'section_id' ] ) {
246 246
                 return $this->getElement( 
247 247
                     $aOptions, 
248 248
                     $aField[ 'field_id' ],
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -239,7 +239,7 @@
 block discarded – undo
239 239
          * @since       3.6.0       Moved from `AdminPageFramework_FieldDefinition`.
240 240
          * @since       DEVVER      Changed the `_field_type` element to `_structure_type`.
241 241
          */
242
-        private function _getStoredInputFieldValue( $aField, $aOptions ) {    
242
+        private function _getStoredInputFieldValue( $aField, $aOptions ) {
243 243
 
244 244
             // If a section is not set, check the first dimension element.
245 245
             if ( ! isset( $aField[ 'section_id' ] ) || '_default' === $aField[ 'section_id' ] ) {
Please login to merge, or discard this patch.