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