@@ -82,11 +82,11 @@ discard block |
||
82 | 82 | 'confirm_perform_task' => 'Please confirm your action.', |
83 | 83 | 'specified_option_been_deleted' => 'The specified options have been deleted.', |
84 | 84 | 'nonce_verification_failed' => 'A problem occurred while processing the form data. Please try again.', |
85 | - 'check_max_input_vars' => 'Not all form fields could not be sent. Please check your server settings of PHP <code>max_input_vars</code> and consult the server administrator to increase the value. <code>max input vars</code>: %1$s. <code>$_POST</code> count: %2$s', // 3.5.11+ |
|
86 | - 'send_email' => 'Is it okay to send the email?', // 3.3.0+ |
|
87 | - 'email_sent' => 'The email has been sent.', // 3.3.0+, 3.3.5+ deprecated |
|
85 | + 'check_max_input_vars' => 'Not all form fields could not be sent. Please check your server settings of PHP <code>max_input_vars</code> and consult the server administrator to increase the value. <code>max input vars</code>: %1$s. <code>$_POST</code> count: %2$s', // 3.5.11+ |
|
86 | + 'send_email' => 'Is it okay to send the email?', // 3.3.0+ |
|
87 | + 'email_sent' => 'The email has been sent.', // 3.3.0+, 3.3.5+ deprecated |
|
88 | 88 | 'email_scheduled' => 'The email has been scheduled.', // 3.3.5+ |
89 | - 'email_could_not_send' => 'There was a problem sending the email', // 3.3.0+ |
|
89 | + 'email_could_not_send' => 'There was a problem sending the email', // 3.3.0+ |
|
90 | 90 | |
91 | 91 | // AdminPageFramework_PostType |
92 | 92 | 'title' => 'Title', |
@@ -112,14 +112,14 @@ discard block |
||
112 | 112 | 'upload_file' => 'Upload File', |
113 | 113 | 'use_this_file' => 'Use This File', |
114 | 114 | 'select_file' => 'Select File', |
115 | - 'remove_value' => 'Remove Value', // 3.2.0+ |
|
116 | - 'select_all' => 'Select All', // 3.3.0+ |
|
117 | - 'select_none' => 'Select None', // 3.3.0+ |
|
115 | + 'remove_value' => 'Remove Value', // 3.2.0+ |
|
116 | + 'select_all' => 'Select All', // 3.3.0+ |
|
117 | + 'select_none' => 'Select None', // 3.3.0+ |
|
118 | 118 | 'no_term_found' => 'No term found.', // 3.3.2+ |
119 | 119 | |
120 | 120 | // AdminPageFramework_Form_View___Script_{...} |
121 | 121 | 'select' => 'Select', // 3.4.2+ |
122 | - 'insert' => 'Insert', // 3.4.2+ |
|
122 | + 'insert' => 'Insert', // 3.4.2+ |
|
123 | 123 | 'use_this' => 'Use This', // 3.4.2+ |
124 | 124 | 'return_to_library' => 'Return to Library', // 3.4.2+ |
125 | 125 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | * @since 3.2.0 Changed it to create an instance per text domain basis. |
197 | 197 | * @remark This class should be instantiated via this method. |
198 | 198 | */ |
199 | - public static function getInstance( $sTextDomain='admin-page-framework' ) { |
|
199 | + public static function getInstance( $sTextDomain = 'admin-page-framework' ) { |
|
200 | 200 | |
201 | 201 | $_oInstance = isset( self::$_aInstancesByTextDomain[ $sTextDomain ] ) && ( self::$_aInstancesByTextDomain[ $sTextDomain ] instanceof AdminPageFramework_Message ) |
202 | 202 | ? self::$_aInstancesByTextDomain[ $sTextDomain ] |
@@ -209,21 +209,21 @@ discard block |
||
209 | 209 | * Ensures that only one instance of this class object exists. ( no multiple instances of this object ) |
210 | 210 | * @deprecated 3.2.0 |
211 | 211 | */ |
212 | - public static function instantiate( $sTextDomain='admin-page-framework' ) { |
|
212 | + public static function instantiate( $sTextDomain = 'admin-page-framework' ) { |
|
213 | 213 | return self::getInstance( $sTextDomain ); |
214 | 214 | } |
215 | 215 | |
216 | 216 | /** |
217 | 217 | * Sets up properties. |
218 | 218 | */ |
219 | - public function __construct( $sTextDomain='admin-page-framework' ) { |
|
219 | + public function __construct( $sTextDomain = 'admin-page-framework' ) { |
|
220 | 220 | |
221 | 221 | $this->_sTextDomain = $sTextDomain; |
222 | 222 | |
223 | 223 | // Fill the $aMessages property with the keys extracted from the $aDefaults property |
224 | 224 | // with the value of null. The null is set to let it trigger the __get() method |
225 | 225 | // so that each translation item gets processed individually. |
226 | - $this->aMessages = array_fill_keys( |
|
226 | + $this->aMessages = array_fill_keys( |
|
227 | 227 | array_keys( $this->aDefaults ), |
228 | 228 | null |
229 | 229 | ); |
@@ -257,13 +257,13 @@ discard block |
||
257 | 257 | * @since DEVVER If no key is specified, return the entire mesage array. |
258 | 258 | * @return string|array |
259 | 259 | */ |
260 | - public function get( $sKey='' ) { |
|
261 | - if ( ! $sKey ) { |
|
260 | + public function get( $sKey = '' ) { |
|
261 | + if ( !$sKey ) { |
|
262 | 262 | return $this->_getAllMessages(); |
263 | 263 | } |
264 | 264 | return isset( $this->aMessages[ $sKey ] ) |
265 | 265 | ? __( $this->aMessages[ $sKey ], $this->_sTextDomain ) |
266 | - : __( $this->{$sKey}, $this->_sTextDomain ); // triggers __get() |
|
266 | + : __( $this->{$sKey}, $this->_sTextDomain ); // triggers __get() |
|
267 | 267 | } |
268 | 268 | /** |
269 | 269 | * Returns the all registered messag items. |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * Defines the field type slugs used for this field type. |
23 | 23 | */ |
24 | - public $aFieldTypeSlugs = array( 'size', ); |
|
24 | + public $aFieldTypeSlugs = array( 'size',); |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Defines the default key-values of this field type. |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | protected $aDefaultKeys = array( |
32 | 32 | 'is_multiple' => false, // indicates whether the select tag alloes multiple selections. |
33 | - 'units' => null, // do not define units here since this will be merged with the user defined field array. |
|
33 | + 'units' => null, // do not define units here since this will be merged with the user defined field array. |
|
34 | 34 | 'attributes' => array( |
35 | 35 | 'size' => array( |
36 | 36 | 'size' => 10, |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | protected $aDefaultUnits = array( |
61 | 61 | 'px' => 'px', // pixel |
62 | - '%' => '%', // percentage |
|
62 | + '%' => '%', // percentage |
|
63 | 63 | 'em' => 'em', // font size |
64 | 64 | 'ex' => 'ex', // font height |
65 | 65 | 'in' => 'in', // inch |
@@ -116,8 +116,8 @@ discard block |
||
116 | 116 | ); |
117 | 117 | |
118 | 118 | $_aOutput = array(); |
119 | - foreach( ( array ) $aField[ 'label' ] as $_isKey => $_sLabel ) { |
|
120 | - $_aOutput[] = $this->_getFieldOutputByLabel( |
|
119 | + foreach ( ( array ) $aField[ 'label' ] as $_isKey => $_sLabel ) { |
|
120 | + $_aOutput[ ] = $this->_getFieldOutputByLabel( |
|
121 | 121 | $_isKey, |
122 | 122 | $_sLabel, |
123 | 123 | $aField |
@@ -139,22 +139,22 @@ discard block |
||
139 | 139 | |
140 | 140 | $_aBaseAttributes = $_bMultiLabels |
141 | 141 | ? array( |
142 | - 'name' => $aField[ 'attributes' ][ 'name' ] . "[{$isKey}]", |
|
143 | - 'id' => $aField[ 'attributes' ][ 'id' ] . "_{$isKey}", |
|
142 | + 'name' => $aField[ 'attributes' ][ 'name' ]."[{$isKey}]", |
|
143 | + 'id' => $aField[ 'attributes' ][ 'id' ]."_{$isKey}", |
|
144 | 144 | 'value' => $aField[ 'value' ], |
145 | 145 | ) |
146 | 146 | + $aField[ 'attributes' ] |
147 | 147 | : $aField[ 'attributes' ]; |
148 | 148 | unset( |
149 | - $_aBaseAttributes['unit'], |
|
150 | - $_aBaseAttributes['size'] |
|
149 | + $_aBaseAttributes[ 'unit' ], |
|
150 | + $_aBaseAttributes[ 'size' ] |
|
151 | 151 | ); |
152 | 152 | |
153 | 153 | $_aOutput = array( |
154 | 154 | $this->getElementByLabel( $aField[ 'before_label' ], $isKey, $aField[ 'label' ] ), |
155 | - "<div class='admin-page-framework-input-label-container admin-page-framework-select-label' style='min-width: " . $this->sanitizeLength( $aField[ 'label_min_width' ] ) . ";'>", |
|
156 | - $this->_getNumberInputPart( $aField, $_aBaseAttributes, $isKey, $aField[ 'label' ] ), // The size (number) part |
|
157 | - $this->_getUnitSelectInput( $aField, $_aBaseAttributes, $isKey, $aField[ 'label' ] ), // The unit (select) part |
|
155 | + "<div class='admin-page-framework-input-label-container admin-page-framework-select-label' style='min-width: ".$this->sanitizeLength( $aField[ 'label_min_width' ] ).";'>", |
|
156 | + $this->_getNumberInputPart( $aField, $_aBaseAttributes, $isKey, $aField[ 'label' ] ), // The size (number) part |
|
157 | + $this->_getUnitSelectInput( $aField, $_aBaseAttributes, $isKey, $aField[ 'label' ] ), // The unit (select) part |
|
158 | 158 | "</div>", |
159 | 159 | $this->getElementByLabel( $aField[ 'after_label' ], $isKey, $aField[ 'label' ] ) |
160 | 160 | ); |
@@ -170,39 +170,39 @@ discard block |
||
170 | 170 | private function _getNumberInputPart( array $aField, array $aBaseAttributes, $isKey, $bMultiLabels ) { |
171 | 171 | |
172 | 172 | // Size and Size Label |
173 | - $_aSizeAttributes = $this->_getSizeAttributes( |
|
173 | + $_aSizeAttributes = $this->_getSizeAttributes( |
|
174 | 174 | $aField, |
175 | 175 | $aBaseAttributes, |
176 | 176 | $bMultiLabels |
177 | 177 | ? $isKey |
178 | 178 | : '' |
179 | 179 | ); |
180 | - $_aSizeLabelAttributes = array( |
|
180 | + $_aSizeLabelAttributes = array( |
|
181 | 181 | 'for' => $_aSizeAttributes[ 'id' ], |
182 | 182 | 'class' => $_aSizeAttributes[ 'disabled' ] |
183 | 183 | ? 'disabled' |
184 | 184 | : null, |
185 | 185 | ); |
186 | 186 | |
187 | - $_sLabel = $this->getElementByLabel( |
|
187 | + $_sLabel = $this->getElementByLabel( |
|
188 | 188 | $aField[ 'label' ], |
189 | 189 | $isKey, |
190 | 190 | $aField[ 'label' ] |
191 | 191 | ); |
192 | - return "<label " . $this->getAttributes( $_aSizeLabelAttributes ) . ">" |
|
192 | + return "<label ".$this->getAttributes( $_aSizeLabelAttributes ).">" |
|
193 | 193 | . $this->getElement( |
194 | 194 | $aField, |
195 | 195 | $bMultiLabels |
196 | 196 | ? array( 'before_label', $isKey, 'size' ) |
197 | 197 | : array( 'before_label', 'size' ) |
198 | 198 | ) |
199 | - . ( $aField['label'] && ! $aField[ 'repeatable' ] |
|
200 | - ? "<span class='admin-page-framework-input-label-string' style='min-width:" . $this->sanitizeLength( $aField[ 'label_min_width' ] ) . ";'>" |
|
199 | + . ( $aField[ 'label' ] && !$aField[ 'repeatable' ] |
|
200 | + ? "<span class='admin-page-framework-input-label-string' style='min-width:".$this->sanitizeLength( $aField[ 'label_min_width' ] ).";'>" |
|
201 | 201 | . $_sLabel |
202 | 202 | . "</span>" |
203 | 203 | : "" |
204 | 204 | ) |
205 | - . "<input " . $this->getAttributes( $_aSizeAttributes ) . " />" |
|
205 | + . "<input ".$this->getAttributes( $_aSizeAttributes )." />" |
|
206 | 206 | . $this->getElement( |
207 | 207 | $aField, |
208 | 208 | $bMultiLabels |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | ) |
245 | 245 | : $aField[ 'units' ]; |
246 | 246 | |
247 | - return "<label " . $this->getAttributes( |
|
247 | + return "<label ".$this->getAttributes( |
|
248 | 248 | array( |
249 | 249 | 'for' => $_aUnitAttributes[ 'id' ], |
250 | 250 | 'class' => $_aUnitAttributes[ 'disabled' ] |
@@ -275,9 +275,9 @@ discard block |
||
275 | 275 | * @since 3.5.3 |
276 | 276 | * @return array an unit attribute array |
277 | 277 | */ |
278 | - private function _getUnitAttributes( array $aField, array $aBaseAttributes, $isLabelKey='' ) { |
|
278 | + private function _getUnitAttributes( array $aField, array $aBaseAttributes, $isLabelKey = '' ) { |
|
279 | 279 | |
280 | - $_bIsMultiple = $aField[ 'is_multiple' ] |
|
280 | + $_bIsMultiple = $aField[ 'is_multiple' ] |
|
281 | 281 | ? true |
282 | 282 | : $this->getElement( |
283 | 283 | $aField, |
@@ -289,13 +289,13 @@ discard block |
||
289 | 289 | |
290 | 290 | $_aSelectAttributes = array( |
291 | 291 | 'type' => 'select', |
292 | - 'id' => $aField[ 'input_id' ] . ( '' === $isLabelKey ? '' : '_' . $isLabelKey ) . '_' . 'unit', |
|
292 | + 'id' => $aField[ 'input_id' ].( '' === $isLabelKey ? '' : '_'.$isLabelKey ).'_'.'unit', |
|
293 | 293 | 'multiple' => $_bIsMultiple |
294 | 294 | ? 'multiple' |
295 | 295 | : null, |
296 | 296 | 'name' => $_bIsMultiple |
297 | - ? "{$aField['_input_name']}" . ( '' === $isLabelKey ? '' : '[' . $isLabelKey . ']' ) . "[unit][]" |
|
298 | - : "{$aField['_input_name']}" . ( '' === $isLabelKey ? '' : '[' . $isLabelKey . ']' ) . "[unit]", |
|
297 | + ? "{$aField[ '_input_name' ]}".( '' === $isLabelKey ? '' : '['.$isLabelKey.']' )."[unit][]" |
|
298 | + : "{$aField[ '_input_name' ]}".( '' === $isLabelKey ? '' : '['.$isLabelKey.']' )."[unit]", |
|
299 | 299 | 'value' => $this->getElement( |
300 | 300 | $aField, |
301 | 301 | array( 'value', 'unit' ), |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | '' === $isLabelKey |
308 | 308 | ? array( 'attributes', 'unit' ) |
309 | 309 | : array( 'attributes', $isLabelKey, 'unit' ), |
310 | - $this->aDefaultKeys['attributes']['unit'] |
|
310 | + $this->aDefaultKeys[ 'attributes' ][ 'unit' ] |
|
311 | 311 | ) |
312 | 312 | + $aBaseAttributes; |
313 | 313 | return $_aSelectAttributes; |
@@ -320,15 +320,15 @@ discard block |
||
320 | 320 | * @since 3.5.3 |
321 | 321 | * @return array an size attribute array |
322 | 322 | */ |
323 | - private function _getSizeAttributes( array $aField, array $aBaseAttributes, $sLabelKey='' ) { |
|
323 | + private function _getSizeAttributes( array $aField, array $aBaseAttributes, $sLabelKey = '' ) { |
|
324 | 324 | |
325 | 325 | return array( |
326 | 326 | 'type' => 'number', |
327 | - 'id' => $aField['input_id'] . '_' . ( '' !== $sLabelKey ? $sLabelKey . '_' : '' ) . 'size', |
|
328 | - 'name' => $aField[ '_input_name' ] . ( '' !== $sLabelKey ? "[{$sLabelKey}]" : '' ) . '[size]', |
|
327 | + 'id' => $aField[ 'input_id' ].'_'.( '' !== $sLabelKey ? $sLabelKey.'_' : '' ).'size', |
|
328 | + 'name' => $aField[ '_input_name' ].( '' !== $sLabelKey ? "[{$sLabelKey}]" : '' ).'[size]', |
|
329 | 329 | 'value' => $this->getElement( |
330 | - $aField, // subject |
|
331 | - array( 'value', 'size' ), // dimensional keys |
|
330 | + $aField, // subject |
|
331 | + array( 'value', 'size' ), // dimensional keys |
|
332 | 332 | '' // default |
333 | 333 | ), |
334 | 334 | ) |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Admin Page Framework |
|
4 | - * |
|
5 | - * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | - * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | - * |
|
8 | - */ |
|
3 | + * Admin Page Framework |
|
4 | + * |
|
5 | + * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | + * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | + * |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Provides methods for creating fields in the taxonomy page (edit-tags.php). |
@@ -433,8 +433,8 @@ discard block |
||
433 | 433 | protected function getField( $aField ) { |
434 | 434 | |
435 | 435 | $_aOutput = array(); |
436 | - foreach( ( array ) $aField[ 'label' ] as $_sKey => $_sLabel ) { |
|
437 | - $_aOutput[] = $this->_getFieldOutputByLabel( |
|
436 | + foreach ( ( array ) $aField[ 'label' ] as $_sKey => $_sLabel ) { |
|
437 | + $_aOutput[ ] = $this->_getFieldOutputByLabel( |
|
438 | 438 | $_sKey, |
439 | 439 | $_sLabel, |
440 | 440 | $aField |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | } |
443 | 443 | |
444 | 444 | // the repeatable field buttons will be replaced with this element. |
445 | - $_aOutput[] = "<div class='repeatable-field-buttons'></div>"; |
|
445 | + $_aOutput[ ] = "<div class='repeatable-field-buttons'></div>"; |
|
446 | 446 | return implode( '', $_aOutput ); |
447 | 447 | |
448 | 448 | } |
@@ -461,27 +461,27 @@ discard block |
||
461 | 461 | $aField[ 'rich' ] = $this->getElementByLabel( $aField[ 'rich' ], $sKey, $aField[ 'label' ] ); |
462 | 462 | $aField[ 'attributes' ] = $_bIsArray |
463 | 463 | ? array( |
464 | - 'name' => $aField[ 'attributes' ][ 'name' ] . "[{$sKey}]", |
|
465 | - 'id' => $aField[ 'attributes' ][ 'id' ] . "_{$sKey}", |
|
464 | + 'name' => $aField[ 'attributes' ][ 'name' ]."[{$sKey}]", |
|
465 | + 'id' => $aField[ 'attributes' ][ 'id' ]."_{$sKey}", |
|
466 | 466 | 'value' => $aField[ 'value' ], |
467 | 467 | ) |
468 | 468 | + $aField[ 'attributes' ] |
469 | 469 | : $aField[ 'attributes' ]; |
470 | - $_aOutput = array( |
|
471 | - $this->getElementByLabel( $aField['before_label'], $sKey, $aField[ 'label' ] ), |
|
470 | + $_aOutput = array( |
|
471 | + $this->getElementByLabel( $aField[ 'before_label' ], $sKey, $aField[ 'label' ] ), |
|
472 | 472 | "<div class='admin-page-framework-input-label-container {$_sClassSelector}'>", |
473 | - "<label for='" . $aField[ 'attributes' ][ 'id' ] . "'>", |
|
474 | - $this->getElementByLabel( $aField['before_input'], $sKey, $aField[ 'label' ] ), |
|
473 | + "<label for='".$aField[ 'attributes' ][ 'id' ]."'>", |
|
474 | + $this->getElementByLabel( $aField[ 'before_input' ], $sKey, $aField[ 'label' ] ), |
|
475 | 475 | $_sLabel |
476 | - ? "<span class='admin-page-framework-input-label-string' style='min-width:" . $this->sanitizeLength( $aField['label_min_width'] ) . ";'>" |
|
476 | + ? "<span class='admin-page-framework-input-label-string' style='min-width:".$this->sanitizeLength( $aField[ 'label_min_width' ] ).";'>" |
|
477 | 477 | . $_sLabel |
478 | 478 | . "</span>" |
479 | 479 | : '', |
480 | 480 | $this->_getEditor( $aField ), |
481 | - $this->getElementByLabel( $aField['after_input'], $sKey, $aField[ 'label' ] ), |
|
481 | + $this->getElementByLabel( $aField[ 'after_input' ], $sKey, $aField[ 'label' ] ), |
|
482 | 482 | "</label>", |
483 | 483 | "</div>", |
484 | - $this->getElementByLabel( $aField['after_label'], $sKey, $aField[ 'label' ] ), |
|
484 | + $this->getElementByLabel( $aField[ 'after_label' ], $sKey, $aField[ 'label' ] ), |
|
485 | 485 | ); |
486 | 486 | return implode( '', $_aOutput ); |
487 | 487 | |
@@ -494,31 +494,31 @@ discard block |
||
494 | 494 | */ |
495 | 495 | private function _getEditor( $aField ) { |
496 | 496 | |
497 | - unset( $aField['attributes']['value'] ); |
|
497 | + unset( $aField[ 'attributes' ][ 'value' ] ); |
|
498 | 498 | |
499 | 499 | // For no TinyMCE |
500 | - if ( empty( $aField['rich'] ) || ! $this->isTinyMCESupported() ) { |
|
501 | - return "<textarea " . $this->getAttributes( $aField['attributes'] ) . " >" // this method is defined in the base class |
|
502 | - . esc_textarea( $aField['value'] ) |
|
500 | + if ( empty( $aField[ 'rich' ] ) || !$this->isTinyMCESupported() ) { |
|
501 | + return "<textarea ".$this->getAttributes( $aField[ 'attributes' ] )." >" // this method is defined in the base class |
|
502 | + . esc_textarea( $aField[ 'value' ] ) |
|
503 | 503 | . "</textarea>"; |
504 | 504 | } |
505 | 505 | |
506 | 506 | // Rich editor |
507 | 507 | ob_start(); |
508 | 508 | wp_editor( |
509 | - $aField['value'], |
|
510 | - $aField['attributes']['id'], |
|
509 | + $aField[ 'value' ], |
|
510 | + $aField[ 'attributes' ][ 'id' ], |
|
511 | 511 | $this->uniteArrays( |
512 | - ( array ) $aField['rich'], |
|
512 | + ( array ) $aField[ 'rich' ], |
|
513 | 513 | array( |
514 | 514 | 'wpautop' => true, // use wpautop? |
515 | 515 | 'media_buttons' => true, // show insert/upload button(s) |
516 | - 'textarea_name' => $aField['attributes']['name'], |
|
517 | - 'textarea_rows' => $aField['attributes']['rows'], |
|
516 | + 'textarea_name' => $aField[ 'attributes' ][ 'name' ], |
|
517 | + 'textarea_rows' => $aField[ 'attributes' ][ 'rows' ], |
|
518 | 518 | 'tabindex' => '', |
519 | 519 | 'tabfocus_elements' => ':prev,:next', // the previous and next element ID to move the focus to when pressing the Tab key in TinyMCE |
520 | 520 | 'editor_css' => '', // intended for extra styles for both visual and Text editors buttons, needs to include the <style> tags, can use "scoped". |
521 | - 'editor_class' => $aField['attributes']['class'], // add extra class(es) to the editor textarea |
|
521 | + 'editor_class' => $aField[ 'attributes' ][ 'class' ], // add extra class(es) to the editor textarea |
|
522 | 522 | 'teeny' => false, // output the minimal editor config used in Press This |
523 | 523 | 'dfw' => false, // replace the default fullscreen with DFW (needs specific DOM elements and css) |
524 | 524 | 'tinymce' => true, // load TinyMCE, can be used to pass settings directly to TinyMCE using an array() |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | ob_end_clean(); |
531 | 531 | |
532 | 532 | return $_sContent |
533 | - . $this->_getScriptForRichEditor( $aField['attributes']['id'] ); |
|
533 | + . $this->_getScriptForRichEditor( $aField[ 'attributes' ][ 'id' ] ); |
|
534 | 534 | |
535 | 535 | } |
536 | 536 |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Admin Page Framework |
|
4 | - * |
|
5 | - * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | - * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | - * |
|
8 | - */ |
|
3 | + * Admin Page Framework |
|
4 | + * |
|
5 | + * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | + * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | + * |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Provides methods for creating fields in the taxonomy page (edit-tags.php). |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Admin Page Framework |
|
4 | - * |
|
5 | - * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | - * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | - * |
|
8 | - */ |
|
3 | + * Admin Page Framework |
|
4 | + * |
|
5 | + * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | + * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | + * |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Provides methods to handle importing options. |
@@ -24,13 +24,13 @@ |
||
24 | 24 | protected function _get() { |
25 | 25 | return $this->_getFormSectionRules(); |
26 | 26 | } |
27 | - /** |
|
28 | - * Returns the CSS rules for form fields. |
|
29 | - * |
|
30 | - * @since 3.4.0 |
|
31 | - * @since 3.7.0 Moved from `AdminPageFramework_CSS`. |
|
32 | - * @internal |
|
33 | - */ |
|
27 | + /** |
|
28 | + * Returns the CSS rules for form fields. |
|
29 | + * |
|
30 | + * @since 3.4.0 |
|
31 | + * @since 3.7.0 Moved from `AdminPageFramework_CSS`. |
|
32 | + * @internal |
|
33 | + */ |
|
34 | 34 | private function _getFormSectionRules() { |
35 | 35 | |
36 | 36 | return <<<CSSRULES |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Admin Page Framework |
|
4 | - * |
|
5 | - * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | - * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | - * |
|
8 | - */ |
|
3 | + * Admin Page Framework |
|
4 | + * |
|
5 | + * http://en.michaeluno.jp/admin-page-framework/ |
|
6 | + * Copyright (c) 2013-2015 Michael Uno; Licensed MIT |
|
7 | + * |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Provides methods to handle importing options. |
@@ -35,41 +35,41 @@ discard block |
||
35 | 35 | // Optional |
36 | 36 | 'page_slug' => null, |
37 | 37 | 'tab_slug' => null, |
38 | - 'section_tab_slug' => null, // 3.0.0+ |
|
38 | + 'section_tab_slug' => null, // 3.0.0+ |
|
39 | 39 | 'title' => null, |
40 | 40 | 'description' => null, |
41 | 41 | 'capability' => null, |
42 | 42 | 'if' => true, |
43 | - 'order' => null, // do not set the default number here because incremented numbers will be added when registering the sections. |
|
43 | + 'order' => null, // do not set the default number here because incremented numbers will be added when registering the sections. |
|
44 | 44 | 'help' => null, |
45 | 45 | 'help_aside' => null, |
46 | - 'repeatable' => false, // (boolean|array) 3.0.0+ |
|
47 | - 'sortable' => false, // (boolean|array) 3.6.0+ |
|
46 | + 'repeatable' => false, // (boolean|array) 3.0.0+ |
|
47 | + 'sortable' => false, // (boolean|array) 3.6.0+ |
|
48 | 48 | 'attributes' => array( // 3.3.1+ |
49 | - 'class' => null, // set null to avoid undefined index warnings. |
|
50 | - 'style' => null, // set null to avoid undefined index warnings. |
|
49 | + 'class' => null, // set null to avoid undefined index warnings. |
|
50 | + 'style' => null, // set null to avoid undefined index warnings. |
|
51 | 51 | 'tab' => array(), |
52 | 52 | ), |
53 | 53 | 'class' => array( // 3.3.1+ |
54 | 54 | 'tab' => array(), |
55 | 55 | ), |
56 | - 'hidden' => false, // 3.3.1+ |
|
57 | - 'collapsible' => false, // 3.4.0+ (boolean|array) For the array structure see the $aStructure_CollapsibleArguments property. |
|
58 | - 'save' => true, // 3.6.0+ |
|
56 | + 'hidden' => false, // 3.3.1+ |
|
57 | + 'collapsible' => false, // 3.4.0+ (boolean|array) For the array structure see the $aStructure_CollapsibleArguments property. |
|
58 | + 'save' => true, // 3.6.0+ |
|
59 | 59 | |
60 | - 'content' => null, // 3.6.1+ (string) An overriding section-set output. |
|
60 | + 'content' => null, // 3.6.1+ (string) An overriding section-set output. |
|
61 | 61 | |
62 | - 'tip' => null, // 3.7.0 (string) Tool tip HTML strings. |
|
62 | + 'tip' => null, // 3.7.0 (string) Tool tip HTML strings. |
|
63 | 63 | |
64 | 64 | // Internal |
65 | - '_fields_type' => null, // @deprecated 3.7.0+ Use the `_structure_type` instead. 3.0.0+ - same as the one of the field definition array. Used to insert debug info at the bottom of sections. |
|
66 | - '_structure_type' => null, // 3.7.0+ |
|
67 | - '_is_first_index' => false, // 3.4.0+ (boolean) indicates whether it is the first item of the sub-sections (for repeatable sections). |
|
68 | - '_is_last_index' => false, // 3.4.0+ (boolean) indicates whether it is the last item of the sub-sections (for repeatable sections). |
|
65 | + '_fields_type' => null, // @deprecated 3.7.0+ Use the `_structure_type` instead. 3.0.0+ - same as the one of the field definition array. Used to insert debug info at the bottom of sections. |
|
66 | + '_structure_type' => null, // 3.7.0+ |
|
67 | + '_is_first_index' => false, // 3.4.0+ (boolean) indicates whether it is the first item of the sub-sections (for repeatable sections). |
|
68 | + '_is_last_index' => false, // 3.4.0+ (boolean) indicates whether it is the last item of the sub-sections (for repeatable sections). |
|
69 | 69 | |
70 | - '_section_path' => '', // 3.7.0+ (string) e.g. my_section|nested_section |
|
71 | - '_section_path_array' => '', // 3.7.0+ (array) an array version of the above section_path argument. Numerically indexed. |
|
72 | - '_nested_depth' => 0, // 3.7.0+ (integer) the nested level of the section |
|
70 | + '_section_path' => '', // 3.7.0+ (string) e.g. my_section|nested_section |
|
71 | + '_section_path_array' => '', // 3.7.0+ (array) an array version of the above section_path argument. Numerically indexed. |
|
72 | + '_nested_depth' => 0, // 3.7.0+ (integer) the nested level of the section |
|
73 | 73 | |
74 | 74 | // 3.6.0+ - (object) the caller framework factory object. This allows the framework to access the factory property when rendering the section. |
75 | 75 | // 3.7.0+ It no longer stores a factory object but a form object. |
@@ -124,11 +124,11 @@ discard block |
||
124 | 124 | $_aSectionPath = explode( '|', $this->sSectionPath ); |
125 | 125 | $_aSectionset = $this->uniteArrays( |
126 | 126 | array( |
127 | - '_fields_type' => $this->sStructureType, // @deprecated 3.7.0+ |
|
128 | - '_structure_type' => $this->sStructureType, // 3.7.0+ |
|
129 | - '_section_path' => $this->sSectionPath, // 3.7.0+ |
|
127 | + '_fields_type' => $this->sStructureType, // @deprecated 3.7.0+ |
|
128 | + '_structure_type' => $this->sStructureType, // 3.7.0+ |
|
129 | + '_section_path' => $this->sSectionPath, // 3.7.0+ |
|
130 | 130 | '_section_path_array' => $_aSectionPath, |
131 | - '_nested_depth' => count( $_aSectionPath ) - 1, // 3.7.0+ - zero base |
|
131 | + '_nested_depth' => count( $_aSectionPath ) - 1, // 3.7.0+ - zero base |
|
132 | 132 | ) |
133 | 133 | + $this->aSectionset |
134 | 134 | + array( |
@@ -29,36 +29,36 @@ discard block |
||
29 | 29 | static public $aStructure = array( |
30 | 30 | |
31 | 31 | // Required Keys |
32 | - 'field_id' => null, // (string) |
|
33 | - 'type' => null, // (string) |
|
34 | - 'section_id' => null, // (string) |
|
32 | + 'field_id' => null, // (string) |
|
33 | + 'type' => null, // (string) |
|
34 | + 'section_id' => null, // (string) |
|
35 | 35 | |
36 | 36 | // Optional Keys |
37 | - 'section_title' => null, // This will be assigned automatically in the formatting method. |
|
38 | - 'page_slug' => null, // This will be assigned automatically in the formatting method. |
|
39 | - 'tab_slug' => null, // This will be assigned automatically in the formatting method. |
|
40 | - 'option_key' => null, // This will be assigned automatically in the formatting method. |
|
41 | - 'class_name' => null, // Stores the instantiated class name. Used by the export field type. Also a third party custom field type uses it. |
|
37 | + 'section_title' => null, // This will be assigned automatically in the formatting method. |
|
38 | + 'page_slug' => null, // This will be assigned automatically in the formatting method. |
|
39 | + 'tab_slug' => null, // This will be assigned automatically in the formatting method. |
|
40 | + 'option_key' => null, // This will be assigned automatically in the formatting method. |
|
41 | + 'class_name' => null, // Stores the instantiated class name. Used by the export field type. Also a third party custom field type uses it. |
|
42 | 42 | 'capability' => null, |
43 | 43 | 'title' => null, |
44 | 44 | 'tip' => null, |
45 | 45 | 'description' => null, |
46 | - 'error_message' => null, // error message for the field |
|
46 | + 'error_message' => null, // error message for the field |
|
47 | 47 | 'before_label' => null, |
48 | 48 | 'after_label' => null, |
49 | 49 | 'if' => true, |
50 | - 'order' => null, // do not set the default number here for this key. |
|
50 | + 'order' => null, // do not set the default number here for this key. |
|
51 | 51 | 'default' => null, |
52 | 52 | 'value' => null, |
53 | - 'help' => null, // 2.1.0+ |
|
54 | - 'help_aside' => null, // 2.1.0+ |
|
55 | - 'repeatable' => null, // 2.1.3+ |
|
56 | - 'sortable' => null, // 2.1.3+ |
|
57 | - 'show_title_column' => true, // 3.0.0+ |
|
58 | - 'hidden' => null, // 3.0.0+ |
|
53 | + 'help' => null, // 2.1.0+ |
|
54 | + 'help_aside' => null, // 2.1.0+ |
|
55 | + 'repeatable' => null, // 2.1.3+ |
|
56 | + 'sortable' => null, // 2.1.3+ |
|
57 | + 'show_title_column' => true, // 3.0.0+ |
|
58 | + 'hidden' => null, // 3.0.0+ |
|
59 | 59 | |
60 | 60 | // @todo Examine why an array is not set but null here for the attributes argument. |
61 | - 'attributes' => null, // 3.0.0+ - the array represents the attributes of input tag |
|
61 | + 'attributes' => null, // 3.0.0+ - the array represents the attributes of input tag |
|
62 | 62 | 'class' => array( // 3.3.1+ |
63 | 63 | 'fieldrow' => array(), |
64 | 64 | 'fieldset' => array(), |
@@ -66,21 +66,21 @@ discard block |
||
66 | 66 | 'field' => array(), |
67 | 67 | ), |
68 | 68 | |
69 | - 'save' => true, // 3.6.0+ |
|
70 | - 'content' => null, // 3.6.1+ - (string) An overriding field-set output. |
|
69 | + 'save' => true, // 3.6.0+ |
|
70 | + 'content' => null, // 3.6.1+ - (string) An overriding field-set output. |
|
71 | 71 | |
72 | 72 | // Internal Keys |
73 | - '_fields_type' => null, // @deprecated 3.7.0++, 3.0.0+ - an internal key that indicates the fields type such as page, meta box for pages, meta box for posts, or taxonomy. |
|
74 | - '_structure_type' => null, // DEVVEr+ |
|
75 | - '_caller_object' => null, // 3.4.0+ - (object) stores the object of the caller class. The object is referenced when creating nested fields. |
|
73 | + '_fields_type' => null, // @deprecated 3.7.0++, 3.0.0+ - an internal key that indicates the fields type such as page, meta box for pages, meta box for posts, or taxonomy. |
|
74 | + '_structure_type' => null, // DEVVEr+ |
|
75 | + '_caller_object' => null, // 3.4.0+ - (object) stores the object of the caller class. The object is referenced when creating nested fields. |
|
76 | 76 | |
77 | - '_section_path' => '', // 3.7.0+ (string) Stores the section path that indicates the structural address of the nested section. e.g. my_section|nested_one |
|
78 | - '_section_path_array' => '', // 3.7.0+ (array) An array version of the above section path. |
|
79 | - '_nested_depth' => 0, // 3.4.0+ - (integer) stores the level of the nesting depth. This is mostly used for debugging by checking if the field is a nested field or not. |
|
80 | - '_subsection_index' => null, // 3.7.0+ Passed to the `field_definition_{...}` filter hook callbacks. |
|
77 | + '_section_path' => '', // 3.7.0+ (string) Stores the section path that indicates the structural address of the nested section. e.g. my_section|nested_one |
|
78 | + '_section_path_array' => '', // 3.7.0+ (array) An array version of the above section path. |
|
79 | + '_nested_depth' => 0, // 3.4.0+ - (integer) stores the level of the nesting depth. This is mostly used for debugging by checking if the field is a nested field or not. |
|
80 | + '_subsection_index' => null, // 3.7.0+ Passed to the `field_definition_{...}` filter hook callbacks. |
|
81 | 81 | |
82 | - '_field_path' => '', // 3.7.0+ (string Stores the field path that indicates the structural location of the field. This is relative to the belonging section. |
|
83 | - '_field_path_array' => '', // 3.7.0+ (array) An array version of the above field path. |
|
82 | + '_field_path' => '', // 3.7.0+ (string Stores the field path that indicates the structural location of the field. This is relative to the belonging section. |
|
83 | + '_field_path_array' => '', // 3.7.0+ (array) An array version of the above field path. |
|
84 | 84 | |
85 | 85 | ); |
86 | 86 | |
@@ -157,8 +157,8 @@ discard block |
||
157 | 157 | array( |
158 | 158 | '_fields_type' => $this->sStructureType, // @deprecated 3.7.0 backward-compatibility |
159 | 159 | '_structure_type' => $this->sStructureType, |
160 | - '_caller_object' => $this->oCallerObject, // 3.4.1+ Stores the caller framework factory object. |
|
161 | - '_subsection_index' => $this->iSubSectionIndex, // 3.7.0+ |
|
160 | + '_caller_object' => $this->oCallerObject, // 3.4.1+ Stores the caller framework factory object. |
|
161 | + '_subsection_index' => $this->iSubSectionIndex, // 3.7.0+ |
|
162 | 162 | ) |
163 | 163 | + $this->aFieldset, |
164 | 164 | array( |
@@ -177,9 +177,9 @@ discard block |
||
177 | 177 | // @todo when nested fields are supported, set an appropriate value here. |
178 | 178 | $_aFieldset[ '_field_path' ] = $this->getFormElementPath( $_aFieldset[ 'field_id' ] ); |
179 | 179 | $_aFieldset[ '_field_path_array' ] = explode( '|', $_aFieldset[ '_field_path' ] ); |
180 | -$_aFieldset[ '_nested_depth' ] = count( $_aFieldset[ '_field_path_array' ] ) - 1 ; |
|
180 | +$_aFieldset[ '_nested_depth' ] = count( $_aFieldset[ '_field_path_array' ] ) - 1; |
|
181 | 181 | |
182 | - $_aFieldset[ 'order' ] = $this->getAOrB( |
|
182 | + $_aFieldset[ 'order' ] = $this->getAOrB( |
|
183 | 183 | is_numeric( $_aFieldset[ 'order' ] ), |
184 | 184 | $_aFieldset[ 'order' ], |
185 | 185 | $this->iCountOfElements + 10 |