Skip to content

Commit 2c6fce4

Browse files
authored
Merge pull request #133 from contactashish13/issue-40
Implement dropdown cells for 2nd row ( type cells ) #42
2 parents d6568c4 + 97b48b0 commit 2c6fce4

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

classes/Visualizer/Source.php

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ abstract class Visualizer_Source {
5050
*/
5151
protected $_series = array();
5252

53+
/**
54+
* The array of allowed types.
55+
*
56+
* @since 1.0.0
57+
*
58+
* @access protected
59+
* @var array
60+
*/
61+
protected static $allowed_types = array( 'string', 'number', 'boolean', 'date', 'datetime', 'timeofday' );
62+
5363
/**
5464
* Returns source name.
5565
*
@@ -164,16 +174,30 @@ protected function _normalizeData( $data ) {
164174
* @return boolean TRUE if sereis types are valid, otherwise FALSE.
165175
*/
166176
protected static function _validateTypes( $types ) {
167-
$allowed_types = array( 'string', 'number', 'boolean', 'date', 'datetime', 'timeofday' );
168177
foreach ( $types as $type ) {
169-
if ( ! in_array( $type, $allowed_types ) ) {
178+
if ( ! in_array( $type, self::$allowed_types ) ) {
170179
return false;
171180
}
172181
}
173182

174183
return true;
175184
}
176185

186+
/**
187+
* Return allowed types
188+
*
189+
* @since 1.0.1
190+
*
191+
* @static
192+
* @access public
193+
* @return array the allowed types
194+
*/
195+
public static function getAllowedTypes() {
196+
return self::$allowed_types;
197+
}
198+
199+
200+
177201
/**
178202
* Re populates series if the source is dynamic.
179203
*

languages/visualizer.pot

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
msgid ""
44
msgstr ""
55
"Project-Id-Version: Visualizer: Charts and Graphs Lite 2.0.0\n"
6-
"Report-Msgid-Bugs-To: https://github.com/Codeinwp/visualizer/issues\n"
7-
"POT-Creation-Date: 2017-03-13 11:07:13+00:00\n"
6+
"Report-Msgid-Bugs-To: https://github.com/Codeinwp/visualizer/issues\n"
87
"MIME-Version: 1.0\n"
98
"Content-Type: text/plain; charset=utf-8\n"
109
"Content-Transfer-Encoding: 8bit\n"

0 commit comments

Comments
 (0)