Is there any way to remove the "Edit this page" button which is not functional for the user who cannot edit page (Not owner of Page). Because that button still showing to the user who cannot edit page. well if its not possible then that is not a problem. Just asking to make it clean and good looking.
Place the following code near the top of your main.php. Make sure it is not included inside another <?php . . . . ?> block.
<?php
function _userCanEdit() {
global $INFO;
global $ID;
$wiki_file = wikiFN($ID);
if(@!file_exists($wiki_file)) return true;
if($INFO['isadmin'] || $INFO['ismanager'] ) return true;
$meta_file = metaFN($ID , '.meta');
if(!$INFO['meta']['user']) return true;
if( $INFO['client'] == $INFO['meta']['user']) return true;
return false;
}
?>
Wherever you find
<?php tpl_button('edit')?>
replace it with:
<?php
if(_userCanEdit() ){
tpl_button('edit');
}
?>
Most templates have two edit buttons.