@@ -73,7 +73,7 @@ |
||
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' ]; |
@@ -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' ]; |
@@ -81,7 +81,7 @@ |
||
81 | 81 | $this->oMsg, |
82 | 82 | false // `false` to disable auto-registering. |
83 | 83 | ); |
84 | - foreach( $_oFieldType->aFieldTypeSlugs as $_sSlug ) { |
|
84 | + foreach( $_oFieldType->aFieldTypeSlugs as $_sSlug ) { |
|
85 | 85 | $_aFieldTypeDefinitions[ $_sSlug ] = $_oFieldType->getDefinitionArray(); |
86 | 86 | } |
87 | 87 | } |
@@ -43,9 +43,9 @@ discard block |
||
43 | 43 | 'posttype', |
44 | 44 | 'size', |
45 | 45 | 'section_title', // 3.0.0+ |
46 | - 'system', // 3.3.0+ |
|
47 | - 'inline_mixed', // 3.8.0+ |
|
48 | - '_nested', // 3.8.0+ |
|
46 | + 'system', // 3.3.0+ |
|
47 | + 'inline_mixed', // 3.8.0+ |
|
48 | + '_nested', // 3.8.0+ |
|
49 | 49 | ); |
50 | 50 | |
51 | 51 | public $sCallerID = ''; |
@@ -75,16 +75,16 @@ discard block |
||
75 | 75 | public function get() { |
76 | 76 | |
77 | 77 | $_aFieldTypeDefinitions = array(); |
78 | - foreach( self::$_aDefaultFieldTypeSlugs as $_sFieldTypeSlug ) { |
|
78 | + foreach ( self::$_aDefaultFieldTypeSlugs as $_sFieldTypeSlug ) { |
|
79 | 79 | |
80 | 80 | $_sFieldTypeClassName = "AdminPageFramework_FieldType_{$_sFieldTypeSlug}"; |
81 | 81 | $_oFieldType = new $_sFieldTypeClassName( |
82 | - $this->sCallerID, // usually an instantiated class name |
|
83 | - null, // field type slugs - if it is different from the one defined in the class property |
|
82 | + $this->sCallerID, // usually an instantiated class name |
|
83 | + null, // field type slugs - if it is different from the one defined in the class property |
|
84 | 84 | $this->oMsg, |
85 | 85 | false // `false` to disable auto-registering. |
86 | 86 | ); |
87 | - foreach( $_oFieldType->aFieldTypeSlugs as $_sSlug ) { |
|
87 | + foreach ( $_oFieldType->aFieldTypeSlugs as $_sSlug ) { |
|
88 | 88 | $_aFieldTypeDefinitions[ $_sSlug ] = $_oFieldType->getDefinitionArray(); |
89 | 89 | } |
90 | 90 | } |
@@ -43,7 +43,7 @@ |
||
43 | 43 | * @since 2.1.5 |
44 | 44 | * @since 3.3.1 Changed from `_replyToGetStyles()`. |
45 | 45 | */ |
46 | - protected function getStyles() { |
|
46 | + protected function getStyles() { |
|
47 | 47 | return <<<CSSRULES |
48 | 48 | /* Text Field Type */ |
49 | 49 | .admin-page-framework-field.admin-page-framework-field-text > .admin-page-framework-input-label-container { |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | /** |
39 | 39 | * Defines the field type slugs used for this field type. |
40 | 40 | */ |
41 | - public $aFieldTypeSlugs = array( 'text', 'password', 'date', 'datetime', 'datetime-local', 'email', 'month', 'search', 'tel', 'url', 'week', ); |
|
41 | + public $aFieldTypeSlugs = array( 'text', 'password', 'date', 'datetime', 'datetime-local', 'email', 'month', 'search', 'tel', 'url', 'week',); |
|
42 | 42 | |
43 | 43 | /** |
44 | 44 | * Defines the default key-values of this field type. |
@@ -82,8 +82,8 @@ discard block |
||
82 | 82 | protected function getField( $aField ) { |
83 | 83 | |
84 | 84 | $_aOutput = array(); |
85 | - foreach( ( array ) $aField[ 'label' ] as $_sKey => $_sLabel ) { |
|
86 | - $_aOutput[] = $this->_getFieldOutputByLabel( |
|
85 | + foreach ( ( array ) $aField[ 'label' ] as $_sKey => $_sLabel ) { |
|
86 | + $_aOutput[ ] = $this->_getFieldOutputByLabel( |
|
87 | 87 | $_sKey, |
88 | 88 | $_sLabel, |
89 | 89 | $aField |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | // the repeatable field buttons will be replaced with this element. |
94 | - $_aOutput[] = "<div class='repeatable-field-buttons'></div>"; |
|
94 | + $_aOutput[ ] = "<div class='repeatable-field-buttons'></div>"; |
|
95 | 95 | return implode( '', $_aOutput ); |
96 | 96 | |
97 | 97 | } |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | $aField[ 'value' ] = $this->getElementByLabel( $aField[ 'value' ], $sKey, $aField[ 'label' ] ); |
112 | 112 | $_aInputAttributes = $_bIsArray |
113 | 113 | ? array( |
114 | - 'name' => $aField[ 'attributes' ][ 'name' ] . "[{$sKey}]", |
|
115 | - 'id' => $aField[ 'attributes' ][ 'id' ] . "_{$sKey}", |
|
114 | + 'name' => $aField[ 'attributes' ][ 'name' ]."[{$sKey}]", |
|
115 | + 'id' => $aField[ 'attributes' ][ 'id' ]."_{$sKey}", |
|
116 | 116 | 'value' => $aField[ 'value' ], |
117 | 117 | ) |
118 | 118 | + $this->getAsArray( |
@@ -120,17 +120,17 @@ discard block |
||
120 | 120 | ) // 3.8.6+ Allows the user to set individual attributes by label. |
121 | 121 | + $aField[ 'attributes' ] |
122 | 122 | : $aField[ 'attributes' ]; |
123 | - $_aOutput = array( |
|
123 | + $_aOutput = array( |
|
124 | 124 | $this->getElementByLabel( $aField[ 'before_label' ], $sKey, $aField[ 'label' ] ), |
125 | 125 | "<div class='admin-page-framework-input-label-container {$_sClassSelector}'>", |
126 | - "<label for='" . $_aInputAttributes[ 'id' ] . "'>", |
|
126 | + "<label for='".$_aInputAttributes[ 'id' ]."'>", |
|
127 | 127 | $this->getElementByLabel( $aField[ 'before_input' ], $sKey, $aField[ 'label' ] ), |
128 | 128 | $_sLabel |
129 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
129 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
130 | 130 | . $_sLabel |
131 | 131 | . "</span>" |
132 | 132 | : '', |
133 | - "<input " . $this->getAttributes( $_aInputAttributes ) . " />", |
|
133 | + "<input ".$this->getAttributes( $_aInputAttributes )." />", |
|
134 | 134 | $this->getElementByLabel( $aField[ 'after_input' ], $sKey, $aField[ 'label' ] ), |
135 | 135 | "</label>", |
136 | 136 | "</div>", |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | /** |
21 | 21 | * Defines the field type slugs used for this field type. |
22 | 22 | */ |
23 | - public $aFieldTypeSlugs = array( 'file', ); |
|
23 | + public $aFieldTypeSlugs = array( 'file',); |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * Defines the default key-values of this field type. |
@@ -76,15 +76,15 @@ discard block |
||
76 | 76 | array( |
77 | 77 | 'type' => 'hidden', |
78 | 78 | 'value' => '', |
79 | - 'name' => $aField[ 'attributes' ][ 'name' ] . '[_dummy_value]', |
|
79 | + 'name' => $aField[ 'attributes' ][ 'name' ].'[_dummy_value]', |
|
80 | 80 | ) |
81 | 81 | ) |
82 | 82 | . $this->getHTMLTag( |
83 | 83 | 'input', |
84 | 84 | array( |
85 | 85 | 'type' => 'hidden', |
86 | - 'name' => '__unset_' . $aField[ '_structure_type' ] . '[' . $aField[ '_input_name_flat' ] . '|_dummy_value' . ']', |
|
87 | - 'value' => $aField[ '_input_name_flat' ] . '|_dummy_value', |
|
86 | + 'name' => '__unset_'.$aField[ '_structure_type' ].'['.$aField[ '_input_name_flat' ].'|_dummy_value'.']', |
|
87 | + 'value' => $aField[ '_input_name_flat' ].'|_dummy_value', |
|
88 | 88 | 'class' => 'unset-element-names element-address', |
89 | 89 | ) |
90 | 90 | ); |
@@ -25,7 +25,7 @@ |
||
25 | 25 | /** |
26 | 26 | * Defines the field type slugs used for this field type. |
27 | 27 | */ |
28 | - public $aFieldTypeSlugs = array( 'section_title', ); |
|
28 | + public $aFieldTypeSlugs = array( 'section_title',); |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Defines the default key-values of this field type. |
@@ -76,7 +76,7 @@ |
||
76 | 76 | protected function getField( $aField ) { |
77 | 77 | |
78 | 78 | $_aOutput = array(); |
79 | - foreach( $this->getAsArray( $aField['label'] ) as $_sKey => $_sLabel ) { |
|
79 | + foreach( $this->getAsArray( $aField['label'] ) as $_sKey => $_sLabel ) { |
|
80 | 80 | $_aOutput[] = $this->_getEachRadioButtonOutput( $aField, $_sKey, $_sLabel ); |
81 | 81 | } |
82 | 82 | $_aOutput[] = $this->_getUpdateCheckedScript( $aField['input_id'] ); |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | */ |
108 | 108 | protected function getField( $aField ) { |
109 | 109 | |
110 | - $_aOutput = array(); |
|
111 | - foreach( $this->getAsArray( $aField['label'] ) as $_sKey => $_sLabel ) { |
|
112 | - $_aOutput[] = $this->_getEachRadioButtonOutput( $aField, $_sKey, $_sLabel ); |
|
110 | + $_aOutput = array(); |
|
111 | + foreach ( $this->getAsArray( $aField[ 'label' ] ) as $_sKey => $_sLabel ) { |
|
112 | + $_aOutput[ ] = $this->_getEachRadioButtonOutput( $aField, $_sKey, $_sLabel ); |
|
113 | 113 | } |
114 | - $_aOutput[] = $this->_getUpdateCheckedScript( $aField['input_id'] ); |
|
114 | + $_aOutput[ ] = $this->_getUpdateCheckedScript( $aField[ 'input_id' ] ); |
|
115 | 115 | return implode( PHP_EOL, $_aOutput ); |
116 | 116 | |
117 | 117 | } |
@@ -127,12 +127,12 @@ discard block |
||
127 | 127 | $_aAttributes = $aField[ 'attributes' ] + $this->getElementAsArray( $aField, array( 'attributes', $sKey ) ); |
128 | 128 | $_oRadio = new AdminPageFramework_Input_radio( $_aAttributes ); |
129 | 129 | $_oRadio->setAttributesByKey( $sKey ); |
130 | - $_oRadio->setAttribute( 'data-default', $aField['default'] ); // refered by the repeater script |
|
130 | + $_oRadio->setAttribute( 'data-default', $aField[ 'default' ] ); // refered by the repeater script |
|
131 | 131 | |
132 | 132 | // Output |
133 | 133 | return $this->getElementByLabel( $aField[ 'before_label' ], $sKey, $aField[ 'label' ] ) |
134 | - . "<div " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-radio-label' ) . ">" |
|
135 | - . "<label " . $this->getAttributes( |
|
134 | + . "<div ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-radio-label' ).">" |
|
135 | + . "<label ".$this->getAttributes( |
|
136 | 136 | array( |
137 | 137 | 'for' => $_oRadio->getAttribute( 'id' ), |
138 | 138 | 'class' => $_oRadio->getAttribute( 'disabled' ) |
@@ -71,7 +71,7 @@ |
||
71 | 71 | * </code> |
72 | 72 | * @access public This must be public as accessed from outside. |
73 | 73 | */ |
74 | - public $aFieldTypeSlugs = array( 'default', ); |
|
74 | + public $aFieldTypeSlugs = array( 'default',); |
|
75 | 75 | |
76 | 76 | /** |
77 | 77 | * Defines the default key-values of this field type. |
@@ -72,7 +72,7 @@ |
||
72 | 72 | protected function getField( $aField ) { |
73 | 73 | |
74 | 74 | $_oSelectInput = new AdminPageFramework_Input_select( $aField[ 'attributes' ] ); |
75 | - if ( $aField[ 'is_multiple' ] ) { |
|
75 | + if ( $aField[ 'is_multiple' ] ) { |
|
76 | 76 | $_oSelectInput->setAttribute( array( 'select', 'multiple' ), 'multiple' ); |
77 | 77 | } |
78 | 78 | return |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | /** |
104 | 104 | * Defines the field type slugs used for this field type. |
105 | 105 | */ |
106 | - public $aFieldTypeSlugs = array( 'select', ); |
|
106 | + public $aFieldTypeSlugs = array( 'select',); |
|
107 | 107 | |
108 | 108 | /** |
109 | 109 | * Defines the default key-values of this field type. |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | 'select' => array( |
116 | 116 | 'size' => 1, |
117 | 117 | 'autofocusNew' => null, |
118 | - 'multiple' => null, // set 'multiple' for multiple selections. If 'is_multiple' is set, it takes the precedence. |
|
118 | + 'multiple' => null, // set 'multiple' for multiple selections. If 'is_multiple' is set, it takes the precedence. |
|
119 | 119 | 'required' => null, |
120 | 120 | ), |
121 | 121 | 'optgroup' => array(), |
@@ -155,12 +155,12 @@ discard block |
||
155 | 155 | protected function getField( $aField ) { |
156 | 156 | |
157 | 157 | $_oSelectInput = new AdminPageFramework_Input_select( $aField[ 'attributes' ] ); |
158 | - if ( $aField[ 'is_multiple' ] ) { |
|
158 | + if ( $aField[ 'is_multiple' ] ) { |
|
159 | 159 | $_oSelectInput->setAttribute( array( 'select', 'multiple' ), 'multiple' ); |
160 | 160 | } |
161 | 161 | return |
162 | 162 | $aField[ 'before_label' ] |
163 | - . "<div " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-select-label' ) . ">" |
|
163 | + . "<div ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-select-label' ).">" |
|
164 | 164 | . "<label for='{$aField[ 'input_id' ]}'>" |
165 | 165 | . $aField[ 'before_input' ] |
166 | 166 | . $_oSelectInput->get( $aField[ 'label' ] ) |
@@ -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 |