Custom fields

- added listing of custom fields in form editor
- ability to delete a custom field
- mades changes to the form editor in order to accomodate for the new custom fields system
- fix form editor bugs
- cleanup
This commit is contained in:
Jonathan Labreuille
2015-11-05 18:35:12 +01:00
parent 5473f94e24
commit b12f7f29de
16 changed files with 394 additions and 202 deletions

View File

@ -16,6 +16,27 @@ class CustomField extends Model {
));
}
function asArray() {
$model = parent::asArray();
$model['params'] = (
is_serialized($this->params)
? unserialize($this->params)
: $this->params
);
return $model;
}
function save() {
$this->set('params', (
is_serialized($this->params)
? $this->params
: serialize($this->params)
));
return parent::save();
}
function subscribers() {
return $this->has_many_through(
__NAMESPACE__ . '\Subscriber',