Add new direct reference data element list to edit page

An edit page can have a new type of reference data type that is not a
link between table A and main table, but a sub table to main table with
several text fields + enable field.
This sub field list can have a max set, that adds empty rows to keep max
empty list available.
The sub table filed does not need a read_data element as the read is
directly connected to the master table (uses the elemen list key name
for table and the elements as read fields).
This sub elements need to have at least one as type = text and can have
error check addded (currently unique and alphanumeric work).

Also fix all old addslashes to correct db_escape_string

Read in for reference list also can have multiple elements (read data ->
name | seperated)

All sub reads have element prefixes

Inline documentation update
This commit is contained in:
Clemens Schwaighofer
2016-07-19 15:12:43 +09:00
parent a20df16c2c
commit 8de868fe4a
5 changed files with 168 additions and 48 deletions

View File

@@ -311,14 +311,14 @@
$elements[] = $form->form_create_element("color");
$elements[] = $form->form_create_element("description");
// add name/value list here
// $elements[] = $form->form_show_list_table("edit_access_data");
$elements[] = $form->form_show_list_table("edit_access_data");
break;
break;
default:
print "NO NO NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!";
break;
}
//$form->debug('edit', "Elements: <pre>".$form->print_ar($elements));
// $form->debug('edit', "Elements: <pre>".$form->print_ar($elements));
$DATA['elements'] = $elements;
$DATA['hidden'] = $form->form_create_hidden_fields();
$DATA['save_delete'] = $form->form_create_save_delete();

View File

@@ -40,13 +40,9 @@
"element_list" => array (
"edit_access_data" => array (
"output_name" => "Edit Access Data",
"delete" => 0, // set then reference entries are deleted, else the "enable" flag is only set
"type" => "reference_data", # is not a sub table read and connect, but only a sub table with data
"max_empty" => 5, # maxium visible if no data is set, if filled add this number to visible
"prefix" => "ead",
"read_data" => array (
"table_name" => "edit_access_data",
"pk_id" => "edit_acesss_id",
"name" => "name"
),
"elements" => array (
"edit_access_data_id" => array (
"output_name" => "Activate",
@@ -68,7 +64,13 @@
"output_name" => "Activate",
"int" => 1,
"element_list" => array(1)
),
"edit_access_id" => array (
"int" => 1,
"type" => "hidden",
"fk_id" => 1 # reference main key from master table above
)
)
)
)