From d124a60b33826ab40bf492bf9ea089063b601cd8 Mon Sep 17 00:00:00 2001 From: Zachary Durber Date: Thu, 25 Sep 2014 14:48:51 +0800 Subject: [PATCH] MDL-18229 gradebook: Renaming of Single_view to Single view --- grade/report/single_view/styles.css | 50 --------------- .../{single_view => singleview}/README.md | 0 .../classes/lib.php | 30 ++++----- .../classes/uilib.php | 64 +++++++++---------- .../{single_view => singleview}/db/access.php | 2 +- .../{single_view => singleview}/index.php | 29 +++++---- .../js/singleview.js} | 4 +- .../lang/en/gradereport_singleview.php} | 2 +- .../{single_view => singleview}/lib.php | 20 +++--- .../screens/grade/lib.php | 12 ++-- .../screens/select/lib.php | 12 ++-- .../screens/user/lib.php | 10 +-- grade/report/singleview/styles.css | 51 +++++++++++++++ .../{single_view => singleview}/version.php | 0 14 files changed, 144 insertions(+), 142 deletions(-) delete mode 100644 grade/report/single_view/styles.css rename grade/report/{single_view => singleview}/README.md (100%) rename grade/report/{single_view => singleview}/classes/lib.php (91%) rename grade/report/{single_view => singleview}/classes/uilib.php (87%) rename grade/report/{single_view => singleview}/db/access.php (97%) rename grade/report/{single_view => singleview}/index.php (85%) rename grade/report/{single_view/js/single_view.js => singleview/js/singleview.js} (94%) rename grade/report/{single_view/lang/en/gradereport_single_view.php => singleview/lang/en/gradereport_singleview.php} (96%) rename grade/report/{single_view => singleview}/lib.php (88%) rename grade/report/{single_view => singleview}/screens/grade/lib.php (95%) rename grade/report/{single_view => singleview}/screens/select/lib.php (86%) rename grade/report/{single_view => singleview}/screens/user/lib.php (95%) create mode 100644 grade/report/singleview/styles.css rename grade/report/{single_view => singleview}/version.php (100%) diff --git a/grade/report/single_view/styles.css b/grade/report/single_view/styles.css deleted file mode 100644 index c47043db76d94..0000000000000 --- a/grade/report/single_view/styles.css +++ /dev/null @@ -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; -} \ No newline at end of file diff --git a/grade/report/single_view/README.md b/grade/report/singleview/README.md similarity index 100% rename from grade/report/single_view/README.md rename to grade/report/singleview/README.md diff --git a/grade/report/single_view/classes/lib.php b/grade/report/singleview/classes/lib.php similarity index 91% rename from grade/report/single_view/classes/lib.php rename to grade/report/singleview/classes/lib.php index c679f9487a83a..f0772258658b0 100644 --- a/grade/report/single_view/classes/lib.php +++ b/grade/report/singleview/classes/lib.php @@ -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 @@ public function setup_structure() { } 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 @@ public function make_toggle($key) { } 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 @@ public function pager() { 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 @@ public function js() { 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 @@ public function display_group_selector() { } } -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 @@ public function html() { 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 @@ public function bulk_insert() { return html_writer::tag( 'div', $this->factory()->create('bulk_insert')->format($this->item)->html(), - array('class' => 'single_view_bulk') + array('class' => 'singleview_bulk') ); } diff --git a/grade/report/single_view/classes/uilib.php b/grade/report/singleview/classes/uilib.php similarity index 87% rename from grade/report/single_view/classes/uilib.php rename to grade/report/singleview/classes/uilib.php index c753eb17e2c0b..cc676ca678e35 100644 --- a/grade/report/single_view/classes/uilib.php +++ b/grade/report/singleview/classes/uilib.php @@ -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 @@ function format() { } } -abstract class single_view_ui_element { +abstract class singleview_ui_element { var $name; var $value; @@ -74,10 +74,10 @@ function is_dropdown() { 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 @@ function html() { } } -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 @@ function html() { } } -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 @@ function html() { } } -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 @@ function html() { } } -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 @@ function get_insert_value($data) { 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 @@ function html() { ); $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 @@ private function name_for($extend) { } } -abstract class single_view_attribute_format { +abstract class singleview_attribute_format { abstract function determine_format(); function __toString() { @@ -327,7 +327,7 @@ function __toString() { } } -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 @@ function determine_format() { $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 @@ function determine_format() { $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 @@ function set($value) { $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 @@ function is_disabled() { } 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 @@ function set($value) { } $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 @@ function is_disabled() { 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 @@ function set($value) { } } -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 @@ function is_checked() { } function determine_format() { - return new single_view_checkbox_attribute( + return new singleview_checkbox_attribute( $this->get_name(), $this->is_checked() ); @@ -544,7 +544,7 @@ function set($value) { // 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 @@ function set($value) { } } -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 @@ function determine_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"); } } diff --git a/grade/report/single_view/db/access.php b/grade/report/singleview/db/access.php similarity index 97% rename from grade/report/single_view/db/access.php rename to grade/report/singleview/db/access.php index ee7fcb677d13c..d7ff86505e846 100755 --- a/grade/report/single_view/db/access.php +++ b/grade/report/singleview/db/access.php @@ -26,7 +26,7 @@ $capabilities = array( - 'gradereport/single_view:view' => array( + 'gradereport/singleview:view' => array( 'riskbitmask' => RISK_PERSONAL, 'captype' => 'read', 'contextlevel' => CONTEXT_COURSE, diff --git a/grade/report/single_view/index.php b/grade/report/singleview/index.php similarity index 85% rename from grade/report/single_view/index.php rename to grade/report/singleview/index.php index 30db476a078bf..32cd9d7232484 100755 --- a/grade/report/single_view/index.php +++ b/grade/report/singleview/index.php @@ -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 @@ $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 @@ $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 @@ 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 @@ $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 @@ $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 '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; } diff --git a/grade/report/single_view/js/single_view.js b/grade/report/singleview/js/singleview.js similarity index 94% rename from grade/report/single_view/js/single_view.js rename to grade/report/singleview/js/singleview.js index cfa6c0641c4fd..02d7be898c983 100644 --- a/grade/report/single_view/js/single_view.js +++ b/grade/report/singleview/js/singleview.js @@ -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]; diff --git a/grade/report/single_view/lang/en/gradereport_single_view.php b/grade/report/singleview/lang/en/gradereport_singleview.php similarity index 96% rename from grade/report/single_view/lang/en/gradereport_single_view.php rename to grade/report/singleview/lang/en/gradereport_singleview.php index e3ce90beb42bd..6c7117add7e83 100755 --- a/grade/report/single_view/lang/en/gradereport_single_view.php +++ b/grade/report/singleview/lang/en/gradereport_singleview.php @@ -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}.'; diff --git a/grade/report/single_view/lib.php b/grade/report/singleview/lib.php similarity index 88% rename from grade/report/single_view/lib.php rename to grade/report/singleview/lib.php index 16b091e68d1e7..32adb850b8201 100755 --- a/grade/report/single_view/lib.php +++ b/grade/report/singleview/lib.php @@ -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 @@ public static function classname($screen) { 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 @@ function process_action($target, $action) { } 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 @@ function __construct($courseid, $gpr, $context, $itemtype, $itemid, $groupid=nul // 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 @@ function output() { } } -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(); diff --git a/grade/report/single_view/screens/grade/lib.php b/grade/report/singleview/screens/grade/lib.php similarity index 95% rename from grade/report/single_view/screens/grade/lib.php rename to grade/report/singleview/screens/grade/lib.php index 2b802c9b722b8..362b9fd22fa04 100644 --- a/grade/report/single_view/screens/grade/lib.php +++ b/grade/report/singleview/screens/grade/lib.php @@ -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 @@ public function init($self_item_is_empty = false) { $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 @@ public function format_line($item) { $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 @@ public function pager() { 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, diff --git a/grade/report/single_view/screens/select/lib.php b/grade/report/singleview/screens/select/lib.php similarity index 86% rename from grade/report/single_view/screens/select/lib.php rename to grade/report/singleview/screens/select/lib.php index 282d94fcc5a01..e58a5d5b9b4d6 100644 --- a/grade/report/single_view/screens/select/lib.php +++ b/grade/report/singleview/screens/select/lib.php @@ -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 @@ public function html() { $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 @@ public function html() { '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; diff --git a/grade/report/single_view/screens/user/lib.php b/grade/report/singleview/screens/user/lib.php similarity index 95% rename from grade/report/single_view/screens/user/lib.php rename to grade/report/singleview/screens/user/lib.php index d011e22363159..05cae08683ff9 100644 --- a/grade/report/single_view/screens/user/lib.php +++ b/grade/report/singleview/screens/user/lib.php @@ -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 @@ public function init($self_item_is_empty = false) { } } - $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 @@ public function original_headers() { 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 @@ public function format_line($item) { $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), diff --git a/grade/report/singleview/styles.css b/grade/report/singleview/styles.css new file mode 100644 index 0000000000000..d7e88178de028 --- /dev/null +++ b/grade/report/singleview/styles.css @@ -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; +} diff --git a/grade/report/single_view/version.php b/grade/report/singleview/version.php similarity index 100% rename from grade/report/single_view/version.php rename to grade/report/singleview/version.php