In this case, I wanted to hide the "Print Preview" button.
This code goes in the TABLENAME_dv() function in the TABLENAME.php file in the hooks directory. This function is called after displaying the table view, and just before displaying the detail view (the comments should explain it):
Code: Select all
function TABLENAME_dv($selectedID, $memberInfo, &$html, &$args){
// ****************************************************************
// Remove "PRINT PREVIEW" button from the detail view editing form
// ****************************************************************
// HTML for detail view PRINT PREVIEW button as generated by AppGini:
// <button tabindex="2" type="submit" id="dvprint" name="dvprint_x" value="1"
// onclick="$$('form')[0].writeAttribute('novalidate', 'novalidate'); document.myform.reset();
// return true;"><img src="print-preview.gif" /> __BUTTON LABEL TEXT__</button>
//
// Get the global variable for language text
global $Translation;
// Get the text of the button label
$buttLabel = $Translation['Print Preview'];
// Delete it!
$html = str_replace("<button tabindex=\"2\" type=\"submit\" id=\"dvprint\" name=\"dvprint_x\" value=\"1\" onclick=\"$$('form')[0].writeAttribute('novalidate', 'novalidate'); document.myform.reset(); return true;\"><img src=\"print-preview.gif\" /> $buttLabel</button>","",$html);
}
Code: Select all
if ($memberInfo['group'] == 'anonymous') {
// Disable detail view button
CODE FROM ABOVE GOES HERE
}
Hope this helps someone,
Garry