This topic is locked

Hide Select All From Non-Admin

6/13/2013 6:50:12 PM
PHPRunner General questions
W
wfcentral author

I have a project with thousands of records. My client wants his login (admin) to have the checkbox at top of column (for select all records) to edit/delete.
He DOES NOT want his staff to be able to select all. They should be able to manually select a few and edit all or delete... he just wants to avoid an accident OR a disgruntled employee wiping out his data quickly.
users have security levels set by a tbl_levels... 1,2,3,4 are normal staff who can do different stuff... level "99" is admin and had all privileges.
So, I guess I just need code that will hide that select all checkbox unless user level "99" is logged in.

Sergey Kornilov admin 6/14/2013

Proceed to Visual Editor, make 'Select all' checkbox selected and switch to HTML mode. You will see check box code highlighted:

<INPUT type=checkbox {$checkboxheader_attrs}>


Enclose it into PHPRunner template BEGIN and END tags:

{BEGIN admin_checkbox}

<INPUT type=checkbox {$checkboxheader_attrs}>

{END admin_checkbox}


Now in BeforeDisplay event of this page use something like this:

$xt->assign("admin_checkbox",$_SESSION["AccessLevel"]==ACCESS_LEVEL_ADMINGROUP);


More info:

http://xlinesoft.com/phprunner/docs/hide_controls_on_add_edit_pages.htm