Skip to content

Instantly share code, notes, and snippets.

@BrandonDyer64
Last active April 5, 2018 19:54
Show Gist options
  • Save BrandonDyer64/54f837392c55952969f93aa44af0a97f to your computer and use it in GitHub Desktop.
Save BrandonDyer64/54f837392c55952969f93aa44af0a97f to your computer and use it in GitHub Desktop.
<?php
include("../../bin/do_not_change/standard_validation_regex.php");
$table_type = "master_id_with_auto";
unset($field);
unset($index);
$table = "${master}_note";
$thing_display = preg_replace("/_/"," ",$table);;
$Thing_display = ucfirst($thing_display);
$things_display = "${thing_display}s";
$Things_display = ucfirst($things_display);
$is_slave_table_to[] = "${master}";
$dont_show_in_vert_table[] = "${master}";
$default_sort_by = "date_added";
$default_sort_dir = "DESC";
$display_name_as = "note";
$field[] = array("name"=>"${master}_id",
"type"=>"INT",
"not_null" => TRUE,
"make_link" => FALSE,
"display_in_table_list_column" => FALSE,
"display_field_in_vertical_table" => TRUE,
"field_is_required_in_form" => TRUE,
"human_display" => "Ad"
);
$field[] = array("name"=>"id",
"type"=>"INT UNSIGNED",
"not_null" => TRUE,
"auto_increment" => TRUE,
"display_in_table_list_column" => TRUE,
"display_field_in_vertical_table" => TRUE,
"field_is_required_in_form" => TRUE,
"human_display" => "ID"
);
$field[] = array("name"=>"note",
"type"=>"TEXT",
"show_full_text_in_list_column"=>TRUE,
"display_in_table_list_column" => TRUE,
"display_field_in_vertical_table" => TRUE,
"field_is_required_in_form" => FALSE,
"filterable" => TRUE,
"filter_operator" => "LIKE",
"human_display" => "Note"
);
include("../../bin/do_not_change/standard_config_files/STANDARD_WRITTEN_BY");
include("../../bin/do_not_change/standard_config_files/STANDARD_TABLE_FIELDS");
$index[] = array("type"=>"PRIMARY KEY",
"name"=>array("${master}_id","id")
);
$startup_sql[] = "INSERT IGNORE INTO thing (id, name, active, date_added) VALUES ('$table','$Thing_display','y',NOW())";
// give admin group read/write permissions
$startup_sql[] = "INSERT IGNORE INTO jusergroup_thing (usergroup_id, thing_id, read_access, write_access, active, date_added) VALUES ('2','$table','all','all','y',NOW())";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment