mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'MDL-47982-master' of git://github.com/gurgus/moodle
This commit is contained in:
commit
a0cba367bd
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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';
|
||||
|
@ -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()
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -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.
|
||||
*
|
||||
|
@ -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()
|
||||
);
|
||||
}
|
||||
|
@ -1,43 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
|
@ -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';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user