mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-19797 Upgraded most output code in grader report
This commit is contained in:
parent
c402af03a8
commit
319770d747
8 changed files with 311 additions and 223 deletions
|
@ -1052,6 +1052,19 @@ class html_table extends labelled_html_component {
|
|||
* @var bool true causes the contents of the heading cells to be rotated 90 degrees.
|
||||
*/
|
||||
public $rotateheaders = false;
|
||||
/**
|
||||
* @var array $headclasses Array of CSS classes to apply to the table's thead.
|
||||
*/
|
||||
public $headclasses = array();
|
||||
/**
|
||||
* @var array $bodyclasses Array of CSS classes to apply to the table's tbody.
|
||||
*/
|
||||
public $bodyclasses = array();
|
||||
/**
|
||||
* @var array $footclasses Array of CSS classes to apply to the table's tfoot.
|
||||
*/
|
||||
public $footclasses = array();
|
||||
|
||||
|
||||
/**
|
||||
* @see moodle_html_component::prepare()
|
||||
|
@ -1416,12 +1429,8 @@ class html_form extends moodle_html_component {
|
|||
* @return void
|
||||
*/
|
||||
public function __construct() {
|
||||
static $yes;
|
||||
$this->button = new html_button();
|
||||
if (!isset($yes)) {
|
||||
$yes = get_string('yes');
|
||||
$this->button->text = $yes;
|
||||
}
|
||||
$this->button->text = get_string('yes');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1554,10 +1554,18 @@ class moodle_core_renderer extends moodle_renderer_base {
|
|||
/**
|
||||
* Prints an inline span element with optional text contents.
|
||||
*
|
||||
* @param html_span $span A html_span object
|
||||
* @param mixed $span A html_span object or some string content to wrap in a span
|
||||
* @param mixed $classes A space-separated list or an array of classes. Only used if $span is a string
|
||||
* @return string A HTML fragment
|
||||
*/
|
||||
public function span($span) {
|
||||
public function span($span, $classes='') {
|
||||
if (!($span instanceof html_span)) {
|
||||
$text = $span;
|
||||
$span = new html_span();
|
||||
$span->contents = $text;
|
||||
$span->add_classes($classes);
|
||||
}
|
||||
|
||||
$span = clone($span);
|
||||
$span->prepare();
|
||||
$this->prepare_event_handlers($span);
|
||||
|
@ -2028,7 +2036,7 @@ class moodle_core_renderer extends moodle_renderer_base {
|
|||
|
||||
if (!empty($table->head)) {
|
||||
$countcols = count($table->head);
|
||||
$output .= $this->output_start_tag('thead', array()) . "\n";
|
||||
$output .= $this->output_start_tag('thead', $table->headclasses) . "\n";
|
||||
$output .= $this->output_start_tag('tr', array()) . "\n";
|
||||
$keys = array_keys($table->head);
|
||||
$lastkey = end($keys);
|
||||
|
@ -2077,7 +2085,7 @@ class moodle_core_renderer extends moodle_renderer_base {
|
|||
$oddeven = 1;
|
||||
$keys = array_keys($table->data);
|
||||
$lastrowkey = end($keys);
|
||||
$output .= $this->output_start_tag('tbody', array()) . "\n";
|
||||
$output .= $this->output_start_tag('tbody', $table->bodyclasses) . "\n";
|
||||
|
||||
foreach ($table->data as $key => $row) {
|
||||
if (($row === 'hr') && ($countcols)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue