SproutCMS

This is the code documentation for the SproutCMS project

class JsonForm

Processes forms using configuration stored in a JSON file which specifies database columns, their HTML input fields,
and validation rules.
A generic implementation which should work for most cases is found in ManagedAdminController::_getEditForm
(generates the form) and Controller::saveJsonData (saves the POST submission)

Source code (11 results)

/sprout/Controllers/Admin/HasCategoriesAdminController.php   Highlighted file source

Line 29: use Sprout\Helpers\JsonForm;
Line 608: $data = array_merge($data, JsonForm::loadMultiEditData($conf, $default_link, $id, []));
Line 609: $data = array_merge($data, JsonForm::loadAutofillListData($conf, $this->table_name, $id, []));
Line 704: $data = array_merge($data, JsonForm::loadMultiEditData($conf, $default_link, $id, []));
Line 705: $data = array_merge($data, JsonForm::loadAutofillListData($conf, $this->table_name, $id, []));

/sprout/Controllers/Admin/HasCategoriesAdminController.php   Highlighted file source

Line 29: use Sprout\Helpers\JsonForm;
Line 608: $data = array_merge($data, JsonForm::loadMultiEditData($conf, $default_link, $id, []));
Line 609: $data = array_merge($data, JsonForm::loadAutofillListData($conf, $this->table_name, $id, []));
Line 704: $data = array_merge($data, JsonForm::loadMultiEditData($conf, $default_link, $id, []));
Line 705: $data = array_merge($data, JsonForm::loadAutofillListData($conf, $this->table_name, $id, []));

/sprout/Controllers/Admin/ManagedAdminController.php   Highlighted file source

Line 33: use Sprout\Helpers\JsonForm;
Line 1387: $data = array_merge($data, JsonForm::loadMultiEditData($conf, $default_link, $id, []));
Line 1388: $data = array_merge($data, JsonForm::loadAutofillListData($conf, $this->table_name, $id, []));
Line 1575: $data = array_merge($data, JsonForm::loadMultiEditData($conf, $default_link, $id, []));
Line 1576: $data = array_merge($data, JsonForm::loadAutofillListData($conf, $this->table_name, $id, []));

/sprout/Controllers/Admin/ManagedAdminController.php   Highlighted file source

Line 33: use Sprout\Helpers\JsonForm;
Line 1387: $data = array_merge($data, JsonForm::loadMultiEditData($conf, $default_link, $id, []));
Line 1388: $data = array_merge($data, JsonForm::loadAutofillListData($conf, $this->table_name, $id, []));
Line 1575: $data = array_merge($data, JsonForm::loadMultiEditData($conf, $default_link, $id, []));
Line 1576: $data = array_merge($data, JsonForm::loadAutofillListData($conf, $this->table_name, $id, []));

/sprout/Controllers/Controller.php   Highlighted file source

Line 26: use Sprout\Helpers\JsonForm;
Line 361: * Loads a config file for a JsonForm associated with this controller
Line 452: JsonForm::setParameterForColumns($items, $fk_cols, 'empty', null);
Line 471: JsonForm::setParameterForColumns($multi['items'], $fk_cols, 'empty', null);
Line 500: list($data, $errs) = JsonForm::collateData($conf, $mode, $validator, $item_id);
Line 558: $field_defns = JsonForm::flattenGroups($multed['items']);
Line 597: $auto = JsonForm::autofillOptionDefaults($auto, $this->table_name);

/sprout/Controllers/Controller.php   Highlighted file source

Line 26: use Sprout\Helpers\JsonForm;
Line 361: * Loads a config file for a JsonForm associated with this controller
Line 452: JsonForm::setParameterForColumns($items, $fk_cols, 'empty', null);
Line 471: JsonForm::setParameterForColumns($multi['items'], $fk_cols, 'empty', null);
Line 500: list($data, $errs) = JsonForm::collateData($conf, $mode, $validator, $item_id);
Line 558: $field_defns = JsonForm::flattenGroups($multed['items']);
Line 597: $auto = JsonForm::autofillOptionDefaults($auto, $this->table_name);

/sprout/Helpers/Fb.php   Highlighted file source

Line 1701: * As JsonForm will auto-convert arrays into comma-separated strings, this field can easily be used with a MySQL

/sprout/Helpers/Fb.php   Highlighted file source

Line 1701: * As JsonForm will auto-convert arrays into comma-separated strings, this field can easily be used with a MySQL

/sprout/Helpers/JsonForm.php   Highlighted file source

Line 26: class JsonForm extends Form
Line 289: return JsonForm::renderField($field, $name_prepend, $metadata);
Line 478: * validation before and/or after collating the JsonForm data
Line 667: * @param array $args Arguments in the JsonForm definition
Line 707: * This implements {@see JsonForm::makeOptional} and {@see JsonForm::makeRequired}

/sprout/views/auto_edit.php   Highlighted file source

Line 6: use Sprout\Helpers\JsonForm;
Line 33: echo JsonForm::renderTabItem($item, $for, $id, $data, $errors);

/sprout/views/auto_edit.php   Highlighted file source

Line 6: use Sprout\Helpers\JsonForm;
Line 33: echo JsonForm::renderTabItem($item, $for, $id, $data, $errors);

A total of 45 lines in 11 files were found