Skip to content

Commit 8c03477

Browse files
Implement dropdown cells for 2nd row ( type cells ) #42
1 parent d704de7 commit 8c03477

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
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 & 1 deletion
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.6\n"
66
"Report-Msgid-Bugs-To: https://github.com/Codeinwp/visualizer/issues\n"
7-
"POT-Creation-Date: 2017-02-23 12:58:23+00:00\n"
7+
"POT-Creation-Date: 2017-02-23 16:36:32+00:00\n"
88
"MIME-Version: 1.0\n"
99
"Content-Type: text/plain; charset=utf-8\n"
1010
"Content-Transfer-Encoding: 8bit\n"

0 commit comments

Comments
 (0)