This commit is contained in:
nicolasconnault 2007-07-08 14:51:41 +00:00
parent a9b24e489b
commit 9aa1e44853
2 changed files with 72 additions and 57 deletions

View file

@ -58,6 +58,7 @@ $decimals = get_user_preferences('grade_report_decimalpoints', $CFG->grade_repor
$displaytotals = get_user_preferences('grade_report_showgrandtotals', $CFG->grade_report_showgrandtotals);
$displaygrouptotals = get_user_preferences('grade_report_showgroups', $CFG->grade_report_showgroups);
$aggregation_position = get_user_preferences('grade_report_aggregationposition', $CFG->grade_report_aggregationposition);
$showscales = get_user_preferences('grade_report_showscales', $CFG->grade_report_showscales);
// Override perpage if set in URL
if ($perpageurl = optional_param('perpage', 0, PARAM_INT)) {

View file

@ -756,6 +756,10 @@ function grade_get_icons($element, $tree) {
// Load user preferences
$aggregationview = get_user_preferences('grade_report_aggregationview', $CFG->grade_report_aggregationview);
$showeyecons = get_user_preferences('grade_report_showeyecons', $CFG->grade_report_showeyecons);
$showlocks = get_user_preferences('grade_report_showlocks', $CFG->grade_report_showlocks);
$shownotes = get_user_preferences('grade_report_notes', $CFG->grade_report_notes);
$showcalculations = get_user_preferences('grade_report_showcalculations', $CFG->grade_report_showcalculations);
// Icons shown when edit mode is on
if ($USER->gradeediting) {
@ -779,19 +783,17 @@ function grade_get_icons($element, $tree) {
*/
}
/* Not sure if there is a good reason to have a calculation icon: the calculation field is in the grade_edit form */
/*
// Calculation icon for items and categories
if ($type != 'grade') {
$html .= '<a href="report/grader/edit_calculation.php?courseid='.$object->courseid.'&amp;id='.$object->id.'">';
$html .= '<img src="'.$CFG->pixpath.'/t/calc.gif" class="iconsmall" alt="'
.$streditcalculation.'" title="'.$streditcalculation.'" /></a>'. "\n";
}
*/
// Prepare Hide/Show icon state
$hide_show = 'hide';
if ($object->is_hidden()) {
$hide_show = 'show';
}
if ($shownotes) {
// Setup object identifier and show feedback icon if applicable
if ($type == 'grade' and $USER->gradefeedback) {
// Display Edit/Add feedback icon
@ -808,13 +810,24 @@ function grade_get_icons($element, $tree) {
. $strfeedback.'\');" onmouseout="return nd();" /></a>'. "\n";
}
}
}
if ($showeyecons) {
// Prepare Hide/Show icon state
$hide_show = 'hide';
if ($object->is_hidden()) {
$hide_show = 'show';
}
// Display Hide/Show icon
$html .= '<a href="report.php?report=grader&amp;target='.$eid
. "&amp;action=$hide_show$tree->commonvars\">\n";
$html .= '<img src="'.$CFG->pixpath.'/t/'.$hide_show.'.gif" class="iconsmall" alt="'
.${'str' . $hide_show}.'" title="'.${'str' . $hide_show}.'" /></a>'. "\n";
}
if ($showlocks) {
// Prepare lock/unlock string
$lock_unlock = 'lock';
if ($object->is_locked()) {
@ -826,6 +839,7 @@ function grade_get_icons($element, $tree) {
. "&amp;action=$lock_unlock$tree->commonvars\">\n";
$html .= '<img src="'.$CFG->pixpath.'/t/'.$lock_unlock.'.gif" class="iconsmall" alt="'
.${'str' . $lock_unlock}.'" title="'.${'str' . $lock_unlock}.'" /></a>'. "\n";
}
// If object is a category, display expand/contract icon
if (get_class($object) == 'grade_category' && $aggregationview == GRADER_REPORT_AGGREGATION_VIEW_COMPACT) {
@ -843,7 +857,7 @@ function grade_get_icons($element, $tree) {
.${'str' . $expand_contract}.'" title="'.${'str' . $expand_contract}.'" /></a>'. "\n";
}
} else {
if ($USER->gradefeedback) {
if ($shownotes) {
// Display view feedback icon
if (!empty($object->feedback)) {
$html .= '<a href="report/grader/edit_feedback.php?id=' . $object->id