@@ -94,10 +94,10 @@ |
||
94 | 94 | */ |
95 | 95 | static public function getEnabler( $sContainerTagID, $aSettings, $oMsg ) { |
96 | 96 | |
97 | - if ( empty( $aSettings ) ) { |
|
97 | + if ( empty( $aSettings ) ) { |
|
98 | 98 | return ''; |
99 | 99 | } |
100 | - if ( in_array( $sContainerTagID, self::$_aSetContainerIDsForSortableSections ) ) { |
|
100 | + if ( in_array( $sContainerTagID, self::$_aSetContainerIDsForSortableSections ) ) { |
|
101 | 101 | return ''; |
102 | 102 | } |
103 | 103 | self::$_aSetContainerIDsForSortableSections[ $sContainerTagID ] = $sContainerTagID; |
@@ -105,7 +105,7 @@ |
||
105 | 105 | new self( $oMsg ); |
106 | 106 | |
107 | 107 | // $aSettings = $this->getAsArray( $aSettings ); |
108 | - $_sScript = <<<JAVASCRIPTS |
|
108 | + $_sScript = <<<JAVASCRIPTS |
|
109 | 109 | jQuery( document ).ready( function() { |
110 | 110 | jQuery( '#{$sContainerTagID}' ).enableAdminPageFrameworkSortableSections( '{$sContainerTagID}' ); |
111 | 111 | }); |
@@ -61,7 +61,7 @@ |
||
61 | 61 | */ |
62 | 62 | private function _getCollapsibleSectionTitleBlock( array $aCollapsible, $sContainer='sections', $iSectionIndex=null ) { |
63 | 63 | |
64 | - if ( $sContainer !== $aCollapsible[ 'container' ] ) { |
|
64 | + if ( $sContainer !== $aCollapsible[ 'container' ] ) { |
|
65 | 65 | return ''; |
66 | 66 | } |
67 | 67 |
@@ -18,17 +18,17 @@ discard block |
||
18 | 18 | */ |
19 | 19 | class AdminPageFramework_Form_View___CollapsibleSectionTitle extends AdminPageFramework_Form_View___SectionTitle { |
20 | 20 | |
21 | - public $aArguments = array( |
|
21 | + public $aArguments = array( |
|
22 | 22 | 'title' => null, |
23 | 23 | 'tag' => null, |
24 | 24 | 'section_index' => null, |
25 | 25 | 'collapsible' => array(), |
26 | 26 | 'container_type' => 'section', // section or sections |
27 | 27 | |
28 | - 'sectionset' => array(), // 3.7.0+ sectionset definition array |
|
28 | + 'sectionset' => array(), // 3.7.0+ sectionset definition array |
|
29 | 29 | |
30 | 30 | ); |
31 | - public $aFieldsets = array(); |
|
31 | + public $aFieldsets = array(); |
|
32 | 32 | public $aSavedData = array(); |
33 | 33 | public $aFieldErrors = array(); |
34 | 34 | public $aFieldTypeDefinitions = array(); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * @param array|boolean $aCollapsible The collapsible argument. |
63 | 63 | * @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. |
64 | 64 | */ |
65 | - private function _getCollapsibleSectionTitleBlock( array $aCollapsible, $sContainer='sections', $iSectionIndex=null ) { |
|
65 | + private function _getCollapsibleSectionTitleBlock( array $aCollapsible, $sContainer = 'sections', $iSectionIndex = null ) { |
|
66 | 66 | |
67 | 67 | if ( $sContainer !== $aCollapsible[ 'container' ] ) { |
68 | 68 | return ''; |
@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | ); |
79 | 79 | |
80 | 80 | $_aSectionset = $this->aArguments[ 'sectionset' ]; |
81 | - $_sSectionTitleTagID = str_replace( '|', '_', $_aSectionset[ '_section_path' ] ) . '_' . $iSectionIndex; |
|
81 | + $_sSectionTitleTagID = str_replace( '|', '_', $_aSectionset[ '_section_path' ] ).'_'.$iSectionIndex; |
|
82 | 82 | |
83 | 83 | return $this->_getCollapsibleSectionsEnablerScript() |
84 | - . "<div " . $this->getAttributes( |
|
84 | + . "<div ".$this->getAttributes( |
|
85 | 85 | array( |
86 | 86 | 'id' => $_sSectionTitleTagID, |
87 | 87 | 'class' => $this->getClassAttribute( |
@@ -102,11 +102,11 @@ discard block |
||
102 | 102 | 'collapsed', |
103 | 103 | '' |
104 | 104 | ), |
105 | - 'admin-page-framework-collapsible-type-' . $aCollapsible[ 'type' ] |
|
105 | + 'admin-page-framework-collapsible-type-'.$aCollapsible[ 'type' ] |
|
106 | 106 | ), |
107 | 107 | ) |
108 | 108 | + $this->getDataAttributeArray( $aCollapsible ) |
109 | - ) . ">" |
|
109 | + ).">" |
|
110 | 110 | . $_sSectionTitle |
111 | 111 | . "</div>"; |
112 | 112 |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | $_aParameters = func_get_args() + array( |
34 | 34 | $this->aFieldset, |
35 | - $this->aSavedData, // passed by reference. @todo: examine why it needs to be passed by reference. |
|
35 | + $this->aSavedData, // passed by reference. @todo: examine why it needs to be passed by reference. |
|
36 | 36 | $this->aFieldErrors, |
37 | 37 | $this->aFieldTypeDefinitions, |
38 | 38 | $this->aCallbacks, // field output element callables. |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | return $this->_getFieldByContainer( |
72 | 72 | $aFieldset, |
73 | 73 | array( |
74 | - 'open_main' => "<div " . $_oFieldrowAttribute->get() . ">", |
|
74 | + 'open_main' => "<div ".$_oFieldrowAttribute->get().">", |
|
75 | 75 | 'close_main' => "</div>", |
76 | 76 | ) |
77 | 77 | ); |
@@ -61,7 +61,7 @@ |
||
61 | 61 | |
62 | 62 | $aFieldset = $this->aFieldset; |
63 | 63 | |
64 | - if ( 'section_title' === $aFieldset[ 'type' ] ) { |
|
64 | + if ( 'section_title' === $aFieldset[ 'type' ] ) { |
|
65 | 65 | return ''; |
66 | 66 | } |
67 | 67 |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @return string |
58 | 58 | * @since DEVVER |
59 | 59 | */ |
60 | - public function get( $bTableRow=true ) { |
|
60 | + public function get( $bTableRow = true ) { |
|
61 | 61 | |
62 | 62 | $_sMethodName = $this->getAOrB( |
63 | 63 | $bTableRow, |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | ); |
67 | 67 | |
68 | 68 | $_aOutput = array(); |
69 | - foreach( $this->aFieldsetsPerSection as $_aFieldset ) { |
|
69 | + foreach ( $this->aFieldsetsPerSection as $_aFieldset ) { |
|
70 | 70 | |
71 | 71 | $_oFieldsetOutputFormatter = new AdminPageFramework_Form_Model___Format_FieldsetOutput( |
72 | 72 | $_aFieldset, |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $this->aFieldTypeDefinitions |
75 | 75 | ); |
76 | 76 | |
77 | - $_aOutput[] = call_user_func_array( |
|
77 | + $_aOutput[ ] = call_user_func_array( |
|
78 | 78 | array( $this, $_sMethodName ), |
79 | 79 | array( $_oFieldsetOutputFormatter->get() ) |
80 | 80 | ); |
@@ -76,15 +76,15 @@ discard block |
||
76 | 76 | $_oSectionTableBodyAttributes = new AdminPageFramework_Form_View___Attribute_SectionTableBody( $this->aSectionset ); |
77 | 77 | |
78 | 78 | $_aOutput = array(); |
79 | - $_aOutput[] = "<table " . $_oSectionTableAttributes->get() . ">" |
|
79 | + $_aOutput[ ] = "<table ".$_oSectionTableAttributes->get().">" |
|
80 | 80 | . $_oTableCaption->get() |
81 | - . "<tbody " . $_oSectionTableBodyAttributes->get() . ">" |
|
81 | + . "<tbody ".$_oSectionTableBodyAttributes->get().">" |
|
82 | 82 | . $this->_getSectionContent( $_iSectionIndex ) |
83 | 83 | . "</tbody>" |
84 | 84 | . "</table>"; |
85 | 85 | |
86 | - $_oSectionTableContainerAttributes = new AdminPageFramework_Form_View___Attribute_SectionTableContainer( $this->aSectionset ); |
|
87 | - return "<div " . $_oSectionTableContainerAttributes->get() . ">" |
|
86 | + $_oSectionTableContainerAttributes = new AdminPageFramework_Form_View___Attribute_SectionTableContainer( $this->aSectionset ); |
|
87 | + return "<div ".$_oSectionTableContainerAttributes->get().">" |
|
88 | 88 | . implode( PHP_EOL, $_aOutput ) |
89 | 89 | . "</div>"; |
90 | 90 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | // Retrieve the formatted sectionsets of the content. |
145 | 145 | $_sSectionPath = $this->aSectionset[ '_section_path' ]; |
146 | 146 | $_aSectionsets = $this->aStructure[ 'sectionsets' ]; |
147 | - if ( ! isset( $_aSectionsets[ $_sSectionPath ] ) ) { // @todo not sure what this check is for |
|
147 | + if ( !isset( $_aSectionsets[ $_sSectionPath ] ) ) { // @todo not sure what this check is for |
|
148 | 148 | return ''; |
149 | 149 | } |
150 | 150 | |
@@ -195,14 +195,14 @@ discard block |
||
195 | 195 | $_aNestedSectionPaths = array(); |
196 | 196 | |
197 | 197 | // List the section paths of the direct children |
198 | - foreach( $aNestedSctionsets as $_aNestedSectionset ) { |
|
199 | - $_sThisSectionPath = $sSubjectSectionPath . '|' . $_aNestedSectionset[ 'section_id' ]; |
|
198 | + foreach ( $aNestedSctionsets as $_aNestedSectionset ) { |
|
199 | + $_sThisSectionPath = $sSubjectSectionPath.'|'.$_aNestedSectionset[ 'section_id' ]; |
|
200 | 200 | $_aNestedSectionPaths[ $_sThisSectionPath ] = $_sThisSectionPath; |
201 | 201 | } |
202 | 202 | |
203 | 203 | // Now we need children's children. |
204 | 204 | $_aChildSectionPaths = array(); |
205 | - foreach( $_aNestedSectionPaths as $_sNestedSectionPath ) { |
|
205 | + foreach ( $_aNestedSectionPaths as $_sNestedSectionPath ) { |
|
206 | 206 | $_aNestedSectionsets = $this->getElementAsArray( |
207 | 207 | $aSectionsets, |
208 | 208 | array( $_sNestedSectionPath, 'content' ) |
@@ -144,7 +144,8 @@ |
||
144 | 144 | // Retrieve the formatted sectionsets of the content. |
145 | 145 | $_sSectionPath = $this->aSectionset[ '_section_path' ]; |
146 | 146 | $_aSectionsets = $this->aStructure[ 'sectionsets' ]; |
147 | - if ( ! isset( $_aSectionsets[ $_sSectionPath ] ) ) { // @todo not sure what this check is for |
|
147 | + if ( ! isset( $_aSectionsets[ $_sSectionPath ] ) ) { |
|
148 | +// @todo not sure what this check is for |
|
148 | 149 | return ''; |
149 | 150 | } |
150 | 151 |
@@ -236,7 +236,7 @@ |
||
236 | 236 | */ |
237 | 237 | private function _shouldShowCaptionTitle( $aSectionset, $iSectionIndex ) { |
238 | 238 | |
239 | - if ( ! $aSectionset[ 'title' ] ){ |
|
239 | + if ( ! $aSectionset[ 'title' ] ) { |
|
240 | 240 | return false; |
241 | 241 | } |
242 | 242 | if ( $aSectionset[ 'collapsible' ] ) { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | private function _getCaption( array $aSectionset, $iSectionIndex, $aFieldsets, $aFieldErrors, $aFieldTypeDefinitions, $aCallbacks, $oMsg ) { |
81 | 81 | |
82 | - if ( ! $aSectionset[ 'description' ] && ! $aSectionset[ 'title' ] ) { |
|
82 | + if ( !$aSectionset[ 'description' ] && !$aSectionset[ 'title' ] ) { |
|
83 | 83 | return "<caption class='admin-page-framework-section-caption' style='display:none;'></caption>"; |
84 | 84 | } |
85 | 85 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | 'collapsible' => $_abCollapsible, |
103 | 103 | 'container_type' => 'section', // section or sections |
104 | 104 | |
105 | - 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
105 | + 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
106 | 106 | ), |
107 | 107 | $aFieldsets, |
108 | 108 | $this->aSavedData, |
@@ -112,15 +112,15 @@ discard block |
||
112 | 112 | $aCallbacks // field output element callables. |
113 | 113 | ); |
114 | 114 | |
115 | - $_bShowTitle = empty( $_abCollapsible ) && ! $aSectionset[ 'section_tab_slug' ]; |
|
115 | + $_bShowTitle = empty( $_abCollapsible ) && !$aSectionset[ 'section_tab_slug' ]; |
|
116 | 116 | return |
117 | - "<caption " . $this->getAttributes( |
|
117 | + "<caption ".$this->getAttributes( |
|
118 | 118 | array( |
119 | 119 | 'class' => 'admin-page-framework-section-caption', |
120 | 120 | // data-section_tab is referred by the repeater script to hide/show the title and the description |
121 | 121 | 'data-section_tab' => $aSectionset[ 'section_tab_slug' ], |
122 | 122 | ) |
123 | - ) . ">" |
|
123 | + ).">" |
|
124 | 124 | . $_oCollapsibleSectionTitle->get() |
125 | 125 | . $this->getAOrB( |
126 | 126 | $_bShowTitle, |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | 'tag' => 'h3', |
175 | 175 | 'section_index' => $iSectionIndex, |
176 | 176 | |
177 | - 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
177 | + 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
178 | 178 | ), |
179 | 179 | $aFieldsets, |
180 | 180 | $this->aSavedData, |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $this->oMsg, |
184 | 184 | $this->aCallbacks // field output element callables. |
185 | 185 | ); |
186 | - return "<div " . $this->getAttributes( |
|
186 | + return "<div ".$this->getAttributes( |
|
187 | 187 | array( |
188 | 188 | 'class' => 'admin-page-framework-section-title', |
189 | 189 | 'style' => $this->getAOrB( |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | 'display: none;' |
193 | 193 | ), |
194 | 194 | ) |
195 | - ). ">" |
|
195 | + ).">" |
|
196 | 196 | . $_oSectionTitle->get() |
197 | 197 | . "</div>"; |
198 | 198 | } |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | if ( $aSectionset[ 'collapsible' ] ) { |
209 | 209 | return ''; |
210 | 210 | } |
211 | - if ( ! is_callable( $hfSectionCallback ) ) { |
|
211 | + if ( !is_callable( $hfSectionCallback ) ) { |
|
212 | 212 | return ''; |
213 | 213 | } |
214 | 214 | |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | */ |
241 | 241 | private function _shouldShowCaptionTitle( $aSectionset, $iSectionIndex ) { |
242 | 242 | |
243 | - if ( ! $aSectionset[ 'title' ] ){ |
|
243 | + if ( !$aSectionset[ 'title' ] ) { |
|
244 | 244 | return false; |
245 | 245 | } |
246 | 246 | if ( $aSectionset[ 'collapsible' ] ) { |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | * @since DEVVER Changed the name from `AdminPageFramework_FormPart_SectionTitle`. |
17 | 17 | * @internal |
18 | 18 | */ |
19 | -class AdminPageFramework_Form_View___SectionTitle extends AdminPageFramework_Form_View___Section_Base { |
|
19 | +class AdminPageFramework_Form_View___SectionTitle extends AdminPageFramework_Form_View___Section_Base { |
|
20 | 20 | |
21 | 21 | public $aArguments = array( |
22 | 22 | 'title' => null, |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | * @since 3.6.0 Added the `$iSectionIndex` parameter. Added the `$aFieldTypeDefinitions` parameter. |
105 | 105 | * @since DEVVER Moved from `AdminPageFramework_FormPart_SectionTitle`. |
106 | 106 | */ |
107 | - private function _getSectionTitleField( array $aFieldsetsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
|
107 | + private function _getSectionTitleField( array $aFieldsetsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
|
108 | 108 | |
109 | 109 | foreach( $aFieldsetsets as $_aFieldsetset ) { |
110 | 110 |
@@ -18,14 +18,14 @@ discard block |
||
18 | 18 | */ |
19 | 19 | class AdminPageFramework_Form_View___SectionTitle extends AdminPageFramework_Form_View___Section_Base { |
20 | 20 | |
21 | - public $aArguments = array( |
|
21 | + public $aArguments = array( |
|
22 | 22 | 'title' => null, |
23 | 23 | 'tag' => null, |
24 | 24 | 'section_index' => null, |
25 | 25 | |
26 | 26 | 'sectionset' => array(), |
27 | 27 | ); |
28 | - public $aFieldsets = array(); |
|
28 | + public $aFieldsets = array(); |
|
29 | 29 | public $aSavedData = array(); |
30 | 30 | public $aFieldErrors = array(); |
31 | 31 | public $aFieldTypeDefinitions = array(); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | private function _getToolTip() { |
84 | 84 | |
85 | 85 | $_aSectionset = $this->aArguments[ 'sectionset' ]; |
86 | - $_sSectionTitleTagID = str_replace( '|', '_', $_aSectionset[ '_section_path' ] ) . '_' . $this->aArguments[ 'section_index' ]; |
|
86 | + $_sSectionTitleTagID = str_replace( '|', '_', $_aSectionset[ '_section_path' ] ).'_'.$this->aArguments[ 'section_index' ]; |
|
87 | 87 | $_oToolTip = new AdminPageFramework_Form_View___ToolTip( |
88 | 88 | $_aSectionset[ 'tip' ], |
89 | 89 | $_sSectionTitleTagID |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * @since DEVVER Moved from `AdminPageFramework_FormPart_SectionTitle`. |
103 | 103 | * @return string The section title output. |
104 | 104 | */ |
105 | - protected function _getSectionTitle( $sTitle, $sTag, $aFieldsets, $iSectionIndex=null, $aFieldTypeDefinitions=array(), $aCollapsible=array() ) { |
|
105 | + protected function _getSectionTitle( $sTitle, $sTag, $aFieldsets, $iSectionIndex = null, $aFieldTypeDefinitions = array(), $aCollapsible = array() ) { |
|
106 | 106 | |
107 | 107 | $_aSectionTitleField = $this->_getSectionTitleField( $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ); |
108 | 108 | return $_aSectionTitleField |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | private function _getSectionTitleField( array $aFieldsetsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
141 | 141 | |
142 | - foreach( $aFieldsetsets as $_aFieldsetset ) { |
|
142 | + foreach ( $aFieldsetsets as $_aFieldsetset ) { |
|
143 | 143 | |
144 | 144 | if ( 'section_title' !== $_aFieldsetset[ 'type' ] ) { |
145 | 145 | continue; |
@@ -54,13 +54,13 @@ |
||
54 | 54 | public function getFieldsetOutput( $aFieldset ) { |
55 | 55 | |
56 | 56 | // Check if the field is visible |
57 | - if ( ! $this->isFieldsetVisible( $aFieldset ) ) { |
|
57 | + if ( !$this->isFieldsetVisible( $aFieldset ) ) { |
|
58 | 58 | return ''; |
59 | 59 | } |
60 | 60 | |
61 | 61 | $_oFieldset = new AdminPageFramework_Form_View___Fieldset( |
62 | 62 | $aFieldset, |
63 | - $this->aSavedData, // passed by reference. @todo: examine why it needs to be passed by reference. |
|
63 | + $this->aSavedData, // passed by reference. @todo: examine why it needs to be passed by reference. |
|
64 | 64 | $this->aFieldErrors, |
65 | 65 | $this->aFieldTypeDefinitions, |
66 | 66 | $this->oMsg, |
@@ -54,7 +54,7 @@ |
||
54 | 54 | public function getFieldsetOutput( $aFieldset ) { |
55 | 55 | |
56 | 56 | // Check if the field is visible |
57 | - if ( ! $this->isFieldsetVisible( $aFieldset ) ) { |
|
57 | + if ( ! $this->isFieldsetVisible( $aFieldset ) ) { |
|
58 | 58 | return ''; |
59 | 59 | } |
60 | 60 |
@@ -531,7 +531,7 @@ |
||
531 | 531 | * @return string The generated section tab list as HTML. |
532 | 532 | */ |
533 | 533 | private function _getSectionTabList( $sSectionTabSlug, array $aSectionTabList ) { |
534 | - return $sSectionTabSlug |
|
534 | + return $sSectionTabSlug |
|
535 | 535 | ? "<ul class='admin-page-framework-section-tabs nav-tab-wrapper'>" |
536 | 536 | . implode( PHP_EOL, $aSectionTabList ) |
537 | 537 | . "</ul>" |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | private function _getSectionsetsTables( array $aSectionsets, array $aFieldsets, array $aCallbacks ) { |
205 | 205 | |
206 | 206 | |
207 | - if ( empty( $aSectionsets ) ) { |
|
207 | + if ( empty( $aSectionsets ) ) { |
|
208 | 208 | return ''; |
209 | 209 | } |
210 | 210 | |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | * Changed the visibility scope to private. Changed the 1st parameter from `$aSection`. |
259 | 259 | * @return array |
260 | 260 | */ |
261 | - private function _getCollapsibleArgumentForSections( array $aSectionset=array() ) { |
|
261 | + private function _getCollapsibleArgumentForSections( array $aSectionset=array() ) { |
|
262 | 262 | |
263 | 263 | $_oArgumentFormater = new AdminPageFramework_Form_Model___Format_CollapsibleSection( |
264 | 264 | $aSectionset[ 'collapsible' ], |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | |
364 | 364 | // Get the section tables. |
365 | 365 | $_aSubSections = $this->numerizeElements( $_aSubSections ); // will include the main section as well. |
366 | - foreach( $_aSubSections as $_iIndex => $_aFields ) { |
|
366 | + foreach( $_aSubSections as $_iIndex => $_aFields ) { |
|
367 | 367 | |
368 | 368 | $_oEachSectionArguments = new AdminPageFramework_Form_Model___Format_EachSection( |
369 | 369 | $_aSection, |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | */ |
429 | 429 | private function _getUnsetFlagSectionInputTag( array $aSection ) { |
430 | 430 | |
431 | - if ( false !== $aSection[ 'save' ] ) { |
|
431 | + if ( false !== $aSection[ 'save' ] ) { |
|
432 | 432 | return ''; |
433 | 433 | } |
434 | 434 | return $this->getHTMLTag( |
@@ -161,6 +161,7 @@ discard block |
||
161 | 161 | } |
162 | 162 | /** |
163 | 163 | * @since DEVVER |
164 | + * @param string $_sOutput |
|
164 | 165 | * @return string |
165 | 166 | */ |
166 | 167 | private function _getSpinnerOutput( $_sOutput ) { |
@@ -297,7 +298,7 @@ discard block |
||
297 | 298 | * @param array $_aOutputs Holds output elements - contents, section tab list, count of subsections |
298 | 299 | * @param string $_sSectionsID The container id of secitons. |
299 | 300 | * @param array $_aSection |
300 | - * @param array $_aFieldsInSections A fieldsets array already divided by section tab. |
|
301 | + * @param array $aFieldsInSections A fieldsets array already divided by section tab. |
|
301 | 302 | * @return array The updated sections table output array. |
302 | 303 | */ |
303 | 304 | private function _getSectionsetTable( $_aOutputs, $_sSectionsID, array $_aSection, array $aFieldsInSections ) { |
@@ -351,6 +352,7 @@ discard block |
||
351 | 352 | } |
352 | 353 | /** |
353 | 354 | * @since DEVVER |
355 | + * @param string $_sSectionsID |
|
354 | 356 | * @return array |
355 | 357 | */ |
356 | 358 | private function _getSubSections( $_aOutputs, $_sSectionsID, $_aSection, $_aSubSections ) { |
@@ -499,6 +501,7 @@ discard block |
||
499 | 501 | * @since 3.5.3 |
500 | 502 | * @since 3.6.0 Removed the `$sSectionID` parameter. Added the `$aSectionset` parameter. |
501 | 503 | * @since DEVVER Moved from `AdminPageFramework_FormPart_Table`. |
504 | + * @param string $sSectionsID |
|
502 | 505 | * @return string The formatted sections table HTML output. |
503 | 506 | */ |
504 | 507 | private function _getFormattedSectionsTablesOutput( array $aOutputs, $aSectionset, $sSectionsID, array $aCollapsible, $sSectionTabSlug ) { |
@@ -126,16 +126,16 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function get() { |
128 | 128 | |
129 | - $_oFormatSectionsetsByTab = new AdminPageFramework_Form_View___Format_SectionsetsByTab( |
|
129 | + $_oFormatSectionsetsByTab = new AdminPageFramework_Form_View___Format_SectionsetsByTab( |
|
130 | 130 | $this->aStructure[ 'sectionsets' ], |
131 | 131 | $this->aStructure[ 'fieldsets' ], |
132 | 132 | $this->aArguments[ 'nested_depth' ] |
133 | 133 | ); |
134 | 134 | |
135 | - $_aOutput = array(); |
|
136 | - foreach( $_oFormatSectionsetsByTab->getTabs() as $_sSectionTabSlug ) { |
|
135 | + $_aOutput = array(); |
|
136 | + foreach ( $_oFormatSectionsetsByTab->getTabs() as $_sSectionTabSlug ) { |
|
137 | 137 | |
138 | - $_aOutput[] = $this->_getFormOutput( |
|
138 | + $_aOutput[ ] = $this->_getFormOutput( |
|
139 | 139 | $_oFormatSectionsetsByTab->getSectionsets( $_sSectionTabSlug ), |
140 | 140 | $_oFormatSectionsetsByTab->getFieldsets( $_sSectionTabSlug ), |
141 | 141 | $_sSectionTabSlug, |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | |
150 | 150 | // Generate id for this output |
151 | 151 | $_sOutput = implode( PHP_EOL, $_aOutput ); |
152 | - $_sElementID = "admin-page-framework-sectionsets-" . uniqid(); |
|
152 | + $_sElementID = "admin-page-framework-sectionsets-".uniqid(); |
|
153 | 153 | return $this->_getSpinnerOutput( $_sOutput ) |
154 | 154 | . "<div id='{$_sElementID}' class='admin-page-framework-sctionsets admin-page-framework-form-js-on'>" |
155 | 155 | . $_sOutput |
@@ -184,17 +184,17 @@ discard block |
||
184 | 184 | |
185 | 185 | // A sectionset is a set of sections. |
186 | 186 | $_sSectionSet = $this->_getSectionsetsTables( |
187 | - $aSectionsets, // sectionset definition (already devided by section tab) |
|
188 | - $aFieldsets, // fieldset definitions (already devided by section tab) |
|
187 | + $aSectionsets, // sectionset definition (already devided by section tab) |
|
188 | + $aFieldsets, // fieldset definitions (already devided by section tab) |
|
189 | 189 | $aCallbacks |
190 | 190 | ); |
191 | 191 | return $_sSectionSet |
192 | - ? "<div " . $this->getAttributes( |
|
192 | + ? "<div ".$this->getAttributes( |
|
193 | 193 | array( |
194 | 194 | 'class' => 'admin-page-framework-sectionset', |
195 | - 'id' => "sectionset-{$sSectionTabSlug}_" . md5( serialize( $aSectionsets ) ), |
|
195 | + 'id' => "sectionset-{$sSectionTabSlug}_".md5( serialize( $aSectionsets ) ), |
|
196 | 196 | ) |
197 | - ) . ">" |
|
197 | + ).">" |
|
198 | 198 | . $_sSectionSet |
199 | 199 | . "</div>" |
200 | 200 | : ''; |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | * If no fields belonging to the section, return empty. |
227 | 227 | * Otherwise, the sectionsets container gets rendered and its CSS rules such as margins give unwanted results. |
228 | 228 | */ |
229 | - if ( ! count( $aFieldsets ) ) { |
|
229 | + if ( !count( $aFieldsets ) ) { |
|
230 | 230 | return ''; |
231 | 231 | } |
232 | 232 | |
@@ -238,12 +238,12 @@ discard block |
||
238 | 238 | 'count_subsections' => 0, |
239 | 239 | ); |
240 | 240 | $_sThisSectionID = $_aFirstSectionset[ 'section_id' ]; |
241 | - $_sSectionsID = 'sections-' . $_sThisSectionID; |
|
241 | + $_sSectionsID = 'sections-'.$_sThisSectionID; |
|
242 | 242 | $_aCollapsible = $this->_getCollapsibleArgumentForSections( |
243 | 243 | $_aFirstSectionset |
244 | 244 | ); |
245 | 245 | |
246 | - foreach( $aSectionsets as $_aSectionset ) { |
|
246 | + foreach ( $aSectionsets as $_aSectionset ) { |
|
247 | 247 | |
248 | 248 | $_sSectionTabSlug = $_aSectionset[ 'section_tab_slug' ]; // needed outside the loop |
249 | 249 | $_aOutputs = $this->_getSectionsetTable( |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | * Changed the visibility scope to private. Changed the 1st parameter from `$aSection`. |
276 | 276 | * @return array |
277 | 277 | */ |
278 | - private function _getCollapsibleArgumentForSections( array $aSectionset=array() ) { |
|
278 | + private function _getCollapsibleArgumentForSections( array $aSectionset = array() ) { |
|
279 | 279 | |
280 | 280 | $_oArgumentFormater = new AdminPageFramework_Form_Model___Format_CollapsibleSection( |
281 | 281 | $aSectionset[ 'collapsible' ], |
@@ -304,17 +304,17 @@ discard block |
||
304 | 304 | */ |
305 | 305 | private function _getSectionsetTable( $_aOutputs, $_sSectionsID, array $_aSection, array $aFieldsInSections ) { |
306 | 306 | |
307 | - if ( ! $this->isSectionsetVisible( $_aSection ) ) { |
|
307 | + if ( !$this->isSectionsetVisible( $_aSection ) ) { |
|
308 | 308 | // var_dump( 'not visible: ' . $_aSection[ '_section_path' ] ); |
309 | 309 | return $_aOutputs; |
310 | 310 | } |
311 | 311 | |
312 | 312 | // If the 'save' argument is false, insert a flag that disables saving the section inputs. |
313 | - $_aOutputs[ 'section_contents' ][] = $this->_getUnsetFlagSectionInputTag( $_aSection ); |
|
313 | + $_aOutputs[ 'section_contents' ][ ] = $this->_getUnsetFlagSectionInputTag( $_aSection ); |
|
314 | 314 | |
315 | 315 | // For repeatable sections - sub-sections are divided field definition arrays by sub-section index, |
316 | 316 | // not section definition arrays. |
317 | - $_aSubSections = $this->getIntegerKeyElements( |
|
317 | + $_aSubSections = $this->getIntegerKeyElements( |
|
318 | 318 | $this->getElementAsArray( |
319 | 319 | $aFieldsInSections, // subject |
320 | 320 | $_aSection[ '_section_path' ], // $_aSection[ 'section_id' ], // dimensional key |
@@ -358,29 +358,29 @@ discard block |
||
358 | 358 | private function _getSubSections( $_aOutputs, $_sSectionsID, $_aSection, $_aSubSections ) { |
359 | 359 | |
360 | 360 | // Add the repeatable sections enabler script. |
361 | - if ( ! empty( $_aSection[ 'repeatable' ] ) ) { |
|
362 | - $_aOutputs[ 'section_contents' ][] = AdminPageFramework_Form_View___Script_RepeatableSection::getEnabler( |
|
361 | + if ( !empty( $_aSection[ 'repeatable' ] ) ) { |
|
362 | + $_aOutputs[ 'section_contents' ][ ] = AdminPageFramework_Form_View___Script_RepeatableSection::getEnabler( |
|
363 | 363 | $_sSectionsID, |
364 | 364 | $_aOutputs[ 'count_subsections' ], |
365 | 365 | $_aSection[ 'repeatable' ], |
366 | 366 | $this->oMsg |
367 | 367 | ); |
368 | - $_aOutputs[ 'section_contents' ][] = $this->_getRepeatableSectionFlagTag( $_aSection ); |
|
368 | + $_aOutputs[ 'section_contents' ][ ] = $this->_getRepeatableSectionFlagTag( $_aSection ); |
|
369 | 369 | } |
370 | 370 | // Add the sortable sections enabler script. 3.6.0+ |
371 | - if ( ! empty( $_aSection[ 'sortable' ] ) ) { |
|
371 | + if ( !empty( $_aSection[ 'sortable' ] ) ) { |
|
372 | 372 | // @todo Change the name of the class to AdminPageFramework_Form_Script_... |
373 | - $_aOutputs[ 'section_contents' ][] = AdminPageFramework_Form_View___Script_SortableSection::getEnabler( |
|
373 | + $_aOutputs[ 'section_contents' ][ ] = AdminPageFramework_Form_View___Script_SortableSection::getEnabler( |
|
374 | 374 | $_sSectionsID, |
375 | 375 | $_aSection[ 'sortable' ], |
376 | 376 | $this->oMsg |
377 | 377 | ); |
378 | - $_aOutputs[ 'section_contents' ][] = $this->_getSortableSectionFlagTag( $_aSection ); |
|
378 | + $_aOutputs[ 'section_contents' ][ ] = $this->_getSortableSectionFlagTag( $_aSection ); |
|
379 | 379 | } |
380 | 380 | |
381 | 381 | // Get the section tables. |
382 | 382 | $_aSubSections = $this->numerizeElements( $_aSubSections ); // will include the main section as well. |
383 | - foreach( $_aSubSections as $_iIndex => $_aFields ) { |
|
383 | + foreach ( $_aSubSections as $_iIndex => $_aFields ) { |
|
384 | 384 | |
385 | 385 | $_oEachSectionArguments = new AdminPageFramework_Form_Model___Format_EachSection( |
386 | 386 | $_aSection, |
@@ -410,8 +410,8 @@ discard block |
||
410 | 410 | array( |
411 | 411 | 'class' => 'element-address', |
412 | 412 | 'type' => 'hidden', |
413 | - 'name' => '__repeatable_elements_' . $aSection[ '_structure_type' ] |
|
414 | - . '[ ' . $aSection[ 'section_id' ] . ' ]', |
|
413 | + 'name' => '__repeatable_elements_'.$aSection[ '_structure_type' ] |
|
414 | + . '[ '.$aSection[ 'section_id' ].' ]', |
|
415 | 415 | // @todo examine whether this value should include a section index. |
416 | 416 | 'value' => $aSection[ 'section_id' ], |
417 | 417 | ) |
@@ -429,8 +429,8 @@ discard block |
||
429 | 429 | array( |
430 | 430 | 'class' => 'element-address', |
431 | 431 | 'type' => 'hidden', |
432 | - 'name' => '__sortable_elements_' . $aSection[ '_structure_type' ] |
|
433 | - . '[ ' . $aSection[ 'section_id' ] . ' ]', |
|
432 | + 'name' => '__sortable_elements_'.$aSection[ '_structure_type' ] |
|
433 | + . '[ '.$aSection[ 'section_id' ].' ]', |
|
434 | 434 | // @todo examine whether this value should include a section index. |
435 | 435 | 'value' => $aSection[ 'section_id' ], |
436 | 436 | ) |
@@ -452,8 +452,8 @@ discard block |
||
452 | 452 | 'input', |
453 | 453 | array( |
454 | 454 | 'type' => 'hidden', |
455 | - 'name' => '__unset_' . $aSection[ '_structure_type' ] . '[ ' . $aSection[ 'section_id' ] . ' ]', |
|
456 | - 'value' => "__dummy_option_key|" . $aSection[ 'section_id' ], |
|
455 | + 'name' => '__unset_'.$aSection[ '_structure_type' ].'[ '.$aSection[ 'section_id' ].' ]', |
|
456 | + 'value' => "__dummy_option_key|".$aSection[ 'section_id' ], |
|
457 | 457 | 'class' => 'unset-element-names element-address', |
458 | 458 | ) |
459 | 459 | ); |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | private function _getSectionTableWithTabList( array $_aOutputs, array $aSectionset, $aFieldsetsPerSection ) { |
470 | 470 | |
471 | 471 | // Tab list |
472 | - $_aOutputs[ 'section_tab_list' ][] = $this->_getTabList( |
|
472 | + $_aOutputs[ 'section_tab_list' ][ ] = $this->_getTabList( |
|
473 | 473 | $aSectionset, |
474 | 474 | $aFieldsetsPerSection, |
475 | 475 | $this->aCallbacks[ 'fieldset_output' ] |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | |
479 | 479 | // Section container |
480 | 480 | $_oSectionTable = new AdminPageFramework_Form_View___Section( |
481 | - $this->aArguments, // for nested sections |
|
481 | + $this->aArguments, // for nested sections |
|
482 | 482 | $aSectionset, |
483 | 483 | $this->aStructure, |
484 | 484 | $aFieldsetsPerSection, |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | $this->aCallbacks, |
489 | 489 | $this->oMsg |
490 | 490 | ); |
491 | - $_aOutputs[ 'section_contents' ][] = $_oSectionTable->get(); |
|
491 | + $_aOutputs[ 'section_contents' ][ ] = $_oSectionTable->get(); |
|
492 | 492 | |
493 | 493 | return $_aOutputs; |
494 | 494 | |
@@ -516,9 +516,9 @@ discard block |
||
516 | 516 | 'section_index' => null, |
517 | 517 | 'collapsible' => $aCollapsible, |
518 | 518 | 'container_type' => 'sections', // section or sections |
519 | - 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
519 | + 'sectionset' => $aSectionset, // 3.7.0+ for tooltip |
|
520 | 520 | ), |
521 | - array(), // fieldsets |
|
521 | + array(), // fieldsets |
|
522 | 522 | $this->aSavedData, |
523 | 523 | $this->aFieldErrors, |
524 | 524 | $this->aStructure[ 'field_type_definitions' ], |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | $aOutputs[ 'count_subsections' ] |
536 | 536 | ); |
537 | 537 | return $_oCollapsibleSectionTitle->get() |
538 | - . "<div " . $_oSectionsTablesContainerAttributes->get() . ">" |
|
538 | + . "<div ".$_oSectionsTablesContainerAttributes->get().">" |
|
539 | 539 | . $this->_getSectionTabList( $sSectionTabSlug, $aOutputs[ 'section_tab_list' ] ) |
540 | 540 | . implode( PHP_EOL, $aOutputs[ 'section_contents' ] ) |
541 | 541 | . "</div>"; |
@@ -566,21 +566,21 @@ discard block |
||
566 | 566 | */ |
567 | 567 | private function _getTabList( array $aSection, array $aFields, $hfFieldCallback ) { |
568 | 568 | |
569 | - if ( ! $aSection[ 'section_tab_slug' ] ) { |
|
569 | + if ( !$aSection[ 'section_tab_slug' ] ) { |
|
570 | 570 | return ''; |
571 | 571 | } |
572 | 572 | |
573 | 573 | $iSectionIndex = $aSection[ '_index' ]; |
574 | 574 | |
575 | - $_sSectionTagID = 'section-' . $aSection[ 'section_id' ] . '__' . $iSectionIndex; |
|
575 | + $_sSectionTagID = 'section-'.$aSection[ 'section_id' ].'__'.$iSectionIndex; |
|
576 | 576 | $_aTabAttributes = $aSection[ 'attributes' ][ 'tab' ] |
577 | 577 | + array( |
578 | 578 | 'class' => 'admin-page-framework-section-tab nav-tab', |
579 | 579 | 'id' => "section_tab-{$_sSectionTagID}", |
580 | 580 | 'style' => null |
581 | 581 | ); |
582 | - $_aTabAttributes[ 'class' ] = $this->getClassAttribute( $_aTabAttributes[ 'class' ], $aSection[ 'class' ][ 'tab' ] ); // 3.3.1+ |
|
583 | - $_aTabAttributes[ 'style' ] = $this->getStyleAttribute( $_aTabAttributes[ 'style' ], $aSection[ 'hidden' ] ? 'display:none' : null ); // 3.3.1+ |
|
582 | + $_aTabAttributes[ 'class' ] = $this->getClassAttribute( $_aTabAttributes[ 'class' ], $aSection[ 'class' ][ 'tab' ] ); // 3.3.1+ |
|
583 | + $_aTabAttributes[ 'style' ] = $this->getStyleAttribute( $_aTabAttributes[ 'style' ], $aSection[ 'hidden' ] ? 'display:none' : null ); // 3.3.1+ |
|
584 | 584 | |
585 | 585 | $_oSectionTitle = new AdminPageFramework_Form_View___SectionTitle( |
586 | 586 | array( |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | 'tag' => 'h4', |
589 | 589 | 'section_index' => $iSectionIndex, |
590 | 590 | |
591 | - 'sectionset' => $aSection, // 3.7.0+ for tooltip |
|
591 | + 'sectionset' => $aSection, // 3.7.0+ for tooltip |
|
592 | 592 | ), |
593 | 593 | $aFields, |
594 | 594 | $this->aSavedData, |
@@ -598,7 +598,7 @@ discard block |
||
598 | 598 | $this->aCallbacks // field output element callables. |
599 | 599 | ); |
600 | 600 | |
601 | - return "<li " . $this->getAttributes( $_aTabAttributes ) . ">" |
|
601 | + return "<li ".$this->getAttributes( $_aTabAttributes ).">" |
|
602 | 602 | . "<a href='#{$_sSectionTagID}'>" |
603 | 603 | . $_oSectionTitle->get() |
604 | 604 | ."</a>" |