if (empty($_REQUEST['do']))
{
// set default branch for this script
$_REQUEST['do'] = 'modify';
}
// #############################################################################
if ($_POST['do'] == 'kill')
{
// 'kill'
// run code to remove item in database
}
// #############################################################################
if ($_REQUEST['do'] == 'delete')
{
// 'delete'
// display delete confirmation message
}
// #############################################################################
if ($_POST['do'] == 'insert')
{
// 'insert'
// run code to insert new item into database
}
// #############################################################################
if ($_REQUEST['do'] == 'add')
{
// 'add'
// display form to add new item
}
// #############################################################################
if ($_POST['do'] == 'update')
{
// 'update'
// run code to update item in database
}
// #############################################################################
if ($_REQUEST['do'] == 'edit')
{
// 'edit'
// display form to edit item
}
// #############################################################################
if ($_REQUEST['do'] == 'modify')
{
// 'modify'
// show default branch for this script
}
If a script contains branches to edit/add/delete more than a single item type (such as template.php containing script to modify both styles and templates), then you should suffix the kill/delete/insert/add/update/edit branch names with the item type.
if ($_REQUEST['do'] == 'edittemplate')
{
// show form to edit a template
}
// #############################################################################
if ($_REQUEST['do'] == 'editstyle')
{
// show form to edit a style
}
if ($_REQUEST['do'] == 'rebuildstylecache')
{
// rebuild style cache
}
// #############################################################################
if ($_REQUEST['do'] == 'updatetemplateparentlists')
{
// update template parent lists
}
// if (empty($_REQUEST['do']))
// if ($_REQUEST['do'] == 'rebuildstylecache')
// if ($_POST['do'] == 'killstyle')
// if ($_REQUEST['do'] == 'deletestyle')
// if ($_POST['do'] == 'insertstyle')
// if ($_REQUEST['do'] == 'addstyle')
// if ($_POST['do'] == 'updatestyle')
// if ($_REQUEST['do'] == 'editstyle')
// if ($_REQUEST['do'] == 'updatetemplateparentlists')
// if ($_POST['do'] == 'killtemplate')
// if ($_REQUEST['do'] == 'deletetemplate')
// if ($_POST['do'] == 'inserttemplate')
// if ($_REQUEST['do'] == 'addtemplate')
// if ($_POST['do'] == 'updatetemplate')
// if ($_REQUEST['do'] == 'edittemplate')
// if ($_REQUEST['do'] == 'modify')