Skip to content

Commit 185dc22

Browse files
authored
Merge pull request #122 from contactashish13/development
remove footer banner #120
2 parents 3748341 + fb35ca0 commit 185dc22

File tree

4 files changed

+30
-12
lines changed

4 files changed

+30
-12
lines changed

classes/Visualizer/Module/Admin.php

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function __construct( Visualizer_Plugin $plugin ) {
7272
* @access private
7373
* @return array The associated array of chart types with localized names.
7474
*/
75-
public static function _getChartTypesLocalized() {
75+
public static function _getChartTypesLocalized( $enabledOnly = false, $get2Darray = false ) {
7676
$types = array(
7777
'pie' => array( 'name' => esc_html__( 'Pie', 'visualizer' ), 'enabled' => true ),
7878
'line' => array( 'name' => esc_html__( 'Line', 'visualizer' ), 'enabled' => true ),
@@ -91,6 +91,24 @@ public static function _getChartTypesLocalized() {
9191

9292
$types = apply_filters( 'visualizer_pro_chart_types', $types );
9393

94+
if ( $enabledOnly ) {
95+
$filtered = array();
96+
foreach ( $types as $type => $array ) {
97+
if ( ! $array['enabled'] ) { continue;
98+
}
99+
$filtered[ $type ] = $array;
100+
}
101+
$types = $filtered;
102+
}
103+
104+
if ( $get2Darray ) {
105+
$doubleD = array();
106+
foreach ( $types as $type => $array ) {
107+
$doubleD[ $type ] = $array['name'];
108+
}
109+
$types = $doubleD;
110+
}
111+
94112
return $types;
95113
}
96114

@@ -143,7 +161,8 @@ public function setupMediaViewStrings( $strings ) {
143161
'create' => esc_html__( 'Create New', 'visualizer' ),
144162
),
145163
'library' => array(
146-
'filters' => self::_getChartTypesLocalized(),
164+
'filters' => self::_getChartTypesLocalized( true, true ),
165+
'types' => array_keys( self::_getChartTypesLocalized( true, true ) ),
147166
),
148167
'nonce' => wp_create_nonce(),
149168
'buildurl' => add_query_arg( 'action', Visualizer_Plugin::ACTION_CREATE_CHART, admin_url( 'admin-ajax.php' ) ),

classes/Visualizer/Plugin.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ public function setModule( $class ) {
165165
*/
166166
public static function getChartTypes() {
167167
$array = array_keys( Visualizer_Module_Admin::_getChartTypesLocalized() );
168-
unset( $array[0] ); // all
169168
return $array;
170169
}
171170

js/media/view.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@
358358
var self = this;
359359

360360
self.filters = {};
361-
_.each(['all', 'pie', 'line', 'area', 'bar', 'column', 'geo', 'scatter', 'gauge', 'candlestick'], function(type, i) {
361+
_.each(l10n.library.types, function(type, i) {
362362
self.filters[type] = {
363363
text: l10n.library.filters[type],
364364
key: type,

languages/visualizer.pot

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ msgid ""
44
msgstr ""
55
"Project-Id-Version: Visualizer: Charts and Graphs Lite 1.7.2\n"
66
"Report-Msgid-Bugs-To: https://github.com/Codeinwp/visualizer/issues\n"
7-
"POT-Creation-Date: 2016-12-09 18:27:39+00:00\n"
7+
"POT-Creation-Date: 2016-12-09 18:57:52+00:00\n"
88
"MIME-Version: 1.0\n"
99
"Content-Type: text/plain; charset=utf-8\n"
1010
"Content-Transfer-Encoding: 8bit\n"
@@ -72,32 +72,32 @@ msgstr ""
7272
msgid "Combo"
7373
msgstr ""
7474

75-
#: classes/Visualizer/Module/Admin.php:139
75+
#: classes/Visualizer/Module/Admin.php:157
7676
msgid "Visualizations"
7777
msgstr ""
7878

79-
#: classes/Visualizer/Module/Admin.php:142
79+
#: classes/Visualizer/Module/Admin.php:160
8080
msgid "From Library"
8181
msgstr ""
8282

83-
#: classes/Visualizer/Module/Admin.php:143
83+
#: classes/Visualizer/Module/Admin.php:161
8484
msgid "Create New"
8585
msgstr ""
8686

87-
#: classes/Visualizer/Module/Admin.php:221
87+
#: classes/Visualizer/Module/Admin.php:240
8888
#: classes/Visualizer/Render/Library.php:168
8989
msgid "Visualizer Library"
9090
msgstr ""
9191

92-
#: classes/Visualizer/Module/Admin.php:345
92+
#: classes/Visualizer/Module/Admin.php:364
9393
msgid "Library"
9494
msgstr ""
9595

96-
#: classes/Visualizer/Module/Admin.php:368
96+
#: classes/Visualizer/Module/Admin.php:387
9797
msgid "Knowledge Base"
9898
msgstr ""
9999

100-
#: classes/Visualizer/Module/Admin.php:373
100+
#: classes/Visualizer/Module/Admin.php:392
101101
msgid "Pro Addon"
102102
msgstr ""
103103

0 commit comments

Comments
 (0)