mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 18:36:42 +02:00
MDL-11511, revert the changes, see tracker
This commit is contained in:
parent
73b36bca84
commit
046dd7dcf6
5 changed files with 7 additions and 58 deletions
|
@ -954,25 +954,14 @@ function data_print_template($template, $records, $data, $search='',$page=0, $re
|
|||
/// Replacing special tags (##Edit##, ##Delete##, ##More##)
|
||||
$patterns[]='##edit##';
|
||||
$patterns[]='##delete##';
|
||||
$isteacher = has_capability('mod/data:manageentries', $context);
|
||||
$isowner = data_isowner($record->id);
|
||||
$canedit = $isteacher or ($isowner && has_capability('mod/data:editownentries', $context));
|
||||
$candelete = $isteacher or ($isowner && has_capability('mod/data:deleteownentries', $context));
|
||||
|
||||
if ($canedit) {
|
||||
if (has_capability('mod/data:manageentries', $context) or data_isowner($record->id)) {
|
||||
$replacement[] = '<a href="'.$CFG->wwwroot.'/mod/data/edit.php?d='
|
||||
.$data->id.'&rid='.$record->id.'&sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/edit.gif" class="iconsmall" alt="'.get_string('edit').'" title="'.get_string('edit').'" /></a>';
|
||||
}else{
|
||||
$replacement[] = '';
|
||||
}
|
||||
|
||||
if($candelete) {
|
||||
$replacement[] = '<a href="'.$CFG->wwwroot.'/mod/data/view.php?d='
|
||||
.$data->id.'&delete='.$record->id.'&sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/t/delete.gif" class="iconsmall" alt="'.get_string('delete').'" title="'.get_string('delete').'" /></a>';
|
||||
}else{
|
||||
} else {
|
||||
$replacement[] = '';
|
||||
}
|
||||
|
||||
$patterns[]='##more##';
|
||||
$replacement[] = '<a href="'.$CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&rid='.$record->id.'"><img src="'.$CFG->pixpath.'/i/search.gif" class="iconsmall" alt="'.get_string('more', 'data').'" title="'.get_string('more', 'data').'" /></a>';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue