1: <?php
2:
3: class ConfigurationKeysController extends AppController {
4:
5: public $scaffold;
6: public $paginate = array(
7: 'limit' => 10000
8: );
9: public $notModuleActions = array(
10: 'add'
11: );
12: public $components = array(
13: 'ExtendedScaffold.ScaffoldUtil' => array(
14: 'editSetFields' => array(
15: 'name' => array(
16: 'type' => 'string',
17: 'readonly' => true
18: ),
19: 'description' => array(
20: 'type' => 'string',
21: 'readonly' => true
22: ),
23: 'default_value' => array(
24: 'type' => 'string',
25: 'readonly' => true
26: ),
27: 'setted_value',
28: ),
29: 'indexUnsetFields' => array(
30: 'default_value',
31: 'setted_value'
32: )
33: )
34: );
35:
36: public function add() {
37: $this->redirect(array('action' => 'index'));
38: }
39:
40: public function beforeRender() {
41: parent::beforeRender();
42: if ($this->request->params['action'] == 'edit') {
43: $this->_settedValueListOptions();
44: }
45: }
46:
47: private function _settedValueListOptions() {
48: if (!empty($this->request->data['ConfigurationKey']['name'])) {
49: $listOptions = ConfigurationKeys::getKeyOptions(
50: $this->request->data['ConfigurationKey']['name']
51: , 'listOptions'
52: );
53: if (is_array($listOptions)) {
54: $this->set(array(
55: 'settedValues' => ArrayUtil::keysAsValues($listOptions)
56: ));
57: }
58: }
59: }
60:
61: }
62:
63: ?>