@@ -219,7 +219,7 @@ |
||
| 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. |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | // For front-end |
| 86 | 86 | // @see http://wordpress.stackexchange.com/a/82722 |
| 87 | - if ( ! is_admin() ) { |
|
| 87 | + if ( !is_admin() ) { |
|
| 88 | 88 | |
| 89 | 89 | // wp_enqueue_style( 'wp-color-picker' ); |
| 90 | 90 | wp_enqueue_script( |
@@ -276,9 +276,9 @@ discard block |
||
| 276 | 276 | protected function getField( $aField ) { |
| 277 | 277 | |
| 278 | 278 | // If the value is not set, apply the default value, 'transparent'. |
| 279 | - $aField['value'] = is_null( $aField['value'] ) |
|
| 279 | + $aField[ 'value' ] = is_null( $aField[ 'value' ] ) |
|
| 280 | 280 | ? 'transparent' |
| 281 | - : $aField['value']; |
|
| 281 | + : $aField[ 'value' ]; |
|
| 282 | 282 | |
| 283 | 283 | $aField[ 'attributes' ] = $this->_getInputAttributes( $aField ); |
| 284 | 284 | |
@@ -287,20 +287,20 @@ discard block |
||
| 287 | 287 | . "<div class='admin-page-framework-input-label-container'>" |
| 288 | 288 | . "<label for='{$aField[ 'input_id' ]}'>" |
| 289 | 289 | . $aField[ 'before_input' ] |
| 290 | - . ( $aField[ 'label' ] && ! $aField[ 'repeatable' ] |
|
| 291 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
| 292 | - . $aField['label'] |
|
| 290 | + . ( $aField[ 'label' ] && !$aField[ 'repeatable' ] |
|
| 291 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
| 292 | + . $aField[ 'label' ] |
|
| 293 | 293 | . "</span>" |
| 294 | 294 | : "" |
| 295 | 295 | ) |
| 296 | - . "<input " . $this->getAttributes( $aField[ 'attributes' ] ) . " />" |
|
| 296 | + . "<input ".$this->getAttributes( $aField[ 'attributes' ] )." />" |
|
| 297 | 297 | . $aField[ 'after_input' ] |
| 298 | 298 | . "<div class='repeatable-field-buttons'></div>" // the repeatable field buttons will be replaced with this element. |
| 299 | 299 | . "</label>" |
| 300 | 300 | . "<div class='colorpicker' id='color_{$aField[ 'input_id' ]}'></div>" // this div element with this class selector becomes a farbtastic color picker. ( below 3.4.x ) // rel='{$aField['input_id']}' |
| 301 | 301 | . $this->_getColorPickerEnablerScript( "{$aField[ 'input_id' ]}" ) |
| 302 | 302 | . "</div>" |
| 303 | - . $aField['after_label']; |
|
| 303 | + . $aField[ 'after_label' ]; |
|
| 304 | 304 | |
| 305 | 305 | } |
| 306 | 306 | /** |
@@ -312,13 +312,13 @@ discard block |
||
| 312 | 312 | private function _getInputAttributes( array $aField ) { |
| 313 | 313 | |
| 314 | 314 | return array( |
| 315 | - 'color' => $aField['value'], |
|
| 316 | - 'value' => $aField['value'], |
|
| 315 | + 'color' => $aField[ 'value' ], |
|
| 316 | + 'value' => $aField[ 'value' ], |
|
| 317 | 317 | 'data-default' => isset( $aField[ 'default' ] ) |
| 318 | 318 | ? $aField[ 'default' ] |
| 319 | 319 | : 'transparent', // used by the repeatable script |
| 320 | 320 | 'type' => 'text', // it must be text |
| 321 | - 'class' => trim( 'input_color ' . $aField['attributes']['class'] ), |
|
| 321 | + 'class' => trim( 'input_color '.$aField[ 'attributes' ][ 'class' ] ), |
|
| 322 | 322 | ) + $aField[ 'attributes' ]; |
| 323 | 323 | |
| 324 | 324 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | /** |
| 39 | 39 | * Defines the field type slugs used for this field type. |
| 40 | 40 | */ |
| 41 | - public $aFieldTypeSlugs = array( 'text', 'password', 'date', 'datetime', 'datetime-local', 'email', 'month', 'search', 'tel', 'url', 'week', ); |
|
| 41 | + public $aFieldTypeSlugs = array( 'text', 'password', 'date', 'datetime', 'datetime-local', 'email', 'month', 'search', 'tel', 'url', 'week',); |
|
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * Defines the default key-values of this field type. |
@@ -82,8 +82,8 @@ discard block |
||
| 82 | 82 | protected function getField( $aField ) { |
| 83 | 83 | |
| 84 | 84 | $_aOutput = array(); |
| 85 | - foreach( ( array ) $aField[ 'label' ] as $_sKey => $_sLabel ) { |
|
| 86 | - $_aOutput[] = $this->_getFieldOutputByLabel( |
|
| 85 | + foreach ( ( array ) $aField[ 'label' ] as $_sKey => $_sLabel ) { |
|
| 86 | + $_aOutput[ ] = $this->_getFieldOutputByLabel( |
|
| 87 | 87 | $_sKey, |
| 88 | 88 | $_sLabel, |
| 89 | 89 | $aField |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | // the repeatable field buttons will be replaced with this element. |
| 94 | - $_aOutput[] = "<div class='repeatable-field-buttons'></div>"; |
|
| 94 | + $_aOutput[ ] = "<div class='repeatable-field-buttons'></div>"; |
|
| 95 | 95 | return implode( '', $_aOutput ); |
| 96 | 96 | |
| 97 | 97 | } |
@@ -111,8 +111,8 @@ discard block |
||
| 111 | 111 | $aField[ 'value' ] = $this->getElementByLabel( $aField[ 'value' ], $sKey, $aField[ 'label' ] ); |
| 112 | 112 | $_aInputAttributes = $_bIsArray |
| 113 | 113 | ? array( |
| 114 | - 'name' => $aField[ 'attributes' ][ 'name' ] . "[{$sKey}]", |
|
| 115 | - 'id' => $aField[ 'attributes' ][ 'id' ] . "_{$sKey}", |
|
| 114 | + 'name' => $aField[ 'attributes' ][ 'name' ]."[{$sKey}]", |
|
| 115 | + 'id' => $aField[ 'attributes' ][ 'id' ]."_{$sKey}", |
|
| 116 | 116 | 'value' => $aField[ 'value' ], |
| 117 | 117 | ) |
| 118 | 118 | + $this->getAsArray( |
@@ -120,17 +120,17 @@ discard block |
||
| 120 | 120 | ) // 3.8.6+ Allows the user to set individual attributes by label. |
| 121 | 121 | + $aField[ 'attributes' ] |
| 122 | 122 | : $aField[ 'attributes' ]; |
| 123 | - $_aOutput = array( |
|
| 123 | + $_aOutput = array( |
|
| 124 | 124 | $this->getElementByLabel( $aField[ 'before_label' ], $sKey, $aField[ 'label' ] ), |
| 125 | 125 | "<div class='admin-page-framework-input-label-container {$_sClassSelector}'>", |
| 126 | - "<label for='" . $_aInputAttributes[ 'id' ] . "'>", |
|
| 126 | + "<label for='".$_aInputAttributes[ 'id' ]."'>", |
|
| 127 | 127 | $this->getElementByLabel( $aField[ 'before_input' ], $sKey, $aField[ 'label' ] ), |
| 128 | 128 | $_sLabel |
| 129 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
| 129 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
| 130 | 130 | . $_sLabel |
| 131 | 131 | . "</span>" |
| 132 | 132 | : '', |
| 133 | - "<input " . $this->getAttributes( $_aInputAttributes ) . " />", |
|
| 133 | + "<input ".$this->getAttributes( $_aInputAttributes )." />", |
|
| 134 | 134 | $this->getElementByLabel( $aField[ 'after_input' ], $sKey, $aField[ 'label' ] ), |
| 135 | 135 | "</label>", |
| 136 | 136 | "</div>", |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | /** |
| 48 | 48 | * Defines the field type slugs used for this field type. |
| 49 | 49 | */ |
| 50 | - public $aFieldTypeSlugs = array( 'section_title', ); |
|
| 50 | + public $aFieldTypeSlugs = array( 'section_title',); |
|
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * Defines the default key-values of this field type. |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | /** |
| 52 | 52 | * Defines the field type slugs used for this field type. |
| 53 | 53 | */ |
| 54 | - public $aFieldTypeSlugs = array( 'export', ); |
|
| 54 | + public $aFieldTypeSlugs = array( 'export',); |
|
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * Defines the default key-values of this field type. |
@@ -59,9 +59,9 @@ discard block |
||
| 59 | 59 | * @remark $_aDefaultKeys holds shared default key-values defined in the base class. |
| 60 | 60 | */ |
| 61 | 61 | protected $aDefaultKeys = array( |
| 62 | - 'data' => null, // ( array|string|object ) This is for the export field type. Do not set a value here. |
|
| 63 | - 'format' => 'json', // ( string ) for the export field type. Do not set a default value here. Currently array, json, and text are supported. |
|
| 64 | - 'file_name' => null, // ( string ) for the export field type. Do not set a default value here. |
|
| 62 | + 'data' => null, // ( array|string|object ) This is for the export field type. Do not set a value here. |
|
| 63 | + 'format' => 'json', // ( string ) for the export field type. Do not set a default value here. Currently array, json, and text are supported. |
|
| 64 | + 'file_name' => null, // ( string ) for the export field type. Do not set a default value here. |
|
| 65 | 65 | 'attributes' => array( |
| 66 | 66 | 'class' => 'button button-primary', |
| 67 | 67 | ), |
@@ -106,14 +106,14 @@ discard block |
||
| 106 | 106 | protected function getField( $aField ) { |
| 107 | 107 | |
| 108 | 108 | /* Set the transient data to export - If the value is not an array and the export data is set. */ |
| 109 | - if ( isset( $aField['data'] ) ) { |
|
| 110 | - $this->setTransient( md5( "{$aField['class_name']}_{$aField['input_id']}" ), $aField['data'], 60*2 ); // 2 minutes. |
|
| 109 | + if ( isset( $aField[ 'data' ] ) ) { |
|
| 110 | + $this->setTransient( md5( "{$aField[ 'class_name' ]}_{$aField[ 'input_id' ]}" ), $aField[ 'data' ], 60 * 2 ); // 2 minutes. |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /* Set some required values */ |
| 114 | - $aField['attributes']['name'] = "__export[submit][{$aField['input_id']}]"; |
|
| 115 | - $aField['file_name'] = $aField['file_name'] ? $aField['file_name'] : $this->_generateExportFileName( $aField['option_key'] ? $aField['option_key'] : $aField['class_name'], $aField['format'] ); |
|
| 116 | - $aField['label'] = $aField['label'] ? $aField['label'] : $this->oMsg->get( 'export' ); |
|
| 114 | + $aField[ 'attributes' ][ 'name' ] = "__export[submit][{$aField[ 'input_id' ]}]"; |
|
| 115 | + $aField[ 'file_name' ] = $aField[ 'file_name' ] ? $aField[ 'file_name' ] : $this->_generateExportFileName( $aField[ 'option_key' ] ? $aField[ 'option_key' ] : $aField[ 'class_name' ], $aField[ 'format' ] ); |
|
| 116 | + $aField[ 'label' ] = $aField[ 'label' ] ? $aField[ 'label' ] : $this->oMsg->get( 'export' ); |
|
| 117 | 117 | |
| 118 | 118 | return parent::getField( $aField ); |
| 119 | 119 | |
@@ -129,42 +129,42 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | $_aAttributes = array( 'type' => 'hidden' ); |
| 131 | 131 | return |
| 132 | - "<input " . $this->getAttributes( |
|
| 132 | + "<input ".$this->getAttributes( |
|
| 133 | 133 | array( |
| 134 | - 'name' => "__export[{$aField['input_id']}][input_id]", |
|
| 135 | - 'value' => $aField['input_id'], |
|
| 134 | + 'name' => "__export[{$aField[ 'input_id' ]}][input_id]", |
|
| 135 | + 'value' => $aField[ 'input_id' ], |
|
| 136 | 136 | ) + $_aAttributes |
| 137 | - ) . "/>" |
|
| 138 | - . "<input " . $this->getAttributes( |
|
| 137 | + )."/>" |
|
| 138 | + . "<input ".$this->getAttributes( |
|
| 139 | 139 | array( |
| 140 | - 'name' => "__export[{$aField['input_id']}][field_id]", |
|
| 141 | - 'value' => $aField['field_id'], |
|
| 140 | + 'name' => "__export[{$aField[ 'input_id' ]}][field_id]", |
|
| 141 | + 'value' => $aField[ 'field_id' ], |
|
| 142 | 142 | ) + $_aAttributes |
| 143 | - ) . "/>" |
|
| 144 | - . "<input " . $this->getAttributes( |
|
| 143 | + )."/>" |
|
| 144 | + . "<input ".$this->getAttributes( |
|
| 145 | 145 | array( |
| 146 | - 'name' => "__export[{$aField['input_id']}][section_id]", |
|
| 147 | - 'value' => isset( $aField['section_id'] ) && $aField['section_id'] != '_default' ? $aField['section_id'] : '', |
|
| 146 | + 'name' => "__export[{$aField[ 'input_id' ]}][section_id]", |
|
| 147 | + 'value' => isset( $aField[ 'section_id' ] ) && $aField[ 'section_id' ] != '_default' ? $aField[ 'section_id' ] : '', |
|
| 148 | 148 | ) + $_aAttributes |
| 149 | - ) . "/>" |
|
| 150 | - . "<input " . $this->getAttributes( |
|
| 149 | + )."/>" |
|
| 150 | + . "<input ".$this->getAttributes( |
|
| 151 | 151 | array( |
| 152 | - 'name' => "__export[{$aField['input_id']}][file_name]", |
|
| 153 | - 'value' => $aField['file_name'], |
|
| 152 | + 'name' => "__export[{$aField[ 'input_id' ]}][file_name]", |
|
| 153 | + 'value' => $aField[ 'file_name' ], |
|
| 154 | 154 | ) + $_aAttributes |
| 155 | - ) . "/>" |
|
| 156 | - . "<input " . $this->getAttributes( |
|
| 155 | + )."/>" |
|
| 156 | + . "<input ".$this->getAttributes( |
|
| 157 | 157 | array( |
| 158 | - 'name' => "__export[{$aField['input_id']}][format]", |
|
| 159 | - 'value' => $aField['format'], |
|
| 158 | + 'name' => "__export[{$aField[ 'input_id' ]}][format]", |
|
| 159 | + 'value' => $aField[ 'format' ], |
|
| 160 | 160 | ) + $_aAttributes |
| 161 | - ) . "/>" |
|
| 162 | - . "<input " . $this->getAttributes( |
|
| 161 | + )."/>" |
|
| 162 | + . "<input ".$this->getAttributes( |
|
| 163 | 163 | array( |
| 164 | - 'name' => "__export[{$aField['input_id']}][transient]", |
|
| 165 | - 'value' => isset( $aField['data'] ), |
|
| 164 | + 'name' => "__export[{$aField[ 'input_id' ]}][transient]", |
|
| 165 | + 'value' => isset( $aField[ 'data' ] ), |
|
| 166 | 166 | ) + $_aAttributes |
| 167 | - ) . "/>" |
|
| 167 | + )."/>" |
|
| 168 | 168 | ; |
| 169 | 169 | } |
| 170 | 170 | |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | * @since 2.1.5 Moved from the AdminPageFramework_FormField class. |
| 179 | 179 | * @internal |
| 180 | 180 | */ |
| 181 | - private function _generateExportFileName( $sOptionKey, $sExportFormat='json' ) { |
|
| 181 | + private function _generateExportFileName( $sOptionKey, $sExportFormat = 'json' ) { |
|
| 182 | 182 | |
| 183 | 183 | switch ( trim( strtolower( $sExportFormat ) ) ) { |
| 184 | 184 | case 'text': // for plain text. |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | break; |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | - return $sOptionKey . '_' . date("Ymd") . '.' . $sExt; |
|
| 196 | + return $sOptionKey.'_'.date( "Ymd" ).'.'.$sExt; |
|
| 197 | 197 | |
| 198 | 198 | } |
| 199 | 199 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | /** |
| 103 | 103 | * Defines the field type slugs used for this field type. |
| 104 | 104 | */ |
| 105 | - public $aFieldTypeSlugs = array( 'select', ); |
|
| 105 | + public $aFieldTypeSlugs = array( 'select',); |
|
| 106 | 106 | |
| 107 | 107 | /** |
| 108 | 108 | * Defines the default key-values of this field type. |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | 'select' => array( |
| 115 | 115 | 'size' => 1, |
| 116 | 116 | 'autofocusNew' => null, |
| 117 | - 'multiple' => null, // set 'multiple' for multiple selections. If 'is_multiple' is set, it takes the precedence. |
|
| 117 | + 'multiple' => null, // set 'multiple' for multiple selections. If 'is_multiple' is set, it takes the precedence. |
|
| 118 | 118 | 'required' => null, |
| 119 | 119 | ), |
| 120 | 120 | 'optgroup' => array(), |
@@ -154,12 +154,12 @@ discard block |
||
| 154 | 154 | protected function getField( $aField ) { |
| 155 | 155 | |
| 156 | 156 | $_oSelectInput = new AdminPageFramework_Input_select( $aField[ 'attributes' ] ); |
| 157 | - if ( $aField[ 'is_multiple' ] ) { |
|
| 157 | + if ( $aField[ 'is_multiple' ] ) { |
|
| 158 | 158 | $_oSelectInput->setAttribute( array( 'select', 'multiple' ), 'multiple' ); |
| 159 | 159 | } |
| 160 | 160 | return |
| 161 | 161 | $aField[ 'before_label' ] |
| 162 | - . "<div " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-select-label' ) . ">" |
|
| 162 | + . "<div ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-select-label' ).">" |
|
| 163 | 163 | . "<label for='{$aField[ 'input_id' ]}'>" |
| 164 | 164 | . $aField[ 'before_input' ] |
| 165 | 165 | . $_oSelectInput->get( $aField[ 'label' ] ) |
@@ -57,7 +57,7 @@ discard block |
||
| 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. |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | return |
| 92 | 92 | $this->_getScript_MediaUploader( |
| 93 | 93 | "admin_page_framework" |
| 94 | - ) . PHP_EOL |
|
| 94 | + ).PHP_EOL |
|
| 95 | 95 | . $this->_getScript_RegisterCallbacks(); |
| 96 | 96 | } |
| 97 | 97 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | $_sInsertFromURL = esc_js( $this->oMsg->get( 'insert_from_url' ) ); |
| 160 | 160 | |
| 161 | 161 | // If the WordPress version is 3.4.x or below |
| 162 | - if ( ! function_exists( 'wp_enqueue_media' ) ) { |
|
| 162 | + if ( !function_exists( 'wp_enqueue_media' ) ) { |
|
| 163 | 163 | return <<<JAVASCRIPTS |
| 164 | 164 | /** |
| 165 | 165 | * Bind/rebinds the thickbox script the given selector element. |
@@ -400,10 +400,10 @@ discard block |
||
| 400 | 400 | // Do not include the escaping character (backslash) in the heredoc variable declaration |
| 401 | 401 | // because the minifier script will parse it and the <<<JAVASCRIPTS and JAVASCRIPTS; parts are converted to double quotes (") |
| 402 | 402 | // which causes the PHP syntax error. |
| 403 | - $_sButtonHTML = '"' . $this->_getUploaderButtonHTML_Media( $sInputID, $aButtonAttributes, $bExternalSource ) . '"'; |
|
| 404 | - $_sRpeatable = $this->getAOrB( ! empty( $abRepeatable ), 'true', 'false' ); |
|
| 403 | + $_sButtonHTML = '"'.$this->_getUploaderButtonHTML_Media( $sInputID, $aButtonAttributes, $bExternalSource ).'"'; |
|
| 404 | + $_sRpeatable = $this->getAOrB( !empty( $abRepeatable ), 'true', 'false' ); |
|
| 405 | 405 | $_sExternalSource = $this->getAOrB( $bExternalSource, 'true', 'false' ); |
| 406 | - $_sScript = <<<JAVASCRIPTS |
|
| 406 | + $_sScript = <<<JAVASCRIPTS |
|
| 407 | 407 | if ( jQuery( 'a#select_media_{$sInputID}' ).length == 0 ) { |
| 408 | 408 | jQuery( 'input#{$sInputID}' ).after( $_sButtonHTML ); |
| 409 | 409 | } |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | . '/* <![CDATA[ */' |
| 417 | 417 | . $_sScript |
| 418 | 418 | . '/* ]]> */' |
| 419 | - . "</script>". PHP_EOL; |
|
| 419 | + . "</script>".PHP_EOL; |
|
| 420 | 420 | |
| 421 | 421 | } |
| 422 | 422 | /** |
@@ -427,19 +427,19 @@ discard block |
||
| 427 | 427 | */ |
| 428 | 428 | private function _getUploaderButtonHTML_Media( $sInputID, array $aButtonAttributes, $bExternalSource ) { |
| 429 | 429 | |
| 430 | - $_bIsLabelSet = isset( $aButtonAttributes['data-label'] ) && $aButtonAttributes['data-label']; |
|
| 430 | + $_bIsLabelSet = isset( $aButtonAttributes[ 'data-label' ] ) && $aButtonAttributes[ 'data-label' ]; |
|
| 431 | 431 | $_aAttributes = $this->_getFormattedUploadButtonAttributes_Media( |
| 432 | 432 | $sInputID, |
| 433 | 433 | $aButtonAttributes, |
| 434 | 434 | $_bIsLabelSet, |
| 435 | 435 | $bExternalSource |
| 436 | 436 | ); |
| 437 | - return "<a " . $this->getAttributes( $_aAttributes ) . ">" |
|
| 437 | + return "<a ".$this->getAttributes( $_aAttributes ).">" |
|
| 438 | 438 | . $this->getAOrB( |
| 439 | 439 | $_bIsLabelSet, |
| 440 | - $_aAttributes['data-label'], |
|
| 440 | + $_aAttributes[ 'data-label' ], |
|
| 441 | 441 | $this->getAOrB( |
| 442 | - strrpos( $_aAttributes['class'], 'dashicons' ), |
|
| 442 | + strrpos( $_aAttributes[ 'class' ], 'dashicons' ), |
|
| 443 | 443 | '', |
| 444 | 444 | $this->oMsg->get( 'select_file' ) |
| 445 | 445 | ) |
@@ -455,26 +455,26 @@ discard block |
||
| 455 | 455 | */ |
| 456 | 456 | private function _getFormattedUploadButtonAttributes_Media( $sInputID, array $aButtonAttributes, $_bIsLabelSet, $bExternalSource ) { |
| 457 | 457 | |
| 458 | - $_aAttributes = array( |
|
| 458 | + $_aAttributes = array( |
|
| 459 | 459 | 'id' => "select_media_{$sInputID}", |
| 460 | 460 | 'href' => '#', |
| 461 | - 'data-uploader_type' => ( string ) function_exists( 'wp_enqueue_media' ), // ? 1 : 0, |
|
| 462 | - 'data-enable_external_source' => ( string ) ( bool ) $bExternalSource, // ? 1 : 0, |
|
| 461 | + 'data-uploader_type' => ( string ) function_exists( 'wp_enqueue_media' ), // ? 1 : 0, |
|
| 462 | + 'data-enable_external_source' => ( string ) ( bool ) $bExternalSource, // ? 1 : 0, |
|
| 463 | 463 | ) |
| 464 | 464 | + $aButtonAttributes |
| 465 | 465 | + array( |
| 466 | 466 | 'title' => $_bIsLabelSet |
| 467 | - ? $aButtonAttributes['data-label'] |
|
| 467 | + ? $aButtonAttributes[ 'data-label' ] |
|
| 468 | 468 | : $this->oMsg->get( 'select_file' ), |
| 469 | 469 | 'data-label' => null, |
| 470 | 470 | ); |
| 471 | - $_aAttributes['class'] = $this->getClassAttribute( |
|
| 471 | + $_aAttributes[ 'class' ] = $this->getClassAttribute( |
|
| 472 | 472 | 'select_media button button-small ', |
| 473 | 473 | $this->getAOrB( |
| 474 | - trim( $aButtonAttributes['class'] ), |
|
| 475 | - $aButtonAttributes['class'], |
|
| 474 | + trim( $aButtonAttributes[ 'class' ] ), |
|
| 475 | + $aButtonAttributes[ 'class' ], |
|
| 476 | 476 | $this->getAOrB( |
| 477 | - ! $_bIsLabelSet && version_compare( $GLOBALS['wp_version'], '3.8', '>=' ), |
|
| 477 | + !$_bIsLabelSet && version_compare( $GLOBALS[ 'wp_version' ], '3.8', '>=' ), |
|
| 478 | 478 | 'dashicons dashicons-portfolio', |
| 479 | 479 | '' |
| 480 | 480 | ) |
@@ -66,16 +66,16 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | protected function getField( $aField ) { |
| 68 | 68 | |
| 69 | - $_oCallerForm = $aField[ '_caller_object' ]; |
|
| 69 | + $_oCallerForm = $aField[ '_caller_object' ]; |
|
| 70 | 70 | |
| 71 | 71 | $_aInlineMixedOutput = array(); |
| 72 | - foreach( $this->getAsArray( $aField[ 'content' ] ) as $_aChildFieldset ) { |
|
| 72 | + foreach ( $this->getAsArray( $aField[ 'content' ] ) as $_aChildFieldset ) { |
|
| 73 | 73 | |
| 74 | 74 | if ( is_scalar( $_aChildFieldset ) ) { |
| 75 | 75 | continue; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - if ( ! $this->isNormalPlacement( $_aChildFieldset ) ) { |
|
| 78 | + if ( !$this->isNormalPlacement( $_aChildFieldset ) ) { |
|
| 79 | 79 | continue; |
| 80 | 80 | } |
| 81 | 81 | |
@@ -91,12 +91,12 @@ discard block |
||
| 91 | 91 | $_oFieldset = new AdminPageFramework_Form_View___Fieldset( |
| 92 | 92 | $_aChildFieldset, |
| 93 | 93 | $_oCallerForm->aSavedData, |
| 94 | - $_oCallerForm->getFieldErrors(), // @todo Generate field errors. $this->aErrors, |
|
| 94 | + $_oCallerForm->getFieldErrors(), // @todo Generate field errors. $this->aErrors, |
|
| 95 | 95 | $_oCallerForm->aFieldTypeDefinitions, |
| 96 | 96 | $_oCallerForm->oMsg, |
| 97 | 97 | $_oCallerForm->aCallbacks // field output element callables. |
| 98 | 98 | ); |
| 99 | - $_aInlineMixedOutput[] = $_oFieldset->get(); // field output |
|
| 99 | + $_aInlineMixedOutput[ ] = $_oFieldset->get(); // field output |
|
| 100 | 100 | |
| 101 | 101 | |
| 102 | 102 | } |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | . ( $aField[ 'label' ] |
| 67 | 67 | ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
| 68 | 68 | . $aField[ 'label' ] |
| 69 | - . "</span>" |
|
| 69 | + . "</span>" |
|
| 70 | 70 | : "" |
| 71 | 71 | ) |
| 72 | 72 | . "<input " . $this->getAttributes( $aField[ 'attributes' ] ) . " />" |
@@ -59,21 +59,21 @@ |
||
| 59 | 59 | protected function getField( $aField ) { |
| 60 | 60 | |
| 61 | 61 | return |
| 62 | - $aField['before_label'] |
|
| 62 | + $aField[ 'before_label' ] |
|
| 63 | 63 | . "<div class='admin-page-framework-input-label-container'>" |
| 64 | 64 | . "<label for='{$aField[ 'input_id' ]}'>" |
| 65 | 65 | . $aField[ 'before_input' ] |
| 66 | 66 | . ( $aField[ 'label' ] |
| 67 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
| 67 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
| 68 | 68 | . $aField[ 'label' ] |
| 69 | 69 | . "</span>" |
| 70 | 70 | : "" |
| 71 | 71 | ) |
| 72 | - . "<input " . $this->getAttributes( $aField[ 'attributes' ] ) . " />" |
|
| 73 | - . $aField['after_input'] |
|
| 72 | + . "<input ".$this->getAttributes( $aField[ 'attributes' ] )." />" |
|
| 73 | + . $aField[ 'after_input' ] |
|
| 74 | 74 | . "</label>" |
| 75 | 75 | . "</div>" |
| 76 | - . $aField['after_label']; |
|
| 76 | + . $aField[ 'after_label' ]; |
|
| 77 | 77 | |
| 78 | 78 | } |
| 79 | 79 | |