The TViwere tool is a generic framework to be used to provision any DB table - the tool can be derived and customized (via the tviewer.inc.php configuration file) to any table format.
It provides standard DB operations (add, edit, delete, view) for a table (with data validation). It also allow to have attached the triggering of an Management Inteface command.
It also provides support for multiple tables to be provisioned using different tabs.
The configuration file (see below) contains a comprehensive description on how to configure the tviewer tool on top of any kind of custom sql table, with different custom views and operations over records and columns.
In order to create a new tool, you need follow these steps (consider we will add the $TOOL
name in the system
section):
mkdir opensips-cp/config/{tools,web}/system/$TOOL
cat <<EOF $branch = "system"; $module_id = "$TOOL"; require_once("../../../common/tools/tviewer/redirect.php"); EOF
db.inc.php - configuration file that indicates the database to be used by this tool; make sure you adjust the $module_id variable with the name of the tool ($TOOL).
settings.inc.php - contains the dynamic settings that can be adjusted for this module; make sure you adjust the your_module field of the $config variable to the name of the tool ($TOOL).
tviewer.inc.php - the main configuration file for your tool, where you should configure the tables you want to provision, its fields, MI commands, tabs, etc; please read the tviewer.inc.php file for a comprehensive description of the configuration options.
"$TOOL" => array ( "enabled" => true, "name" => "Your Tool's Name" ),