| 1 |
<?php |
| 2 |
abstract class OptionElement extends Element { |
| 3 |
protected $options; |
| 4 |
|
| 5 |
public function __construct($label, $name, array $options, array $properties = null) { |
| 6 |
$this->options = $options; |
| 7 |
if(!empty($this->options) && array_values($this->options) === $this->options) |
| 8 |
$this->options = array_combine($this->options, $this->options); |
| 9 |
|
| 10 |
parent::__construct($label, $name, $properties); |
| 11 |
} |
| 12 |
|
| 13 |
protected function getOptionValue($value) { |
| 14 |
$position = strpos($value, ":pfbc"); |
| 15 |
if($position !== false) { |
| 16 |
if($position == 0) |
| 17 |
$value = ""; |
| 18 |
else |
| 19 |
$value = substr($value, 0, $position); |
| 20 |
} |
| 21 |
return $value; |
| 22 |
} |
| 23 |
} |
| 24 |
|