@@ -166,7 +166,7 @@ |
||
166 | 166 | $aField[ '_structure_type' ], |
167 | 167 | array( 'widget', 'post_meta_box', 'page_meta_box' ) |
168 | 168 | ) |
169 | - ){ |
|
169 | + ) { |
|
170 | 170 | return "<span class='title-colon'>:</span>" ; |
171 | 171 | } |
172 | 172 |
@@ -173,7 +173,7 @@ |
||
173 | 173 | . $this->getFrameworkNameVersion() |
174 | 174 | . ' (' |
175 | 175 | . __( 'This information will be disabled when <code>WP_DEBUG</code> is set to <code>false</code> in <code>wp-config.php</code>.', 'admin-page-framework' ) |
176 | - . ')' |
|
176 | + . ')' |
|
177 | 177 | . '</span>', |
178 | 178 | 'attributes' => array( |
179 | 179 | 'container' => array( |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | $aField = $this->aFieldset; |
72 | 72 | |
73 | - if ( ! $aField[ 'show_title_column' ] ) { |
|
73 | + if ( !$aField[ 'show_title_column' ] ) { |
|
74 | 74 | return ''; |
75 | 75 | } |
76 | 76 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | 'for' => $_oInputTagIDGenerator->get(), |
85 | 85 | ); |
86 | 86 | $_sOutput .= $aField[ 'title' ] |
87 | - ? "<label " . $this->getAttributes( $_aLabelAttributes ) . "'>" |
|
87 | + ? "<label ".$this->getAttributes( $_aLabelAttributes )."'>" |
|
88 | 88 | . "<a id='{$aField[ 'field_id' ]}'></a>" // to allow the browser to link to the element. |
89 | 89 | . "<span title='" |
90 | 90 | . esc_attr( |
@@ -115,12 +115,12 @@ discard block |
||
115 | 115 | */ |
116 | 116 | private function _getFieldOutputsInFieldTitleAreaFromNestedFields( $aField ) { |
117 | 117 | |
118 | - if ( ! $this->hasNestedFields( $aField ) ) { |
|
118 | + if ( !$this->hasNestedFields( $aField ) ) { |
|
119 | 119 | return ''; |
120 | 120 | } |
121 | 121 | |
122 | 122 | $_sOutput = ''; |
123 | - foreach( $aField[ 'content' ] as $_aNestedField ) { |
|
123 | + foreach ( $aField[ 'content' ] as $_aNestedField ) { |
|
124 | 124 | |
125 | 125 | if ( 'field_title' !== $_aNestedField[ 'placement' ] ) { |
126 | 126 | continue; |
@@ -128,13 +128,13 @@ discard block |
||
128 | 128 | |
129 | 129 | $_oFieldset = new AdminPageFramework_Form_View___Fieldset( |
130 | 130 | $_aNestedField, |
131 | - $this->aSavedData, // passed by reference. @todo: examine why it needs to be passed by reference. |
|
131 | + $this->aSavedData, // passed by reference. @todo: examine why it needs to be passed by reference. |
|
132 | 132 | $this->aFieldErrors, |
133 | 133 | $this->aFieldTypeDefinitions, |
134 | 134 | $this->oMsg, |
135 | 135 | $this->aCallbacks // field output element callables. |
136 | 136 | ); |
137 | - $_sOutput .= $_oFieldset->get(); // field output |
|
137 | + $_sOutput .= $_oFieldset->get(); // field output |
|
138 | 138 | |
139 | 139 | } |
140 | 140 | return $_sOutput; |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * @since 3.7.0 |
147 | 147 | */ |
148 | 148 | private function _getToolTip( $asTip, $sElementID ) { |
149 | - $_oToolTip = new AdminPageFramework_Form_View___ToolTip( |
|
149 | + $_oToolTip = new AdminPageFramework_Form_View___ToolTip( |
|
150 | 150 | $asTip, |
151 | 151 | $sElementID |
152 | 152 | ); |
@@ -160,14 +160,14 @@ discard block |
||
160 | 160 | */ |
161 | 161 | private function _getDebugInfo( $aField ) { |
162 | 162 | |
163 | - if ( ! $this->_shouldShowDebugInfo( $aField ) ) { |
|
163 | + if ( !$this->_shouldShowDebugInfo( $aField ) ) { |
|
164 | 164 | return ''; |
165 | 165 | } |
166 | - $_oToolTip = new AdminPageFramework_Form_View___ToolTip( |
|
166 | + $_oToolTip = new AdminPageFramework_Form_View___ToolTip( |
|
167 | 167 | array( |
168 | 168 | 'title' => $this->oMsg->get( 'field_arguments' ), |
169 | 169 | 'dash-icon' => 'dashicons-info', |
170 | - 'icon_alt_text' => '[' . $this->oMsg->get( 'debug' ) . ' ]', |
|
170 | + 'icon_alt_text' => '['.$this->oMsg->get( 'debug' ).' ]', |
|
171 | 171 | 'content' => AdminPageFramework_Debug::get( $aField ) |
172 | 172 | . '<span class="admin-page-framework-info">' |
173 | 173 | . $this->getFrameworkNameVersion() |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | ), |
182 | 182 | ) |
183 | 183 | ), |
184 | - $aField[ 'field_id' ] . '_debug' |
|
184 | + $aField[ 'field_id' ].'_debug' |
|
185 | 185 | ); |
186 | 186 | return $_oToolTip->get(); |
187 | 187 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | */ |
193 | 193 | private function _shouldShowDebugInfo( $aField ) { |
194 | 194 | |
195 | - if ( ! $aField[ 'show_debug_info' ] ) { |
|
195 | + if ( !$aField[ 'show_debug_info' ] ) { |
|
196 | 196 | return false; |
197 | 197 | } |
198 | 198 | if ( strlen( $aField[ '_parent_field_path' ] ) ) { |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | */ |
209 | 209 | private function _getTitleColon( $aField ) { |
210 | 210 | |
211 | - if ( ! isset( $aField[ 'title' ] ) || '' === $aField[ 'title' ] ) { |
|
211 | + if ( !isset( $aField[ 'title' ] ) || '' === $aField[ 'title' ] ) { |
|
212 | 212 | return ''; |
213 | 213 | } |
214 | 214 | if ( |
@@ -216,8 +216,8 @@ discard block |
||
216 | 216 | $aField[ '_structure_type' ], |
217 | 217 | array( 'widget', 'post_meta_box', 'page_meta_box' ) |
218 | 218 | ) |
219 | - ){ |
|
220 | - return "<span class='title-colon'>:</span>" ; |
|
219 | + ) { |
|
220 | + return "<span class='title-colon'>:</span>"; |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | * @since 3.7.0 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, |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * @since 3.8.0 |
136 | 136 | * @internal |
137 | 137 | */ |
138 | - private function _getFieldsetsOutputInSectionTitleArea( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
|
138 | + private function _getFieldsetsOutputInSectionTitleArea( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
|
139 | 139 | |
140 | 140 | $_aFieldsetsInSectionTitle = array(); |
141 | 141 | $_aFieldsetsInSectionTitle[] = $this->_getSectionTitleField( $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | ); |
146 | 146 | $_sOutput = ''; |
147 | 147 | foreach( $_aFieldsetsInSectionTitle as $_aFieldset ) { |
148 | - if ( empty( $_aFieldset ) ) { |
|
148 | + if ( empty( $_aFieldset ) ) { |
|
149 | 149 | continue; |
150 | 150 | } |
151 | 151 | $_sOutput .= $this->getFieldsetOutput( $_aFieldset ); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | * @since 3.7.0 Moved from `AdminPageFramework_FormPart_SectionTitle`. |
190 | 190 | * @return array|void |
191 | 191 | */ |
192 | - private function _getSectionTitleField( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
|
192 | + private function _getSectionTitleField( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
|
193 | 193 | |
194 | 194 | foreach( $aFieldsets as $_aFieldset ) { |
195 | 195 |
@@ -158,7 +158,7 @@ |
||
158 | 158 | . $this->getFrameworkNameVersion() |
159 | 159 | . ' (' |
160 | 160 | . $this->oMsg->get( 'debug_info_will_be_disabled' ) |
161 | - . ')' |
|
161 | + . ')' |
|
162 | 162 | . '</span>', |
163 | 163 | 'attributes' => array( |
164 | 164 | 'container' => array( |
@@ -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(); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * @since 3.7.0 Moved from `AdminPageFramework_FormPart_SectionTitle`. |
92 | 92 | * @return string The section title output. |
93 | 93 | */ |
94 | - protected function _getSectionTitle( $sTitle, $sTag, $aFieldsets, $iSectionIndex=null, $aFieldTypeDefinitions=array(), $aCollapsible=array() ) { |
|
94 | + protected function _getSectionTitle( $sTitle, $sTag, $aFieldsets, $iSectionIndex = null, $aFieldTypeDefinitions = array(), $aCollapsible = array() ) { |
|
95 | 95 | |
96 | 96 | $_aSectionTitleFieldset = $this->_getSectionTitleField( $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ); |
97 | 97 | $_sFieldsInSectionTitle = $this->_getFieldsetsOutputInSectionTitleArea( $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $_bHasOtherFields = $_sFieldsInSectionTitle |
102 | 102 | ? ' has-fields' |
103 | 103 | : ''; |
104 | - $_sOutput = $_sTitle . $_sFieldsInSectionTitle; |
|
104 | + $_sOutput = $_sTitle.$_sFieldsInSectionTitle; |
|
105 | 105 | return $_sOutput |
106 | 106 | ? "<div class='section-title-container{$_bHasOtherFields}'>" |
107 | 107 | . $_sOutput |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | * @return string |
131 | 131 | */ |
132 | 132 | private function _getToolTip( $_aSectionset ) { |
133 | - $_sSectionTitleTagID = str_replace( '|', '_', $_aSectionset[ '_section_path' ] ) . '_' . $this->aArguments[ 'section_index' ]; |
|
133 | + $_sSectionTitleTagID = str_replace( '|', '_', $_aSectionset[ '_section_path' ] ).'_'.$this->aArguments[ 'section_index' ]; |
|
134 | 134 | $_oToolTip = new AdminPageFramework_Form_View___ToolTip( |
135 | 135 | $_aSectionset[ 'tip' ], |
136 | 136 | $_sSectionTitleTagID |
@@ -145,14 +145,14 @@ discard block |
||
145 | 145 | */ |
146 | 146 | private function _getDebugInfo( $aSectionset ) { |
147 | 147 | |
148 | - if ( ! $aSectionset[ 'show_debug_info' ] ) { |
|
148 | + if ( !$aSectionset[ 'show_debug_info' ] ) { |
|
149 | 149 | return ''; |
150 | 150 | } |
151 | - $_oToolTip = new AdminPageFramework_Form_View___ToolTip( |
|
151 | + $_oToolTip = new AdminPageFramework_Form_View___ToolTip( |
|
152 | 152 | array( |
153 | 153 | 'title' => $this->oMsg->get( 'section_arguments' ), |
154 | 154 | 'dash-icon' => 'dashicons-info', |
155 | - 'icon_alt_text' => '[' . $this->oMsg->get( 'debug' ) . ' ]', |
|
155 | + 'icon_alt_text' => '['.$this->oMsg->get( 'debug' ).' ]', |
|
156 | 156 | 'content' => AdminPageFramework_Debug::get( $aSectionset ) |
157 | 157 | . '<span class="admin-page-framework-info">' |
158 | 158 | . $this->getFrameworkNameVersion() |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | ), |
167 | 167 | ) |
168 | 168 | ), |
169 | - $aSectionset[ '_section_path' ] . '_debug' |
|
169 | + $aSectionset[ '_section_path' ].'_debug' |
|
170 | 170 | ); |
171 | 171 | return $_oToolTip->get(); |
172 | 172 | |
@@ -195,8 +195,8 @@ discard block |
||
195 | 195 | private function _getFieldsetsOutputInSectionTitleArea( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
196 | 196 | |
197 | 197 | $_sOutput = ''; |
198 | - foreach( $this->_getFieldsetsInSectionTitleArea( $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) as $_aFieldset ) { |
|
199 | - if ( empty( $_aFieldset ) ) { |
|
198 | + foreach ( $this->_getFieldsetsInSectionTitleArea( $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) as $_aFieldset ) { |
|
199 | + if ( empty( $_aFieldset ) ) { |
|
200 | 200 | continue; |
201 | 201 | } |
202 | 202 | $_sOutput .= $this->getFieldsetOutput( $_aFieldset ); |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | private function _getFieldsetsInSectionTitleArea( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
213 | 213 | |
214 | 214 | $_aFieldsetsInSectionTitle = array(); |
215 | - foreach( $aFieldsets as $_aFieldset ) { |
|
215 | + foreach ( $aFieldsets as $_aFieldset ) { |
|
216 | 216 | |
217 | 217 | if ( 'section_title' !== $_aFieldset[ 'placement' ] ) { |
218 | 218 | continue; |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | $iSectionIndex, |
224 | 224 | $aFieldTypeDefinitions |
225 | 225 | ); |
226 | - $_aFieldsetsInSectionTitle[] = $_oFieldsetOutputFormatter->get(); |
|
226 | + $_aFieldsetsInSectionTitle[ ] = $_oFieldsetOutputFormatter->get(); |
|
227 | 227 | |
228 | 228 | } |
229 | 229 | return $_aFieldsetsInSectionTitle; |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | */ |
243 | 243 | private function _getSectionTitleField( array $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
244 | 244 | |
245 | - foreach( $aFieldsets as $_aFieldset ) { |
|
245 | + foreach ( $aFieldsets as $_aFieldset ) { |
|
246 | 246 | |
247 | 247 | if ( 'section_title' !== $_aFieldset[ 'type' ] ) { |
248 | 248 | continue; |
@@ -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. |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | $aFieldset = $this->aFieldset; |
62 | 62 | |
63 | - if ( ! $this->isNormalPlacement( $aFieldset ) ) { |
|
63 | + if ( !$this->isNormalPlacement( $aFieldset ) ) { |
|
64 | 64 | return ''; |
65 | 65 | } |
66 | 66 | |
@@ -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 | ); |
@@ -183,6 +183,8 @@ |
||
183 | 183 | } |
184 | 184 | /** |
185 | 185 | * Trims a traling sub-string if exists. |
186 | + * @param string $sString |
|
187 | + * @param string $sSuffix |
|
186 | 188 | * @return string |
187 | 189 | * @since 3.7.2 |
188 | 190 | */ |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * @since 3.8.4 When non-true value is passed, `0px` will be returned. |
37 | 37 | * @return string |
38 | 38 | */ |
39 | - static public function getLengthSanitized( $sLength, $sUnit='px' ) { |
|
39 | + static public function getLengthSanitized( $sLength, $sUnit='px' ) { |
|
40 | 40 | $sLength = $sLength ? $sLength : 0; |
41 | 41 | return is_numeric( $sLength ) |
42 | 42 | ? $sLength . $sUnit |
@@ -90,13 +90,13 @@ discard block |
||
90 | 90 | */ |
91 | 91 | static public function fixNumber( $nToFix, $nDefault, $nMin='', $nMax='' ) { |
92 | 92 | |
93 | - if ( ! is_numeric( trim( $nToFix ) ) ) { |
|
93 | + if ( ! is_numeric( trim( $nToFix ) ) ) { |
|
94 | 94 | return $nDefault; |
95 | 95 | } |
96 | - if ( $nMin !== '' && $nToFix < $nMin ) { |
|
96 | + if ( $nMin !== '' && $nToFix < $nMin ) { |
|
97 | 97 | return $nMin; |
98 | 98 | } |
99 | - if ( $nMax !== '' && $nToFix > $nMax ) { |
|
99 | + if ( $nMax !== '' && $nToFix > $nMax ) { |
|
100 | 100 | return $nMax; |
101 | 101 | } |
102 | 102 | return $nToFix; |
@@ -36,10 +36,10 @@ discard block |
||
36 | 36 | * @since 3.8.4 When non-true value is passed, `0px` will be returned. |
37 | 37 | * @return string |
38 | 38 | */ |
39 | - static public function getLengthSanitized( $sLength, $sUnit='px' ) { |
|
39 | + static public function getLengthSanitized( $sLength, $sUnit = 'px' ) { |
|
40 | 40 | $sLength = $sLength ? $sLength : 0; |
41 | 41 | return is_numeric( $sLength ) |
42 | - ? $sLength . $sUnit |
|
42 | + ? $sLength.$sUnit |
|
43 | 43 | : $sLength; |
44 | 44 | } |
45 | 45 | |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | * @since 3.8.11 Renamed from `fixNumber()`. |
82 | 82 | * @return string|integer A numeric value will be returned. |
83 | 83 | */ |
84 | - static public function getNumberFixed( $nToFix, $nDefault, $nMin='', $nMax='' ) { |
|
84 | + static public function getNumberFixed( $nToFix, $nDefault, $nMin = '', $nMax = '' ) { |
|
85 | 85 | |
86 | - if ( ! is_numeric( trim( $nToFix ) ) ) { |
|
86 | + if ( !is_numeric( trim( $nToFix ) ) ) { |
|
87 | 87 | return $nDefault; |
88 | 88 | } |
89 | 89 | if ( $nMin !== '' && $nToFix < $nMin ) { |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * @return string|integer A numeric value will be returned. |
102 | 102 | * @deprecated 3.8.11 |
103 | 103 | */ |
104 | - static public function fixNumber( $nToFix, $nDefault, $nMin='', $nMax='' ) { |
|
104 | + static public function fixNumber( $nToFix, $nDefault, $nMin = '', $nMax = '' ) { |
|
105 | 105 | return self::getNumberFixed( $nToFix, $nDefault, $nMin, $nMax ); |
106 | 106 | } |
107 | 107 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | */ |
115 | 115 | static public function getCSSMinified( $sCSSRules ) { |
116 | 116 | return str_replace( |
117 | - array( "\r\n", "\r", "\n", "\t", ' ', ' ', ' '), // remove line breaks, tab, and white sspaces. |
|
117 | + array( "\r\n", "\r", "\n", "\t", ' ', ' ', ' ' ), // remove line breaks, tab, and white sspaces. |
|
118 | 118 | '', |
119 | 119 | preg_replace( '!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $sCSSRules ) // remove comments |
120 | 120 | ); |
@@ -151,8 +151,8 @@ discard block |
||
151 | 151 | */ |
152 | 152 | static public function getNumberOfReadableSize( $nSize ) { |
153 | 153 | |
154 | - $_nReturn = substr( $nSize, 0, -1 ); |
|
155 | - switch( strtoupper( substr( $nSize, -1 ) ) ) { |
|
154 | + $_nReturn = substr( $nSize, 0, -1 ); |
|
155 | + switch ( strtoupper( substr( $nSize, -1 ) ) ) { |
|
156 | 156 | case 'P': |
157 | 157 | $_nReturn *= 1024; |
158 | 158 | case 'T': |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $_nLog = log( $nBytes, 1024 ); |
179 | 179 | $_iPower = ( int ) $_nLog; |
180 | 180 | $_iSize = pow( 1024, $_nLog - $_iPower ); |
181 | - return $_iSize . $_aUnits[ $_iPower ]; |
|
181 | + return $_iSize.$_aUnits[ $_iPower ]; |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | /** |
@@ -36,11 +36,11 @@ discard block |
||
36 | 36 | */ |
37 | 37 | static public function getInlineCSS( array $aCSSRules ) { |
38 | 38 | $_aOutput = array(); |
39 | - foreach( $aCSSRules as $_sProperty => $_sValue ) { |
|
39 | + foreach ( $aCSSRules as $_sProperty => $_sValue ) { |
|
40 | 40 | if ( is_null( $_sValue ) ) { |
41 | 41 | continue; |
42 | 42 | } |
43 | - $_aOutput[] = $_sProperty . ': ' . $_sValue; |
|
43 | + $_aOutput[ ] = $_sProperty.': '.$_sValue; |
|
44 | 44 | } |
45 | 45 | return implode( '; ', $_aOutput ); |
46 | 46 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | static public function getStyleAttribute( $asInlineCSSes ) { |
72 | 72 | |
73 | 73 | $_aCSSRules = array(); |
74 | - foreach( array_reverse( func_get_args() ) as $_asCSSRules ) { |
|
74 | + foreach ( array_reverse( func_get_args() ) as $_asCSSRules ) { |
|
75 | 75 | |
76 | 76 | // For array, store in the container. |
77 | 77 | if ( is_array( $_asCSSRules ) ) { |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | |
82 | 82 | // At this point, it is a string. Break them down to array elements. |
83 | 83 | $__aCSSRules = explode( ';', $_asCSSRules ); |
84 | - foreach( $__aCSSRules as $_sPair ) { |
|
84 | + foreach ( $__aCSSRules as $_sPair ) { |
|
85 | 85 | $_aCSSPair = explode( ':', $_sPair ); |
86 | - if ( ! isset( $_aCSSPair[ 0 ], $_aCSSPair[ 1 ] ) ) { |
|
86 | + if ( !isset( $_aCSSPair[ 0 ], $_aCSSPair[ 1 ] ) ) { |
|
87 | 87 | continue; |
88 | 88 | } |
89 | 89 | $_aCSSRules[ $_aCSSPair[ 0 ] ] = $_aCSSPair[ 1 ]; |
@@ -120,9 +120,9 @@ discard block |
||
120 | 120 | */ |
121 | 121 | static public function getClassAttribute( /* $asClassSelectors1, $asClassSelectors12, ... */ ) { |
122 | 122 | |
123 | - $_aClasses = array(); |
|
124 | - foreach( func_get_args() as $_asClasses ) { |
|
125 | - if ( ! in_array( gettype( $_asClasses ), array( 'array', 'string' ) ) ) { |
|
123 | + $_aClasses = array(); |
|
124 | + foreach ( func_get_args() as $_asClasses ) { |
|
125 | + if ( !in_array( gettype( $_asClasses ), array( 'array', 'string' ) ) ) { |
|
126 | 126 | continue; |
127 | 127 | } |
128 | 128 | $_aClasses = array_merge( |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | : explode( ' ', $_asClasses ) |
133 | 133 | ); |
134 | 134 | } |
135 | - $_aClasses = array_unique( array_filter( $_aClasses ) ); |
|
135 | + $_aClasses = array_unique( array_filter( $_aClasses ) ); |
|
136 | 136 | |
137 | 137 | // @todo examine if it is okay to remove the trim() function below. |
138 | 138 | return trim( implode( ' ', $_aClasses ) ); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | static public function generateClassAttribute( /* $asClassSelectors1, $asClassSelectors12 ... */ ) { |
149 | 149 | $_aParams = func_get_args(); |
150 | 150 | return call_user_func_array( |
151 | - array( __CLASS__ , 'getClassAttribute' ), |
|
151 | + array( __CLASS__, 'getClassAttribute' ), |
|
152 | 152 | $_aParams |
153 | 153 | ); |
154 | 154 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | static public function getDataAttributeArray( array $aArray ) { |
163 | 163 | |
164 | 164 | $_aNewArray = array(); |
165 | - foreach( $aArray as $sKey => $v ) { |
|
165 | + foreach ( $aArray as $sKey => $v ) { |
|
166 | 166 | if ( in_array( gettype( $v ), array( 'array', 'object' ) ) ) { |
167 | 167 | continue; |
168 | 168 | } |
@@ -59,23 +59,23 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function get() { |
61 | 61 | |
62 | - $this->aResources[ 'internal_scripts' ] = $this->_getUpdatedInternalItemsByCallback( |
|
62 | + $this->aResources[ 'internal_scripts' ] = $this->_getUpdatedInternalItemsByCallback( |
|
63 | 63 | $this->aResources[ 'internal_scripts' ], |
64 | 64 | 'hfGetScripts' |
65 | 65 | ); |
66 | - $this->aResources[ 'internal_styles' ] = $this->_getUpdatedInternalItemsByCallback( |
|
66 | + $this->aResources[ 'internal_styles' ] = $this->_getUpdatedInternalItemsByCallback( |
|
67 | 67 | $this->aResources[ 'internal_styles' ], |
68 | 68 | 'hfGetStyles' |
69 | 69 | ); |
70 | - $this->aResources[ 'internal_styles_ie' ] = $this->_getUpdatedInternalItemsByCallback( |
|
70 | + $this->aResources[ 'internal_styles_ie' ] = $this->_getUpdatedInternalItemsByCallback( |
|
71 | 71 | $this->aResources[ 'internal_styles_ie' ], |
72 | 72 | 'hfGetIEStyles' |
73 | 73 | ); |
74 | - $this->aResources[ 'src_styles' ] = $this->_getUpdatedEnqueuingItemsByCallback( |
|
74 | + $this->aResources[ 'src_styles' ] = $this->_getUpdatedEnqueuingItemsByCallback( |
|
75 | 75 | $this->aResources[ 'src_styles' ], |
76 | 76 | 'aEnqueueStyles' |
77 | 77 | ); |
78 | - $this->aResources[ 'src_scripts' ] = $this->_getUpdatedEnqueuingItemsByCallback( |
|
78 | + $this->aResources[ 'src_scripts' ] = $this->_getUpdatedEnqueuingItemsByCallback( |
|
79 | 79 | $this->aResources[ 'src_scripts' ], |
80 | 80 | 'aEnqueueScripts' |
81 | 81 | ); |
@@ -89,10 +89,10 @@ discard block |
||
89 | 89 | */ |
90 | 90 | private function _getUpdatedInternalItemsByCallback( array $aSubject, $sKey ) { |
91 | 91 | $_oCallable = $this->getElement( $this->aFieldTypeDefinition, $sKey ); |
92 | - if ( ! is_callable( $_oCallable ) ) { |
|
92 | + if ( !is_callable( $_oCallable ) ) { |
|
93 | 93 | return $aSubject; |
94 | 94 | } |
95 | - $aSubject[] = call_user_func_array( |
|
95 | + $aSubject[ ] = call_user_func_array( |
|
96 | 96 | $_oCallable, |
97 | 97 | array() |
98 | 98 | ); |
@@ -67,7 +67,7 @@ |
||
67 | 67 | . ( $aField[ 'label' ] |
68 | 68 | ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
69 | 69 | . $aField[ 'label' ] |
70 | - . "</span>" |
|
70 | + . "</span>" |
|
71 | 71 | : "" |
72 | 72 | ) |
73 | 73 | . "<input " . $this->getAttributes( $aField[ 'attributes' ] ) . " />" |
@@ -60,21 +60,21 @@ |
||
60 | 60 | protected function getField( $aField ) { |
61 | 61 | |
62 | 62 | return |
63 | - $aField['before_label'] |
|
63 | + $aField[ 'before_label' ] |
|
64 | 64 | . "<div class='admin-page-framework-input-label-container'>" |
65 | 65 | . "<label for='{$aField[ 'input_id' ]}'>" |
66 | 66 | . $aField[ 'before_input' ] |
67 | 67 | . ( $aField[ 'label' ] |
68 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
68 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
69 | 69 | . $aField[ 'label' ] |
70 | 70 | . "</span>" |
71 | 71 | : "" |
72 | 72 | ) |
73 | - . "<input " . $this->getAttributes( $aField[ 'attributes' ] ) . " />" |
|
74 | - . $aField['after_input'] |
|
73 | + . "<input ".$this->getAttributes( $aField[ 'attributes' ] )." />" |
|
74 | + . $aField[ 'after_input' ] |
|
75 | 75 | . "</label>" |
76 | 76 | . "</div>" |
77 | - . $aField['after_label']; |
|
77 | + . $aField[ 'after_label' ]; |
|
78 | 78 | |
79 | 79 | } |
80 | 80 |
@@ -554,8 +554,8 @@ discard block |
||
554 | 554 | protected function getField( $aField ) { |
555 | 555 | |
556 | 556 | $_aOutput = array(); |
557 | - foreach( ( array ) $aField[ 'label' ] as $_sKey => $_sLabel ) { |
|
558 | - $_aOutput[] = $this->_getFieldOutputByLabel( |
|
557 | + foreach ( ( array ) $aField[ 'label' ] as $_sKey => $_sLabel ) { |
|
558 | + $_aOutput[ ] = $this->_getFieldOutputByLabel( |
|
559 | 559 | $_sKey, |
560 | 560 | $_sLabel, |
561 | 561 | $aField |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | } |
564 | 564 | |
565 | 565 | // the repeatable field buttons will be replaced with this element. |
566 | - $_aOutput[] = "<div class='repeatable-field-buttons'></div>"; |
|
566 | + $_aOutput[ ] = "<div class='repeatable-field-buttons'></div>"; |
|
567 | 567 | return implode( '', $_aOutput ); |
568 | 568 | |
569 | 569 | } |
@@ -584,27 +584,27 @@ discard block |
||
584 | 584 | $aField[ 'rich' ] = $this->getElementByLabel( $aField[ 'rich' ], $sKey, $aField[ 'label' ] ); |
585 | 585 | $aField[ 'attributes' ] = $_bIsArray |
586 | 586 | ? array( |
587 | - 'name' => $aField[ 'attributes' ][ 'name' ] . "[{$sKey}]", |
|
588 | - 'id' => $aField[ 'attributes' ][ 'id' ] . "_{$sKey}", |
|
587 | + 'name' => $aField[ 'attributes' ][ 'name' ]."[{$sKey}]", |
|
588 | + 'id' => $aField[ 'attributes' ][ 'id' ]."_{$sKey}", |
|
589 | 589 | 'value' => $aField[ 'value' ], |
590 | 590 | ) |
591 | 591 | + $aField[ 'attributes' ] |
592 | 592 | : $aField[ 'attributes' ]; |
593 | - $_aOutput = array( |
|
594 | - $this->getElementByLabel( $aField['before_label'], $sKey, $aField[ 'label' ] ), |
|
593 | + $_aOutput = array( |
|
594 | + $this->getElementByLabel( $aField[ 'before_label' ], $sKey, $aField[ 'label' ] ), |
|
595 | 595 | "<div class='admin-page-framework-input-label-container {$_sClassSelector}'>", |
596 | - "<label for='" . $aField[ 'attributes' ][ 'id' ] . "'>", |
|
597 | - $this->getElementByLabel( $aField['before_input'], $sKey, $aField[ 'label' ] ), |
|
596 | + "<label for='".$aField[ 'attributes' ][ 'id' ]."'>", |
|
597 | + $this->getElementByLabel( $aField[ 'before_input' ], $sKey, $aField[ 'label' ] ), |
|
598 | 598 | $_sLabel |
599 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
599 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
600 | 600 | . $_sLabel |
601 | 601 | . "</span>" |
602 | 602 | : '', |
603 | 603 | $this->_getEditor( $aField ), |
604 | - $this->getElementByLabel( $aField['after_input'], $sKey, $aField[ 'label' ] ), |
|
604 | + $this->getElementByLabel( $aField[ 'after_input' ], $sKey, $aField[ 'label' ] ), |
|
605 | 605 | "</label>", |
606 | 606 | "</div>", |
607 | - $this->getElementByLabel( $aField['after_label'], $sKey, $aField[ 'label' ] ), |
|
607 | + $this->getElementByLabel( $aField[ 'after_label' ], $sKey, $aField[ 'label' ] ), |
|
608 | 608 | ); |
609 | 609 | return implode( '', $_aOutput ); |
610 | 610 | |
@@ -619,31 +619,31 @@ discard block |
||
619 | 619 | */ |
620 | 620 | private function _getEditor( $aField ) { |
621 | 621 | |
622 | - unset( $aField['attributes']['value'] ); |
|
622 | + unset( $aField[ 'attributes' ][ 'value' ] ); |
|
623 | 623 | |
624 | 624 | // For no TinyMCE |
625 | - if ( empty( $aField['rich'] ) || ! $this->isTinyMCESupported() ) { |
|
626 | - return "<textarea " . $this->getAttributes( $aField['attributes'] ) . " >" // this method is defined in the base class |
|
627 | - . esc_textarea( $aField['value'] ) |
|
625 | + if ( empty( $aField[ 'rich' ] ) || !$this->isTinyMCESupported() ) { |
|
626 | + return "<textarea ".$this->getAttributes( $aField[ 'attributes' ] )." >" // this method is defined in the base class |
|
627 | + . esc_textarea( $aField[ 'value' ] ) |
|
628 | 628 | . "</textarea>"; |
629 | 629 | } |
630 | 630 | |
631 | 631 | // Rich editor |
632 | 632 | ob_start(); |
633 | 633 | wp_editor( |
634 | - $aField['value'], |
|
635 | - $aField['attributes']['id'], |
|
634 | + $aField[ 'value' ], |
|
635 | + $aField[ 'attributes' ][ 'id' ], |
|
636 | 636 | $this->uniteArrays( |
637 | - ( array ) $aField['rich'], |
|
637 | + ( array ) $aField[ 'rich' ], |
|
638 | 638 | array( |
639 | 639 | 'wpautop' => true, // use wpautop? |
640 | 640 | 'media_buttons' => true, // show insert/upload button(s) |
641 | - 'textarea_name' => $aField['attributes']['name'], |
|
642 | - 'textarea_rows' => $aField['attributes']['rows'], |
|
641 | + 'textarea_name' => $aField[ 'attributes' ][ 'name' ], |
|
642 | + 'textarea_rows' => $aField[ 'attributes' ][ 'rows' ], |
|
643 | 643 | 'tabindex' => '', |
644 | 644 | 'tabfocus_elements' => ':prev,:next', // the previous and next element ID to move the focus to when pressing the Tab key in TinyMCE |
645 | 645 | 'editor_css' => '', // intended for extra styles for both visual and Text editors buttons, needs to include the <style> tags, can use "scoped". |
646 | - 'editor_class' => $aField['attributes']['class'], // add extra class(es) to the editor textarea |
|
646 | + 'editor_class' => $aField[ 'attributes' ][ 'class' ], // add extra class(es) to the editor textarea |
|
647 | 647 | 'teeny' => false, // output the minimal editor config used in Press This |
648 | 648 | 'dfw' => false, // replace the default fullscreen with DFW (needs specific DOM elements and css) |
649 | 649 | 'tinymce' => true, // load TinyMCE, can be used to pass settings directly to TinyMCE using an array() |
@@ -655,7 +655,7 @@ discard block |
||
655 | 655 | ob_end_clean(); |
656 | 656 | |
657 | 657 | return $_sContent |
658 | - . $this->_getScriptForRichEditor( $aField['attributes']['id'] ); |
|
658 | + . $this->_getScriptForRichEditor( $aField[ 'attributes' ][ 'id' ] ); |
|
659 | 659 | |
660 | 660 | } |
661 | 661 |
@@ -37,21 +37,21 @@ |
||
37 | 37 | */ |
38 | 38 | public function _replyToGetField( $aField ) { |
39 | 39 | return |
40 | - $aField['before_label'] |
|
40 | + $aField[ 'before_label' ] |
|
41 | 41 | . "<div class='admin-page-framework-input-label-container'>" |
42 | - . "<label for='{$aField['input_id']}'>" |
|
43 | - . $aField['before_input'] |
|
44 | - . ( $aField['label'] && ! $aField['repeatable'] |
|
45 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
42 | + . "<label for='{$aField[ 'input_id' ]}'>" |
|
43 | + . $aField[ 'before_input' ] |
|
44 | + . ( $aField[ 'label' ] && !$aField[ 'repeatable' ] |
|
45 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
46 | 46 | . $aField[ 'label' ] |
47 | 47 | . "</span>" |
48 | 48 | : "" |
49 | 49 | ) |
50 | - . $aField['value'] |
|
51 | - . $aField['after_input'] |
|
50 | + . $aField[ 'value' ] |
|
51 | + . $aField[ 'after_input' ] |
|
52 | 52 | . "</label>" |
53 | 53 | . "</div>" |
54 | - . $aField['after_label'] |
|
54 | + . $aField[ 'after_label' ] |
|
55 | 55 | ; |
56 | 56 | } |
57 | 57 |