Posted by Trajce
2016-01-25

Hello Tom

Is there any chance to remove delete button from staff page.

Thanks
Best regards
Trajce
Posted by Tom
2016-01-25

To prevent non-administrators from deleting records, first you have to disable it in the backend code. To do so, open web/staff/app/cls_ps_lead.inc.php and add
if ( !$this->sys->IsAdmin() ) exit;
after
case 'del_multi':
The result should look like:
case 'del_multi': if ( !$this->sys->IsAdmin() ) exit;
Next, hide the delete button if the user is a non-administrator. To do so, open web/staff/include/tpl.sr.top_bar.inc.php and find the following code:
<div style='float:left;'><?php
echo $hm->Button( array(
'<>'=>'</>',
'id'=>'btn_del_multi',
'name'=>"_sc=_this/search_pxy&_ssc=del_multi&",
'src'=>'delete',
'value'=>RSTR_DELETE,
) ); ?></div>
Encolse the code above with $sys->IsAdmin() like this:
<?php if ( $sys->IsAdmin() ) { ?>
<div style='float:left;'><?php
echo $hm->Button( array(
'<>'=>'</>',
'id'=>'btn_del_multi',
'name'=>"_sc=_this/search_pxy&_ssc=del_multi&",
'src'=>'delete',
'value'=>RSTR_DELETE,
) ); ?></div>
<?php } ?>