@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | /** |
21 | 21 | * Defines the field type slugs used for this field type. |
22 | 22 | */ |
23 | - public $aFieldTypeSlugs = array( 'import', ); |
|
23 | + public $aFieldTypeSlugs = array( 'import',); |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * Defines the default key-values of this field type. |
@@ -91,9 +91,9 @@ discard block |
||
91 | 91 | protected function getField( $aField ) { |
92 | 92 | |
93 | 93 | /* Set some required values */ |
94 | - $aField['attributes']['name'] = "__import[submit][{$aField['input_id']}]"; |
|
95 | - $aField['label'] = $aField['label'] |
|
96 | - ? $aField['label'] |
|
94 | + $aField[ 'attributes' ][ 'name' ] = "__import[submit][{$aField[ 'input_id' ]}]"; |
|
95 | + $aField[ 'label' ] = $aField[ 'label' ] |
|
96 | + ? $aField[ 'label' ] |
|
97 | 97 | : $this->oMsg->get( 'import' ); |
98 | 98 | return parent::getField( $aField ); |
99 | 99 | } |
@@ -106,13 +106,13 @@ discard block |
||
106 | 106 | * @since 3.0.0 |
107 | 107 | */ |
108 | 108 | protected function _getExtraFieldsBeforeLabel( &$aField ) { |
109 | - return "<input " . $this->getAttributes( |
|
109 | + return "<input ".$this->getAttributes( |
|
110 | 110 | array( |
111 | - 'id' => "{$aField['input_id']}_file", |
|
111 | + 'id' => "{$aField[ 'input_id' ]}_file", |
|
112 | 112 | 'type' => 'file', |
113 | - 'name' => "__import[{$aField['input_id']}]", |
|
114 | - ) + $aField['attributes']['file'] |
|
115 | - ) . " />"; |
|
113 | + 'name' => "__import[{$aField[ 'input_id' ]}]", |
|
114 | + ) + $aField[ 'attributes' ][ 'file' ] |
|
115 | + )." />"; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
@@ -121,44 +121,44 @@ discard block |
||
121 | 121 | */ |
122 | 122 | protected function _getExtraInputFields( &$aField ) { |
123 | 123 | |
124 | - $aHiddenAttributes = array( 'type' => 'hidden', ); |
|
124 | + $aHiddenAttributes = array( 'type' => 'hidden',); |
|
125 | 125 | return |
126 | - "<input " . $this->getAttributes( |
|
126 | + "<input ".$this->getAttributes( |
|
127 | 127 | array( |
128 | - 'name' => "__import[{$aField['input_id']}][input_id]", |
|
129 | - 'value' => $aField['input_id'], |
|
128 | + 'name' => "__import[{$aField[ 'input_id' ]}][input_id]", |
|
129 | + 'value' => $aField[ 'input_id' ], |
|
130 | 130 | ) + $aHiddenAttributes |
131 | - ) . "/>" |
|
132 | - . "<input " . $this->getAttributes( |
|
131 | + )."/>" |
|
132 | + . "<input ".$this->getAttributes( |
|
133 | 133 | array( |
134 | - 'name' => "__import[{$aField['input_id']}][field_id]", |
|
135 | - 'value' => $aField['field_id'], |
|
134 | + 'name' => "__import[{$aField[ 'input_id' ]}][field_id]", |
|
135 | + 'value' => $aField[ 'field_id' ], |
|
136 | 136 | ) + $aHiddenAttributes |
137 | - ) . "/>" |
|
138 | - . "<input " . $this->getAttributes( |
|
137 | + )."/>" |
|
138 | + . "<input ".$this->getAttributes( |
|
139 | 139 | array( |
140 | - 'name' => "__import[{$aField['input_id']}][section_id]", |
|
141 | - 'value' => isset( $aField['section_id'] ) && $aField['section_id'] != '_default' ? $aField['section_id'] : '', |
|
140 | + 'name' => "__import[{$aField[ 'input_id' ]}][section_id]", |
|
141 | + 'value' => isset( $aField[ 'section_id' ] ) && $aField[ 'section_id' ] != '_default' ? $aField[ 'section_id' ] : '', |
|
142 | 142 | ) + $aHiddenAttributes |
143 | - ) . "/>" |
|
144 | - . "<input " . $this->getAttributes( |
|
143 | + )."/>" |
|
144 | + . "<input ".$this->getAttributes( |
|
145 | 145 | array( |
146 | - 'name' => "__import[{$aField['input_id']}][is_merge]", |
|
147 | - 'value' => $aField['is_merge'], |
|
146 | + 'name' => "__import[{$aField[ 'input_id' ]}][is_merge]", |
|
147 | + 'value' => $aField[ 'is_merge' ], |
|
148 | 148 | ) + $aHiddenAttributes |
149 | - ) . "/>" |
|
150 | - . "<input " . $this->getAttributes( |
|
149 | + )."/>" |
|
150 | + . "<input ".$this->getAttributes( |
|
151 | 151 | array( |
152 | - 'name' => "__import[{$aField['input_id']}][option_key]", |
|
153 | - 'value' => $aField['option_key'], |
|
152 | + 'name' => "__import[{$aField[ 'input_id' ]}][option_key]", |
|
153 | + 'value' => $aField[ 'option_key' ], |
|
154 | 154 | ) + $aHiddenAttributes |
155 | - ) . "/>" |
|
156 | - . "<input " . $this->getAttributes( |
|
155 | + )."/>" |
|
156 | + . "<input ".$this->getAttributes( |
|
157 | 157 | array( |
158 | - 'name' => "__import[{$aField['input_id']}][format]", |
|
159 | - 'value' => $aField['format'], |
|
158 | + 'name' => "__import[{$aField[ 'input_id' ]}][format]", |
|
159 | + 'value' => $aField[ 'format' ], |
|
160 | 160 | ) + $aHiddenAttributes |
161 | - ) . "/>" |
|
161 | + )."/>" |
|
162 | 162 | ; |
163 | 163 | } |
164 | 164 |
@@ -43,7 +43,7 @@ |
||
43 | 43 | * @since 2.1.5 |
44 | 44 | * @since 3.3.1 Changed from `_replyToGetStyles()`. |
45 | 45 | */ |
46 | - protected function getStyles() { |
|
46 | + protected function getStyles() { |
|
47 | 47 | return <<<CSSRULES |
48 | 48 | /* Text Field Type */ |
49 | 49 | .admin-page-framework-field.admin-page-framework-field-text > .admin-page-framework-input-label-container { |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | /** |
21 | 21 | * Defines the field type slugs used for this field type. |
22 | 22 | */ |
23 | - public $aFieldTypeSlugs = array( 'export', ); |
|
23 | + public $aFieldTypeSlugs = array( 'export',); |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * Defines the default key-values of this field type. |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | * @remark $_aDefaultKeys holds shared default key-values defined in the base class. |
29 | 29 | */ |
30 | 30 | protected $aDefaultKeys = array( |
31 | - 'data' => null, // ( array|string|object ) This is for the export field type. Do not set a value here. |
|
32 | - 'format' => 'json', // ( string ) for the export field type. Do not set a default value here. Currently array, json, and text are supported. |
|
33 | - 'file_name' => null, // ( string ) for the export field type. Do not set a default value here. |
|
31 | + 'data' => null, // ( array|string|object ) This is for the export field type. Do not set a value here. |
|
32 | + 'format' => 'json', // ( string ) for the export field type. Do not set a default value here. Currently array, json, and text are supported. |
|
33 | + 'file_name' => null, // ( string ) for the export field type. Do not set a default value here. |
|
34 | 34 | 'attributes' => array( |
35 | 35 | 'class' => 'button button-primary', |
36 | 36 | ), |
@@ -71,14 +71,14 @@ discard block |
||
71 | 71 | protected function getField( $aField ) { |
72 | 72 | |
73 | 73 | /* Set the transient data to export - If the value is not an array and the export data is set. */ |
74 | - if ( isset( $aField['data'] ) ) { |
|
75 | - $this->setTransient( md5( "{$aField['class_name']}_{$aField['input_id']}" ), $aField['data'], 60*2 ); // 2 minutes. |
|
74 | + if ( isset( $aField[ 'data' ] ) ) { |
|
75 | + $this->setTransient( md5( "{$aField[ 'class_name' ]}_{$aField[ 'input_id' ]}" ), $aField[ 'data' ], 60 * 2 ); // 2 minutes. |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /* Set some required values */ |
79 | - $aField['attributes']['name'] = "__export[submit][{$aField['input_id']}]"; |
|
80 | - $aField['file_name'] = $aField['file_name'] ? $aField['file_name'] : $this->_generateExportFileName( $aField['option_key'] ? $aField['option_key'] : $aField['class_name'], $aField['format'] ); |
|
81 | - $aField['label'] = $aField['label'] ? $aField['label'] : $this->oMsg->get( 'export' ); |
|
79 | + $aField[ 'attributes' ][ 'name' ] = "__export[submit][{$aField[ 'input_id' ]}]"; |
|
80 | + $aField[ 'file_name' ] = $aField[ 'file_name' ] ? $aField[ 'file_name' ] : $this->_generateExportFileName( $aField[ 'option_key' ] ? $aField[ 'option_key' ] : $aField[ 'class_name' ], $aField[ 'format' ] ); |
|
81 | + $aField[ 'label' ] = $aField[ 'label' ] ? $aField[ 'label' ] : $this->oMsg->get( 'export' ); |
|
82 | 82 | |
83 | 83 | return parent::getField( $aField ); |
84 | 84 | |
@@ -93,42 +93,42 @@ discard block |
||
93 | 93 | |
94 | 94 | $_aAttributes = array( 'type' => 'hidden' ); |
95 | 95 | return |
96 | - "<input " . $this->getAttributes( |
|
96 | + "<input ".$this->getAttributes( |
|
97 | 97 | array( |
98 | - 'name' => "__export[{$aField['input_id']}][input_id]", |
|
99 | - 'value' => $aField['input_id'], |
|
98 | + 'name' => "__export[{$aField[ 'input_id' ]}][input_id]", |
|
99 | + 'value' => $aField[ 'input_id' ], |
|
100 | 100 | ) + $_aAttributes |
101 | - ) . "/>" |
|
102 | - . "<input " . $this->getAttributes( |
|
101 | + )."/>" |
|
102 | + . "<input ".$this->getAttributes( |
|
103 | 103 | array( |
104 | - 'name' => "__export[{$aField['input_id']}][field_id]", |
|
105 | - 'value' => $aField['field_id'], |
|
104 | + 'name' => "__export[{$aField[ 'input_id' ]}][field_id]", |
|
105 | + 'value' => $aField[ 'field_id' ], |
|
106 | 106 | ) + $_aAttributes |
107 | - ) . "/>" |
|
108 | - . "<input " . $this->getAttributes( |
|
107 | + )."/>" |
|
108 | + . "<input ".$this->getAttributes( |
|
109 | 109 | array( |
110 | - 'name' => "__export[{$aField['input_id']}][section_id]", |
|
111 | - 'value' => isset( $aField['section_id'] ) && $aField['section_id'] != '_default' ? $aField['section_id'] : '', |
|
110 | + 'name' => "__export[{$aField[ 'input_id' ]}][section_id]", |
|
111 | + 'value' => isset( $aField[ 'section_id' ] ) && $aField[ 'section_id' ] != '_default' ? $aField[ 'section_id' ] : '', |
|
112 | 112 | ) + $_aAttributes |
113 | - ) . "/>" |
|
114 | - . "<input " . $this->getAttributes( |
|
113 | + )."/>" |
|
114 | + . "<input ".$this->getAttributes( |
|
115 | 115 | array( |
116 | - 'name' => "__export[{$aField['input_id']}][file_name]", |
|
117 | - 'value' => $aField['file_name'], |
|
116 | + 'name' => "__export[{$aField[ 'input_id' ]}][file_name]", |
|
117 | + 'value' => $aField[ 'file_name' ], |
|
118 | 118 | ) + $_aAttributes |
119 | - ) . "/>" |
|
120 | - . "<input " . $this->getAttributes( |
|
119 | + )."/>" |
|
120 | + . "<input ".$this->getAttributes( |
|
121 | 121 | array( |
122 | - 'name' => "__export[{$aField['input_id']}][format]", |
|
123 | - 'value' => $aField['format'], |
|
122 | + 'name' => "__export[{$aField[ 'input_id' ]}][format]", |
|
123 | + 'value' => $aField[ 'format' ], |
|
124 | 124 | ) + $_aAttributes |
125 | - ) . "/>" |
|
126 | - . "<input " . $this->getAttributes( |
|
125 | + )."/>" |
|
126 | + . "<input ".$this->getAttributes( |
|
127 | 127 | array( |
128 | - 'name' => "__export[{$aField['input_id']}][transient]", |
|
129 | - 'value' => isset( $aField['data'] ), |
|
128 | + 'name' => "__export[{$aField[ 'input_id' ]}][transient]", |
|
129 | + 'value' => isset( $aField[ 'data' ] ), |
|
130 | 130 | ) + $_aAttributes |
131 | - ) . "/>" |
|
131 | + )."/>" |
|
132 | 132 | ; |
133 | 133 | } |
134 | 134 | |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | * @since 2.0.0 |
142 | 142 | * @since 2.1.5 Moved from the AdminPageFramework_FormField class. |
143 | 143 | */ |
144 | - private function _generateExportFileName( $sOptionKey, $sExportFormat='json' ) { |
|
144 | + private function _generateExportFileName( $sOptionKey, $sExportFormat = 'json' ) { |
|
145 | 145 | |
146 | 146 | switch ( trim( strtolower( $sExportFormat ) ) ) { |
147 | 147 | case 'text': // for plain text. |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | break; |
157 | 157 | } |
158 | 158 | |
159 | - return $sOptionKey . '_' . date("Ymd") . '.' . $sExt; |
|
159 | + return $sOptionKey.'_'.date( "Ymd" ).'.'.$sExt; |
|
160 | 160 | |
161 | 161 | } |
162 | 162 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | /** |
21 | 21 | * Defines the field type slugs used for this field type. |
22 | 22 | */ |
23 | - public $aFieldTypeSlugs = array( 'posttype', ); |
|
23 | + public $aFieldTypeSlugs = array( 'posttype',); |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * Defines the default key-values of this field type. |
@@ -28,19 +28,19 @@ discard block |
||
28 | 28 | * @remark $_aDefaultKeys holds shared default key-values defined in the base class. |
29 | 29 | */ |
30 | 30 | protected $aDefaultKeys = array( |
31 | - 'slugs_to_remove' => null, // the default array will be assigned in the rendering method. |
|
31 | + 'slugs_to_remove' => null, // the default array will be assigned in the rendering method. |
|
32 | 32 | /** |
33 | 33 | * Accepts query arguments. For the specification, see the arg parameter of get_post_types() function. |
34 | 34 | * See: http://codex.wordpress.org/Function_Reference/get_post_types#Parameters |
35 | 35 | */ |
36 | - 'query' => array(), // 3.2.1+ |
|
37 | - 'operator' => 'and', // 3.2.1+ either 'and' or 'or' |
|
36 | + 'query' => array(), // 3.2.1+ |
|
37 | + 'operator' => 'and', // 3.2.1+ either 'and' or 'or' |
|
38 | 38 | 'attributes' => array( |
39 | 39 | 'size' => 30, |
40 | 40 | 'maxlength' => 400, |
41 | 41 | ), |
42 | - 'select_all_button' => true, // 3.3.0+ to change the label, set the label here |
|
43 | - 'select_none_button' => true, // 3.3.0+ to change the label, set the label here |
|
42 | + 'select_all_button' => true, // 3.3.0+ to change the label, set the label here |
|
43 | + 'select_none_button' => true, // 3.3.0+ to change the label, set the label here |
|
44 | 44 | ); |
45 | 45 | protected $aDefaultRemovingPostTypeSlugs = array( |
46 | 46 | 'revision', |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | protected function getStyles() { |
57 | 57 | $_sParentStyles = parent::getStyles(); |
58 | - return $_sParentStyles . <<<CSSRULES |
|
58 | + return $_sParentStyles.<<<CSSRULES |
|
59 | 59 | /* Posttype Field Type */ |
60 | 60 | .admin-page-framework-field input[type='checkbox'] { |
61 | 61 | margin-right: 0.5em; |
@@ -80,13 +80,13 @@ discard block |
||
80 | 80 | */ |
81 | 81 | protected function getField( $aField ) { |
82 | 82 | |
83 | - $this->_sCheckboxClassSelector = ''; // disable the checkbox class selector. |
|
84 | - $aField['label'] = $this->_getPostTypeArrayForChecklist( |
|
85 | - isset( $aField['slugs_to_remove'] ) |
|
86 | - ? $this->getAsArray( $aField['slugs_to_remove'] ) |
|
87 | - : $this->aDefaultRemovingPostTypeSlugs, // slugs to remove |
|
88 | - $aField['query'], |
|
89 | - $aField['operator'] |
|
83 | + $this->_sCheckboxClassSelector = ''; // disable the checkbox class selector. |
|
84 | + $aField[ 'label' ] = $this->_getPostTypeArrayForChecklist( |
|
85 | + isset( $aField[ 'slugs_to_remove' ] ) |
|
86 | + ? $this->getAsArray( $aField[ 'slugs_to_remove' ] ) |
|
87 | + : $this->aDefaultRemovingPostTypeSlugs, // slugs to remove |
|
88 | + $aField[ 'query' ], |
|
89 | + $aField[ 'operator' ] |
|
90 | 90 | ); |
91 | 91 | return parent::getField( $aField ); |
92 | 92 | |
@@ -104,11 +104,11 @@ discard block |
||
104 | 104 | * @param $sOperator array The query operator. |
105 | 105 | * @return array The array holding the elements of installed post types' labels and their slugs except the specified expluding post types. |
106 | 106 | */ |
107 | - private function _getPostTypeArrayForChecklist( $aSlugsToRemove, $asQueryArgs=array(), $sOperator='and' ) { |
|
107 | + private function _getPostTypeArrayForChecklist( $aSlugsToRemove, $asQueryArgs = array(), $sOperator = 'and' ) { |
|
108 | 108 | |
109 | 109 | $_aPostTypes = array(); |
110 | - foreach( get_post_types( $asQueryArgs, 'objects' ) as $_oPostType ) { |
|
111 | - if ( isset( $_oPostType->name, $_oPostType->label ) ) { |
|
110 | + foreach ( get_post_types( $asQueryArgs, 'objects' ) as $_oPostType ) { |
|
111 | + if ( isset( $_oPostType->name, $_oPostType->label ) ) { |
|
112 | 112 | $_aPostTypes[ $_oPostType->name ] = $_oPostType->label; |
113 | 113 | } |
114 | 114 | } |
@@ -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 |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | */ |
18 | 18 | class AdminPageFramework_Form_View___ToolTip extends AdminPageFramework_Form_View___Section_Base { |
19 | 19 | |
20 | - public $aArguments = array( |
|
20 | + public $aArguments = array( |
|
21 | 21 | 'attributes' => array(), // attributes |
22 | - 'icon' => null, // the icon output |
|
22 | + 'icon' => null, // the icon output |
|
23 | 23 | 'title' => null, |
24 | 24 | 'content' => null, |
25 | 25 | ); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | if ( is_string( $asContent ) ) { |
55 | 55 | return true; |
56 | 56 | } |
57 | - if ( is_array( $asContent ) && ! $this->isAssociative( $asContent ) ) { |
|
57 | + if ( is_array( $asContent ) && !$this->isAssociative( $asContent ) ) { |
|
58 | 58 | return true; |
59 | 59 | } |
60 | 60 | return false; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @return string The output. |
69 | 69 | */ |
70 | 70 | public function get() { |
71 | - if ( ! $this->aArguments[ 'content' ] ) { |
|
71 | + if ( !$this->aArguments[ 'content' ] ) { |
|
72 | 72 | return ''; |
73 | 73 | } |
74 | 74 | $_sHref = esc_attr( "#{$this->sTitleElementID}" ); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | return $this->aArguments[ 'icon' ]; |
93 | 93 | } |
94 | 94 | |
95 | - if ( version_compare( $GLOBALS['wp_version'], '3.8', '>=' ) ) { |
|
95 | + if ( version_compare( $GLOBALS[ 'wp_version' ], '3.8', '>=' ) ) { |
|
96 | 96 | return "<span class='dashicons dashicons-editor-help'></span>"; |
97 | 97 | } |
98 | 98 |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * @since DEVVER |
16 | 16 | * @internal |
17 | 17 | */ |
18 | -class AdminPageFramework_Form_View___ToolTip extends AdminPageFramework_Form_View___Section_Base { |
|
18 | +class AdminPageFramework_Form_View___ToolTip extends AdminPageFramework_Form_View___Section_Base { |
|
19 | 19 | |
20 | 20 | public $aArguments = array( |
21 | 21 | 'attributes' => array(), // attributes |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @since DEVVER |
100 | 100 | * @return string |
101 | 101 | */ |
102 | - private function _getDescriptions() { |
|
102 | + private function _getDescriptions() { |
|
103 | 103 | |
104 | 104 | if ( isset( $this->aArguments[ 'content' ] ) ) { |
105 | 105 | return "<span class='admin-page-framework-form-tool-tip-description'>" |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | $_aParameters = func_get_args() + array( |
35 | 35 | $this->aFieldset, |
36 | - $this->aSavedData, // passed by reference. @todo: examine why it needs to be passed by reference. |
|
36 | + $this->aSavedData, // passed by reference. @todo: examine why it needs to be passed by reference. |
|
37 | 37 | $this->aFieldErrors, |
38 | 38 | $this->aFieldTypeDefinitions, |
39 | 39 | $this->aCallbacks, // field output element callables. |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | return ''; |
66 | 66 | } |
67 | 67 | |
68 | - $_oFieldrowAttribute = new AdminPageFramework_Form_View___Attribute_Fieldrow( |
|
68 | + $_oFieldrowAttribute = new AdminPageFramework_Form_View___Attribute_Fieldrow( |
|
69 | 69 | $aFieldset, |
70 | 70 | array( |
71 | - 'id' => 'fieldrow-' . $aFieldset[ 'tag_id' ], |
|
71 | + 'id' => 'fieldrow-'.$aFieldset[ 'tag_id' ], |
|
72 | 72 | 'valign' => 'top', |
73 | 73 | 'class' => 'admin-page-framework-fieldrow', |
74 | 74 | ) |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | return $this->_getFieldByContainer( |
78 | 78 | $aFieldset, |
79 | 79 | array( |
80 | - 'open_container' => "<tr " . $_oFieldrowAttribute->get() . ">", |
|
80 | + 'open_container' => "<tr ".$_oFieldrowAttribute->get().">", |
|
81 | 81 | 'close_container' => "</tr>", |
82 | 82 | 'open_title' => "<th>", |
83 | 83 | 'close_title' => "</th>", |
@@ -117,13 +117,13 @@ discard block |
||
117 | 117 | 'close_main' => '', |
118 | 118 | ); |
119 | 119 | |
120 | - $_aOutput = array(); |
|
120 | + $_aOutput = array(); |
|
121 | 121 | if ( $aFieldset[ 'show_title_column' ] ) { |
122 | - $_aOutput[] = $aOpenCloseTags[ 'open_title' ] |
|
122 | + $_aOutput[ ] = $aOpenCloseTags[ 'open_title' ] |
|
123 | 123 | . $this->_getFieldTitle( $aFieldset ) |
124 | 124 | . $aOpenCloseTags[ 'close_title' ]; |
125 | 125 | } |
126 | - $_aOutput[] = $aOpenCloseTags[ 'open_main' ] |
|
126 | + $_aOutput[ ] = $aOpenCloseTags[ 'open_main' ] |
|
127 | 127 | // . call_user_func_array( $hfCallback, array( $aFieldset ) ) |
128 | 128 | . $this->getFieldsetOutput( $aFieldset ) |
129 | 129 | . $aOpenCloseTags[ 'close_main' ]; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | 0 // the first item |
149 | 149 | ); |
150 | 150 | |
151 | - return "<label for='" . $_oInputTagIDGenerator->get() . "'>" |
|
151 | + return "<label for='".$_oInputTagIDGenerator->get()."'>" |
|
152 | 152 | . "<a id='{$aField[ 'field_id' ]}'></a>" // to allow the browser to link to the element. |
153 | 153 | . "<span title='" |
154 | 154 | . esc_attr( |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * @since DEVVER |
172 | 172 | */ |
173 | 173 | private function _getToolTip( $asTip, $sElementID ) { |
174 | - $_oToolTip = new AdminPageFramework_Form_View___ToolTip( |
|
174 | + $_oToolTip = new AdminPageFramework_Form_View___ToolTip( |
|
175 | 175 | $asTip, |
176 | 176 | $sElementID |
177 | 177 | ); |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | private function _getTitleColon( $aField ) { |
186 | 186 | |
187 | - if ( ! isset( $aField[ 'title' ] ) || '' === $aField[ 'title' ] ) { |
|
187 | + if ( !isset( $aField[ 'title' ] ) || '' === $aField[ 'title' ] ) { |
|
188 | 188 | return ''; |
189 | 189 | } |
190 | 190 | if ( |
@@ -192,8 +192,8 @@ discard block |
||
192 | 192 | $aField[ '_structure_type' ], |
193 | 193 | array( 'widget', 'post_meta_box', 'page_meta_box' ) |
194 | 194 | ) |
195 | - ){ |
|
196 | - return "<span class='title-colon'>:</span>" ; |
|
195 | + ) { |
|
196 | + return "<span class='title-colon'>:</span>"; |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | $aFieldset = $this->aFieldset; |
63 | 63 | |
64 | - if ( 'section_title' === $aFieldset[ 'type' ] ) { |
|
64 | + if ( 'section_title' === $aFieldset[ 'type' ] ) { |
|
65 | 65 | return ''; |
66 | 66 | } |
67 | 67 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $aField[ '_structure_type' ], |
193 | 193 | array( 'widget', 'post_meta_box', 'page_meta_box' ) |
194 | 194 | ) |
195 | - ){ |
|
195 | + ) { |
|
196 | 196 | return "<span class='title-colon'>:</span>" ; |
197 | 197 | } |
198 | 198 |
@@ -18,14 +18,14 @@ discard block |
||
18 | 18 | */ |
19 | 19 | class AdminPageFramework_Form_View___SectionTitle extends AdminPageFramework_Form_View___Section_Base { |
20 | 20 | |
21 | - public $aArguments = array( |
|
21 | + public $aArguments = array( |
|
22 | 22 | 'title' => null, |
23 | 23 | 'tag' => null, |
24 | 24 | 'section_index' => null, |
25 | 25 | |
26 | 26 | 'sectionset' => array(), |
27 | 27 | ); |
28 | - public $aFieldsets = array(); |
|
28 | + public $aFieldsets = array(); |
|
29 | 29 | public $aSavedData = array(); |
30 | 30 | public $aFieldErrors = array(); |
31 | 31 | public $aFieldTypeDefinitions = array(); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | private function _getToolTip() { |
84 | 84 | |
85 | 85 | $_aSectionset = $this->aArguments[ 'sectionset' ]; |
86 | - $_sSectionTitleTagID = str_replace( '|', '_', $_aSectionset[ '_section_path' ] ) . '_' . $this->aArguments[ 'section_index' ]; |
|
86 | + $_sSectionTitleTagID = str_replace( '|', '_', $_aSectionset[ '_section_path' ] ).'_'.$this->aArguments[ 'section_index' ]; |
|
87 | 87 | $_oToolTip = new AdminPageFramework_Form_View___ToolTip( |
88 | 88 | $_aSectionset[ 'tip' ], |
89 | 89 | $_sSectionTitleTagID |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * @since DEVVER Moved from `AdminPageFramework_FormPart_SectionTitle`. |
103 | 103 | * @return string The section title output. |
104 | 104 | */ |
105 | - protected function _getSectionTitle( $sTitle, $sTag, $aFieldsets, $iSectionIndex=null, $aFieldTypeDefinitions=array(), $aCollapsible=array() ) { |
|
105 | + protected function _getSectionTitle( $sTitle, $sTag, $aFieldsets, $iSectionIndex = null, $aFieldTypeDefinitions = array(), $aCollapsible = array() ) { |
|
106 | 106 | |
107 | 107 | $_aSectionTitleField = $this->_getSectionTitleField( $aFieldsets, $iSectionIndex, $aFieldTypeDefinitions ); |
108 | 108 | return $_aSectionTitleField |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | private function _getSectionTitleField( array $aFieldsetsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
141 | 141 | |
142 | - foreach( $aFieldsetsets as $_aFieldsetset ) { |
|
142 | + foreach ( $aFieldsetsets as $_aFieldsetset ) { |
|
143 | 143 | |
144 | 144 | if ( 'section_title' !== $_aFieldsetset[ 'type' ] ) { |
145 | 145 | continue; |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | * @since DEVVER Changed the name from `AdminPageFramework_FormPart_SectionTitle`. |
17 | 17 | * @internal |
18 | 18 | */ |
19 | -class AdminPageFramework_Form_View___SectionTitle extends AdminPageFramework_Form_View___Section_Base { |
|
19 | +class AdminPageFramework_Form_View___SectionTitle extends AdminPageFramework_Form_View___Section_Base { |
|
20 | 20 | |
21 | 21 | public $aArguments = array( |
22 | 22 | 'title' => null, |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | * @since 3.6.0 Added the `$iSectionIndex` parameter. Added the `$aFieldTypeDefinitions` parameter. |
105 | 105 | * @since DEVVER Moved from `AdminPageFramework_FormPart_SectionTitle`. |
106 | 106 | */ |
107 | - private function _getSectionTitleField( array $aFieldsetsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
|
107 | + private function _getSectionTitleField( array $aFieldsetsets, $iSectionIndex, $aFieldTypeDefinitions ) { |
|
108 | 108 | |
109 | 109 | foreach( $aFieldsetsets as $_aFieldsetset ) { |
110 | 110 |
@@ -54,13 +54,13 @@ |
||
54 | 54 | public function getFieldsetOutput( $aFieldset ) { |
55 | 55 | |
56 | 56 | // Check if the field is visible |
57 | - if ( ! $this->isFieldsetVisible( $aFieldset ) ) { |
|
57 | + if ( !$this->isFieldsetVisible( $aFieldset ) ) { |
|
58 | 58 | return ''; |
59 | 59 | } |
60 | 60 | |
61 | 61 | $_oFieldset = new AdminPageFramework_Form_View___Fieldset( |
62 | 62 | $aFieldset, |
63 | - $this->aSavedData, // passed by reference. @todo: examine why it needs to be passed by reference. |
|
63 | + $this->aSavedData, // passed by reference. @todo: examine why it needs to be passed by reference. |
|
64 | 64 | $this->aFieldErrors, |
65 | 65 | $this->aFieldTypeDefinitions, |
66 | 66 | $this->oMsg, |
@@ -54,7 +54,7 @@ |
||
54 | 54 | public function getFieldsetOutput( $aFieldset ) { |
55 | 55 | |
56 | 56 | // Check if the field is visible |
57 | - if ( ! $this->isFieldsetVisible( $aFieldset ) ) { |
|
57 | + if ( ! $this->isFieldsetVisible( $aFieldset ) ) { |
|
58 | 58 | return ''; |
59 | 59 | } |
60 | 60 |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @return string |
58 | 58 | * @since DEVVER |
59 | 59 | */ |
60 | - public function get( $bTableRow=true ) { |
|
60 | + public function get( $bTableRow = true ) { |
|
61 | 61 | |
62 | 62 | $_sMethodName = $this->getAOrB( |
63 | 63 | $bTableRow, |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | ); |
67 | 67 | |
68 | 68 | $_aOutput = array(); |
69 | - foreach( $this->aFieldsetsPerSection as $_aFieldset ) { |
|
69 | + foreach ( $this->aFieldsetsPerSection as $_aFieldset ) { |
|
70 | 70 | |
71 | 71 | $_oFieldsetOutputFormatter = new AdminPageFramework_Form_Model___Format_FieldsetOutput( |
72 | 72 | $_aFieldset, |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $this->aFieldTypeDefinitions |
75 | 75 | ); |
76 | 76 | |
77 | - $_aOutput[] = call_user_func_array( |
|
77 | + $_aOutput[ ] = call_user_func_array( |
|
78 | 78 | array( $this, $_sMethodName ), |
79 | 79 | array( $_oFieldsetOutputFormatter->get() ) |
80 | 80 | ); |