public $uses_extra_credit = false;
public $uses_weight = false;
-
+
public $table;
-
+
public $categories = array();
/**
* Constructor
$this->columns[] = grade_edit_tree_column::factory('select');
$mode = ($USER->gradeediting[$COURSE->id]) ? 'advanced' : 'simple';
-
+
$widthstyle = '';
if ($mode == 'simple') {
$widthstyle = ' style="width:auto;" ';
$this->table = new html_table();
$this->table->id = "grade_edit_tree_table";
$this->table->cellpadding = 5;
- $this->table->add_class('generaltable');
+ $this->table->add_classes(array('generaltable', $mode));
$this->table->style = $widthstyle;
foreach ($this->columns as $column) {
*/
public function build_html_tree($element, $totals, $parents, $level, &$row_count) {
global $CFG, $COURSE, $USER, $OUTPUT;
-
+
$object = $element['object'];
$eid = $element['eid'];
$object->name = $this->gtree->get_element_header($element, true, true, false);
$moveicon->image->src = $OUTPUT->old_icon_url('movehere');
$moveicon->image->alt = $strmovehere;
$moveicon->image->title = $strmovehere;
-
+
$cell = new html_table_cell();
$cell->colspan = 12;
$cell->text = $OUTPUT->action_icon($moveicon);
if ($level == 1) {
$courseclass = 'coursecategory';
}
-
+
$row = new html_table_row();
$row->add_classes(array($courseclass, 'category', $dimmed));
foreach ($rowclasses as $class) {
$row->cells[] = $column->get_category_cell($category, $levelclass, array('id' => $id, 'name' => $object->name, 'level' => $level, 'actions' => $actions, 'eid' => $eid));
}
}
-
+
$returnrows[] = $row;
$returnrows = array_merge($returnrows, $html_children);
$weightfield->name = "extracredit_$item->id";
$weightfield->value = 0;
- $extracredit = html_select_option::make_checkbox(1, ($item->aggregationcoef > 0), ' ');
+ $extracredit = html_select_option::make_checkbox(1, ($item->aggregationcoef > 0), get_string($aggcoef, 'grades'));
+ $extracredit->label->add_class('accesshide');
$extracredit->id = "extracredit_$item->id";
$extracredit->name = "extracredit_$item->id";
return $OUTPUT->field($weightfield) . $OUTPUT->checkbox($extracredit);
global $OUTPUT;
$headercell = clone($this->headercell);
$headercell->style .= 'width: 40px;';
- $headercell->text = get_string('aggregateonlygraded', 'grades')
+ $headercell->text = get_string('aggregateonlygraded', 'grades')
. $OUTPUT->help_icon(moodle_help_icon::make('aggregateonlygraded', 'aggregateonlygraded', 'grade'));
return $headercell;
}
$hidden->name = "aggregateonlygraded_$category->id";
$hidden->value = 0;
- $aggregateonlygraded = html_select_option::make_checkbox(1, ($category->aggregateonlygraded == 1), ' ');
+ $aggregateonlygraded = html_select_option::make_checkbox(1, ($category->aggregateonlygraded == 1), get_string('aggregateonlygraded', 'grades'));
+ $aggregateonlygraded->label->add_class('accesshide');
$aggregateonlygraded->id = "aggregateonlygraded_$category->id";
$aggregateonlygraded->name = "aggregateonlygraded_$category->id";
$aggregateonlygraded = $OUTPUT->checkbox($aggregateonlygraded);
$hidden->name = "aggregatesubcats_$category->id";
$hidden->value = 0;
- $aggregatesubcats = html_select_option::make_checkbox(1, ($category->aggregatesubcats == 1), ' ');
+ $aggregatesubcats = html_select_option::make_checkbox(1, ($category->aggregatesubcats == 1), get_string('aggregatesubcats', 'grades'));
+ $aggregatesubcats->label->add_class('accesshide');
$aggregatesubcats->id = "aggregatesubcats_$category->id";
$aggregatesubcats->name = "aggregatesubcats_$category->id";
$aggregatesubcats = $OUTPUT->checkbox($aggregatesubcats);
$hidden->name = "aggregateoutcomes_$category->id";
$hidden->value = 0;
- $aggregateoutcomes = html_select_option::make_checkbox(1, ($category->aggregateoutcomes == 1), ' ');
+ $aggregateoutcomes = html_select_option::make_checkbox(1, ($category->aggregateoutcomes == 1), get_string('aggregateoutcomes', 'grades'));
+ $aggregateoutcomes->label->add_class('accesshide');
$aggregateoutcomes->id = "aggregateoutcomes_$category->id";
$aggregateoutcomes->name = "aggregateoutcomes_$category->id";
$aggregateoutcomes = $OUTPUT->checkbox($aggregateoutcomes);
class grade_edit_tree_column_actions extends grade_edit_tree_column {
public function __construct($params) {
- parent::__construct();
+ parent::__construct();
}
public function get_header_cell() {
$itemselect = '';
if ($params['itemtype'] != 'course' && $params['itemtype'] != 'category') {
- $itemselect = html_select_option::make_checkbox('0', false, ' ');
+ $itemselect = html_select_option::make_checkbox('0', false, get_string('select'));
+ $itemselect->label->add_class('accesshide');
$itemselect->add_action('change', 'toggleCategorySelector');
$itemselect->add_class('itemselect');
$itemselect = $OUTPUT->checkbox($itemselect, 'select_'.$params['eid']);