@@ -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(), |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $this->aAttributes, |
39 | 39 | $this->iFieldsCount, |
40 | 40 | ); |
41 | - $this->aArguments = $_aParameters[ 0 ]; |
|
41 | + $this->aArguments = $_aParameters[ 0 ]; |
|
42 | 42 | $this->aAttributes = $_aParameters[ 1 ]; |
43 | 43 | $this->iFieldsCount = $_aParameters[ 2 ]; |
44 | 44 | |
@@ -51,17 +51,17 @@ discard block |
||
51 | 51 | */ |
52 | 52 | protected function _getAttributes() { |
53 | 53 | return array( |
54 | - 'id' => $this->sContext . '-' . $this->aArguments[ 'tag_id' ], |
|
55 | - 'class' => 'admin-page-framework-' . $this->sContext |
|
56 | - . $this->getAOrB( ! empty( $this->aArguments[ 'repeatable' ] ), ' repeatable dynamic-fields', '' ) // 3.6.0+ Added the 'dynamic-fields' class selector. |
|
57 | - . $this->getAOrB( ! empty( $this->aArguments[ 'sortable' ] ), ' sortable dynamic-fields', '' ), |
|
54 | + 'id' => $this->sContext.'-'.$this->aArguments[ 'tag_id' ], |
|
55 | + 'class' => 'admin-page-framework-'.$this->sContext |
|
56 | + . $this->getAOrB( !empty( $this->aArguments[ 'repeatable' ] ), ' repeatable dynamic-fields', '' ) // 3.6.0+ Added the 'dynamic-fields' class selector. |
|
57 | + . $this->getAOrB( !empty( $this->aArguments[ 'sortable' ] ), ' sortable dynamic-fields', '' ), |
|
58 | 58 | |
59 | 59 | // referred by the sortable field JavaScript script. |
60 | 60 | 'data-type' => $this->aArguments[ 'type' ], |
61 | 61 | |
62 | 62 | // 3.6.0+ Stores the total number of dynamic fields, used to generate the input id and name of repeated fields which contain an incremented index number. |
63 | 63 | 'data-largest_index' => max( |
64 | - ( int ) $this->iFieldsCount - 1, // zero-base index |
|
64 | + ( int ) $this->iFieldsCount - 1, // zero-base index |
|
65 | 65 | 0 |
66 | 66 | ), // convert negative numbers to zero. |
67 | 67 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * |
25 | 25 | * @since 3.6.0 |
26 | 26 | */ |
27 | - public $sContext = 'fieldset'; |
|
27 | + public $sContext = 'fieldset'; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Returns an attribute array. |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | */ |
33 | 33 | protected function _getAttributes() { |
34 | 34 | return array( |
35 | - 'id' => $this->sContext . '-' . $this->aArguments[ 'tag_id' ], |
|
35 | + 'id' => $this->sContext.'-'.$this->aArguments[ 'tag_id' ], |
|
36 | 36 | 'class' => implode( |
37 | 37 | ' ', |
38 | 38 | array( |
39 | - 'admin-page-framework-' . $this->sContext, |
|
39 | + 'admin-page-framework-'.$this->sContext, |
|
40 | 40 | $this->_getSelectorForChildFieldset() |
41 | 41 | ) |
42 | 42 | ), |
@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | return ''; |
68 | 68 | } |
69 | 69 | if ( $this->aArguments[ '_nested_depth' ] == 1 ) { |
70 | - return 'child-fieldset nested-depth-' . $this->aArguments[ '_nested_depth' ]; |
|
70 | + return 'child-fieldset nested-depth-'.$this->aArguments[ '_nested_depth' ]; |
|
71 | 71 | } |
72 | - return 'child-fieldset multiple-nesting nested-depth-' . $this->aArguments[ '_nested_depth' ]; |
|
72 | + return 'child-fieldset multiple-nesting nested-depth-'.$this->aArguments[ '_nested_depth' ]; |
|
73 | 73 | |
74 | 74 | } |
75 | 75 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @param object $oForm |
31 | 31 | * @param string $sHeadActionHook The action hook triggered inside the `<head>` tag. For front-end forms, use `wp_head`. |
32 | 32 | */ |
33 | - public function __construct( $oForm, $sHeadActionHook='admin_head' ) { |
|
33 | + public function __construct( $oForm, $sHeadActionHook = 'admin_head' ) { |
|
34 | 34 | |
35 | 35 | $this->oForm = $oForm; |
36 | 36 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * as multiple instances of the factory class is loaded among separate pages, |
55 | 55 | * one gets denied here and if it can load earlier than the one which should insert the below script. |
56 | 56 | */ |
57 | - if ( ! $this->oForm->isInThePage() ) { |
|
57 | + if ( !$this->oForm->isInThePage() ) { |
|
58 | 58 | return; |
59 | 59 | } |
60 | 60 | |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | private function _getScripts_RequiredInHead() { |
78 | 78 | return 'document.write( "<style class=\'admin-page-framework-js-embedded-internal-style\'>' |
79 | 79 | . str_replace( |
80 | - '\\n', // search |
|
81 | - '', // replace |
|
80 | + '\\n', // search |
|
81 | + '', // replace |
|
82 | 82 | esc_js( $this->_getInternalCSS() ) // subject |
83 | 83 | ) |
84 | 84 | . '</style>" );'; |
@@ -40,7 +40,7 @@ |
||
40 | 40 | // Widgets can be called multiple times for the number of user-created widget instances for one class instance |
41 | 41 | // so make sure it is processed only once per page. |
42 | 42 | if ( $this->hasBeenCalled( 'resource_' . $oForm->aArguments[ 'caller_id' ] ) ) { |
43 | - return; |
|
43 | + return; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | $this->_setHooks(); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | // Widgets can be called multiple times for the number of user-created widget instances for one class instance |
41 | 41 | // so make sure it is processed only once per page. |
42 | - if ( $this->hasBeenCalled( 'resource_' . $oForm->aArguments[ 'caller_id' ] ) ) { |
|
42 | + if ( $this->hasBeenCalled( 'resource_'.$oForm->aArguments[ 'caller_id' ] ) ) { |
|
43 | 43 | return; |
44 | 44 | } |
45 | 45 | |
@@ -112,12 +112,12 @@ discard block |
||
112 | 112 | * @since 3.7.0 |
113 | 113 | */ |
114 | 114 | public function _replyToEnqueueScripts() { |
115 | - if ( ! $this->oForm->isInThePage() ) { |
|
115 | + if ( !$this->oForm->isInThePage() ) { |
|
116 | 116 | return; |
117 | 117 | } |
118 | - foreach( $this->oForm->getResources( 'src_scripts' ) as $_isIndex => $_asEnqueue ) { |
|
118 | + foreach ( $this->oForm->getResources( 'src_scripts' ) as $_isIndex => $_asEnqueue ) { |
|
119 | 119 | $this->_enqueueScript( $_asEnqueue ); |
120 | - $this->oForm->unsetResources( array( 'src_scripts', $_isIndex ) ); // no longer needed |
|
120 | + $this->oForm->unsetResources( array( 'src_scripts', $_isIndex ) ); // no longer needed |
|
121 | 121 | } |
122 | 122 | } |
123 | 123 | /** |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | private function _getFormattedEnqueueScript( $asEnqueue ) { |
165 | 165 | static $_iCallCount = 1; |
166 | 166 | $_aEnqueueItem = $this->getAsArray( $asEnqueue ) + array( |
167 | - 'handle_id' => 'script_form_' . $this->oForm->aArguments[ 'caller_id' ] . '_' . $_iCallCount, |
|
167 | + 'handle_id' => 'script_form_'.$this->oForm->aArguments[ 'caller_id' ].'_'.$_iCallCount, |
|
168 | 168 | 'src' => null, |
169 | 169 | 'dependencies' => null, |
170 | 170 | 'version' => null, |
@@ -187,10 +187,10 @@ discard block |
||
187 | 187 | */ |
188 | 188 | public function _replyToEnqueueStyles() { |
189 | 189 | |
190 | - if ( ! $this->oForm->isInThePage() ) { |
|
190 | + if ( !$this->oForm->isInThePage() ) { |
|
191 | 191 | return; |
192 | 192 | } |
193 | - foreach( $this->oForm->getResources( 'src_styles' ) as $_isIndex => $_asEnqueueItem ) { |
|
193 | + foreach ( $this->oForm->getResources( 'src_styles' ) as $_isIndex => $_asEnqueueItem ) { |
|
194 | 194 | $this->_enqueueStyle( $_asEnqueueItem ); |
195 | 195 | $this->oForm->unsetResources( array( 'src_styles', $_isIndex ) ); // no longer needed |
196 | 196 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | private function _getFormattedEnqueueStyle( $asEnqueue ) { |
213 | 213 | static $_iCallCount = 1; |
214 | 214 | $_aEnqueueItem = $this->getAsArray( $asEnqueue ) + array( |
215 | - 'handle_id' => 'style_form_' . $this->oForm->aArguments[ 'caller_id' ] . '_' . $_iCallCount, |
|
215 | + 'handle_id' => 'style_form_'.$this->oForm->aArguments[ 'caller_id' ].'_'.$_iCallCount, |
|
216 | 216 | 'src' => null, |
217 | 217 | 'dependencies' => null, |
218 | 218 | 'version' => null, |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | */ |
237 | 237 | public function _replyToAddStyle() { |
238 | 238 | |
239 | - if ( ! $this->oForm->isInThePage() ) { |
|
239 | + if ( !$this->oForm->isInThePage() ) { |
|
240 | 240 | return; |
241 | 241 | } |
242 | 242 | $_sCSSRules = $this->_getFormattedInternalStyles( |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | */ |
279 | 279 | public function _replyToAddScript() { |
280 | 280 | |
281 | - if ( ! $this->oForm->isInThePage() ) { |
|
281 | + if ( !$this->oForm->isInThePage() ) { |
|
282 | 282 | return; |
283 | 283 | } |
284 | 284 |
@@ -23,13 +23,13 @@ |
||
23 | 23 | protected function _get() { |
24 | 24 | return $this->_getFormSectionRules(); |
25 | 25 | } |
26 | - /** |
|
27 | - * Returns the CSS rules for form fields. |
|
28 | - * |
|
29 | - * @since 3.4.0 |
|
30 | - * @since 3.7.0 Moved from `AdminPageFramework_CSS`. |
|
31 | - * @internal |
|
32 | - */ |
|
26 | + /** |
|
27 | + * Returns the CSS rules for form fields. |
|
28 | + * |
|
29 | + * @since 3.4.0 |
|
30 | + * @since 3.7.0 Moved from `AdminPageFramework_CSS`. |
|
31 | + * @internal |
|
32 | + */ |
|
33 | 33 | private function _getFormSectionRules() { |
34 | 34 | $_sCSSRules = <<<CSSRULES |
35 | 35 | /* Section Table */ |