MDL-26464: remove 'add entry' link on setting block when it reachs the max number of records. Link removal does not apply to user who has data:manageentries capability (eg: teacher).

This commit is contained in:
Rossiani Wijaya
2011-03-11 10:03:14 +08:00
parent c09604234a
commit e4e9611570
3 changed files with 19 additions and 9 deletions
+1 -1
View File
@@ -49,7 +49,7 @@
$row[] = new tabobject('asearch', $CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&mode=asearch', get_string('search', 'data'));
if (isloggedin()) { // just a perf shortcut
if (data_user_can_add_entry($data, $currentgroup, $groupmode) && !data_atmaxentries($data)) { // took out participation list here!
if (data_user_can_add_entry($data, $currentgroup, $groupmode, $context)) { // took out participation list here!
$addstring = empty($editentry) ? get_string('add', 'data') : get_string('editentry', 'data');
$row[] = new tabobject('add', $CFG->wwwroot.'/mod/data/edit.php?d='.$data->id, $addstring);
}