Hiding the Detail View From A Group
Posted: 2015-02-13 17:13
I have an application where I've set permissions for the anonymous user to view a table, but not to be able to edit or insert.
When this user visits the Table View page they get a target link when they mouse over the contents of a column. When they click on this link, they see a Detail View. This Detail View is informational only, and nothing is editable (it respects the permissions).
What I would prefer is that there is no link and no Detail View available. The non-editable Detail View is simply a distraction.
I can't simply turn off Detail View for the table because the admin needs to have a Detail View to edit the table.
1. Does anyone know of a way of defeating the entire Detail View mechanism including the target link on each column for a particular group?
2. If not, is there an elegant way of preventing this link from displaying a Table View when clicked?
I've tried using the tableview_dv() function in the hook file like so:
This works after a fashion, but is not elegant. It has an annoying side effect. When the user clicks on the target link, the column background changes to the editing highlight colour, and the column loses it's ability to wrap (normal behaviour with Detail View). Then a short time later, the page refreshes and all is well again. This is better than displaying a useless Detail View, but is somewhat glitchy.
I can modify this behaviour by setting the Detail View as a separate page. Now, I don't get the row highlighting and unwrapping, but the table view momentarily disappears, then the page reloads and re-displays it. Still not exactly elegant.
Is there a better way to do this?
Thanks,
Garry
When this user visits the Table View page they get a target link when they mouse over the contents of a column. When they click on this link, they see a Detail View. This Detail View is informational only, and nothing is editable (it respects the permissions).
What I would prefer is that there is no link and no Detail View available. The non-editable Detail View is simply a distraction.
I can't simply turn off Detail View for the table because the admin needs to have a Detail View to edit the table.
1. Does anyone know of a way of defeating the entire Detail View mechanism including the target link on each column for a particular group?
2. If not, is there an elegant way of preventing this link from displaying a Table View when clicked?
I've tried using the tableview_dv() function in the hook file like so:
Code: Select all
// No Detail View for non-admins
if ($memberInfo['group'] == 'anonymous')
{
$html = ""; // Clear the Detail View HTML
header("Refresh:0"); // Reload the script
}
I can modify this behaviour by setting the Detail View as a separate page. Now, I don't get the row highlighting and unwrapping, but the table view momentarily disappears, then the page reloads and re-displays it. Still not exactly elegant.
Is there a better way to do this?
Thanks,
Garry