mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
MDL-18229 gradebook: Renaming of Single_view to Single view
This commit is contained in:
parent
edd8b27923
commit
d124a60b33
@ -1,50 +0,0 @@
|
||||
#page-grade-report-single_view-index div.generalbox {
|
||||
margin: 0 20px 15px 20px;
|
||||
}
|
||||
|
||||
#page-grade-report-single_view-index div.generalbox div.singleselect form div {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#page-grade-report-single_view-index div.generalbox table.generaltable {
|
||||
margin: 0 auto 15px auto;
|
||||
}
|
||||
|
||||
#page-grade-report-single_view-index div.generalbox form div {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#page-grade-report-single_view-index .single_view_buttons {
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
#page-grade-report-single_view-index table.generaltable .cell {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#page-grade-report-single_view-index div.generalbox h2 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
input[name^="finalgrade"] {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
#page-grade-report-single_view-index #region-main h2, .paging{
|
||||
text-align: center;
|
||||
}
|
||||
#page-grade-report-single_view-index itemnav.previtem {
|
||||
float:left;
|
||||
}
|
||||
#page-grade-report-single_view-index itemnav.previtem {
|
||||
float:left;
|
||||
}
|
||||
#page-grade-report-single_view-index.dir-rtl small.previtem {
|
||||
float:right;
|
||||
}
|
||||
#page-grade-report-single_view-index small.nextitem {
|
||||
float:right;
|
||||
}
|
||||
#page-grade-report-single_view-index.dir-rtl small.nextitem {
|
||||
float:left;
|
||||
}
|
@ -18,12 +18,12 @@
|
||||
/**
|
||||
* The gradebook simple view - base class for the table
|
||||
*
|
||||
* @package simple_view
|
||||
* @package singleview
|
||||
* @copyright 2014 Moodle Pty Ltd (http://moodle.com)
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once $CFG->dirroot . '/grade/report/single_view/classes/uilib.php';
|
||||
require_once $CFG->dirroot . '/grade/report/singleview/classes/uilib.php';
|
||||
|
||||
interface selectable_items {
|
||||
public function description();
|
||||
@ -37,7 +37,7 @@ interface item_filtering {
|
||||
public static function filter($item);
|
||||
}
|
||||
|
||||
abstract class single_view_screen {
|
||||
abstract class singleview_screen {
|
||||
var $courseid;
|
||||
|
||||
var $itemid;
|
||||
@ -72,7 +72,7 @@ abstract class single_view_screen {
|
||||
}
|
||||
|
||||
public function format_link($screen, $itemid, $display = null) {
|
||||
$url = new moodle_url('/grade/report/single_view/index.php', array(
|
||||
$url = new moodle_url('/grade/report/singleview/index.php', array(
|
||||
'id' => $this->courseid,
|
||||
'item' => $screen,
|
||||
'itemid' => $itemid,
|
||||
@ -123,12 +123,12 @@ abstract class single_view_screen {
|
||||
}
|
||||
|
||||
public function make_toggle_links($key) {
|
||||
return get_string($key, 'gradereport_single_view') . ' ' .
|
||||
return get_string($key, 'gradereport_singleview') . ' ' .
|
||||
$this->make_toggle($key);
|
||||
}
|
||||
|
||||
public function heading() {
|
||||
return get_string('pluginname', 'gradereport_single_view');
|
||||
return get_string('pluginname', 'gradereport_singleview');
|
||||
}
|
||||
|
||||
public abstract function init($self_item_is_empty = false);
|
||||
@ -146,11 +146,11 @@ abstract class single_view_screen {
|
||||
|
||||
global $OUTPUT;
|
||||
|
||||
list($___, $item) = explode('single_view_', get_class($this));
|
||||
list($___, $item) = explode('singleview_', get_class($this));
|
||||
|
||||
return $OUTPUT->paging_bar(
|
||||
count($this->items), $this->page, $this->perpage,
|
||||
new moodle_url('/grade/report/single_view/index.php', array(
|
||||
new moodle_url('/grade/report/singleview/index.php', array(
|
||||
'perpage' => $this->perpage,
|
||||
'id' => $this->courseid,
|
||||
'groupid' => $this->groupid,
|
||||
@ -164,17 +164,17 @@ abstract class single_view_screen {
|
||||
global $PAGE;
|
||||
|
||||
$module = array(
|
||||
'name' => 'gradereport_single_view',
|
||||
'fullpath' => '/grade/report/single_view/js/single_view.js',
|
||||
'name' => 'gradereport_singleview',
|
||||
'fullpath' => '/grade/report/singleview/js/singleview.js',
|
||||
'requires' => array('base', 'dom', 'event', 'event-simulate', 'io-base')
|
||||
);
|
||||
|
||||
$PAGE->requires->js_init_call('M.gradereport_single_view.init', array(), false, $module);
|
||||
$PAGE->requires->js_init_call('M.gradereport_singleview.init', array(), false, $module);
|
||||
}
|
||||
|
||||
public function factory() {
|
||||
if (empty($this->__factory)) {
|
||||
$this->__factory = new single_view_grade_ui_factory();
|
||||
$this->__factory = new singleview_grade_ui_factory();
|
||||
}
|
||||
|
||||
return $this->__factory;
|
||||
@ -250,7 +250,7 @@ abstract class single_view_screen {
|
||||
}
|
||||
}
|
||||
|
||||
abstract class single_view_tablelike extends single_view_screen implements tabbable {
|
||||
abstract class singleview_tablelike extends singleview_screen implements tabbable {
|
||||
var $items;
|
||||
|
||||
protected $headers = array();
|
||||
@ -380,7 +380,7 @@ abstract class single_view_tablelike extends single_view_screen implements tabba
|
||||
|
||||
qe_events_trigger($underlying . '_table_built', $data);
|
||||
|
||||
$button_attr = array('class' => 'single_view_buttons submit');
|
||||
$button_attr = array('class' => 'singleview_buttons submit');
|
||||
$button_html = implode(' ', $this->buttons());
|
||||
|
||||
$buttons = html_writer::tag('div', $button_html, $button_attr);
|
||||
@ -395,7 +395,7 @@ abstract class single_view_tablelike extends single_view_screen implements tabba
|
||||
return html_writer::tag(
|
||||
'div',
|
||||
$this->factory()->create('bulk_insert')->format($this->item)->html(),
|
||||
array('class' => 'single_view_bulk')
|
||||
array('class' => 'singleview_bulk')
|
||||
);
|
||||
}
|
||||
|
@ -18,26 +18,26 @@
|
||||
/**
|
||||
* The gradebook simple view - UI factory
|
||||
*
|
||||
* @package simple_view
|
||||
* @package singleview
|
||||
* @copyright 2014 Moodle Pty Ltd (http://moodle.com)
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
abstract class single_view_ui_factory {
|
||||
abstract class singleview_ui_factory {
|
||||
public abstract function create($type);
|
||||
|
||||
protected function wrap($class) {
|
||||
return new single_view_factory_class_wrap($class);
|
||||
return new singleview_factory_class_wrap($class);
|
||||
}
|
||||
}
|
||||
|
||||
class single_view_grade_ui_factory extends single_view_ui_factory {
|
||||
class singleview_grade_ui_factory extends singleview_ui_factory {
|
||||
public function create($type) {
|
||||
return $this->wrap("single_view_{$type}_ui");
|
||||
return $this->wrap("singleview_{$type}_ui");
|
||||
}
|
||||
}
|
||||
|
||||
class single_view_factory_class_wrap {
|
||||
class singleview_factory_class_wrap {
|
||||
function __construct($class) {
|
||||
$this->class = $class;
|
||||
}
|
||||
@ -50,7 +50,7 @@ class single_view_factory_class_wrap {
|
||||
}
|
||||
}
|
||||
|
||||
abstract class single_view_ui_element {
|
||||
abstract class singleview_ui_element {
|
||||
var $name;
|
||||
var $value;
|
||||
|
||||
@ -74,10 +74,10 @@ abstract class single_view_ui_element {
|
||||
abstract function html();
|
||||
}
|
||||
|
||||
class single_view_empty_element extends single_view_ui_element {
|
||||
class singleview_empty_element extends singleview_ui_element {
|
||||
function __construct($msg = null) {
|
||||
if (is_null($msg)) {
|
||||
$this->text = get_string('notavailable', 'gradereport_single_view');
|
||||
$this->text = get_string('notavailable', 'gradereport_singleview');
|
||||
} else {
|
||||
$this->text = $msg;
|
||||
}
|
||||
@ -88,7 +88,7 @@ class single_view_empty_element extends single_view_ui_element {
|
||||
}
|
||||
}
|
||||
|
||||
class single_view_text_attribute extends single_view_ui_element {
|
||||
class singleview_text_attribute extends singleview_ui_element {
|
||||
var $is_disabled;
|
||||
var $tabindex;
|
||||
|
||||
@ -129,7 +129,7 @@ class single_view_text_attribute extends single_view_ui_element {
|
||||
}
|
||||
}
|
||||
|
||||
class single_view_checkbox_attribute extends single_view_ui_element {
|
||||
class singleview_checkbox_attribute extends singleview_ui_element {
|
||||
var $is_checked;
|
||||
var $tabindex;
|
||||
|
||||
@ -185,7 +185,7 @@ class single_view_checkbox_attribute extends single_view_ui_element {
|
||||
}
|
||||
}
|
||||
|
||||
class single_view_dropdown_attribute extends single_view_ui_element {
|
||||
class singleview_dropdown_attribute extends singleview_ui_element {
|
||||
var $selected;
|
||||
var $options;
|
||||
var $is_disabled;
|
||||
@ -226,7 +226,7 @@ class single_view_dropdown_attribute extends single_view_ui_element {
|
||||
}
|
||||
}
|
||||
|
||||
abstract class single_view_grade_attribute_format extends single_view_attribute_format implements unique_name, tabbable {
|
||||
abstract class singleview_grade_attribute_format extends singleview_attribute_format implements unique_name, tabbable {
|
||||
var $name;
|
||||
|
||||
function __construct() {
|
||||
@ -273,7 +273,7 @@ interface tabbable {
|
||||
function get_tabindex();
|
||||
}
|
||||
|
||||
class single_view_bulk_insert_ui extends single_view_ui_element {
|
||||
class singleview_bulk_insert_ui extends singleview_ui_element {
|
||||
function __construct($item) {
|
||||
$this->name = 'bulk_' . $item->id;
|
||||
$this->applyname = $this->name_for('apply');
|
||||
@ -295,7 +295,7 @@ class single_view_bulk_insert_ui extends single_view_ui_element {
|
||||
|
||||
function html() {
|
||||
$_s = function($key) {
|
||||
return get_string($key, 'gradereport_single_view');
|
||||
return get_string($key, 'gradereport_singleview');
|
||||
};
|
||||
|
||||
$apply = html_writer::checkbox($this->applyname, 1, false, ' ' . $_s('bulk'));
|
||||
@ -310,7 +310,7 @@ class single_view_bulk_insert_ui extends single_view_ui_element {
|
||||
);
|
||||
|
||||
$label = html_writer::tag('label', $_s('for'));
|
||||
$text = new single_view_text_attribute($this->insertname, "0");
|
||||
$text = new singleview_text_attribute($this->insertname, "0");
|
||||
return implode(' ', array($apply, $text->html(), $label, $select));
|
||||
}
|
||||
|
||||
@ -319,7 +319,7 @@ class single_view_bulk_insert_ui extends single_view_ui_element {
|
||||
}
|
||||
}
|
||||
|
||||
abstract class single_view_attribute_format {
|
||||
abstract class singleview_attribute_format {
|
||||
abstract function determine_format();
|
||||
|
||||
function __toString() {
|
||||
@ -327,7 +327,7 @@ abstract class single_view_attribute_format {
|
||||
}
|
||||
}
|
||||
|
||||
class single_view_finalgrade_ui extends single_view_grade_attribute_format implements unique_value, be_disabled {
|
||||
class singleview_finalgrade_ui extends singleview_grade_attribute_format implements unique_value, be_disabled {
|
||||
|
||||
var $name = 'finalgrade';
|
||||
|
||||
@ -368,7 +368,7 @@ class single_view_finalgrade_ui extends single_view_grade_attribute_format imple
|
||||
$options[$i + 1] = $name;
|
||||
}
|
||||
|
||||
return new single_view_dropdown_attribute(
|
||||
return new singleview_dropdown_attribute(
|
||||
$this->get_name(),
|
||||
$options,
|
||||
$this->get_value(),
|
||||
@ -376,7 +376,7 @@ class single_view_finalgrade_ui extends single_view_grade_attribute_format imple
|
||||
$this->get_tabindex()
|
||||
);
|
||||
} else {
|
||||
return new single_view_text_attribute(
|
||||
return new singleview_text_attribute(
|
||||
$this->get_name(),
|
||||
$this->get_value(),
|
||||
$this->is_disabled(),
|
||||
@ -427,12 +427,12 @@ class single_view_finalgrade_ui extends single_view_grade_attribute_format imple
|
||||
$errorstr = get_string($errorstr, 'grades', $gradestr);
|
||||
}
|
||||
|
||||
$grade_item->update_final_grade($userid, $finalgrade, 'single_view', $feedback, FORMAT_MOODLE);
|
||||
$grade_item->update_final_grade($userid, $finalgrade, 'singleview', $feedback, FORMAT_MOODLE);
|
||||
return $errorstr;
|
||||
}
|
||||
}
|
||||
|
||||
class single_view_feedback_ui extends single_view_grade_attribute_format implements unique_value, be_disabled {
|
||||
class singleview_feedback_ui extends singleview_grade_attribute_format implements unique_value, be_disabled {
|
||||
|
||||
var $name = 'feedback';
|
||||
|
||||
@ -456,7 +456,7 @@ class single_view_feedback_ui extends single_view_grade_attribute_format impleme
|
||||
}
|
||||
|
||||
function determine_format() {
|
||||
return new single_view_text_attribute(
|
||||
return new singleview_text_attribute(
|
||||
$this->get_name(),
|
||||
$this->get_value(),
|
||||
$this->is_disabled(),
|
||||
@ -474,14 +474,14 @@ class single_view_feedback_ui extends single_view_grade_attribute_format impleme
|
||||
}
|
||||
|
||||
$this->grade->grade_item->update_final_grade(
|
||||
$this->grade->userid, $finalgrade, 'single_view',
|
||||
$this->grade->userid, $finalgrade, 'singleview',
|
||||
$feedback, FORMAT_MOODLE
|
||||
);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class single_view_override_ui extends single_view_grade_attribute_format implements be_checked, be_disabled {
|
||||
class singleview_override_ui extends singleview_grade_attribute_format implements be_checked, be_disabled {
|
||||
var $name = 'override';
|
||||
|
||||
function is_checked() {
|
||||
@ -497,9 +497,9 @@ class single_view_override_ui extends single_view_grade_attribute_format impleme
|
||||
|
||||
function determine_format() {
|
||||
if (!$this->grade->grade_item->is_overridable_item()) {
|
||||
return new single_view_empty_element();
|
||||
return new singleview_empty_element();
|
||||
}
|
||||
return new single_view_checkbox_attribute(
|
||||
return new singleview_checkbox_attribute(
|
||||
$this->get_name(),
|
||||
$this->is_checked(),
|
||||
null,
|
||||
@ -520,7 +520,7 @@ class single_view_override_ui extends single_view_grade_attribute_format impleme
|
||||
}
|
||||
}
|
||||
|
||||
class single_view_exclude_ui extends single_view_grade_attribute_format implements be_checked {
|
||||
class singleview_exclude_ui extends singleview_grade_attribute_format implements be_checked {
|
||||
var $name = 'exclude';
|
||||
|
||||
function is_checked() {
|
||||
@ -528,7 +528,7 @@ class single_view_exclude_ui extends single_view_grade_attribute_format implemen
|
||||
}
|
||||
|
||||
function determine_format() {
|
||||
return new single_view_checkbox_attribute(
|
||||
return new singleview_checkbox_attribute(
|
||||
$this->get_name(),
|
||||
$this->is_checked()
|
||||
);
|
||||
@ -544,7 +544,7 @@ class single_view_exclude_ui extends single_view_grade_attribute_format implemen
|
||||
|
||||
// Fill in arbitrary grade to be excluded.
|
||||
$grade_item->update_final_grade(
|
||||
$this->grade->userid, null, 'single_view', null, FORMAT_MOODLE
|
||||
$this->grade->userid, null, 'singleview', null, FORMAT_MOODLE
|
||||
);
|
||||
|
||||
$grade_params = array(
|
||||
@ -565,7 +565,7 @@ class single_view_exclude_ui extends single_view_grade_attribute_format implemen
|
||||
}
|
||||
}
|
||||
|
||||
class single_view_range_ui extends single_view_attribute_format {
|
||||
class singleview_range_ui extends singleview_attribute_format {
|
||||
function __construct($item) {
|
||||
$this->item = $item;
|
||||
}
|
||||
@ -576,6 +576,6 @@ class single_view_range_ui extends single_view_attribute_format {
|
||||
$min = format_float($this->item->grademin, $decimals);
|
||||
$max = format_float($this->item->grademax, $decimals);
|
||||
|
||||
return new single_view_empty_element("$min - $max");
|
||||
return new singleview_empty_element("$min - $max");
|
||||
}
|
||||
}
|
@ -26,7 +26,7 @@
|
||||
|
||||
$capabilities = array(
|
||||
|
||||
'gradereport/single_view:view' => array(
|
||||
'gradereport/singleview:view' => array(
|
||||
'riskbitmask' => RISK_PERSONAL,
|
||||
'captype' => 'read',
|
||||
'contextlevel' => CONTEXT_COURSE,
|
@ -25,7 +25,7 @@
|
||||
require_once '../../../config.php';
|
||||
require_once $CFG->dirroot.'/lib/gradelib.php';
|
||||
require_once $CFG->dirroot.'/grade/lib.php';
|
||||
require_once $CFG->dirroot.'/grade/report/single_view/lib.php';
|
||||
require_once $CFG->dirroot.'/grade/report/singleview/lib.php';
|
||||
|
||||
$courseid = required_param('id', PARAM_INT);
|
||||
$groupid = optional_param('group', null, PARAM_INT);
|
||||
@ -40,14 +40,14 @@ $itemtype = optional_param('item', $default_type, PARAM_TEXT);
|
||||
|
||||
$course_params = array('id' => $courseid);
|
||||
|
||||
$PAGE->set_url(new moodle_url('/grade/report/single_view/index.php', $course_params));
|
||||
$PAGE->set_url(new moodle_url('/grade/report/singleview/index.php', $course_params));
|
||||
|
||||
if (!$course = $DB->get_record('course', $course_params)) {
|
||||
print_error('nocourseid');
|
||||
}
|
||||
|
||||
if (!in_array($itemtype, grade_report_single_view::valid_screens())) {
|
||||
print_error('notvalid', 'gradereport_single_view', '', $itemtype);
|
||||
if (!in_array($itemtype, grade_report_singleview::valid_screens())) {
|
||||
print_error('notvalid', 'gradereport_singleview', '', $itemtype);
|
||||
}
|
||||
|
||||
require_login($course);
|
||||
@ -55,14 +55,14 @@ require_login($course);
|
||||
$context = context_course::instance($course->id);
|
||||
|
||||
// This is the normal requirements
|
||||
require_capability('gradereport/single_view:view', $context);
|
||||
require_capability('gradereport/singleview:view', $context);
|
||||
require_capability('moodle/grade:viewall', $context);
|
||||
require_capability('moodle/grade:edit', $context);
|
||||
// End permission
|
||||
|
||||
$gpr = new grade_plugin_return(array(
|
||||
'type' => 'report',
|
||||
'plugin' => 'single_view',
|
||||
'plugin' => 'singleview',
|
||||
'courseid' => $courseid
|
||||
));
|
||||
|
||||
@ -70,21 +70,21 @@ $gpr = new grade_plugin_return(array(
|
||||
if (!isset($USER->grade_last_report)) {
|
||||
$USER->grade_last_report = array();
|
||||
}
|
||||
$USER->grade_last_report[$course->id] = 'single_view';
|
||||
$USER->grade_last_report[$course->id] = 'singleview';
|
||||
|
||||
grade_regrade_final_grades($courseid);
|
||||
|
||||
$report = new grade_report_single_view(
|
||||
$report = new grade_report_singleview(
|
||||
$courseid, $gpr, $context,
|
||||
$itemtype, $itemid, $groupid
|
||||
);
|
||||
|
||||
$reportname = $report->screen->heading();
|
||||
|
||||
$pluginname = get_string('pluginname', 'gradereport_single_view');
|
||||
$pluginname = get_string('pluginname', 'gradereport_singleview');
|
||||
|
||||
$report_url = new moodle_url('/grade/report/grader/index.php', $course_params);
|
||||
$edit_url = new moodle_url('/grade/report/single_view/index.php', $course_params);
|
||||
$edit_url = new moodle_url('/grade/report/singleview/index.php', $course_params);
|
||||
|
||||
$PAGE->navbar->ignore_active(true);
|
||||
|
||||
@ -116,7 +116,7 @@ if ($report->screen instanceof selectable_items
|
||||
$optionkeys = array_keys($report->screen->options());
|
||||
$optionitemid = array_shift($optionkeys); //just any one thanks
|
||||
|
||||
$relreport = new grade_report_single_view(
|
||||
$relreport = new grade_report_singleview(
|
||||
$courseid, $gpr, $context,
|
||||
$report->screen->item_type(), $optionitemid, $groupid
|
||||
);
|
||||
@ -127,19 +127,20 @@ if ($report->screen instanceof selectable_items
|
||||
$navparams = array('item' => $itemtype, 'id' => $courseid, 'group' => $groupid);
|
||||
if ($i>0) {
|
||||
$navparams['itemid'] = $reloptionssorting[$i-1];
|
||||
$link = new moodle_url('/grade/report/single_view/index.php', $navparams);
|
||||
$link = new moodle_url('/grade/report/singleview/index.php', $navparams);
|
||||
$navprev=html_writer::link($link, $reloptions[$reloptionssorting[$i-1]]);
|
||||
$graderleftnav = html_writer::tag('small', $navprev, array('class' => 'itemnav previtem'));
|
||||
}
|
||||
if ($i<count($reloptionssorting)-1) {
|
||||
$navparams['itemid'] = $reloptionssorting[$i+1];
|
||||
$link = new moodle_url('/grade/report/single_view/index.php', $navparams);
|
||||
$link = new moodle_url('/grade/report/singleview/index.php', $navparams);
|
||||
$navnext=html_writer::link($link, $reloptions[$reloptionssorting[$i+1]]);
|
||||
$graderrightnav = html_writer::tag('small', $navnext, array('class' => 'itemnav nextitem'));
|
||||
}
|
||||
}
|
||||
|
||||
print_grade_page_head($course->id, 'report', 'single_view', $reportname);
|
||||
print_grade_page_head($course->id, 'report', 'singleview', $reportname);
|
||||
|
||||
if(!is_null($graderleftnav)) {
|
||||
echo $graderleftnav;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
M.gradereport_single_view = {};
|
||||
M.gradereport_singleview = {};
|
||||
|
||||
M.gradereport_single_view.init = function(Y) {
|
||||
M.gradereport_singleview.init = function(Y) {
|
||||
// Make toggle links
|
||||
Y.all('.include').each(function(link) {
|
||||
var type = link.getAttribute('class').split(" ")[2];
|
@ -24,7 +24,7 @@
|
||||
|
||||
// General Strings
|
||||
$string['pluginname'] = 'Single view';
|
||||
$string['single_view:view'] = 'View the '.$string['pluginname'].' report';
|
||||
$string['singleview:view'] = 'View the '.$string['pluginname'].' report';
|
||||
|
||||
$string['not_allowed'] = 'Not allowed to quick edit this item';
|
||||
$string['filtergrades'] = 'Show grades for {$a}.';
|
@ -23,9 +23,9 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
require_once($CFG->dirroot . '/grade/report/lib.php');
|
||||
require_once($CFG->dirroot . '/grade/report/single_view/classes/lib.php');
|
||||
require_once($CFG->dirroot . '/grade/report/singleview/classes/lib.php');
|
||||
|
||||
class grade_report_single_view extends grade_report {
|
||||
class grade_report_singleview extends grade_report {
|
||||
|
||||
public static function valid_screens() {
|
||||
$screendir = dirname(__FILE__) . '/screens';
|
||||
@ -53,11 +53,11 @@ class grade_report_single_view extends grade_report {
|
||||
|
||||
require_once $screendir . '/lib.php';
|
||||
|
||||
return 'single_view_' . $screen;
|
||||
return 'singleview_' . $screen;
|
||||
}
|
||||
|
||||
public static function filters() {
|
||||
$classnames = array('grade_report_single_view', 'classname');
|
||||
$classnames = array('grade_report_singleview', 'classname');
|
||||
$classes = array_map($classnames, self::valid_screens());
|
||||
|
||||
$screens = array_filter($classes, function($screen) {
|
||||
@ -81,7 +81,7 @@ class grade_report_single_view extends grade_report {
|
||||
}
|
||||
|
||||
function _s($key, $a = null) {
|
||||
return get_string($key, 'gradereport_single_view', $a);
|
||||
return get_string($key, 'gradereport_singleview', $a);
|
||||
}
|
||||
|
||||
function __construct($courseid, $gpr, $context, $itemtype, $itemid, $groupid=null) {
|
||||
@ -97,7 +97,7 @@ class grade_report_single_view extends grade_report {
|
||||
// Load custom or predifined js
|
||||
$this->screen->js();
|
||||
|
||||
$base = '/grade/report/single_view/index.php';
|
||||
$base = '/grade/report/singleview/index.php';
|
||||
|
||||
$id_params = array('id' => $courseid);
|
||||
|
||||
@ -117,7 +117,7 @@ class grade_report_single_view extends grade_report {
|
||||
}
|
||||
}
|
||||
|
||||
function grade_report_single_view_profilereport($course, $user) {
|
||||
function grade_report_singleview_profilereport($course, $user) {
|
||||
global $CFG, $OUTPUT;
|
||||
|
||||
if (!function_exists('grade_report_user_profilereport')) {
|
||||
@ -127,7 +127,7 @@ function grade_report_single_view_profilereport($course, $user) {
|
||||
$context = context_course::instance($course->id);
|
||||
|
||||
$can_use = (
|
||||
has_capability('gradereport/single_view:view', $context) and
|
||||
has_capability('gradereport/singleview:view', $context) and
|
||||
has_capability('moodle/grade:viewall', $context) and
|
||||
has_capability('moodle/grade:edit', $context)
|
||||
);
|
||||
@ -137,12 +137,12 @@ function grade_report_single_view_profilereport($course, $user) {
|
||||
} else {
|
||||
$gpr = new grade_plugin_return(array(
|
||||
'type' => 'report',
|
||||
'plugin' => 'single_view',
|
||||
'plugin' => 'singleview',
|
||||
'courseid' => $course->id,
|
||||
'userid' => $user->id
|
||||
));
|
||||
|
||||
$report = new grade_report_single_view($course->id, $gpr, $context, 'user', $user->id);
|
||||
$report = new grade_report_singleview($course->id, $gpr, $context, 'user', $user->id);
|
||||
|
||||
echo $OUTPUT->heading($report->screen->heading());
|
||||
echo $report->output();
|
@ -18,12 +18,12 @@
|
||||
/**
|
||||
* The gradebook simple view - grades view (for an activity)
|
||||
*
|
||||
* @package simple_view
|
||||
* @package singleview
|
||||
* @copyright 2014 Moodle Pty Ltd (http://moodle.com)
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
class single_view_grade extends single_view_tablelike
|
||||
class singleview_grade extends singleview_tablelike
|
||||
implements selectable_items, item_filtering {
|
||||
|
||||
private $requires_extra = false;
|
||||
@ -114,12 +114,12 @@ class single_view_grade extends single_view_tablelike
|
||||
|
||||
$this->item = grade_item::fetch($params);
|
||||
|
||||
$filter_fun = grade_report_single_view::filters();
|
||||
$filter_fun = grade_report_singleview::filters();
|
||||
|
||||
$allowed = $filter_fun($this->item);
|
||||
|
||||
if (empty($allowed)) {
|
||||
print_error('not_allowed', 'gradereport_single_view');
|
||||
print_error('not_allowed', 'gradereport_singleview');
|
||||
}
|
||||
|
||||
$this->requires_extra = !$this->item->is_manual_item();
|
||||
@ -169,7 +169,7 @@ class single_view_grade extends single_view_tablelike
|
||||
$url = new moodle_url("/user/view.php", array('id' => $item->id, 'course' => $this->courseid));
|
||||
|
||||
$line = array(
|
||||
$OUTPUT->action_icon($this->format_link('grade', $item->id), new pix_icon('t/editstring', get_string('filtergrades', 'gradereport_single_view', $fullname))),
|
||||
$OUTPUT->action_icon($this->format_link('grade', $item->id), new pix_icon('t/editstring', get_string('filtergrades', 'gradereport_singleview', $fullname))),
|
||||
$OUTPUT->user_picture($item),
|
||||
html_writer::tag('a', $fullname, array('href' => $url)),
|
||||
$this->item_range()
|
||||
@ -204,7 +204,7 @@ class single_view_grade extends single_view_tablelike
|
||||
|
||||
return $OUTPUT->paging_bar(
|
||||
count($this->all_items), $this->page, $this->perpage,
|
||||
new moodle_url('/grade/report/single_view/index.php', array(
|
||||
new moodle_url('/grade/report/singleview/index.php', array(
|
||||
'perpage' => $this->perpage,
|
||||
'id' => $this->courseid,
|
||||
'groupid' => $this->groupid,
|
@ -18,12 +18,12 @@
|
||||
/**
|
||||
* The gradebook simple view - initial view to select your search options
|
||||
*
|
||||
* @package simple_view
|
||||
* @package singleview
|
||||
* @copyright 2014 Moodle Pty Ltd (http://moodle.com)
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
class single_view_select extends single_view_screen {
|
||||
class singleview_select extends singleview_screen {
|
||||
public function init($self_item_is_empty = false) {
|
||||
global $DB;
|
||||
|
||||
@ -35,10 +35,10 @@ class single_view_select extends single_view_screen {
|
||||
|
||||
$html = '';
|
||||
|
||||
$types = grade_report_single_view::valid_screens();
|
||||
$types = grade_report_singleview::valid_screens();
|
||||
|
||||
foreach ($types as $type) {
|
||||
$class = grade_report_single_view::classname($type);
|
||||
$class = grade_report_singleview::classname($type);
|
||||
|
||||
$screen = new $class($this->courseid, null, $this->groupid);
|
||||
|
||||
@ -58,14 +58,14 @@ class single_view_select extends single_view_screen {
|
||||
'group' => $this->groupid
|
||||
);
|
||||
|
||||
$url = new moodle_url('/grade/report/single_view/index.php', $params);
|
||||
$url = new moodle_url('/grade/report/singleview/index.php', $params);
|
||||
$html .= $OUTPUT->heading($screen->description());
|
||||
|
||||
$html .= $OUTPUT->single_select($url, 'itemid', $options);
|
||||
}
|
||||
|
||||
if (empty($html)) {
|
||||
$OUTPUT->notification(get_string('no_screens', 'gradereport_single_view'));
|
||||
$OUTPUT->notification(get_string('no_screens', 'gradereport_singleview'));
|
||||
}
|
||||
|
||||
return $html;
|
@ -18,12 +18,12 @@
|
||||
/**
|
||||
* The gradebook simple view - grades view (for a user)
|
||||
*
|
||||
* @package simple_view
|
||||
* @package singleview
|
||||
* @copyright 2014 Moodle Pty Ltd (http://moodle.com)
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
class single_view_user extends single_view_tablelike implements selectable_items {
|
||||
class singleview_user extends singleview_tablelike implements selectable_items {
|
||||
|
||||
private $categories = array();
|
||||
|
||||
@ -62,7 +62,7 @@ class single_view_user extends single_view_tablelike implements selectable_items
|
||||
}
|
||||
}
|
||||
|
||||
$this->items = array_filter($seq->items, grade_report_single_view::filters());
|
||||
$this->items = array_filter($seq->items, grade_report_singleview::filters());
|
||||
|
||||
unset($seq);
|
||||
|
||||
@ -78,7 +78,7 @@ class single_view_user extends single_view_tablelike implements selectable_items
|
||||
return array(
|
||||
'', // for filter icon.
|
||||
'', // for activity icon.
|
||||
get_string('assessmentname', 'gradereport_single_view'),
|
||||
get_string('assessmentname', 'gradereport_singleview'),
|
||||
get_string('gradecategory', 'grades'),
|
||||
get_string('range', 'grades'),
|
||||
get_string('grade', 'grades'),
|
||||
@ -104,7 +104,7 @@ class single_view_user extends single_view_tablelike implements selectable_items
|
||||
$url = new moodle_url("/mod/$item->itemmodule/view.php", array('id' => $item->cmid));
|
||||
|
||||
$line = array(
|
||||
$OUTPUT->action_icon($this->format_link('grade', $item->id), new pix_icon('t/editstring', get_string('filtergrades', 'gradereport_single_view', $item->get_name()))),
|
||||
$OUTPUT->action_icon($this->format_link('grade', $item->id), new pix_icon('t/editstring', get_string('filtergrades', 'gradereport_singleview', $item->get_name()))),
|
||||
$this->format_icon($item) . $lockicon,
|
||||
html_writer::link($url, $item->get_name()),
|
||||
$this->category($item),
|
51
grade/report/singleview/styles.css
Normal file
51
grade/report/singleview/styles.css
Normal file
@ -0,0 +1,51 @@
|
||||
#page-grade-report-singleview-index div.generalbox {
|
||||
margin: 0 20px 15px 20px;
|
||||
}
|
||||
|
||||
#page-grade-report-singleview-index div.generalbox div.singleselect form div {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#page-grade-report-singleview-index div.generalbox table.generaltable {
|
||||
margin: 0 auto 15px auto;
|
||||
}
|
||||
|
||||
#page-grade-report-singleview-index div.generalbox form div {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#page-grade-report-singleview-index .singleview_buttons {
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
#page-grade-report-singleview-index table.generaltable .cell {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#page-grade-report-singleview-index div.generalbox h2 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
input[name^="finalgrade"] {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
#page-grade-report-singleview-index #region-main h2, .paging{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#page-grade-report-singleview-index itemnav.previtem {
|
||||
float:left;
|
||||
}
|
||||
#page-grade-report-singleview-index itemnav.previtem {
|
||||
float:left;
|
||||
}
|
||||
#page-grade-report-singleview-index.dir-rtl small.previtem {
|
||||
float:right;
|
||||
}
|
||||
#page-grade-report-singleview-index small.nextitem {
|
||||
float:right;
|
||||
}
|
||||
#page-grade-report-singleview-index.dir-rtl small.nextitem {
|
||||
float:left;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user