Browse files

allow values that equate to FALSE

  • Loading branch information...
1 parent 8742373 commit a637bed6e18c9262933c0c047aadde459933981b @brandonkelly brandonkelly committed Feb 23, 2011
View
10 ee1/fieldtypes/pt_list/ft.pt_list.php
@@ -108,12 +108,20 @@ function display_var_field($cell_name, $data, $settings)
// --------------------------------------------------------------------
/**
+ * Filter Data
+ */
+ private function _filter_data($item)
+ {
+ return ($item !== '');
+ }
+
+ /**
* Save Field
*/
function save_field($data, $settings)
{
// flatten list into one string
- $data = implode("\n", array_filter($data));
+ $data = implode("\n", array_filter($data, array(&$this, '_filter_data')));
// use real quotes
$data = str_replace('"', '"', $data);
View
10 ee2/third_party/pt_list/ft.pt_list.php
@@ -149,12 +149,20 @@ function display_var_field($data)
// --------------------------------------------------------------------
/**
+ * Filter Data
+ */
+ private function _filter_data($item)
+ {
+ return ($item !== '');
+ }
+
+ /**
* Save Field
*/
function save($data)
{
// flatten list into one string
- $data = implode("\n", array_filter($data));
+ $data = implode("\n", array_filter($data, array(&$this, '_filter_data')));
// use real quotes
$data = str_replace('"', '"', $data);
View
BIN themes/third_party/pt_list/images/.DS_Store
Binary file not shown.

0 comments on commit a637bed

Please sign in to comment.