Conditions | 1 |
Paths | 1 |
Total Lines | 20 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | public function edit($jointClass) |
||
27 | { |
||
28 | $joint = new $jointClass(); |
||
29 | |||
30 | $this->location($joint->label()); |
||
31 | |||
32 | $form = $this->add(new Form()) |
||
33 | ->addElements($joint->elements()) |
||
34 | ->confirmLeave() |
||
35 | ->setValues(UserSetting::getGroup($joint->group())); |
||
36 | |||
37 | $form->validate(function(Form $form) use ($joint) { |
||
38 | UserSetting::putGroup($joint->group(), $form->getValues()); |
||
39 | |||
40 | return $form->notify(__('Settings saved!')); |
||
41 | }); |
||
42 | |||
43 | ActionBar::addButton('back'); |
||
44 | |||
45 | ActionBar::addButton('save')->on('click', $form->submit()); |
||
46 | } |
||
48 |