From c7ef2c4c634874eeed77b216e444767dc0ad555c Mon Sep 17 00:00:00 2001 From: Dave Cooper Date: Fri, 31 Oct 2014 16:06:46 +0800 Subject: [PATCH] MDL-47982 gradebook: Remove tabindex from all elements. --- .../classes/local/screen/tablelike.php | 10 ----- .../classes/local/ui/checkbox_attribute.php | 11 +---- .../classes/local/ui/dropdown_attribute.php | 7 +-- .../singleview/classes/local/ui/feedback.php | 3 +- .../classes/local/ui/finalgrade.php | 6 +-- .../local/ui/grade_attribute_format.php | 19 +------- .../singleview/classes/local/ui/override.php | 1 - .../singleview/classes/local/ui/tabbable.php | 43 ------------------- .../classes/local/ui/text_attribute.php | 10 +---- 9 files changed, 8 insertions(+), 102 deletions(-) delete mode 100644 grade/report/singleview/classes/local/ui/tabbable.php diff --git a/grade/report/singleview/classes/local/screen/tablelike.php b/grade/report/singleview/classes/local/screen/tablelike.php index c71878707b3..3b0a4afb9e2 100644 --- a/grade/report/singleview/classes/local/screen/tablelike.php +++ b/grade/report/singleview/classes/local/screen/tablelike.php @@ -124,15 +124,6 @@ abstract class tablelike extends screen { 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) @@ -232,7 +223,6 @@ abstract class tablelike extends screen { $save = html_writer::empty_tag('input', array( 'type' => 'submit', 'value' => get_string('update'), - 'tabindex' => $this->get_tabindex(), )); return array($save); diff --git a/grade/report/singleview/classes/local/ui/checkbox_attribute.php b/grade/report/singleview/classes/local/ui/checkbox_attribute.php index a16b08180b4..c83ff77b0d1 100644 --- a/grade/report/singleview/classes/local/ui/checkbox_attribute.php +++ b/grade/report/singleview/classes/local/ui/checkbox_attribute.php @@ -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); } @@ -90,10 +85,6 @@ class checkbox_attribute extends element { 'name' => 'old' . $this->name ); - if (!empty($this->tabindex)) { - $attributes['tabindex'] = $this->tabindex; - } - if ($this->ischecked) { $attributes['checked'] = 'CHECKED'; $hidden['value'] = 1; diff --git a/grade/report/singleview/classes/local/ui/dropdown_attribute.php b/grade/report/singleview/classes/local/ui/dropdown_attribute.php index 921ba92434c..aaaed88752c 100644 --- a/grade/report/singleview/classes/local/ui/dropdown_attribute.php +++ b/grade/report/singleview/classes/local/ui/dropdown_attribute.php @@ -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); } @@ -86,9 +84,6 @@ class dropdown_attribute extends element { ); $attributes = array(); - if (!empty($this->tabindex)) { - $attributes['tabindex'] = $this->tabindex; - } if (!empty($this->isdisabled)) { $attributes['disabled'] = 'DISABLED'; diff --git a/grade/report/singleview/classes/local/ui/feedback.php b/grade/report/singleview/classes/local/ui/feedback.php index a41e0f20d71..e14b60aa22e 100644 --- a/grade/report/singleview/classes/local/ui/feedback.php +++ b/grade/report/singleview/classes/local/ui/feedback.php @@ -95,8 +95,7 @@ class feedback extends grade_attribute_format implements unique_value, be_disabl $this->get_name(), $this->get_value(), $this->get_label(), - $this->is_disabled(), - $this->get_tabindex() + $this->is_disabled() ); } diff --git a/grade/report/singleview/classes/local/ui/finalgrade.php b/grade/report/singleview/classes/local/ui/finalgrade.php index d3d9f7f09b2..dd5348c5b9b 100644 --- a/grade/report/singleview/classes/local/ui/finalgrade.php +++ b/grade/report/singleview/classes/local/ui/finalgrade.php @@ -120,16 +120,14 @@ class finalgrade extends grade_attribute_format implements unique_value, be_disa $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() ); } } diff --git a/grade/report/singleview/classes/local/ui/grade_attribute_format.php b/grade/report/singleview/classes/local/ui/grade_attribute_format.php index dcaebcd576f..94f027f5f2e 100644 --- a/grade/report/singleview/classes/local/ui/grade_attribute_format.php +++ b/grade/report/singleview/classes/local/ui/grade_attribute_format.php @@ -33,7 +33,7 @@ defined('MOODLE_INTERNAL') || die; * @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; @@ -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; } /** @@ -68,15 +62,6 @@ abstract class grade_attribute_format extends attribute_format implements unique 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. * diff --git a/grade/report/singleview/classes/local/ui/override.php b/grade/report/singleview/classes/local/ui/override.php index 64b829251fe..0db1f0fbf56 100644 --- a/grade/report/singleview/classes/local/ui/override.php +++ b/grade/report/singleview/classes/local/ui/override.php @@ -88,7 +88,6 @@ class override extends grade_attribute_format implements be_checked, be_disabled $this->get_name(), $this->get_label(), $this->is_checked(), - null, $this->is_disabled() ); } diff --git a/grade/report/singleview/classes/local/ui/tabbable.php b/grade/report/singleview/classes/local/ui/tabbable.php deleted file mode 100644 index d90493150a2..00000000000 --- a/grade/report/singleview/classes/local/ui/tabbable.php +++ /dev/null @@ -1,43 +0,0 @@ -. - -/** - * The gradebook simple view - UI factory - * - * @package gradereport_singleview - * @copyright 2014 Moodle Pty Ltd (http://moodle.com) - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - -namespace gradereport_singleview\local\ui; - -defined('MOODLE_INTERNAL') || die; - -/** - * This element has a tabindex - * - * @package gradereport_singleview - * @copyright 2014 Moodle Pty Ltd (http://moodle.com) - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ -interface tabbable { - /** - * Get the tabindex for this element - * @return int - */ - public function get_tabindex(); -} - diff --git a/grade/report/singleview/classes/local/ui/text_attribute.php b/grade/report/singleview/classes/local/ui/text_attribute.php index 8c86349de4d..2766a9de8d6 100644 --- a/grade/report/singleview/classes/local/ui/text_attribute.php +++ b/grade/report/singleview/classes/local/ui/text_attribute.php @@ -39,9 +39,6 @@ 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 * @@ -49,11 +46,9 @@ class text_attribute extends element { * @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); } @@ -77,9 +72,6 @@ class text_attribute extends element { 'id' => $this->name ); - if (!empty($this->tabindex)) { - $attributes['tabindex'] = $this->tabindex; - } if ($this->isdisabled) { $attributes['disabled'] = 'DISABLED'; }