getSource();
foreach($source as $key => $value) {
$itemID = $this->id() . "_" . ereg_replace('[^a-zA-Z0-9]+','',$key);
if($key == $this->value/* || $useValue */) {
$useValue = false;
$checked = " checked=\"checked\"";
} else {
$checked="";
}
$odd = ($odd + 1) % 2;
$extraClass = $odd ? "odd" : "even";
$extraClass .= " val" . preg_replace('/[^a-zA-Z0-9\-\_]/','_', $key);
$disabled = $this->disabled ? 'disabled="disabled"' : '';
$options .= "
\n";
}
$id = $this->id();
return "extraClass()}\">\n$options
\n";
}
protected $disabled = false;
function setDisabled($val) {
$this->disabled = $val;
}
function performReadonlyTransformation() {
// Source and values are DataObject sets.
$items = $this->getSource();
$field = new LookupField($this->name,$this->title ? $this->title : "" ,$items,$this->value);
$field->setForm($this->form);
$field->setReadonly(true);
return $field;
}
/**
* Mark certain elements as disabled,
* regardless of the {@link setDisabled()} settings.
*
* @param array $items Collection of array keys, as defined in the $source array
*/
function setDisabledItems($items) {
$this->disabledItems = $items;
}
/**
* @return Array
*/
function getDisabledItems() {
return $this->disabledItems;
}
function ExtraOptions() {
return new DataObjectSet();
}
}
?>