function saveFieldConfiguration($field_id) { $field = DynamicFormField::lookup($field_id); if (!$field->setConfiguration()) { include STAFFINC_DIR . 'templates/dynamic-field-config.tmpl.php'; } else { $field->save(); } }
function getField() { if (!isset($this->field)) { $f = DynamicFormField::lookup($this->get('field_id')); $this->field = $f->getImpl($f); $this->field->setAnswer($this); } return $this->field; }
function upload($id) { if (!($field = DynamicFormField::lookup($id))) { Http::response(400, 'No such field'); } $impl = $field->getImpl(); if (!$impl instanceof FileUploadField) { Http::response(400, 'Upload to a non file-field'); } return JsonDataEncoder::encode(array('id' => $impl->ajaxUpload())); }