[almost] AUTOMATIC FORM BUTTONS
Posted: 2016-07-17 19:43
I've put together a module that handles detail view form buttons, in much the same way mktabbed_html() does for tabs. (Note I say mktabbed_html() and not mktabbed(), meaning this module uses an array and only an array.)
I've added the module to my mktabbed demo site. Once you click into the detail view, there you will see the additional buttons.
Source is linked on the main page.
Instructions for use are in the source comments.
For the click-averse, a sample:
I've added the module to my mktabbed demo site. Once you click into the detail view, there you will see the additional buttons.
Source is linked on the main page.
Instructions for use are in the source comments.
For the click-averse, a sample:
Code: Select all
require('hooks/_mkbuttons.php');
$buttons['print']['invoice']['name'] = 'Print Invoice';
$buttons['print']['invoice']['insert'] = false;
$buttons['print']['invoice']['update'] = true;
$buttons['print']['invoice']['style'] = 'default';
$buttons['print']['invoice']['icon'] = 'print';
$buttons['print']['voucher']['name'] = 'Print Voucher';
$buttons['print']['voucher']['insert'] = false;
$buttons['print']['voucher']['update'] = true;
$buttons['print']['voucher']['style'] = 'default';
$buttons['print']['voucher']['icon'] = 'print';
$buttons['email']['invoice']['name'] = 'Email Invoice';
$buttons['email']['invoice']['insert'] = false;
$buttons['email']['invoice']['update'] = true;
$buttons['email']['invoice']['style'] = 'success';
$buttons['email']['invoice']['icon'] = 'envelope';
$html .= mkbuttons('orders', $selecteID, $buttons)