Test Failed
Branch dev (88dacc)
by Michael
02:09
created
_common/form/field_type/posttype/AdminPageFramework_FieldType_posttype.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     /**
81 81
      * Defines the field type slugs used for this field type.
82 82
      */
83
-    public $aFieldTypeSlugs = array( 'posttype', );
83
+    public $aFieldTypeSlugs = array( 'posttype',);
84 84
 
85 85
     /**
86 86
      * Defines the default key-values of this field type.
@@ -88,20 +88,20 @@  discard block
 block discarded – undo
88 88
      * @remark $_aDefaultKeys holds shared default key-values defined in the base class.
89 89
      */
90 90
     protected $aDefaultKeys = array(
91
-        'slugs_to_remove'       => null,    // the default array will be assigned in the rendering method.
91
+        'slugs_to_remove'       => null, // the default array will be assigned in the rendering method.
92 92
         /**
93 93
          * Accepts query arguments. For the argument specification, see the arg parameter of get_post_types() function.
94 94
          * See: http://codex.wordpress.org/Function_Reference/get_post_types#Parameters
95 95
          */
96
-        'query'                 => array(),  // 3.2.1+
97
-        'operator'              => 'and',    // 3.2.1+ either 'and' or 'or'
96
+        'query'                 => array(), // 3.2.1+
97
+        'operator'              => 'and', // 3.2.1+ either 'and' or 'or'
98 98
         'attributes'            => array(
99 99
             'size'      => 30,
100 100
             'maxlength' => 400,
101 101
         ),
102
-        'select_all_button'     => true,     // 3.3.0+   to change the label, set the label here
103
-        'select_none_button'    => true,     // 3.3.0+   to change the label, set the label here
104
-        'save_unchecked'        => true,     // (optional, boolean) 3.8.8+   Whether to store the values of unchecked items.
102
+        'select_all_button'     => true, // 3.3.0+   to change the label, set the label here
103
+        'select_none_button'    => true, // 3.3.0+   to change the label, set the label here
104
+        'save_unchecked'        => true, // (optional, boolean) 3.8.8+   Whether to store the values of unchecked items.
105 105
     );
106 106
     protected $aDefaultRemovingPostTypeSlugs = array(
107 107
         'revision',
@@ -123,11 +123,11 @@  discard block
 block discarded – undo
123 123
      * @return      string
124 124
      */
125 125
     protected function getField( $aField ) {
126
-        $this->_sCheckboxClassSelector = '';    // disable the checkbox class selector.
126
+        $this->_sCheckboxClassSelector = ''; // disable the checkbox class selector.
127 127
         $aField[ 'label' ] = $this->_getPostTypeArrayForChecklist(
128 128
             isset( $aField[ 'slugs_to_remove' ] )
129 129
                 ? $this->getAsArray( $aField[ 'slugs_to_remove' ] )
130
-                : $this->aDefaultRemovingPostTypeSlugs,    // slugs to remove
130
+                : $this->aDefaultRemovingPostTypeSlugs, // slugs to remove
131 131
             $aField[ 'query' ],
132 132
             $aField[ 'operator' ]
133 133
         );
@@ -147,10 +147,10 @@  discard block
 block discarded – undo
147 147
          * @return  array   The array holding the elements of installed post types' labels and their slugs except the specified expluding post types.
148 148
          * @internal
149 149
          */
150
-        private function _getPostTypeArrayForChecklist( $aSlugsToRemove, $asQueryArgs=array(), $sOperator='and' ) {
150
+        private function _getPostTypeArrayForChecklist( $aSlugsToRemove, $asQueryArgs = array(), $sOperator = 'and' ) {
151 151
             $_aPostTypes = array();
152
-            foreach( get_post_types( $asQueryArgs, 'objects' ) as $_oPostType ) {
153
-                if (  isset( $_oPostType->name, $_oPostType->label ) ) {
152
+            foreach ( get_post_types( $asQueryArgs, 'objects' ) as $_oPostType ) {
153
+                if ( isset( $_oPostType->name, $_oPostType->label ) ) {
154 154
                     $_aPostTypes[ $_oPostType->name ] = $_oPostType->label;
155 155
                 }
156 156
             }
Please login to merge, or discard this patch.
_common/form/field_type/contact/AdminPageFramework_FieldType_contact.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
     /**
155 155
      * Defines the field type slugs used for this field type.
156 156
      */
157
-    public $aFieldTypeSlugs = array( 'contact', );
157
+    public $aFieldTypeSlugs = array( 'contact',);
158 158
 
159 159
     /**
160 160
      * @var string
@@ -168,14 +168,14 @@  discard block
 block discarded – undo
168 168
     protected function construct() {
169 169
         $this->aDefaultKeys = array(
170 170
             'email' => array(
171
-                '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 field ID.
172
-                'subject'       => null,    // string|array     The email title 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 field ID.
173
-                'message'       => null,    // string|array     The email body 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 field ID.
174
-                'headers'       => null,    // string|array     The email header 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 field ID.
175
-                '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 field ID.
176
-                'is_html'       => true,    // boolean  Whether the mail should be sent as an html text
177
-                'from'          => null,    // the sender email 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 field ID.
178
-                'name'          => null,    // the sender name 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 field ID.
171
+                '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 field ID.
172
+                'subject'       => null, // string|array     The email title 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 field ID.
173
+                'message'       => null, // string|array     The email body 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 field ID.
174
+                'headers'       => null, // string|array     The email header 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 field ID.
175
+                '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 field ID.
176
+                'is_html'       => true, // boolean  Whether the mail should be sent as an html text
177
+                'from'          => null, // the sender email 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 field ID.
178
+                'name'          => null, // the sender name 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 field ID.
179 179
                 'data'          => array(), // array            extra data appended to the message
180 180
             ),
181 181
             'system_message' => array(
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         // This is a dummy callback. Adding a dummy callback because WordPress does not proceed in admin-ajax.php
189 189
         // and the `admin_init` action is not triggered if no `wp_ajax_{...}` action is registered.
190 190
         // for guests:  `wp_ajax_nopriv_{...}` might be needed. Not tested for front-end uses.
191
-        add_action( "wp_ajax_{$this->___sAction}" , '__return_empty_string' );
191
+        add_action( "wp_ajax_{$this->___sAction}", '__return_empty_string' );
192 192
     }
193 193
 
194 194
     /**
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
         return array(
212 212
             array(
213 213
                 'handle_id'     => 'admin-page-framework-field-type-contact',
214
-                'src'           => dirname( __FILE__ ) . '/js/contact.bundle.js',
214
+                'src'           => dirname( __FILE__ ).'/js/contact.bundle.js',
215 215
                 'in_footer'         => true,
216 216
                 'dependencies'      => array( 'jquery', 'admin-page-framework-script-form-main' ),
217 217
                 'translation_var'   => 'AdminPageFrameworkContactFieldType',
@@ -248,8 +248,8 @@  discard block
 block discarded – undo
248 248
                 return array();
249 249
             }
250 250
             return array(
251
-                'email'             => true,    // for the JavaScript script to detect
252
-                'input_flat'        => $aField[ '_input_name_flat' ],  // this is a part of the email transient key. This is passed to the Ajax response event so that it can receive the transient set for this field
251
+                'email'             => true, // for the JavaScript script to detect
252
+                'input_flat'        => $aField[ '_input_name_flat' ], // this is a part of the email transient key. This is passed to the Ajax response event so that it can receive the transient set for this field
253 253
                 'section_id'        => $aField[ 'section_id' ],
254 254
             );
255 255
         }
@@ -260,15 +260,15 @@  discard block
 block discarded – undo
260 260
      */
261 261
     protected function _getHiddenInput_Email( array $aField ) {
262 262
 
263
-        $_sTransientKey = 'apf_em_' . md5( $aField[ '_input_name_flat' ] . get_current_user_id() );
263
+        $_sTransientKey = 'apf_em_'.md5( $aField[ '_input_name_flat' ].get_current_user_id() );
264 264
         $this->setTransient(
265 265
             $_sTransientKey,
266 266
             array(
267
-                'nonce' => $this->getNonceCreated( 'apf_email_nonce_' . md5( ( string ) site_url() ), 86400 ),  // @todo the nonce is crated when the page is rendered so change this to when the form is submitted so that a shorter nonce lifespan can be set.
267
+                'nonce' => $this->getNonceCreated( 'apf_email_nonce_'.md5( ( string ) site_url() ), 86400 ), // @todo the nonce is crated when the page is rendered so change this to when the form is submitted so that a shorter nonce lifespan can be set.
268 268
                 'system_message' => $this->getElementAsArray( $aField, 'system_message' ),
269 269
             ) + $this->getAsArray( $aField[ 'email' ] )
270 270
         );
271
-        return ! $this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'email' )
271
+        return !$this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'email' )
272 272
             ? $this->getHTMLTag(
273 273
                 'input',
274 274
                 array(
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
      */
306 306
     private function ___doAjaxResponse() {
307 307
 
308
-        if ( false === wp_verify_nonce( $this->getElement( $_REQUEST, 'nonce' ),  get_class( $this ) ) ) {
308
+        if ( false === wp_verify_nonce( $this->getElement( $_REQUEST, 'nonce' ), get_class( $this ) ) ) {
309 309
             wp_send_json( array(
310 310
                 'result'  => false,
311 311
                 'message' => $this->oMsg->get( 'nonce_verification_failed' )
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
         $_sRootDimension   = reset( $_aInputPath );
320 320
         $_aForm            = $this->___getFormDataParsed( $this->getElementAsArray( $_aRequest, array( 'form' ) ) );
321 321
         $_aInputs          = $this->getElementAsArray( $_aForm, array( $_sRootDimension ) );
322
-        $_sTransientKey    = 'apf_em_' . md5( $_sInputFlat . get_current_user_id() );
322
+        $_sTransientKey    = 'apf_em_'.md5( $_sInputFlat.get_current_user_id() );
323 323
         $_aEmailOptions    = $this->getTransient( $_sTransientKey );
324 324
         $_aEmailOptions    = $this->getAsArray( $_aEmailOptions ) + array(
325 325
             'nonce'         => '',
@@ -332,8 +332,8 @@  discard block
 block discarded – undo
332 332
             'from'          => '',
333 333
             'name'          => '',
334 334
         );
335
-        $_aMessages        = $this->getElementAsArray( $_aEmailOptions, array( 'system_message' ) );
336
-        if ( false === wp_verify_nonce( $_aEmailOptions[ 'nonce' ], 'apf_email_nonce_' . md5( ( string ) site_url() ) ) ) {
335
+        $_aMessages = $this->getElementAsArray( $_aEmailOptions, array( 'system_message' ) );
336
+        if ( false === wp_verify_nonce( $_aEmailOptions[ 'nonce' ], 'apf_email_nonce_'.md5( ( string ) site_url() ) ) ) {
337 337
             wp_send_json( array(
338 338
                 'result'  => false,
339 339
                 'message' => $this->getElement( $_aMessages, 'error', $this->oMsg->get( 'nonce_verification_failed' ) )
@@ -371,12 +371,12 @@  discard block
 block discarded – undo
371 371
          */
372 372
         private function ___getFormDataParsed( array $aForm ) {
373 373
             $_aForm = array();
374
-            $aForm  = array_reverse( $aForm );  // to preserver checkbox checked values as checkbox inputs have a preceding hidden input with the same name.
375
-            foreach( $aForm as $_iIndex => $_aNameValue ) {
376
-                parse_str( $_aNameValue[ 'name' ] . '=' . $_aNameValue[ 'value' ], $_a );
374
+            $aForm  = array_reverse( $aForm ); // to preserver checkbox checked values as checkbox inputs have a preceding hidden input with the same name.
375
+            foreach ( $aForm as $_iIndex => $_aNameValue ) {
376
+                parse_str( $_aNameValue[ 'name' ].'='.$_aNameValue[ 'value' ], $_a );
377 377
                 $_aForm = $this->uniteArrays( $_aForm, $_a );
378 378
             }
379
-            return array_reverse( $_aForm );    // @note inner nested elements are still in the reversed order
379
+            return array_reverse( $_aForm ); // @note inner nested elements are still in the reversed order
380 380
         }
381 381
     
382 382
 }
383 383
\ No newline at end of file
Please login to merge, or discard this patch.
factory/_common/form/field_type/size/AdminPageFramework_FieldType_size.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     /**
65 65
      * Defines the field type slugs used for this field type.
66 66
      */
67
-    public $aFieldTypeSlugs = array( 'size', );
67
+    public $aFieldTypeSlugs = array( 'size',);
68 68
 
69 69
     /**
70 70
      * Defines the default key-values of this field type.
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      */
74 74
     protected $aDefaultKeys = array(
75 75
         'is_multiple'           => false, // indicates whether the select tag alloes multiple selections.
76
-        'units'                 => null,  // do not define units here since this will be merged with the user defined field array.
76
+        'units'                 => null, // do not define units here since this will be merged with the user defined field array.
77 77
         'attributes'            => array(
78 78
             'size'      => array(
79 79
                 'min'           => null,
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      */
102 102
     protected $aDefaultUnits = array(
103 103
         'px'    => 'px', // pixel
104
-        '%'     => '%',  // percentage
104
+        '%'     => '%', // percentage
105 105
         'em'    => 'em', // font size
106 106
         'ex'    => 'ex', // font height
107 107
         'in'    => 'in', // inch
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
         );
162 162
 
163 163
         $_aOutput = array();
164
-        foreach( ( array ) $aField[ 'label' ] as $_isKey => $_sLabel ) {
165
-            $_aOutput[] = $this->_getFieldOutputByLabel(
164
+        foreach ( ( array ) $aField[ 'label' ] as $_isKey => $_sLabel ) {
165
+            $_aOutput[ ] = $this->_getFieldOutputByLabel(
166 166
                 $_isKey,
167 167
                 $_sLabel,
168 168
                 $aField
@@ -185,8 +185,8 @@  discard block
 block discarded – undo
185 185
 
186 186
             $_aBaseAttributes   = $_bMultiLabels
187 187
                 ? array(
188
-                        'name'  => $aField[ 'attributes' ][ 'name' ] . "[{$isKey}]",
189
-                        'id'    => $aField[ 'attributes' ][ 'id' ] . "_{$isKey}",
188
+                        'name'  => $aField[ 'attributes' ][ 'name' ]."[{$isKey}]",
189
+                        'id'    => $aField[ 'attributes' ][ 'id' ]."_{$isKey}",
190 190
                         'value' => $aField[ 'value' ],
191 191
                     )
192 192
                     + $aField[ 'attributes' ]
@@ -198,9 +198,9 @@  discard block
 block discarded – undo
198 198
 
199 199
             $_aOutput = array(
200 200
                 $this->getElementByLabel( $aField[ 'before_label' ], $isKey, $aField[ 'label' ] ),
201
-                    "<div " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-select-label' ) . ">",
202
-                        $this->_getNumberInputPart( $aField, $_aBaseAttributes, $isKey, is_array( $aField[ 'label' ] ) ),  // The size (number) part
203
-                        $this->_getUnitSelectInput( $aField, $_aBaseAttributes, $isKey, is_array( $aField[ 'label' ] ) ),  // The unit (select) part
201
+                    "<div ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-select-label' ).">",
202
+                        $this->_getNumberInputPart( $aField, $_aBaseAttributes, $isKey, is_array( $aField[ 'label' ] ) ), // The size (number) part
203
+                        $this->_getUnitSelectInput( $aField, $_aBaseAttributes, $isKey, is_array( $aField[ 'label' ] ) ), // The unit (select) part
204 204
                     "</div>",
205 205
                 $this->getElementByLabel( $aField[ 'after_label' ], $isKey, $aField[ 'label' ] )
206 206
             );
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
             private function _getNumberInputPart( array $aField, array $aBaseAttributes, $isKey, $bMultiLabels ) {
218 218
 
219 219
                 // Size and Size Label
220
-                $_aSizeAttributes       = $this->_getSizeAttributes(
220
+                $_aSizeAttributes = $this->_getSizeAttributes(
221 221
                     $aField,
222 222
                     $aBaseAttributes,
223 223
                     $bMultiLabels
@@ -225,32 +225,32 @@  discard block
 block discarded – undo
225 225
                         : ''
226 226
                 );
227 227
 
228
-                $_aSizeLabelAttributes  = array(
228
+                $_aSizeLabelAttributes = array(
229 229
                     'for'   => $_aSizeAttributes[ 'id' ],
230 230
                     'class' => $_aSizeAttributes[ 'disabled' ]
231 231
                         ? 'disabled'
232 232
                         : null,
233 233
                 );
234 234
 
235
-                $_sLabel                = $this->getElementByLabel(
235
+                $_sLabel = $this->getElementByLabel(
236 236
                     $aField[ 'label' ],
237 237
                     $isKey,
238 238
                     $aField[ 'label' ]
239 239
                 );
240
-                return "<label " . $this->getAttributes( $_aSizeLabelAttributes ) . ">"
240
+                return "<label ".$this->getAttributes( $_aSizeLabelAttributes ).">"
241 241
                     . $this->getElement(
242 242
                         $aField,
243 243
                         $bMultiLabels
244 244
                             ? array( 'before_label', $isKey, 'size' )
245 245
                             : array( 'before_label', 'size' )
246 246
                     )
247
-                    . ( $aField[ 'label' ] && ! $aField[ 'repeatable' ]
248
-                        ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">"
247
+                    . ( $aField[ 'label' ] && !$aField[ 'repeatable' ]
248
+                        ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">"
249 249
                                 . $_sLabel
250 250
                             . "</span>"
251 251
                         : ""
252 252
                     )
253
-                    . "<input " . $this->getAttributes( $_aSizeAttributes ) . " />"
253
+                    . "<input ".$this->getAttributes( $_aSizeAttributes )." />"
254 254
                     . $this->getElement(
255 255
                         $aField,
256 256
                         $bMultiLabels
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
                     )
294 294
                     : $aField[ 'units' ];
295 295
 
296
-                return "<label " . $this->getAttributes(
296
+                return "<label ".$this->getAttributes(
297 297
                         array(
298 298
                             'for'       => $_aUnitAttributes[ 'id' ],
299 299
                             'class'     => $_aUnitAttributes[ 'disabled' ]
@@ -325,9 +325,9 @@  discard block
 block discarded – undo
325 325
                  * @return      array       an unit attribute array
326 326
                  * @internal
327 327
                  */
328
-                private function _getUnitAttributes( array $aField, array $aBaseAttributes, $isLabelKey='' ) {
328
+                private function _getUnitAttributes( array $aField, array $aBaseAttributes, $isLabelKey = '' ) {
329 329
 
330
-                    $_bIsMultiple    = $aField[ 'is_multiple' ]
330
+                    $_bIsMultiple = $aField[ 'is_multiple' ]
331 331
                         ? true
332 332
                         : $this->getElement(
333 333
                             $aField,
@@ -339,13 +339,13 @@  discard block
 block discarded – undo
339 339
 
340 340
                     $_aSelectAttributes = array(
341 341
                         'type'      => 'select',
342
-                        'id'        => $aField[ 'input_id' ] . ( '' === $isLabelKey ? '' : '_' . $isLabelKey ) . '_' . 'unit',
342
+                        'id'        => $aField[ 'input_id' ].( '' === $isLabelKey ? '' : '_'.$isLabelKey ).'_'.'unit',
343 343
                         'multiple'  => $_bIsMultiple
344 344
                             ? 'multiple'
345 345
                             : null,
346 346
                         'name'      => $_bIsMultiple
347
-                            ? "{$aField['_input_name']}" . ( '' === $isLabelKey ? '' : '[' . $isLabelKey . ']' ) . "[unit][]"
348
-                            : "{$aField['_input_name']}" . ( '' === $isLabelKey ? '' : '[' . $isLabelKey . ']' ) . "[unit]",
347
+                            ? "{$aField[ '_input_name' ]}".( '' === $isLabelKey ? '' : '['.$isLabelKey.']' )."[unit][]"
348
+                            : "{$aField[ '_input_name' ]}".( '' === $isLabelKey ? '' : '['.$isLabelKey.']' )."[unit]",
349 349
                         'value'     => $this->getElement(
350 350
                             $aField,
351 351
                             array( 'value', 'unit' ),
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
                         '' === $isLabelKey
358 358
                             ? array( 'attributes', 'unit' )
359 359
                             : array( 'attributes', $isLabelKey, 'unit' ),
360
-                        $this->aDefaultKeys['attributes']['unit']
360
+                        $this->aDefaultKeys[ 'attributes' ][ 'unit' ]
361 361
                     )
362 362
                     + $aBaseAttributes;
363 363
                     return $_aSelectAttributes;
@@ -371,15 +371,15 @@  discard block
 block discarded – undo
371 371
              * @return      array       an size attribute array
372 372
              * @internal
373 373
              */
374
-            private function _getSizeAttributes( array $aField, array $aBaseAttributes, $sLabelKey='' ) {
374
+            private function _getSizeAttributes( array $aField, array $aBaseAttributes, $sLabelKey = '' ) {
375 375
 
376 376
                 return array(
377 377
                         'type'  => 'number',
378
-                        'id'    => $aField['input_id'] . '_' . ( '' !== $sLabelKey ? $sLabelKey . '_' : '' ) . 'size',
379
-                        'name'  => $aField[ '_input_name' ] . ( '' !== $sLabelKey ? "[{$sLabelKey}]" : '' ) . '[size]',
378
+                        'id'    => $aField[ 'input_id' ].'_'.( '' !== $sLabelKey ? $sLabelKey.'_' : '' ).'size',
379
+                        'name'  => $aField[ '_input_name' ].( '' !== $sLabelKey ? "[{$sLabelKey}]" : '' ).'[size]',
380 380
                         'value' => $this->getElement(
381
-                            $aField,        // subject
382
-                            array( 'value', 'size' ),   // dimensional keys
381
+                            $aField, // subject
382
+                            array( 'value', 'size' ), // dimensional keys
383 383
                             ''  // default
384 384
                         ),
385 385
                     )
Please login to merge, or discard this patch.
_common/form/field_type/media/AdminPageFramework_FieldType_media.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     /**
58 58
      * Defines the field type slugs used for this field type.
59 59
      */
60
-    public $aFieldTypeSlugs = array( 'media', );
60
+    public $aFieldTypeSlugs = array( 'media',);
61 61
 
62 62
     /**
63 63
      * Defines the default key-values of this field type.
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         return array(
91 91
             array(
92 92
                 'handle_id'     => 'admin-page-framework-field-type-media',
93
-                'src'           => dirname( __FILE__ ) . '/js/media.bundle.js',
93
+                'src'           => dirname( __FILE__ ).'/js/media.bundle.js',
94 94
                 'in_footer'         => true,
95 95
                 'dependencies'      => array( 'jquery', 'admin-page-framework-script-form-main' ),
96 96
                 'translation_var'   => 'AdminPageFrameworkMediaFieldType',
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
             $bExternalSource,
124 124
             $bRepeatable
125 125
         );
126
-        return "<a " . $this->getAttributes( $_aAttributes ) . ">"
126
+        return "<a ".$this->getAttributes( $_aAttributes ).">"
127 127
                 . $this->getAOrB(
128 128
                     $_bIsLabelSet,
129 129
                     $_aAttributes[ 'data-label' ],
@@ -144,28 +144,28 @@  discard block
 block discarded – undo
144 144
          */
145 145
         private function ___getFormattedUploadButtonAttributes_Media( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $bExternalSource, $bRepeatable ) {
146 146
 
147
-            $_aAttributes           = array(
147
+            $_aAttributes = array(
148 148
                     'id'                          => "select_media_{$sInputID}",
149 149
                     'href'                        => '#',
150 150
                     'data-input_id'               => $sInputID,
151 151
                     'data-repeatable'             => ( string ) ( boolean ) $bRepeatable,
152
-                    'data-uploader_type'          => ( string ) function_exists( 'wp_enqueue_media' ),    //  ? 1 : 0,
153
-                    'data-enable_external_source' => ( string ) ( boolean ) $bExternalSource,    //  ? 1 : 0,
152
+                    'data-uploader_type'          => ( string ) function_exists( 'wp_enqueue_media' ), //  ? 1 : 0,
153
+                    'data-enable_external_source' => ( string ) ( boolean ) $bExternalSource, //  ? 1 : 0,
154 154
                 )
155 155
                 + $aButtonAttributes
156 156
                 + array(
157 157
                     'title'     => $_bIsLabelSet
158
-                        ? $aButtonAttributes['data-label']
158
+                        ? $aButtonAttributes[ 'data-label' ]
159 159
                         : $this->oMsg->get( 'select_file' ),
160 160
                     'data-label' => null,
161 161
                 );
162
-            $_aAttributes[ 'class' ]  = $this->getClassAttribute(
162
+            $_aAttributes[ 'class' ] = $this->getClassAttribute(
163 163
                 'select_media button button-small ',
164 164
                 $this->getAOrB(
165 165
                     trim( $aButtonAttributes[ 'class' ] ),
166 166
                     $aButtonAttributes[ 'class' ],
167 167
                     $this->getAOrB(
168
-                        ! $_bIsLabelSet && version_compare( $GLOBALS['wp_version'], '3.8', '>=' ),
168
+                        !$_bIsLabelSet && version_compare( $GLOBALS[ 'wp_version' ], '3.8', '>=' ),
169 169
                         'dashicons dashicons-portfolio',
170 170
                         ''
171 171
                     )
Please login to merge, or discard this patch.
_common/form/field_type/submit/AdminPageFramework_FieldType_submit.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -337,8 +337,8 @@
 block discarded – undo
337 337
                 ) + $_aAttributes
338 338
             );
339 339
             return "<p class='submit-confirm-container'><label>"
340
-                   . $_sInput
341
-                   . "<span>{$_aConfirm[ 'label' ]}</span>"
340
+                    . $_sInput
341
+                    . "<span>{$_aConfirm[ 'label' ]}</span>"
342 342
                 . "</label></p>";
343 343
         }
344 344
 
Please login to merge, or discard this patch.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     /**
126 126
      * Defines the field type slugs used for this field type.
127 127
      */
128
-    public $aFieldTypeSlugs = array( 'submit', );
128
+    public $aFieldTypeSlugs = array( 'submit',);
129 129
     
130 130
     /**
131 131
      * Defines the default key-values of this field type. 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
         'redirect_url'  => null,
137 137
         'href'          => null,
138 138
         'reset'         => null, 
139
-        'email'         => null,    // [3.3.0+] string of an email address to send to or it can be an array with the following keys.
139
+        'email'         => null, // [3.3.0+] string of an email address to send to or it can be an array with the following keys.
140 140
         /* 
141 141
             array(
142 142
                 '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 field ID.
@@ -150,11 +150,11 @@  discard block
 block discarded – undo
150 150
             )
151 151
         */
152 152
         'confirm'       => '',
153
-        'skip_confirmation' => false,   // 3.7.6+ For emails.
153
+        'skip_confirmation' => false, // 3.7.6+ For emails.
154 154
         'attributes'    => array(
155 155
             'class' => 'button button-primary',
156 156
         ),
157
-        'save'          => false,       // 3.9.0+
157
+        'save'          => false, // 3.9.0+
158 158
     );    
159 159
 
160 160
     /**
@@ -165,9 +165,9 @@  discard block
 block discarded – undo
165 165
         return array(
166 166
             array(
167 167
                 'handle_id'     => 'admin-page-framework-submit-field-type',
168
-                'src'           => dirname( __FILE__ ) . '/js/submit.bundle.js',
168
+                'src'           => dirname( __FILE__ ).'/js/submit.bundle.js',
169 169
                 'in_footer'     => true,
170
-                'dependencies'  => array( 'jquery', ),
170
+                'dependencies'  => array( 'jquery',),
171 171
             ),
172 172
         );
173 173
     }
@@ -190,17 +190,17 @@  discard block
 block discarded – undo
190 190
 
191 191
         return 
192 192
             $aField[ 'before_label' ]
193
-            . "<div " . $this->getAttributes( $_aLabelContainerAttributes ) . ">"
193
+            . "<div ".$this->getAttributes( $_aLabelContainerAttributes ).">"
194 194
                 . $this->_getExtraFieldsBeforeLabel( $aField ) // this is for the import field type that cannot place file input tag inside the label tag.
195
-                . "<label " . $this->getAttributes( $_aLabelAttributes ) . ">"
195
+                . "<label ".$this->getAttributes( $_aLabelAttributes ).">"
196 196
                     . $aField[ 'before_input' ]
197 197
                     . $this->_getExtraInputFields( $aField )
198
-                    . "<input " . $this->getAttributes( $_aInputAttributes ) . " />" // this method is defined in the base class
198
+                    . "<input ".$this->getAttributes( $_aInputAttributes )." />" // this method is defined in the base class
199 199
                     . $aField[ 'after_input' ]
200 200
                 . "</label>"
201 201
                 . $this->___getConfirmationCheckbox( $aField )
202 202
             . "</div>"
203
-            . $aField['after_label'];
203
+            . $aField[ 'after_label' ];
204 204
         
205 205
     }
206 206
         /**
@@ -212,12 +212,12 @@  discard block
 block discarded – undo
212 212
             if ( empty( $aField[ 'confirm' ] ) ) {
213 213
                 return '';
214 214
             }
215
-            $_aConfirm    = is_string( $aField[ 'confirm' ] )
215
+            $_aConfirm = is_string( $aField[ 'confirm' ] )
216 216
                 ? array(
217 217
                     'label' => $aField[ 'confirm' ]
218 218
                 )
219 219
                 : $this->getAsArray( $aField[ 'confirm' ] );
220
-            $_aConfirm    = $_aConfirm + array(
220
+            $_aConfirm = $_aConfirm + array(
221 221
                 'label' => $this->oMsg->get( 'submit_confirmation_label' ),
222 222
                 'error' => $this->oMsg->get( 'submit_confirmation_error' ),
223 223
             );
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
         private function ___getLabelAttributes( array $aField, array $aInputAttributes ) {
269 269
             return array(
270 270
                 'style' => $aField[ 'label_min_width' ] 
271
-                    ? "min-width:" . $this->getLengthSanitized( $aField[ 'label_min_width' ] ) . ";" 
271
+                    ? "min-width:".$this->getLengthSanitized( $aField[ 'label_min_width' ] ).";" 
272 272
                     : null,
273 273
                 'for'   => $aInputAttributes[ 'id' ],
274 274
                 'class' => $aInputAttributes[ 'disabled' ] 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
         private function ___getLabelContainerAttributes( array $aField ) {           
288 288
             return array(
289 289
                 'style' => $aField[ 'label_min_width' ] || '0' === ( string ) $aField[ 'label_min_width' ]
290
-                    ? "min-width:" . $this->getLengthSanitized( $aField[ 'label_min_width' ] ) . ";" 
290
+                    ? "min-width:".$this->getLengthSanitized( $aField[ 'label_min_width' ] ).";" 
291 291
                     : null,
292 292
                 'class' => 'admin-page-framework-input-label-container'
293 293
                     . ' admin-page-framework-input-button-container'
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
     protected function _getExtraInputFields( &$aField ) {
343 343
         
344 344
         $_aOutput   = array();
345
-        $_aOutput[] = $this->getHTMLTag( 
345
+        $_aOutput[ ] = $this->getHTMLTag( 
346 346
             'input',
347 347
             array(
348 348
                 'type'  => 'hidden',
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
                 'value' => $aField[ 'input_id' ],
351 351
             )
352 352
         );
353
-        $_aOutput[] = $this->getHTMLTag( 
353
+        $_aOutput[ ] = $this->getHTMLTag( 
354 354
             'input',
355 355
             array(
356 356
                 'type'  => 'hidden',
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
                 'value' => $aField[ 'field_id' ],
359 359
             ) 
360 360
         );            
361
-        $_aOutput[] = $this->getHTMLTag( 
361
+        $_aOutput[ ] = $this->getHTMLTag( 
362 362
             'input',
363 363
             array(
364 364
                 'type'  => 'hidden',
@@ -366,11 +366,11 @@  discard block
 block discarded – undo
366 366
                 'value' => $aField[ '_input_name_flat' ],
367 367
             ) 
368 368
         );         
369
-        $_aOutput[] = $this->___getHiddenInput_SectionID( $aField );
370
-        $_aOutput[] = $this->___getHiddenInputByKey( $aField, 'redirect_url' );       
371
-        $_aOutput[] = $this->___getHiddenInputByKey( $aField, 'href' );       
372
-        $_aOutput[] = $this->___getHiddenInput_Reset( $aField );
373
-        $_aOutput[] = $this->_getHiddenInput_Email( $aField );
369
+        $_aOutput[ ] = $this->___getHiddenInput_SectionID( $aField );
370
+        $_aOutput[ ] = $this->___getHiddenInputByKey( $aField, 'redirect_url' );       
371
+        $_aOutput[ ] = $this->___getHiddenInputByKey( $aField, 'href' );       
372
+        $_aOutput[ ] = $this->___getHiddenInput_Reset( $aField );
373
+        $_aOutput[ ] = $this->_getHiddenInput_Email( $aField );
374 374
         return implode( PHP_EOL, array_filter( $_aOutput ) );  
375 375
         
376 376
     }
@@ -387,9 +387,9 @@  discard block
 block discarded – undo
387 387
                 'input',
388 388
                 array(
389 389
                     'type'  => 'hidden',
390
-                    'name'  => "__submit[{$aField['input_id']}][section_id]",
391
-                    'value' => isset( $aField['section_id'] ) && '_default' !== $aField['section_id'] 
392
-                        ? $aField['section_id'] 
390
+                    'name'  => "__submit[{$aField[ 'input_id' ]}][section_id]",
391
+                    'value' => isset( $aField[ 'section_id' ] ) && '_default' !== $aField[ 'section_id' ] 
392
+                        ? $aField[ 'section_id' ] 
393 393
                         : '',
394 394
                 ) 
395 395
             );                  
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
                     'input',
410 410
                     array(
411 411
                         'type'  => 'hidden',
412
-                        'name'  => "__submit[{$aField['input_id']}][{$sKey}]",
412
+                        'name'  => "__submit[{$aField[ 'input_id' ]}][{$sKey}]",
413 413
                         'value' => $aField[ $sKey ],
414 414
                     ) 
415 415
                 )
@@ -424,15 +424,15 @@  discard block
 block discarded – undo
424 424
          * @return      string      the HTML input tag output for the 'reset' argument.
425 425
          */        
426 426
         private function ___getHiddenInput_Reset( array $aField ) {
427
-            if ( ! $aField[ 'reset' ] ) {
427
+            if ( !$aField[ 'reset' ] ) {
428 428
                 return '';
429 429
             }
430
-            return ! $this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'reset' )
430
+            return !$this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'reset' )
431 431
                 ? $this->getHTMLTag( 
432 432
                     'input',
433 433
                     array(
434 434
                         'type'  => 'hidden',
435
-                        'name'  => "__submit[{$aField['input_id']}][is_reset]",
435
+                        'name'  => "__submit[{$aField[ 'input_id' ]}][is_reset]",
436 436
                         'value' => '1',
437 437
                     ) 
438 438
                 )
@@ -466,14 +466,14 @@  discard block
 block discarded – undo
466 466
                 $this->showDeprecationNotice( 'The <code>email</code> argument has been deprecated.', 'the <code>contact</code> field type' );
467 467
             }
468 468
 
469
-            $_sTransientKey = 'apf_em_' . md5( $aField[ '_input_name_flat' ] . get_current_user_id() );
469
+            $_sTransientKey = 'apf_em_'.md5( $aField[ '_input_name_flat' ].get_current_user_id() );
470 470
             $this->setTransient( 
471 471
                 $_sTransientKey,
472 472
                 array(
473
-                    'nonce' => $this->getNonceCreated( 'apf_email_nonce_' . md5( ( string ) site_url() ), 86400 ),  // @todo the nonce is crated when the page is rendered so change this to when the form is submitted so that a shorter nonce lifespan can be set.
473
+                    'nonce' => $this->getNonceCreated( 'apf_email_nonce_'.md5( ( string ) site_url() ), 86400 ), // @todo the nonce is crated when the page is rendered so change this to when the form is submitted so that a shorter nonce lifespan can be set.
474 474
                 ) + $this->getAsArray( $aField[ 'email' ] )
475 475
             );
476
-            return ! $this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'email' )
476
+            return !$this->_checkConfirmationDisplayed( $aField, $aField[ '_input_name_flat' ], 'email' )
477 477
                 ? $this->getHTMLTag( 
478 478
                     'input',
479 479
                     array(
@@ -501,18 +501,18 @@  discard block
 block discarded – undo
501 501
          * @return      boolean
502 502
          * @internal
503 503
          */
504
-        protected function _checkConfirmationDisplayed( $aField, $sFlatFieldName, $sType='reset' ) {
504
+        protected function _checkConfirmationDisplayed( $aField, $sFlatFieldName, $sType = 'reset' ) {
505 505
                             
506
-            switch( $sType ) {
506
+            switch ( $sType ) {
507 507
                 default:
508 508
                 case 'reset':       // admin page framework _ reset confirmation
509
-                    $_sTransientKey = 'apf_rc_' . md5( $sFlatFieldName . get_current_user_id() );
509
+                    $_sTransientKey = 'apf_rc_'.md5( $sFlatFieldName.get_current_user_id() );
510 510
                     break;
511 511
                 case 'email':       // admin page framework _ email confirmation
512
-                    $_sTransientKey = 'apf_ec_' . md5( $sFlatFieldName . get_current_user_id() );   
512
+                    $_sTransientKey = 'apf_ec_'.md5( $sFlatFieldName.get_current_user_id() );   
513 513
                     break;
514 514
             }
515
-            $_bConfirmed = ! ( false === $this->getTransient( $_sTransientKey ) && ! $aField['skip_confirmation'] );
515
+            $_bConfirmed = !( false === $this->getTransient( $_sTransientKey ) && !$aField[ 'skip_confirmation' ] );
516 516
             if ( $_bConfirmed ) {
517 517
                 $this->deleteTransient( $_sTransientKey );
518 518
             }             
Please login to merge, or discard this patch.
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
          * @return      array   The label container attribute array.
285 285
          * @internal
286 286
          */        
287
-        private function ___getLabelContainerAttributes( array $aField ) {           
287
+        private function ___getLabelContainerAttributes( array $aField ) {
288 288
             return array(
289 289
                 'style' => $aField[ 'label_min_width' ] || '0' === ( string ) $aField[ 'label_min_width' ]
290 290
                     ? "min-width:" . $this->getLengthSanitized( $aField[ 'label_min_width' ] ) . ";" 
@@ -537,19 +537,19 @@  discard block
 block discarded – undo
537 537
      * @internal
538 538
      * @param       array   $aField
539 539
      */ 
540
-    protected function _getInputFieldValueFromLabel( $aField ) {    
540
+    protected function _getInputFieldValueFromLabel( $aField ) {
541 541
         
542 542
         // If the value key is explicitly set, use it. But the empty string will be ignored.
543
-        if ( isset( $aField[ 'value' ] ) && $aField[ 'value' ] != '' ) { 
543
+        if ( isset( $aField[ 'value' ] ) && $aField[ 'value' ] != '' ) {
544 544
             return $aField[ 'value' ]; 
545 545
         }
546 546
         
547
-        if ( isset( $aField[ 'label' ] ) ) { 
547
+        if ( isset( $aField[ 'label' ] ) ) {
548 548
             return $aField[ 'label' ]; 
549 549
         }
550 550
         
551 551
         // If the default value is set,
552
-        if ( isset( $aField[ 'default' ] ) ) { 
552
+        if ( isset( $aField[ 'default' ] ) ) {
553 553
             return $aField[ 'default' ]; 
554 554
         }
555 555
         
Please login to merge, or discard this patch.
factory/_common/form/field_type/text/AdminPageFramework_FieldType_text.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
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.
@@ -57,15 +57,15 @@  discard block
 block discarded – undo
57 57
      */
58 58
     protected function getField( $aField ) {
59 59
         $_aOutput = array();
60
-        foreach( ( array ) $aField[ 'label' ] as $_sKey => $_sLabel ) {
61
-            $_aOutput[] = $this->___getFieldOutputByLabel(
60
+        foreach ( ( array ) $aField[ 'label' ] as $_sKey => $_sLabel ) {
61
+            $_aOutput[ ] = $this->___getFieldOutputByLabel(
62 62
                 $_sKey,
63 63
                 $_sLabel,
64 64
                 $aField
65 65
             );
66 66
         }
67 67
         // the repeatable field buttons will be replaced with this element.
68
-        $_aOutput[] = "<div class='repeatable-field-buttons'></div>";
68
+        $_aOutput[ ] = "<div class='repeatable-field-buttons'></div>";
69 69
         return implode( '', $_aOutput );
70 70
     }
71 71
         /**
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
             $aField[ 'value' ]  = $this->getElementByLabel( $aField[ 'value' ], $sKey, $aField[ 'label' ] );
82 82
             $_aInputAttributes  = $_bIsArray
83 83
                 ? array(
84
-                        'name'  => $aField[ 'attributes' ][ 'name' ] . "[{$sKey}]",
85
-                        'id'    => $aField[ 'attributes' ][ 'id' ] . "_{$sKey}",
84
+                        'name'  => $aField[ 'attributes' ][ 'name' ]."[{$sKey}]",
85
+                        'id'    => $aField[ 'attributes' ][ 'id' ]."_{$sKey}",
86 86
                         'value' => $aField[ 'value' ],
87 87
                     )
88 88
                     + $this->getAsArray(
@@ -90,17 +90,17 @@  discard block
 block discarded – undo
90 90
                     )    // 3.8.6+ Allows the user to set individual attributes by label.
91 91
                     + $aField[ 'attributes' ]
92 92
                 : $aField[ 'attributes' ];
93
-            $_aOutput           = array(
93
+            $_aOutput = array(
94 94
                 $this->getElementByLabel( $aField[ 'before_label' ], $sKey, $aField[ 'label' ] ),
95 95
                 "<div class='admin-page-framework-input-label-container {$_sClassSelector}'>",
96
-                    "<label for='" . $_aInputAttributes[ 'id' ] . "'>",
96
+                    "<label for='".$_aInputAttributes[ 'id' ]."'>",
97 97
                         $this->getElementByLabel( $aField[ 'before_input' ], $sKey, $aField[ 'label' ] ),
98 98
                         $_sLabel
99
-                            ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">"
99
+                            ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">"
100 100
                                     . $_sLabel
101 101
                                 . "</span>"
102 102
                             : '',
103
-                        "<input " . $this->getAttributes( $_aInputAttributes ) . " />",
103
+                        "<input ".$this->getAttributes( $_aInputAttributes )." />",
104 104
                         $this->getElementByLabel( $aField[ 'after_input' ], $sKey, $aField[ 'label' ] ),
105 105
                     "</label>",
106 106
                 "</div>",
Please login to merge, or discard this patch.
_common/form/field_type/_common/_abstract/AdminPageFramework_FieldType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -219,7 +219,7 @@
 block discarded – undo
219 219
      * </code>
220 220
      * @access       public      This must be public as accessed from outside.
221 221
      */
222
-    public $aFieldTypeSlugs = array( 'default', );
222
+    public $aFieldTypeSlugs = array( 'default',);
223 223
 
224 224
     /**
225 225
      * Defines the default key-values of this field type.
Please login to merge, or discard this patch.
form/field_type/_common/_abstract/AdminPageFramework_FieldType_Base.php 2 patches
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         'after_label'       => null,    
60 60
         'before_field'      => null,
61 61
         'after_field'       => null,
62
-        'label_min_width'   => '',   // (string|integer) min-width applied to the input label in pixels. 3.8.0+ Changed the default value from 140 to 0 as it is now applied via embedded CSS. When this value is set by the user, it is set inline and the value will be overridden. [3.8.4+] Changed the value from `0`  to `''`.
62
+        'label_min_width'   => '', // (string|integer) min-width applied to the input label in pixels. 3.8.0+ Changed the default value from 140 to 0 as it is now applied via embedded CSS. When this value is set by the user, it is set inline and the value will be overridden. [3.8.4+] Changed the value from `0`  to `''`.
63 63
         'before_fieldset'   => null, // 3.1.1+
64 64
         'after_fieldset'    => null, // 3.1.1+
65 65
         
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
      * @param       object              $oMsg                   The framework message object.
100 100
      * @param       boolean             $bAutoRegister          Whether or not to register the field type(s).
101 101
      */
102
-    public function __construct( $asClassName='admin_page_framework', $asFieldTypeSlug=null, $oMsg=null, $bAutoRegister=true ) {
102
+    public function __construct( $asClassName = 'admin_page_framework', $asFieldTypeSlug = null, $oMsg = null, $bAutoRegister = true ) {
103 103
             
104 104
         $this->aFieldTypeSlugs  = empty( $asFieldTypeSlug ) 
105 105
             ? $this->aFieldTypeSlugs 
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
         
111 111
         // This automatically registers the field type. The build-in ones will be registered manually so it will be skipped.
112 112
         if ( $bAutoRegister ) {
113
-            foreach( ( array ) $asClassName as $_sClassName ) {
113
+            foreach ( ( array ) $asClassName as $_sClassName ) {
114 114
                 add_filter( 
115
-                    'field_types_' . $_sClassName, 
115
+                    'field_types_'.$_sClassName, 
116 116
                     array( $this, '_replyToRegisterInputFieldType' )
117 117
                 );
118 118
             }
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
         }
162 162
         return is_array( $asLabel ) // if the user sets multiple items
163 163
             ? $this->getElement( 
164
-                $asElement,         // subject
165
-                $this->getAsArray( $asKey, true /* preserve empty */ ),     // dimensional path 
164
+                $asElement, // subject
165
+                $this->getAsArray( $asKey, true /* preserve empty */ ), // dimensional path 
166 166
                 ''                  // default - if the element is not found, return an empty
167 167
             )
168 168
             : $asElement;
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
      */
179 179
     protected function getFieldOutput( array $aFieldset ) {
180 180
         
181
-        if ( ! is_object( $aFieldset[ '_caller_object' ] ) ) {
181
+        if ( !is_object( $aFieldset[ '_caller_object' ] ) ) {
182 182
             return '';
183 183
         }
184 184
 
@@ -186,14 +186,14 @@  discard block
 block discarded – undo
186 186
         $aFieldset[ '_parent_field_object' ] = $aFieldset[ '_field_object' ]; // 3.6.0+
187 187
         
188 188
         // 3.7.0+ The caller object is no longer a factory object but a form object.
189
-        $_oCallerForm   = $aFieldset[ '_caller_object' ];
189
+        $_oCallerForm = $aFieldset[ '_caller_object' ];
190 190
 
191 191
         $_oFieldset = new AdminPageFramework_Form_View___Fieldset( 
192
-            $aFieldset,                          // the field definition array
193
-            $_oCallerForm->aSavedData,               // the stored form data
194
-            $_oCallerForm->getFieldErrors(),         // the field error array.
195
-            $_oCallerForm->aFieldTypeDefinitions,    // the field type definition array.
196
-            $_oCallerForm->oMsg,                     // the system message object
192
+            $aFieldset, // the field definition array
193
+            $_oCallerForm->aSavedData, // the stored form data
194
+            $_oCallerForm->getFieldErrors(), // the field error array.
195
+            $_oCallerForm->aFieldTypeDefinitions, // the field type definition array.
196
+            $_oCallerForm->oMsg, // the system message object
197 197
             $_oCallerForm->aCallbacks                // field output element callables.
198 198
         );           
199 199
         return $_oFieldset->get();
@@ -237,13 +237,13 @@  discard block
 block discarded – undo
237 237
      * @return      array
238 238
      * @internal
239 239
      */
240
-    public function getDefinitionArray( $sFieldTypeSlug='' ) {
240
+    public function getDefinitionArray( $sFieldTypeSlug = '' ) {
241 241
         
242 242
         // The uniteArrays() method resulted in somewhat being slow due to overhead on checking array keys for recursive array merges.
243 243
         $_aDefaultKeys = $this->aDefaultKeys + self::$_aDefaultKeys;
244
-        $_aDefaultKeys['attributes'] = isset( $this->aDefaultKeys['attributes'] ) && is_array( $this->aDefaultKeys['attributes'] )
245
-            ? $this->aDefaultKeys['attributes'] + self::$_aDefaultKeys['attributes'] 
246
-            : self::$_aDefaultKeys['attributes'];
244
+        $_aDefaultKeys[ 'attributes' ] = isset( $this->aDefaultKeys[ 'attributes' ] ) && is_array( $this->aDefaultKeys[ 'attributes' ] )
245
+            ? $this->aDefaultKeys[ 'attributes' ] + self::$_aDefaultKeys[ 'attributes' ] 
246
+            : self::$_aDefaultKeys[ 'attributes' ];
247 247
         
248 248
         return array(
249 249
             'sFieldTypeSlug'        => $sFieldTypeSlug,
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
      * @param       string  $sFieldSetType
290 290
      * @internal
291 291
      */
292
-    public function _replyToFieldTypeSetter( $sFieldSetType='' ) {
292
+    public function _replyToFieldTypeSetter( $sFieldSetType = '' ) {
293 293
         $this->_sFieldSetType = $sFieldSetType;
294 294
     }
295 295
     
@@ -344,8 +344,8 @@  discard block
 block discarded – undo
344 344
             wp_enqueue_script( 'media-upload' );    
345 345
         }
346 346
 
347
-        if ( in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php', ) ) ) {     
348
-            add_filter( 'gettext', array( $this, '_replyToReplaceThickBoxText' ) , 1, 2 );     
347
+        if ( in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php',) ) ) {     
348
+            add_filter( 'gettext', array( $this, '_replyToReplaceThickBoxText' ), 1, 2 );     
349 349
         }
350 350
         
351 351
     }
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
         public function _replyToReplaceThickBoxText( $sTranslated, $sText ) {
364 364
 
365 365
             // Replace the button label in the media thick box.
366
-            if ( ! in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php' ) ) ) { 
366
+            if ( !in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php' ) ) ) { 
367 367
                 return $sTranslated; 
368 368
             }
369 369
             if ( $sText !== 'Insert into Post' ) { 
@@ -396,10 +396,10 @@  discard block
 block discarded – undo
396 396
          */
397 397
         public function _replyToRemovingMediaLibraryTab( $aTabs ) {
398 398
             
399
-            if ( ! isset( $_REQUEST[ 'enable_external_source' ] ) ) {    // sanitization unnecessary
399
+            if ( !isset( $_REQUEST[ 'enable_external_source' ] ) ) {    // sanitization unnecessary
400 400
                 return $aTabs; 
401 401
             }
402
-            if ( ! ( boolean ) $_REQUEST[ 'enable_external_source' ] ) { // sanitization unnecessary
402
+            if ( !( boolean ) $_REQUEST[ 'enable_external_source' ] ) { // sanitization unnecessary
403 403
                 unset( $aTabs[ 'type_url' ] ); // removes the 'From URL' tab in the thick box.
404 404
             }
405 405
             return $aTabs;
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
      * @return string
418 418
      * @since  3.8.0
419 419
      */
420
-    protected function getLabelContainerAttributes( $aField, $asClassAttributes, array $aAttributes=array() ) {
420
+    protected function getLabelContainerAttributes( $aField, $asClassAttributes, array $aAttributes = array() ) {
421 421
 
422 422
         $aAttributes[ 'class' ] = $this->getClassAttribute( $asClassAttributes, $this->getElement( $aAttributes, 'class' ) );
423 423
         $aAttributes[ 'style' ] = $this->getStyleAttribute(
Please login to merge, or discard this patch.
Braces   +10 added lines, -7 removed lines patch added patch discarded remove patch
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
             wp_enqueue_script( 'media-upload' );    
345 345
         }
346 346
 
347
-        if ( in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php', ) ) ) {     
347
+        if ( in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php', ) ) ) {
348 348
             add_filter( 'gettext', array( $this, '_replyToReplaceThickBoxText' ) , 1, 2 );     
349 349
         }
350 350
         
@@ -374,17 +374,18 @@  discard block
 block discarded – undo
374 374
         public function _replyToReplaceThickBoxText( $sTranslated, $sText ) {
375 375
 
376 376
             // Replace the button label in the media thick box.
377
-            if ( ! in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php' ) ) ) { 
377
+            if ( ! in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php' ) ) ) {
378 378
                 return $sTranslated; 
379 379
             }
380
-            if ( $sText !== 'Insert into Post' ) { 
380
+            if ( $sText !== 'Insert into Post' ) {
381 381
                 return $sTranslated; 
382 382
             }
383
-            if ( $this->getQueryValueInURLByKey( wp_get_referer(), 'referrer' ) !== 'admin_page_framework' ) { 
383
+            if ( $this->getQueryValueInURLByKey( wp_get_referer(), 'referrer' ) !== 'admin_page_framework' ) {
384 384
                 return $sTranslated; 
385 385
             }
386 386
             
387
-            if ( isset( $_GET[ 'button_label' ] ) ) {   // sanitization unnecessary
387
+            if ( isset( $_GET[ 'button_label' ] ) ) {
388
+// sanitization unnecessary
388 389
                 return $this->getHTTPQueryGET( 'button_label', '' );
389 390
             }
390 391
 
@@ -407,10 +408,12 @@  discard block
 block discarded – undo
407 408
          */
408 409
         public function _replyToRemovingMediaLibraryTab( $aTabs ) {
409 410
             
410
-            if ( ! isset( $_REQUEST[ 'enable_external_source' ] ) ) {    // sanitization unnecessary
411
+            if ( ! isset( $_REQUEST[ 'enable_external_source' ] ) ) {
412
+// sanitization unnecessary
411 413
                 return $aTabs; 
412 414
             }
413
-            if ( ! ( boolean ) $_REQUEST[ 'enable_external_source' ] ) { // sanitization unnecessary
415
+            if ( ! ( boolean ) $_REQUEST[ 'enable_external_source' ] ) {
416
+// sanitization unnecessary
414 417
                 unset( $aTabs[ 'type_url' ] ); // removes the 'From URL' tab in the thick box.
415 418
             }
416 419
             return $aTabs;
Please login to merge, or discard this patch.
field_type/_common/utility/AdminPageFramework_WalkerTaxonomyChecklist.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -62,16 +62,16 @@  discard block
 block discarded – undo
62 62
      *  - use_desc_for_title    (boolean|int) default is 1 - Whether to use the category description as the title attribute. side note: the framework enables this by default.
63 63
      * @param       integer     $iCurrentObjectID
64 64
      */
65
-    function start_el( &$sOutput, $oTerm, $iDepth=0, $aArgs=array(), $iCurrentObjectID=0 ) {
65
+    function start_el( &$sOutput, $oTerm, $iDepth = 0, $aArgs = array(), $iCurrentObjectID = 0 ) {
66 66
 
67 67
         $aArgs = $aArgs + array(
68 68
             '_name_prefix'      => null,
69 69
             '_input_id_prefix'  => null,
70 70
             '_attributes'       => array(),
71 71
             '_selected_items'   => array(),
72
-            'taxonomy'          => null,    // parsed by the core function to perform the database query.
73
-            'disabled'          => null,    // not sure what this was for
74
-            '_save_unchecked'   => true,    // 3.8.8+
72
+            'taxonomy'          => null, // parsed by the core function to perform the database query.
73
+            'disabled'          => null, // not sure what this was for
74
+            '_save_unchecked'   => true, // 3.8.8+
75 75
         );
76 76
 
77 77
         // Local variables
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
         // Post count
85 85
         $_sPostCount     = $aArgs[ 'show_post_count' ]
86
-            ? " <span class='font-lighter'>(" . $oTerm->count . ")</span>"
86
+            ? " <span class='font-lighter'>(".$oTerm->count.")</span>"
87 87
             : '';
88 88
 
89 89
         // Attributes
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
           + array(
103 103
             'class'     => null,
104 104
         );
105
-        $_aInputAttributes['class'] .= ' apf_checkbox';
105
+        $_aInputAttributes[ 'class' ] .= ' apf_checkbox';
106 106
 
107 107
         $_aLiTagAttributes = array(
108 108
             'id'        => "list-{$_sID}",
@@ -111,15 +111,15 @@  discard block
 block discarded – undo
111 111
         );
112 112
 
113 113
         $_sHiddenInputForUnchecked = $aArgs[ '_save_unchecked' ]
114
-            ? "<input value='0' type='hidden' name='" . $_aInputAttributes[ 'name' ] . "' class='apf_checkbox' />"
114
+            ? "<input value='0' type='hidden' name='".$_aInputAttributes[ 'name' ]."' class='apf_checkbox' />"
115 115
             : '';
116 116
 
117 117
         // Output - the variable is by reference so the modification takes effect
118 118
         $sOutput .= "\n"
119
-            . "<li " . AdminPageFramework_WPUtility::getAttributes( $_aLiTagAttributes ) . ">"
119
+            . "<li ".AdminPageFramework_WPUtility::getAttributes( $_aLiTagAttributes ).">"
120 120
                 . "<label for='{$_sID}' class='taxonomy-checklist-label'>"
121 121
                     . $_sHiddenInputForUnchecked    // 3.8.8+
122
-                    . "<input " . AdminPageFramework_WPUtility::getAttributes( $_aInputAttributes ) . " />"
122
+                    . "<input ".AdminPageFramework_WPUtility::getAttributes( $_aInputAttributes )." />"
123 123
                     . esc_html( apply_filters( 'the_category', $oTerm->name ) )
124 124
                     . $_sPostCount
125 125
                 . "</label>";
Please login to merge, or discard this patch.