@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * @return string the input id attribute |
42 | 42 | */ |
43 | 43 | public function _replyToGetSectionName( /* $sSectionName, $aSectionset */ ) { |
44 | - $_aParams = func_get_args() + array( null, null, ); |
|
44 | + $_aParams = func_get_args() + array( null, null,); |
|
45 | 45 | return $_aParams[ 0 ]; |
46 | 46 | } |
47 | 47 | |
@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | * @since 3.6.0 |
70 | 70 | * @return string |
71 | 71 | */ |
72 | - public function _replyToGetFieldNameAttribute( /* $sFieldName, $aFieldset */ ) { |
|
73 | - $_aParams = func_get_args() + array( null, null, ); |
|
72 | + public function _replyToGetFieldNameAttribute( /* $sFieldName, $aFieldset */ ) { |
|
73 | + $_aParams = func_get_args() + array( null, null,); |
|
74 | 74 | return $_aParams[ 0 ]; |
75 | 75 | } |
76 | 76 | /** |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * @return string |
81 | 81 | */ |
82 | 82 | public function _replyToGetFlatFieldName( /* $sFieldName, $aFieldset */ ) { |
83 | - $_aParams = func_get_args() + array( null, null, ); |
|
83 | + $_aParams = func_get_args() + array( null, null,); |
|
84 | 84 | return $_aParams[ 0 ]; |
85 | 85 | } |
86 | 86 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * @return string the flat input name attribute |
103 | 103 | */ |
104 | 104 | public function _replyToGetFlatInputName( /* $sFlatNameAttribute, $aField, $sKey */ ) { |
105 | - $_aParams = func_get_args() + array( null, null, null ); |
|
105 | + $_aParams = func_get_args() + array( null, null, null ); |
|
106 | 106 | return $_aParams[ 0 ]; |
107 | 107 | } |
108 | 108 | |
@@ -144,14 +144,14 @@ discard block |
||
144 | 144 | 'if' => true, |
145 | 145 | 'capability' => '', |
146 | 146 | ); |
147 | - if ( ! $aElementDefinition[ 'if' ] ) { |
|
147 | + if ( !$aElementDefinition[ 'if' ] ) { |
|
148 | 148 | return false; |
149 | 149 | } |
150 | 150 | // For front-end forms that allow guests, the capability level can be empty. In that case, return true. |
151 | - if ( ! $aElementDefinition[ 'capability' ] ) { |
|
151 | + if ( !$aElementDefinition[ 'capability' ] ) { |
|
152 | 152 | return true; |
153 | 153 | } |
154 | - if ( ! current_user_can( $aElementDefinition[ 'capability' ] ) ) { |
|
154 | + if ( !current_user_can( $aElementDefinition[ 'capability' ] ) ) { |
|
155 | 155 | return false; |
156 | 156 | } |
157 | 157 | return $bDefault; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $this, |
188 | 188 | array( |
189 | 189 | // section_{instantiated class name}_{section id} |
190 | - 'section_head_' . $this->oProp->sClassName . '_' . $aSectionset[ 'section_id' ] |
|
190 | + 'section_head_'.$this->oProp->sClassName.'_'.$aSectionset[ 'section_id' ] |
|
191 | 191 | ), |
192 | 192 | $sSectionDescription |
193 | 193 | ); |
@@ -204,15 +204,15 @@ discard block |
||
204 | 204 | */ |
205 | 205 | public function _replyToGetFieldOutput( $sFieldOutput, $aFieldset ) { |
206 | 206 | |
207 | - $_sSectionPart = $this->oUtil->getAOrB( |
|
207 | + $_sSectionPart = $this->oUtil->getAOrB( |
|
208 | 208 | isset( $aFieldset[ 'section_id' ] ) && '_default' !== $aFieldset[ 'section_id' ], |
209 | - '_' . $aFieldset[ 'section_id' ], |
|
209 | + '_'.$aFieldset[ 'section_id' ], |
|
210 | 210 | '' |
211 | 211 | ); |
212 | 212 | return $this->oUtil->addAndApplyFilters( |
213 | 213 | $this, |
214 | 214 | array( |
215 | - 'field_' . $this->oProp->sClassName . $_sSectionPart . '_' . $aFieldset[ 'field_id' ] |
|
215 | + 'field_'.$this->oProp->sClassName.$_sSectionPart.'_'.$aFieldset[ 'field_id' ] |
|
216 | 216 | ), |
217 | 217 | $sFieldOutput, |
218 | 218 | $aFieldset // the field array |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @since 3.6.0 |
70 | 70 | * @return string |
71 | 71 | */ |
72 | - public function _replyToGetFieldNameAttribute( /* $sFieldName, $aFieldset */ ) { |
|
72 | + public function _replyToGetFieldNameAttribute( /* $sFieldName, $aFieldset */ ) { |
|
73 | 73 | $_aParams = func_get_args() + array( null, null, ); |
74 | 74 | return $_aParams[ 0 ]; |
75 | 75 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * @since 3.6.0 |
80 | 80 | * @return string |
81 | 81 | */ |
82 | - public function _replyToGetFlatFieldName( /* $sFieldName, $aFieldset */ ) { |
|
82 | + public function _replyToGetFlatFieldName( /* $sFieldName, $aFieldset */ ) { |
|
83 | 83 | $_aParams = func_get_args() + array( null, null, ); |
84 | 84 | return $_aParams[ 0 ]; |
85 | 85 | } |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | /** |
27 | 27 | * Sets up hooks and properties. |
28 | 28 | */ |
29 | - public function __construct( $oProp, $oMsg=null ) { |
|
29 | + public function __construct( $oProp, $oMsg = null ) { |
|
30 | 30 | |
31 | - if ( ! $this->_isLoadable( $oProp ) ) { |
|
31 | + if ( !$this->_isLoadable( $oProp ) ) { |
|
32 | 32 | return; |
33 | 33 | } |
34 | 34 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | // Add an action link in the plugin listing page |
41 | 41 | if ( $this->_shouldSetPluginActionLinks() ) { |
42 | 42 | add_filter( |
43 | - 'plugin_action_links_' . plugin_basename( $this->oProp->aScriptInfo[ 'sPath' ] ), |
|
43 | + 'plugin_action_links_'.plugin_basename( $this->oProp->aScriptInfo[ 'sPath' ] ), |
|
44 | 44 | array( $this, '_replyToAddSettingsLinkInPluginListingPage' ), |
45 | 45 | 20 // set a lower priority so that the link will be embedded at the beginning ( the most left hand side ). |
46 | 46 | ); |
@@ -55,13 +55,13 @@ discard block |
||
55 | 55 | * @return boolean |
56 | 56 | */ |
57 | 57 | private function _isLoadable( $oProp ) { |
58 | - if ( ! $oProp->bIsAdmin ) { |
|
58 | + if ( !$oProp->bIsAdmin ) { |
|
59 | 59 | return false; |
60 | 60 | } |
61 | 61 | if ( $oProp->bIsAdminAjax ) { |
62 | 62 | return false; |
63 | 63 | } |
64 | - return ! $this->hasBeenCalled( 'links_' . $oProp->sClassName ); |
|
64 | + return !$this->hasBeenCalled( 'links_'.$oProp->sClassName ); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -72,11 +72,11 @@ discard block |
||
72 | 72 | protected function _shouldSetPluginActionLinks() { |
73 | 73 | |
74 | 74 | // It is possible that the sub-objects are not set when the class is considered not loadable. |
75 | - if ( ! isset( $this->oProp ) ) { |
|
75 | + if ( !isset( $this->oProp ) ) { |
|
76 | 76 | return false; |
77 | 77 | } |
78 | 78 | |
79 | - if ( ! in_array( $this->oProp->sPageNow, array( 'plugins.php' ) ) ) { |
|
79 | + if ( !in_array( $this->oProp->sPageNow, array( 'plugins.php' ) ) ) { |
|
80 | 80 | return false; |
81 | 81 | } |
82 | 82 | return 'plugin' === $this->oProp->aScriptInfo[ 'sType' ]; |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | array( |
144 | 144 | 'href' => $aScriptInfo[ 'sURI' ], |
145 | 145 | 'target' => '_blank', |
146 | - 'title' => $aScriptInfo[ 'sName' ] . $_sVersion . $_sDescription |
|
146 | + 'title' => $aScriptInfo[ 'sName' ].$_sVersion.$_sDescription |
|
147 | 147 | ), |
148 | 148 | $aScriptInfo[ 'sName' ] |
149 | 149 | ) |
@@ -165,13 +165,13 @@ discard block |
||
165 | 165 | $_sAuthorInfo = $this->getAOrB( |
166 | 166 | empty( $aScriptInfo[ 'sAuthor' ] ), |
167 | 167 | $_sAuthorInfo, |
168 | - ' by ' . $_sAuthorInfo |
|
168 | + ' by '.$_sAuthorInfo |
|
169 | 169 | ); |
170 | 170 | |
171 | 171 | // Enclosing the output in a span tag as the outer element is a '<p>' tag. So this cannot be div. |
172 | 172 | // 3.5.7+ Added the class attribute for acceptance testing |
173 | 173 | return "<span class='apf-script-info'>" |
174 | - . $_sPluginInfo . $_sAuthorInfo |
|
174 | + . $_sPluginInfo.$_sAuthorInfo |
|
175 | 175 | . "</span>"; |
176 | 176 | |
177 | 177 | } |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | array( |
203 | 203 | 'href' => $aScriptInfo[ 'sURI' ], |
204 | 204 | 'target' => '_blank', |
205 | - 'title' => $aScriptInfo[ 'sName' ] . $_sVersion . $_sDescription, |
|
205 | + 'title' => $aScriptInfo[ 'sName' ].$_sVersion.$_sDescription, |
|
206 | 206 | ), |
207 | 207 | $aScriptInfo[ 'sName' ] |
208 | 208 | ) |
@@ -212,16 +212,16 @@ discard block |
||
212 | 212 | // 3.5.7+ added the 'apf-credit' class attribute for acceptance testing |
213 | 213 | // 3.7.0+ added the footer-thankyou id attribute. |
214 | 214 | return "<span class='apf-credit' id='footer-thankyou'>" |
215 | - . $this->oMsg->get( 'powered_by' ) . ' ' |
|
215 | + . $this->oMsg->get( 'powered_by' ).' ' |
|
216 | 216 | . $_sLibraryInfo |
217 | 217 | . ", " |
218 | - . $this->oMsg->get( 'and' ) . ' ' |
|
218 | + . $this->oMsg->get( 'and' ).' ' |
|
219 | 219 | . $this->getHTMLTag( |
220 | 220 | 'a', |
221 | 221 | array( |
222 | 222 | 'href' => 'https://wordpress.org', |
223 | 223 | 'target' => '_blank', |
224 | - 'title' => 'WordPress ' . $GLOBALS[ 'wp_version' ] |
|
224 | + 'title' => 'WordPress '.$GLOBALS[ 'wp_version' ] |
|
225 | 225 | ), |
226 | 226 | 'WordPress' |
227 | 227 | ) |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | */ |
238 | 238 | protected function _setFooterHooks() { |
239 | 239 | |
240 | - add_filter( 'admin_footer_text' , array( $this, '_replyToAddInfoInFooterLeft' ) ); |
|
240 | + add_filter( 'admin_footer_text', array( $this, '_replyToAddInfoInFooterLeft' ) ); |
|
241 | 241 | add_filter( 'update_footer', array( $this, '_replyToAddInfoInFooterRight' ), 11 ); |
242 | 242 | |
243 | 243 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | * @callback filter admin_footer_text |
250 | 250 | * @internal |
251 | 251 | */ |
252 | - public function _replyToAddInfoInFooterLeft( $sLinkHTML='' ) { |
|
252 | + public function _replyToAddInfoInFooterLeft( $sLinkHTML = '' ) { |
|
253 | 253 | |
254 | 254 | $sLinkHTML = empty( $this->oProp->aScriptInfo[ 'sName' ] ) |
255 | 255 | ? $sLinkHTML |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | |
258 | 258 | return $this->addAndApplyFilters( |
259 | 259 | $this->oProp->oCaller, |
260 | - 'footer_left_' . $this->oProp->sClassName, |
|
260 | + 'footer_left_'.$this->oProp->sClassName, |
|
261 | 261 | $sLinkHTML |
262 | 262 | ); |
263 | 263 | |
@@ -270,10 +270,10 @@ discard block |
||
270 | 270 | * @callback filter admin_footer_text |
271 | 271 | * @internal |
272 | 272 | */ |
273 | - public function _replyToAddInfoInFooterRight( $sLinkHTML='' ) { |
|
273 | + public function _replyToAddInfoInFooterRight( $sLinkHTML = '' ) { |
|
274 | 274 | return $this->addAndApplyFilters( |
275 | 275 | $this->oProp->oCaller, |
276 | - 'footer_right_' . $this->oProp->sClassName, |
|
276 | + 'footer_right_'.$this->oProp->sClassName, |
|
277 | 277 | $this->oProp->aFooterInfo[ 'sRight' ] |
278 | 278 | ); |
279 | 279 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | add_action( 'in_admin_footer', array( $this, '_replyToSetFooterInfo' ) ); |
39 | 39 | |
40 | 40 | // Add an action link in the plugin listing page |
41 | - if ( $this->_shouldSetPluginActionLinks() ) { |
|
41 | + if ( $this->_shouldSetPluginActionLinks() ) { |
|
42 | 42 | add_filter( |
43 | 43 | 'plugin_action_links_' . plugin_basename( $this->oProp->aScriptInfo[ 'sPath' ] ), |
44 | 44 | array( $this, '_replyToAddSettingsLinkInPluginListingPage' ), |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * @return boolean |
56 | 56 | */ |
57 | 57 | private function _isLoadable( $oProp ) { |
58 | - if ( ! $oProp->bIsAdmin ) { |
|
58 | + if ( ! $oProp->bIsAdmin ) { |
|
59 | 59 | return false; |
60 | 60 | } |
61 | 61 | if ( $oProp->bIsAdminAjax ) { |
@@ -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 { |
@@ -67,16 +67,16 @@ discard block |
||
67 | 67 | */ |
68 | 68 | protected function getField( $aField ) { |
69 | 69 | |
70 | - $_oCallerForm = $aField[ '_caller_object' ]; |
|
70 | + $_oCallerForm = $aField[ '_caller_object' ]; |
|
71 | 71 | |
72 | 72 | $_aInlineMixedOutput = array(); |
73 | - foreach( $this->getAsArray( $aField[ 'content' ] ) as $_aChildFieldset ) { |
|
73 | + foreach ( $this->getAsArray( $aField[ 'content' ] ) as $_aChildFieldset ) { |
|
74 | 74 | |
75 | 75 | if ( is_scalar( $_aChildFieldset ) ) { |
76 | 76 | continue; |
77 | 77 | } |
78 | 78 | |
79 | - if ( ! $this->isNormalPlacement( $_aChildFieldset ) ) { |
|
79 | + if ( !$this->isNormalPlacement( $_aChildFieldset ) ) { |
|
80 | 80 | continue; |
81 | 81 | } |
82 | 82 | |
@@ -92,12 +92,12 @@ discard block |
||
92 | 92 | $_oFieldset = new AdminPageFramework_Form_View___Fieldset( |
93 | 93 | $_aChildFieldset, |
94 | 94 | $_oCallerForm->aSavedData, |
95 | - $_oCallerForm->getFieldErrors(), // @todo Generate field errors. $this->aErrors, |
|
95 | + $_oCallerForm->getFieldErrors(), // @todo Generate field errors. $this->aErrors, |
|
96 | 96 | $_oCallerForm->aFieldTypeDefinitions, |
97 | 97 | $_oCallerForm->oMsg, |
98 | 98 | $_oCallerForm->aCallbacks // field output element callables. |
99 | 99 | ); |
100 | - $_aInlineMixedOutput[] = $_oFieldset->get(); // field output |
|
100 | + $_aInlineMixedOutput[ ] = $_oFieldset->get(); // field output |
|
101 | 101 | |
102 | 102 | |
103 | 103 | } |
@@ -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 { |
@@ -218,8 +218,8 @@ |
||
218 | 218 | * @remark $_aDefaultKeys holds shared default key-values defined in the base class. |
219 | 219 | */ |
220 | 220 | protected $aDefaultKeys = array( |
221 | - 'label_min_width' => '', // disabled as the embedded elements are all inline. |
|
222 | - 'show_debug_info' => false, // 3.8.8+ @todo Examine why this value does not override the default value of field definition arguments and if possible and appropriate, override it. |
|
221 | + 'label_min_width' => '', // disabled as the embedded elements are all inline. |
|
222 | + 'show_debug_info' => false, // 3.8.8+ @todo Examine why this value does not override the default value of field definition arguments and if possible and appropriate, override it. |
|
223 | 223 | ); |
224 | 224 | |
225 | 225 |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | * @return array The label container attribute array. |
305 | 305 | * @internal |
306 | 306 | */ |
307 | - private function _getLabelContainerAttributes( array $aField ) { |
|
307 | + private function _getLabelContainerAttributes( array $aField ) { |
|
308 | 308 | return array( |
309 | 309 | 'style' => $aField['label_min_width'] |
310 | 310 | ? "min-width:" . $this->sanitizeLength( $aField['label_min_width'] ) . ";" |
@@ -540,19 +540,19 @@ discard block |
||
540 | 540 | * @since 2.1.5 Moved from `AdminPageFramwrork_InputField`. Changed the scope to protected from private. Removed the second parameter. |
541 | 541 | * @internal |
542 | 542 | */ |
543 | - protected function _getInputFieldValueFromLabel( $aField ) { |
|
543 | + protected function _getInputFieldValueFromLabel( $aField ) { |
|
544 | 544 | |
545 | 545 | // If the value key is explicitly set, use it. But the empty string will be ignored. |
546 | - if ( isset( $aField[ 'value' ] ) && $aField[ 'value' ] != '' ) { |
|
546 | + if ( isset( $aField[ 'value' ] ) && $aField[ 'value' ] != '' ) { |
|
547 | 547 | return $aField[ 'value' ]; |
548 | 548 | } |
549 | 549 | |
550 | - if ( isset( $aField[ 'label' ] ) ) { |
|
550 | + if ( isset( $aField[ 'label' ] ) ) { |
|
551 | 551 | return $aField[ 'label' ]; |
552 | 552 | } |
553 | 553 | |
554 | 554 | // If the default value is set, |
555 | - if ( isset( $aField[ 'default' ] ) ) { |
|
555 | + if ( isset( $aField[ 'default' ] ) ) { |
|
556 | 556 | return $aField[ 'default' ]; |
557 | 557 | } |
558 | 558 |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | /** |
188 | 188 | * Defines the field type slugs used for this field type. |
189 | 189 | */ |
190 | - public $aFieldTypeSlugs = array( 'submit', ); |
|
190 | + public $aFieldTypeSlugs = array( 'submit',); |
|
191 | 191 | |
192 | 192 | /** |
193 | 193 | * Defines the default key-values of this field type. |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | 'redirect_url' => null, |
199 | 199 | 'href' => null, |
200 | 200 | 'reset' => null, |
201 | - 'email' => null, // [3.3.0+] string of an email address to send to or it can be an array with the following keys. |
|
201 | + 'email' => null, // [3.3.0+] string of an email address to send to or it can be an array with the following keys. |
|
202 | 202 | /* |
203 | 203 | array( |
204 | 204 | 'to' => null, // string|array The email address to send to or an array representing the key structure of the submitted form data holding the value. The first key should be the section ID and the second key is the the field ID. |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | 'attachments' => null, // string|array The file path(s) or an array representing the key structure of the submitted form data holding the value. The first key should be the section ID and the second key is the the field ID. |
209 | 209 | ) |
210 | 210 | */ |
211 | - 'skip_confirmation' => false, // 3.7.6+ For emails. |
|
211 | + 'skip_confirmation' => false, // 3.7.6+ For emails. |
|
212 | 212 | 'attributes' => array( |
213 | 213 | 'class' => 'button button-primary', |
214 | 214 | ), |
@@ -248,16 +248,16 @@ discard block |
||
248 | 248 | |
249 | 249 | return |
250 | 250 | $aField[ 'before_label' ] |
251 | - . "<div " . $this->getAttributes( $_aLabelContainerAttributes ) . ">" |
|
251 | + . "<div ".$this->getAttributes( $_aLabelContainerAttributes ).">" |
|
252 | 252 | . $this->_getExtraFieldsBeforeLabel( $aField ) // this is for the import field type that cannot place file input tag inside the label tag. |
253 | - . "<label " . $this->getAttributes( $_aLabelAttributes ) . ">" |
|
253 | + . "<label ".$this->getAttributes( $_aLabelAttributes ).">" |
|
254 | 254 | . $aField[ 'before_input' ] |
255 | 255 | . $this->_getExtraInputFields( $aField ) |
256 | - . "<input " . $this->getAttributes( $_aInputAttributes ) . " />" // this method is defined in the base class |
|
256 | + . "<input ".$this->getAttributes( $_aInputAttributes )." />" // this method is defined in the base class |
|
257 | 257 | . $aField[ 'after_input' ] |
258 | 258 | . "</label>" |
259 | 259 | . "</div>" |
260 | - . $aField['after_label']; |
|
260 | + . $aField[ 'after_label' ]; |
|
261 | 261 | |
262 | 262 | } |
263 | 263 | /** |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | private function _getLabelAttributes( array $aField, array $aInputAttributes ) { |
290 | 290 | return array( |
291 | 291 | 'style' => $aField[ 'label_min_width' ] |
292 | - ? "min-width:" . $this->getLengthSanitized( $aField[ 'label_min_width' ] ) . ";" |
|
292 | + ? "min-width:".$this->getLengthSanitized( $aField[ 'label_min_width' ] ).";" |
|
293 | 293 | : null, |
294 | 294 | 'for' => $aInputAttributes[ 'id' ], |
295 | 295 | 'class' => $aInputAttributes[ 'disabled' ] |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | private function _getLabelContainerAttributes( array $aField ) { |
308 | 308 | return array( |
309 | 309 | 'style' => $aField[ 'label_min_width' ] |
310 | - ? "min-width:" . $this->getLengthSanitized( $aField[ 'label_min_width' ] ) . ";" |
|
310 | + ? "min-width:".$this->getLengthSanitized( $aField[ 'label_min_width' ] ).";" |
|
311 | 311 | : null, |
312 | 312 | 'class' => 'admin-page-framework-input-label-container' |
313 | 313 | . ' admin-page-framework-input-button-container' |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | protected function _getExtraInputFields( &$aField ) { |
359 | 359 | |
360 | 360 | $_aOutput = array(); |
361 | - $_aOutput[] = $this->getHTMLTag( |
|
361 | + $_aOutput[ ] = $this->getHTMLTag( |
|
362 | 362 | 'input', |
363 | 363 | array( |
364 | 364 | 'type' => 'hidden', |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | 'value' => $aField[ 'input_id' ], |
367 | 367 | ) |
368 | 368 | ); |
369 | - $_aOutput[] = $this->getHTMLTag( |
|
369 | + $_aOutput[ ] = $this->getHTMLTag( |
|
370 | 370 | 'input', |
371 | 371 | array( |
372 | 372 | 'type' => 'hidden', |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | 'value' => $aField[ 'field_id' ], |
375 | 375 | ) |
376 | 376 | ); |
377 | - $_aOutput[] = $this->getHTMLTag( |
|
377 | + $_aOutput[ ] = $this->getHTMLTag( |
|
378 | 378 | 'input', |
379 | 379 | array( |
380 | 380 | 'type' => 'hidden', |
@@ -382,11 +382,11 @@ discard block |
||
382 | 382 | 'value' => $aField[ '_input_name_flat' ], |
383 | 383 | ) |
384 | 384 | ); |
385 | - $_aOutput[] = $this->_getHiddenInput_SectionID( $aField ); |
|
386 | - $_aOutput[] = $this->_getHiddenInputByKey( $aField, 'redirect_url' ); |
|
387 | - $_aOutput[] = $this->_getHiddenInputByKey( $aField, 'href' ); |
|
388 | - $_aOutput[] = $this->_getHiddenInput_Reset( $aField ); |
|
389 | - $_aOutput[] = $this->_getHiddenInput_Email( $aField ); |
|
385 | + $_aOutput[ ] = $this->_getHiddenInput_SectionID( $aField ); |
|
386 | + $_aOutput[ ] = $this->_getHiddenInputByKey( $aField, 'redirect_url' ); |
|
387 | + $_aOutput[ ] = $this->_getHiddenInputByKey( $aField, 'href' ); |
|
388 | + $_aOutput[ ] = $this->_getHiddenInput_Reset( $aField ); |
|
389 | + $_aOutput[ ] = $this->_getHiddenInput_Email( $aField ); |
|
390 | 390 | return implode( PHP_EOL, array_filter( $_aOutput ) ); |
391 | 391 | |
392 | 392 | } |
@@ -402,9 +402,9 @@ discard block |
||
402 | 402 | 'input', |
403 | 403 | array( |
404 | 404 | 'type' => 'hidden', |
405 | - 'name' => "__submit[{$aField['input_id']}][section_id]", |
|
406 | - 'value' => isset( $aField['section_id'] ) && '_default' !== $aField['section_id'] |
|
407 | - ? $aField['section_id'] |
|
405 | + 'name' => "__submit[{$aField[ 'input_id' ]}][section_id]", |
|
406 | + 'value' => isset( $aField[ 'section_id' ] ) && '_default' !== $aField[ 'section_id' ] |
|
407 | + ? $aField[ 'section_id' ] |
|
408 | 408 | : '', |
409 | 409 | ) |
410 | 410 | ); |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | 'input', |
423 | 423 | array( |
424 | 424 | 'type' => 'hidden', |
425 | - 'name' => "__submit[{$aField['input_id']}][{$sKey}]", |
|
425 | + 'name' => "__submit[{$aField[ 'input_id' ]}][{$sKey}]", |
|
426 | 426 | 'value' => $aField[ $sKey ], |
427 | 427 | ) |
428 | 428 | ) |
@@ -436,15 +436,15 @@ discard block |
||
436 | 436 | * @return string the HTML input tag output for the 'reset' argument. |
437 | 437 | */ |
438 | 438 | private function _getHiddenInput_Reset( array $aField ) { |
439 | - if ( ! $aField['reset'] ) { |
|
439 | + if ( !$aField[ 'reset' ] ) { |
|
440 | 440 | return ''; |
441 | 441 | } |
442 | - return ! $this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'reset' ) |
|
442 | + return !$this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'reset' ) |
|
443 | 443 | ? $this->getHTMLTag( |
444 | 444 | 'input', |
445 | 445 | array( |
446 | 446 | 'type' => 'hidden', |
447 | - 'name' => "__submit[{$aField['input_id']}][is_reset]", |
|
447 | + 'name' => "__submit[{$aField[ 'input_id' ]}][is_reset]", |
|
448 | 448 | 'value' => '1', |
449 | 449 | ) |
450 | 450 | ) |
@@ -452,10 +452,10 @@ discard block |
||
452 | 452 | 'input', |
453 | 453 | array( |
454 | 454 | 'type' => 'hidden', |
455 | - 'name' => "__submit[{$aField['input_id']}][reset_key]", |
|
456 | - 'value' => is_array( $aField['reset'] ) // set the option array key to delete. |
|
457 | - ? implode( '|', $aField['reset'] ) |
|
458 | - : $aField['reset'], |
|
455 | + 'name' => "__submit[{$aField[ 'input_id' ]}][reset_key]", |
|
456 | + 'value' => is_array( $aField[ 'reset' ] ) // set the option array key to delete. |
|
457 | + ? implode( '|', $aField[ 'reset' ] ) |
|
458 | + : $aField[ 'reset' ], |
|
459 | 459 | ) |
460 | 460 | ); |
461 | 461 | } |
@@ -472,10 +472,10 @@ discard block |
||
472 | 472 | return ''; |
473 | 473 | } |
474 | 474 | $this->setTransient( |
475 | - 'apf_em_' . md5( $aField[ '_input_name_flat' ] . get_current_user_id() ), |
|
475 | + 'apf_em_'.md5( $aField[ '_input_name_flat' ].get_current_user_id() ), |
|
476 | 476 | $aField[ 'email' ] |
477 | 477 | ); |
478 | - return ! $this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'email' ) |
|
478 | + return !$this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'email' ) |
|
479 | 479 | ? $this->getHTMLTag( |
480 | 480 | 'input', |
481 | 481 | array( |
@@ -500,19 +500,19 @@ discard block |
||
500 | 500 | * @return boolean |
501 | 501 | * @internal |
502 | 502 | */ |
503 | - private function _checkConfirmationDisplayed( $aField, $sFlatFieldName, $sType='reset' ) { |
|
503 | + private function _checkConfirmationDisplayed( $aField, $sFlatFieldName, $sType = 'reset' ) { |
|
504 | 504 | |
505 | - switch( $sType ) { |
|
505 | + switch ( $sType ) { |
|
506 | 506 | default: |
507 | 507 | case 'reset': // admin page framework _ reset confirmation |
508 | - $_sTransientKey = 'apf_rc_' . md5( $sFlatFieldName . get_current_user_id() ); |
|
508 | + $_sTransientKey = 'apf_rc_'.md5( $sFlatFieldName.get_current_user_id() ); |
|
509 | 509 | break; |
510 | 510 | case 'email': // admin page framework _ email confirmation |
511 | - $_sTransientKey = 'apf_ec_' . md5( $sFlatFieldName . get_current_user_id() ); |
|
511 | + $_sTransientKey = 'apf_ec_'.md5( $sFlatFieldName.get_current_user_id() ); |
|
512 | 512 | break; |
513 | 513 | } |
514 | 514 | |
515 | - $_bConfirmed = false === $this->getTransient( $_sTransientKey ) && ! $aField[ 'skip_confirmation' ] |
|
515 | + $_bConfirmed = false === $this->getTransient( $_sTransientKey ) && !$aField[ 'skip_confirmation' ] |
|
516 | 516 | ? false |
517 | 517 | : true; |
518 | 518 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * @since 3.6.0 |
27 | 27 | */ |
28 | - public $sContext = 'fieldset'; |
|
28 | + public $sContext = 'fieldset'; |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Returns an attribute array. |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | */ |
34 | 34 | protected function _getAttributes() { |
35 | 35 | return array( |
36 | - 'id' => $this->sContext . '-' . $this->aArguments[ 'tag_id' ], |
|
36 | + 'id' => $this->sContext.'-'.$this->aArguments[ 'tag_id' ], |
|
37 | 37 | 'class' => implode( |
38 | 38 | ' ', |
39 | 39 | array( |
40 | - 'admin-page-framework-' . $this->sContext, |
|
40 | + 'admin-page-framework-'.$this->sContext, |
|
41 | 41 | $this->_getSelectorForChildFieldset() |
42 | 42 | ) |
43 | 43 | ), |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | return ''; |
57 | 57 | } |
58 | 58 | if ( $this->aArguments[ '_nested_depth' ] == 1 ) { |
59 | - return 'child-fieldset nested-depth-' . $this->aArguments[ '_nested_depth' ]; |
|
59 | + return 'child-fieldset nested-depth-'.$this->aArguments[ '_nested_depth' ]; |
|
60 | 60 | } |
61 | - return 'child-fieldset multiple-nesting nested-depth-' . $this->aArguments[ '_nested_depth' ]; |
|
61 | + return 'child-fieldset multiple-nesting nested-depth-'.$this->aArguments[ '_nested_depth' ]; |
|
62 | 62 | |
63 | 63 | } |
64 | 64 |
@@ -70,7 +70,7 @@ |
||
70 | 70 | } |
71 | 71 | |
72 | 72 | // If the first element is a string, it is a inline mixed field definition. |
73 | - return is_array( self::getElement( $aFieldset[ 'content' ], 0 ) ); |
|
73 | + return is_array( self::getElement( $aFieldset[ 'content' ], 0 ) ); |
|
74 | 74 | |
75 | 75 | } |
76 | 76 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | static public function hasNestedFields( array $aFieldset ) { |
61 | 61 | |
62 | - if ( ! self::hasFieldDefinitionsInContent( $aFieldset ) ) { |
|
62 | + if ( !self::hasFieldDefinitionsInContent( $aFieldset ) ) { |
|
63 | 63 | return false; |
64 | 64 | } |
65 | 65 | // At this point, the `content` argument contains either the definition of nested fields or inline-mixed fields. |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | static public function hasFieldDefinitionsInContent( array $aFieldset ) { |
105 | 105 | |
106 | - if ( ! isset( $aFieldset[ 'content' ] ) ) { |
|
106 | + if ( !isset( $aFieldset[ 'content' ] ) ) { |
|
107 | 107 | return false; |
108 | 108 | } |
109 | 109 | if ( empty( $aFieldset[ 'content' ] ) ) { |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | if ( empty( $sString ) ) { |
156 | 156 | return $sString; |
157 | 157 | } |
158 | - return $sString . '|'; |
|
158 | + return $sString.'|'; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -171,17 +171,17 @@ discard block |
||
171 | 171 | */ |
172 | 172 | static public function getFieldsetReformattedBySubFieldIndex( array $aFieldset, $iSubFieldIndex, $bHasSubFields, array $aParentFieldset ) { |
173 | 173 | |
174 | - $_oCallerForm = $aFieldset[ '_caller_object' ]; |
|
174 | + $_oCallerForm = $aFieldset[ '_caller_object' ]; |
|
175 | 175 | |
176 | 176 | // Add sub-field index to the parent field path for repeated nested items. |
177 | - $aFieldset[ '_parent_field_path' ] = self::getAOrB( |
|
177 | + $aFieldset[ '_parent_field_path' ] = self::getAOrB( |
|
178 | 178 | $bHasSubFields, |
179 | - $aFieldset[ '_parent_field_path' ] . '|' . $iSubFieldIndex, |
|
179 | + $aFieldset[ '_parent_field_path' ].'|'.$iSubFieldIndex, |
|
180 | 180 | $aFieldset[ '_parent_field_path' ] |
181 | 181 | ); |
182 | - $aFieldset[ '_parent_tag_id' ] = self::getAOrB( |
|
182 | + $aFieldset[ '_parent_tag_id' ] = self::getAOrB( |
|
183 | 183 | $bHasSubFields, |
184 | - $aParentFieldset[ 'tag_id' ] . '__' . $iSubFieldIndex, |
|
184 | + $aParentFieldset[ 'tag_id' ].'__'.$iSubFieldIndex, |
|
185 | 185 | $aParentFieldset[ 'tag_id' ] |
186 | 186 | ); |
187 | 187 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | $aFieldset, |
191 | 191 | $aFieldset[ '_structure_type' ], |
192 | 192 | $aFieldset[ 'capability' ], |
193 | - ( integer ) $iSubFieldIndex + 1, // 1-based count (not index) |
|
193 | + ( integer ) $iSubFieldIndex + 1, // 1-based count (not index) |
|
194 | 194 | $aFieldset[ '_subsection_index' ], |
195 | 195 | $aFieldset[ '_is_section_repeatable' ], |
196 | 196 | $aFieldset[ '_caller_object' ] |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | |
200 | 200 | $_oFieldsetOutputFormatter = new AdminPageFramework_Form_Model___Format_FieldsetOutput( |
201 | 201 | $aFieldset, |
202 | - $aFieldset[ '_section_index' ], // `_section_index` is defined in the ...FieldsetOutput class. Since this is a nested item, it should be already set. |
|
202 | + $aFieldset[ '_section_index' ], // `_section_index` is defined in the ...FieldsetOutput class. Since this is a nested item, it should be already set. |
|
203 | 203 | $_oCallerForm->aFieldTypeDefinitions |
204 | 204 | ); |
205 | 205 | return $_oFieldsetOutputFormatter->get(); |
@@ -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 |
@@ -44,7 +44,7 @@ |
||
44 | 44 | call_user_func_array( |
45 | 45 | $aFieldTypeDefinition[ 'hfFieldSetTypeSetter' ], |
46 | 46 | array( $sStructureType ) |
47 | - ); |
|
47 | + ); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | if ( is_callable( $aFieldTypeDefinition[ 'hfFieldLoader' ] ) ) { |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | * Represents the structure of the sub-field definition array. |
25 | 25 | */ |
26 | 26 | static public $aStructure = array( |
27 | - '_is_sub_field' => false, // @todo change this key name as all the parsed field is technically a sub-field. |
|
28 | - '_index' => 0, // indicates the field index |
|
27 | + '_is_sub_field' => false, // @todo change this key name as all the parsed field is technically a sub-field. |
|
28 | + '_index' => 0, // indicates the field index |
|
29 | 29 | '_is_multiple_fields' => false, |
30 | 30 | '_saved_value' => null, |
31 | 31 | '_is_value_set_by_user' => false, |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | '_fields_container_id' => '', |
40 | 40 | '_fieldset_container_id' => '', |
41 | 41 | |
42 | - '_field_object' => null, // 3.6.0+ |
|
43 | - '_parent_field_object' => null, // 3.6.0+ Stores the parent field object to be accessed from the nested fields to generate id and name attribute models. |
|
42 | + '_field_object' => null, // 3.6.0+ |
|
43 | + '_parent_field_object' => null, // 3.6.0+ Stores the parent field object to be accessed from the nested fields to generate id and name attribute models. |
|
44 | 44 | ); |
45 | 45 | |
46 | 46 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | $_aField = $this->aField + self::$aStructure; |
89 | 89 | |
90 | - $_aField[ '_is_sub_field' ] = is_numeric( $this->isIndex ) && 0 < $this->isIndex; // 3.5.3+ |
|
90 | + $_aField[ '_is_sub_field' ] = is_numeric( $this->isIndex ) && 0 < $this->isIndex; // 3.5.3+ |
|
91 | 91 | $_aField[ '_index' ] = $this->isIndex; |
92 | 92 | |
93 | 93 | // 'input_id' - something like ({section id}_){field_id}__{index} e.g. my_section_id_my_field_id__0 |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | 'value' => $_aField[ 'value' ], |
135 | 135 | 'type' => $_aField[ 'type' ], // text, password, etc. |
136 | 136 | 'disabled' => null, |
137 | - 'data-id_model' => $_aField[ '_input_id_model' ], // 3.3.1+ |
|
138 | - 'data-name_model' => $_aField[ '_input_name_model' ], // 3.3.1+ |
|
137 | + 'data-id_model' => $_aField[ '_input_id_model' ], // 3.3.1+ |
|
138 | + 'data-name_model' => $_aField[ '_input_name_model' ], // 3.3.1+ |
|
139 | 139 | ) |
140 | 140 | ), |
141 | 141 | // this allows sub-fields with different field types to set the default key-values for the sub-field. |