Skip to content

Commit

Permalink
Merge branch 'MDL-47982-master' of git://github.com/gurgus/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Nov 5, 2014
2 parents 7a311ad + c7ef2c4 commit a0cba36
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 102 deletions.
10 changes: 0 additions & 10 deletions grade/report/singleview/classes/local/screen/tablelike.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,6 @@ public function set_definition($overwrite) {
return $this;
}

/**
* Get the tabindex for the table in the page.
*
* @return int
*/
public function get_tabindex() {
return (count($this->definition()) * $this->total) + $this->index;
}

/**
* Get a element to generate the HTML for this table row
* @param array $line This is a list of lines in the table (modified)
Expand Down Expand Up @@ -232,7 +223,6 @@ public function buttons() {
$save = html_writer::empty_tag('input', array(
'type' => 'submit',
'value' => get_string('update'),
'tabindex' => $this->get_tabindex(),
));

return array($save);
Expand Down
11 changes: 1 addition & 10 deletions grade/report/singleview/classes/local/ui/checkbox_attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,16 @@ class checkbox_attribute extends element {
/** @var bool $ischecked Is it checked? */
private $ischecked;

/** @var int $tabindex The tab index for this form element. */
private $tabindex;

/**
* Constructor
*
* @param string $name The element name
* @param string $label The label for the form element
* @param bool $ischecked Is this thing on?
* @param int $tabindex The tab index for the form element.
* @param int $locked Is this element locked either 0 or a time.
*/
public function __construct($name, $label, $ischecked = false, $tabindex = null, $locked=0) {
public function __construct($name, $label, $ischecked = false, $locked=0) {
$this->ischecked = $ischecked;
$this->tabindex = $tabindex;
$this->locked = $locked;
parent::__construct($name, 1, $label);
}
Expand Down Expand Up @@ -90,10 +85,6 @@ public function html() {
'name' => 'old' . $this->name
);

if (!empty($this->tabindex)) {
$attributes['tabindex'] = $this->tabindex;
}

if ($this->ischecked) {
$attributes['checked'] = 'CHECKED';
$hidden['value'] = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,10 @@ class dropdown_attribute extends element {
* @param string $label The form label for this input.
* @param string $selected The name of the selected item in this input.
* @param bool $isdisabled Are we disabled?
* @param int $tabindex The tab index for this field
*/
public function __construct($name, $options, $label, $selected = '', $isdisabled = false, $tabindex = null) {
public function __construct($name, $options, $label, $selected = '', $isdisabled = false) {
$this->selected = $selected;
$this->options = $options;
$this->tabindex = $tabindex;
$this->isdisabled = $isdisabled;
parent::__construct($name, $selected, $label);
}
Expand All @@ -86,9 +84,6 @@ public function html() {
);

$attributes = array();
if (!empty($this->tabindex)) {
$attributes['tabindex'] = $this->tabindex;
}

if (!empty($this->isdisabled)) {
$attributes['disabled'] = 'DISABLED';
Expand Down
3 changes: 1 addition & 2 deletions grade/report/singleview/classes/local/ui/feedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ public function determine_format() {
$this->get_name(),
$this->get_value(),
$this->get_label(),
$this->is_disabled(),
$this->get_tabindex()
$this->is_disabled()
);
}

Expand Down
6 changes: 2 additions & 4 deletions grade/report/singleview/classes/local/ui/finalgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,14 @@ public function determine_format() {
$options,
$this->get_label(),
$this->get_value(),
$this->is_disabled(),
$this->get_tabindex()
$this->is_disabled()
);
} else {
return new text_attribute(
$this->get_name(),
$this->get_value(),
$this->get_label(),
$this->is_disabled(),
$this->get_tabindex()
$this->is_disabled()
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @copyright 2014 Moodle Pty Ltd (http://moodle.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class grade_attribute_format extends attribute_format implements unique_name, tabbable {
abstract class grade_attribute_format extends attribute_format implements unique_name {

/** @var string $name The first part of the name attribute of the form input */
public $name;
Expand All @@ -44,19 +44,13 @@ abstract class grade_attribute_format extends attribute_format implements unique
/** @var grade_grade $grade The grade_grade of the input */
public $grade;

/** @var int $tabindex The tabindex of the input */
public $tabindex;

/**
* Constructor
*
* @param grade_grade $grade The grade_grade we are editing.
* @param int $tabindex The tabindex for the input.
*/
public function __construct($grade = 0, $tabindex = 1) {

public function __construct($grade = 0) {
$this->grade = $grade;
$this->tabindex = $tabindex;
}

/**
Expand All @@ -68,15 +62,6 @@ public function get_name() {
return "{$this->name}_{$this->grade->itemid}_{$this->grade->userid}";
}

/**
* Get the tabindex for this form input
*
* @return int The tab index
*/
public function get_tabindex() {
return isset($this->tabindex) ? $this->tabindex : null;
}

/**
* Should be overridden by the child class to save the value returned in this input.
*
Expand Down
1 change: 0 additions & 1 deletion grade/report/singleview/classes/local/ui/override.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public function determine_format() {
$this->get_name(),
$this->get_label(),
$this->is_checked(),
null,
$this->is_disabled()
);
}
Expand Down
43 changes: 0 additions & 43 deletions grade/report/singleview/classes/local/ui/tabbable.php

This file was deleted.

10 changes: 1 addition & 9 deletions grade/report/singleview/classes/local/ui/text_attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,16 @@ class text_attribute extends element {
/** @var bool $isdisabled Is this input disabled? */
private $isdisabled;

/** @var int $tabindex Tabindex value for this input. */
private $tabindex;

/**
* Constructor
*
* @param string $name The input name (the first bit)
* @param string $value The input initial value.
* @param string $label The label for this input field.
* @param bool $isdisabled Is this input disabled.
* @param int $tabindex Tab index for this input.
*/
public function __construct($name, $value, $label, $isdisabled = false, $tabindex = null) {
public function __construct($name, $value, $label, $isdisabled = false) {
$this->isdisabled = $isdisabled;
$this->tabindex = $tabindex;
parent::__construct($name, $value, $label);
}

Expand All @@ -77,9 +72,6 @@ public function html() {
'id' => $this->name
);

if (!empty($this->tabindex)) {
$attributes['tabindex'] = $this->tabindex;
}
if ($this->isdisabled) {
$attributes['disabled'] = 'DISABLED';
}
Expand Down

0 comments on commit a0cba36

Please sign in to comment.