@@ -121,6 +121,7 @@ public function enqueueMediaScripts() {
121
121
* @return array The extended array of media view strings.
122
122
*/
123
123
public function setupMediaViewStrings ( $ strings ) {
124
+ $ chart_types = self ::_getChartTypesLocalized ( true , true , true );
124
125
$ strings ['visualizer ' ] = array (
125
126
'actions ' => array (
126
127
'get_charts ' => Visualizer_Plugin::ACTION_GET_CHARTS ,
@@ -134,8 +135,8 @@ public function setupMediaViewStrings( $strings ) {
134
135
'create ' => esc_html__ ( 'Create New ' , 'visualizer ' ),
135
136
),
136
137
'library ' => array (
137
- 'filters ' => self :: _getChartTypesLocalized ( true , true ) ,
138
- 'types ' => array_keys ( self :: _getChartTypesLocalized ( true , true ) ),
138
+ 'filters ' => $ chart_types ,
139
+ 'types ' => array_keys ( $ chart_types ),
139
140
),
140
141
'nonce ' => wp_create_nonce (),
141
142
'buildurl ' => add_query_arg ( 'action ' , Visualizer_Plugin::ACTION_CREATE_CHART , admin_url ( 'admin-ajax.php ' ) ),
@@ -153,8 +154,16 @@ public function setupMediaViewStrings( $strings ) {
153
154
* @access private
154
155
* @return array The associated array of chart types with localized names.
155
156
*/
156
- public static function _getChartTypesLocalized ( $ enabledOnly = false , $ get2Darray = false ) {
157
- $ types = array (
157
+ public static function _getChartTypesLocalized ( $ enabledOnly = false , $ get2Darray = false , $ add_select = false ) {
158
+ $ additional = array ();
159
+ if ( $ add_select ) {
160
+ $ additional ['select ' ] = array (
161
+ 'name ' => esc_html__ ( 'All ' , 'visualizer ' ),
162
+ 'enabled ' => true ,
163
+ );
164
+ }
165
+
166
+ $ types = array_merge ( $ additional , array (
158
167
'pie ' => array (
159
168
'name ' => esc_html__ ( 'Pie ' , 'visualizer ' ),
160
169
'enabled ' => true ,
@@ -204,7 +213,7 @@ public static function _getChartTypesLocalized( $enabledOnly = false, $get2Darra
204
213
'name ' => esc_html__ ( 'Combo ' , 'visualizer ' ),
205
214
'enabled ' => false ,
206
215
),
207
- );
216
+ ) ) ;
208
217
$ types = apply_filters ( 'visualizer_pro_chart_types ' , $ types );
209
218
if ( $ enabledOnly ) {
210
219
$ filtered = array ();
0 commit comments