@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | */ |
19 | 19 | class AdminPageFramework_Form_Model___SectionConditioner extends AdminPageFramework_FrameworkUtility { |
20 | 20 | |
21 | - public $aSectionsets = array(); |
|
21 | + public $aSectionsets = array(); |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Sets up hooks. |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $_aParameters = func_get_args() + array( |
30 | 30 | $this->aSectionsets, |
31 | 31 | ); |
32 | - $this->aSectionsets = $_aParameters[ 0 ]; |
|
32 | + $this->aSectionsets = $_aParameters[ 0 ]; |
|
33 | 33 | |
34 | 34 | } |
35 | 35 | |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | * @since 3.7.0 Moved from `AdminPageFramework_FormDefinition`. Changed the name from `getConditionedSections()`. |
52 | 52 | * @return array The conditioned sectionsets array. |
53 | 53 | */ |
54 | - private function _getSectionsConditioned( array $aSections=array() ) { |
|
54 | + private function _getSectionsConditioned( array $aSections = array() ) { |
|
55 | 55 | |
56 | - $_aNewSections = array(); |
|
57 | - foreach( $aSections as $_sSectionID => $_aSection ) { |
|
58 | - if ( ! $this->_isAllowed( $_aSection ) ) { |
|
56 | + $_aNewSections = array(); |
|
57 | + foreach ( $aSections as $_sSectionID => $_aSection ) { |
|
58 | + if ( !$this->_isAllowed( $_aSection ) ) { |
|
59 | 59 | continue; |
60 | 60 | } |
61 | 61 | $_aNewSections[ $_sSectionID ] = $_aSection; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | protected function _isAllowed( array $aDefinition ) { |
75 | 75 | |
76 | 76 | // Check capability. If the access level is not sufficient, skip. |
77 | - if ( ! current_user_can( $aDefinition[ 'capability' ] ) ) { |
|
77 | + if ( !current_user_can( $aDefinition[ 'capability' ] ) ) { |
|
78 | 78 | return false; |
79 | 79 | } |
80 | 80 | return ( boolean ) $aDefinition[ 'if' ]; |
@@ -58,23 +58,23 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function get() { |
60 | 60 | |
61 | - $this->aResources[ 'internal_scripts' ] = $this->_getUpdatedInternalItemsByCallback( |
|
61 | + $this->aResources[ 'internal_scripts' ] = $this->_getUpdatedInternalItemsByCallback( |
|
62 | 62 | $this->aResources[ 'internal_scripts' ], |
63 | 63 | 'hfGetScripts' |
64 | 64 | ); |
65 | - $this->aResources[ 'internal_styles' ] = $this->_getUpdatedInternalItemsByCallback( |
|
65 | + $this->aResources[ 'internal_styles' ] = $this->_getUpdatedInternalItemsByCallback( |
|
66 | 66 | $this->aResources[ 'internal_styles' ], |
67 | 67 | 'hfGetStyles' |
68 | 68 | ); |
69 | - $this->aResources[ 'internal_styles_ie' ] = $this->_getUpdatedInternalItemsByCallback( |
|
69 | + $this->aResources[ 'internal_styles_ie' ] = $this->_getUpdatedInternalItemsByCallback( |
|
70 | 70 | $this->aResources[ 'internal_styles_ie' ], |
71 | 71 | 'hfGetIEStyles' |
72 | 72 | ); |
73 | - $this->aResources[ 'src_styles' ] = $this->_getUpdatedEnqueuingItemsByCallback( |
|
73 | + $this->aResources[ 'src_styles' ] = $this->_getUpdatedEnqueuingItemsByCallback( |
|
74 | 74 | $this->aResources[ 'src_styles' ], |
75 | 75 | 'aEnqueueStyles' |
76 | 76 | ); |
77 | - $this->aResources[ 'src_scripts' ] = $this->_getUpdatedEnqueuingItemsByCallback( |
|
77 | + $this->aResources[ 'src_scripts' ] = $this->_getUpdatedEnqueuingItemsByCallback( |
|
78 | 78 | $this->aResources[ 'src_scripts' ], |
79 | 79 | 'aEnqueueScripts' |
80 | 80 | ); |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | */ |
89 | 89 | private function _getUpdatedInternalItemsByCallback( array $aSubject, $sKey ) { |
90 | 90 | $_oCallable = $this->getElement( $this->aFieldTypeDefinition, $sKey ); |
91 | - if ( ! is_callable( $_oCallable ) ) { |
|
91 | + if ( !is_callable( $_oCallable ) ) { |
|
92 | 92 | return $aSubject; |
93 | 93 | } |
94 | - $aSubject[] = call_user_func_array( |
|
94 | + $aSubject[ ] = call_user_func_array( |
|
95 | 95 | $_oCallable, |
96 | 96 | array() |
97 | 97 | ); |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | * @param string $sStructureType The type of object. Currently 'post_meta_box' or 'user_meta' is accepted. |
33 | 33 | * @return void |
34 | 34 | */ |
35 | - public function updateMetaDataByType( $iObjectID, array $aInput, array $aSavedMeta, $sStructureType='post_meta_box' ) { |
|
35 | + public function updateMetaDataByType( $iObjectID, array $aInput, array $aSavedMeta, $sStructureType = 'post_meta_box' ) { |
|
36 | 36 | |
37 | - if ( ! $iObjectID ) { |
|
37 | + if ( !$iObjectID ) { |
|
38 | 38 | return; |
39 | 39 | } |
40 | 40 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | 'user_meta' => 'update_user_meta', |
44 | 44 | 'term_meta' => 'update_term_meta', |
45 | 45 | ); |
46 | - if ( ! in_array( $sStructureType, array_keys( $_aFunctionNameMapByFieldsType ) ) ) { |
|
46 | + if ( !in_array( $sStructureType, array_keys( $_aFunctionNameMapByFieldsType ) ) ) { |
|
47 | 47 | return; |
48 | 48 | } |
49 | 49 | $_sFunctionName = $this->getElement( $_aFunctionNameMapByFieldsType, $sStructureType ); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | $_vSavedValue = $this->getElement( |
82 | 82 | $aSavedMeta, // subject |
83 | - $_sSectionOrFieldID, // dimensional keys |
|
83 | + $_sSectionOrFieldID, // dimensional keys |
|
84 | 84 | null // default value |
85 | 85 | ); |
86 | 86 |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | */ |
18 | 18 | class AdminPageFramework_Form_View___Attribute_SectionTable extends AdminPageFramework_Form_View___Attribute_Base { |
19 | 19 | |
20 | - public $sContext = 'section_table'; |
|
20 | + public $sContext = 'section_table'; |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * Returns an attribute array. |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | protected function _getAttributes() { |
29 | 29 | return array( |
30 | - 'id' => 'section_table-' . $this->aArguments[ '_tag_id' ], // 'section-' . $sSectionID . '__' . $iSectionIndex |
|
30 | + 'id' => 'section_table-'.$this->aArguments[ '_tag_id' ], // 'section-' . $sSectionID . '__' . $iSectionIndex |
|
31 | 31 | 'class' => $this->getClassAttribute( |
32 | 32 | 'form-table', |
33 | 33 | 'admin-page-framework-section-table' // referred by the collapsible section script |
@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | */ |
28 | 28 | protected function _getAttributes() { |
29 | 29 | |
30 | - $_aSectionAttributes = $this->uniteArrays( |
|
31 | - $this->dropElementsByType( $this->aArguments[ 'attributes' ] ), // remove elements of an array. |
|
30 | + $_aSectionAttributes = $this->uniteArrays( |
|
31 | + $this->dropElementsByType( $this->aArguments[ 'attributes' ] ), // remove elements of an array. |
|
32 | 32 | array( |
33 | 33 | 'id' => $this->aArguments[ '_tag_id' ], // section-{section id}__{index} |
34 | 34 | 'class' => $this->getClassAttribute( |
@@ -49,19 +49,19 @@ discard block |
||
49 | 49 | ) |
50 | 50 | ); |
51 | 51 | |
52 | - $_aSectionAttributes[ 'class' ] = $this->getClassAttribute( |
|
52 | + $_aSectionAttributes[ 'class' ] = $this->getClassAttribute( |
|
53 | 53 | $_aSectionAttributes[ 'class' ], |
54 | 54 | $this->dropElementsByType( $this->aArguments[ 'class' ] ) |
55 | - ); // 3.3.1+ |
|
55 | + ); // 3.3.1+ |
|
56 | 56 | |
57 | - $_aSectionAttributes[ 'style' ] = $this->getStyleAttribute( |
|
57 | + $_aSectionAttributes[ 'style' ] = $this->getStyleAttribute( |
|
58 | 58 | $_aSectionAttributes[ 'style' ], |
59 | 59 | $this->getAOrB( |
60 | 60 | $this->aArguments[ 'hidden' ], |
61 | 61 | 'display:none', |
62 | 62 | null |
63 | 63 | ) |
64 | - ); // 3.3.1+ |
|
64 | + ); // 3.3.1+ |
|
65 | 65 | |
66 | 66 | return $_aSectionAttributes; |
67 | 67 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | * |
26 | 26 | * @since 3.6.0 |
27 | 27 | */ |
28 | - public $sContext = ''; |
|
28 | + public $sContext = ''; |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * |
25 | 25 | * @since 3.6.0 |
26 | 26 | */ |
27 | - public $sContext = 'fieldrow'; |
|
27 | + public $sContext = 'fieldrow'; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * @return array The formatted attributes array. |
@@ -61,15 +61,15 @@ discard block |
||
61 | 61 | 'class' => $this->getClassAttribute( |
62 | 62 | 'admin-page-framework-sections', |
63 | 63 | $this->getAOrB( |
64 | - ! $this->sSectionTabSlug || '_default' === $this->sSectionTabSlug, |
|
64 | + !$this->sSectionTabSlug || '_default' === $this->sSectionTabSlug, |
|
65 | 65 | null, |
66 | 66 | 'admin-page-framework-section-tabs-contents' |
67 | 67 | ), |
68 | 68 | $this->getAOrB( |
69 | 69 | empty( $this->aCollapsible ), |
70 | 70 | null, |
71 | - 'admin-page-framework-collapsible-sections-content' . ' ' |
|
72 | - . 'admin-page-framework-collapsible-content' . ' ' |
|
71 | + 'admin-page-framework-collapsible-sections-content'.' ' |
|
72 | + . 'admin-page-framework-collapsible-content'.' ' |
|
73 | 73 | . 'accordion-section-content' |
74 | 74 | |
75 | 75 | ), |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | // 3.6.0+ - dimensional section address without the option key, used by the 'save' argument and when sorting dynamic elements. |
86 | 86 | 'data-section_address' => $this->aSectionset[ 'section_id' ], |
87 | - 'data-section_address_model' => $this->aSectionset[ 'section_id' ] . '|' . '___i___', |
|
87 | + 'data-section_address_model' => $this->aSectionset[ 'section_id' ].'|'.'___i___', |
|
88 | 88 | |
89 | 89 | ) |
90 | 90 | + $this->_getDynamicElementArguments( $this->aSectionset ); |
@@ -123,12 +123,12 @@ discard block |
||
123 | 123 | return array( |
124 | 124 | // 3.6.0+ Stores the total number of dynamic elements, used to generate the input id and name of repeated sections which contain an incremented index number. |
125 | 125 | 'data-largest_index' => max( |
126 | - ( int ) $this->iSubSectionCount - 1, // zero-base index |
|
126 | + ( int ) $this->iSubSectionCount - 1, // zero-base index |
|
127 | 127 | 0 |
128 | 128 | ), // convert negative numbers to zero. |
129 | 129 | |
130 | - 'data-section_id_model' => $aSectionset[ 'section_id' ] . '__' . '___i___', |
|
131 | - 'data-flat_section_name_model' => $aSectionset[ 'section_id' ] . '|___i___', |
|
130 | + 'data-section_id_model' => $aSectionset[ 'section_id' ].'__'.'___i___', |
|
131 | + 'data-flat_section_name_model' => $aSectionset[ 'section_id' ].'|___i___', |
|
132 | 132 | // @todo apply a callback |
133 | 133 | // 'data-section_name_model' => $aSectionset[ 'section_id' ] . '[___i___]', |
134 | 134 | 'data-section_name_model' => $_oSectionNameGenerator->getModel(), |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * |
25 | 25 | * @since 3.6.0 |
26 | 26 | */ |
27 | - public $sContext = 'field'; |
|
27 | + public $sContext = 'field'; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Returns the field container attribute array. |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | protected function _getAttributes() { |
41 | 41 | |
42 | 42 | // 3.8.0+ Supports omitting the `type` argument. |
43 | - $_sFieldTypeSelector = $this->getAOrB( |
|
43 | + $_sFieldTypeSelector = $this->getAOrB( |
|
44 | 44 | $this->aArguments[ 'type' ], |
45 | 45 | " admin-page-framework-field-{$this->aArguments[ 'type' ]}", |
46 | 46 | '' |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | return array( |
67 | 67 | 'id' => $this->aArguments[ '_field_container_id' ], |
68 | - 'data-type' => $this->aArguments[ 'type' ], // referred by the repeatable field JavaScript script. |
|
68 | + 'data-type' => $this->aArguments[ 'type' ], // referred by the repeatable field JavaScript script. |
|
69 | 69 | 'class' => "admin-page-framework-field{$_sFieldTypeSelector}{$_sNestedFieldSelector}{$_sMixedFieldSelector}{$_sChildFieldSelector}" |
70 | 70 | . $this->getAOrB( |
71 | 71 | $this->aArguments[ 'attributes' ][ 'disabled' ], |