1: <?php
2:
3: 4: 5: 6: 7: 8: 9: 10: 11:
12:
13:
14: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
15:
16: plugin_include(Pifa::getName(), 'classes/class.pifa.external_options_datasource_interface.php');
17:
18: 19: 20: 21: 22:
23: class ExampleOptionsDatasource extends PifaExternalOptionsDatasourceInterface {
24:
25: 26: 27: 28: 29:
30: protected $_options = NULL;
31:
32: 33: 34: 35: 36: 37:
38: protected function _getData() {
39: $options = array(
40: 'n/a' => mi18n("CHOOSE_OPTION"),
41: 'foo' => mi18n("FOO"),
42: 'bar' => mi18n("BAR")
43: );
44:
45: return $options;
46: }
47:
48: 49: 50: 51:
52: public function getOptionLabels() {
53: if (NULL === $this->_options) {
54: $this->_options = $this->_getData();
55: }
56: return array_values($this->_options);
57: }
58:
59: 60: 61: 62:
63: public function getOptionValues() {
64: if (NULL === $this->_options) {
65: $this->_options = $this->_getData();
66: }
67: return array_keys($this->_options);
68: }
69: }
70: