修訂 | cc1367bac4deb8ea9dbd579403f5d86d86cf7679 (tree) |
---|---|
時間 | 2007-10-01 23:29:01 |
作者 | henoheno <henoheno> |
Commiter | henoheno |
Simplify: reset() returns the first value of the array()
@@ -1,6 +1,6 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | -// $Id: tracker.inc.php,v 1.98 2007/10/01 13:55:45 henoheno Exp $ | |
3 | +// $Id: tracker.inc.php,v 1.99 2007/10/01 14:29:01 henoheno Exp $ | |
4 | 4 | // Copyright (C) 2003-2005, 2007 PukiWiki Developers Team |
5 | 5 | // License: GPL v2 or (at your option) any later version |
6 | 6 | // |
@@ -363,6 +363,7 @@ class Tracker_form | ||
363 | 363 | } |
364 | 364 | } |
365 | 365 | |
366 | +// TODO: Why a filter sometimes created so many? | |
366 | 367 | // Field classes within a form |
367 | 368 | class Tracker_field |
368 | 369 | { |
@@ -608,10 +609,7 @@ class Tracker_field_radio extends Tracker_field_format | ||
608 | 609 | $name = $this->name; |
609 | 610 | |
610 | 611 | if (! isset($options[$name])) { |
611 | - $values = array_map( | |
612 | - create_function('$array', 'return $array[0];'), | |
613 | - $this->config->get($name) | |
614 | - ); | |
612 | + $values = array_map('reset', $this->config->get($name)); | |
615 | 613 | $options[$name] = array_flip($values); // array('value0' => 0, 'value1' => 1, ...) |
616 | 614 | } |
617 | 615 |