From fbb207c57a86c4340593da2efa345dcd43372f75 Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Tue, 13 Nov 2012 16:48:50 +0800 Subject: [PATCH] MDL-36323 usability: New icon names to assign and switch roles --- course/lib.php | 2 +- lib/blocklib.php | 2 +- lib/enrollib.php | 4 ++-- lib/navigationlib.php | 4 ++-- pix/i/{roles.png => assignroles.png} | Bin pix/i/{roles.svg => assignroles.svg} | 0 pix/i/{rolesm.png => switchrole.png} | Bin pix/i/{rolesm.svg => switchrole.svg} | 0 pix/t/assignroles.png | Bin 0 -> 233 bytes pix/t/assignroles.svg | 15 +++++++++++++++ theme/upgrade.txt | 8 ++++++-- 11 files changed, 27 insertions(+), 8 deletions(-) rename pix/i/{roles.png => assignroles.png} (100%) rename pix/i/{roles.svg => assignroles.svg} (100%) rename pix/i/{rolesm.png => switchrole.png} (100%) rename pix/i/{rolesm.svg => switchrole.svg} (100%) create mode 100644 pix/t/assignroles.png create mode 100644 pix/t/assignroles.svg diff --git a/course/lib.php b/course/lib.php index dab4668dda7..c3a4165df14 100644 --- a/course/lib.php +++ b/course/lib.php @@ -3315,7 +3315,7 @@ function make_editing_buttons(stdClass $mod, $absolute_ignored = true, $movesele if (has_capability('moodle/role:assign', $modcontext)){ $actions[] = new action_link( new moodle_url('/'.$CFG->admin.'/roles/assign.php', array('contextid' => $modcontext->id)), - new pix_icon('i/roles', $str->assign, 'moodle', array('class' => 'iconsmall', 'title' => '')), + new pix_icon('t/assignroles', $str->assign, 'moodle', array('class' => 'iconsmall', 'title' => '')), null, array('class' => 'editing_assign', 'title' => $str->assign) ); diff --git a/lib/blocklib.php b/lib/blocklib.php index c28c9193b05..e56693300ae 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -1067,7 +1067,7 @@ class block_manager { $controls[] = array('url' => $CFG->wwwroot . '/' . $CFG->admin . '/roles/assign.php?contextid=' . $block->context->id . '&returnurl=' . urlencode($return), - 'icon' => 'i/roles', 'caption' => get_string('assignroles', 'role'), 'class' => 'editing_roles'); + 'icon' => 't/assignroles', 'caption' => get_string('assignroles', 'role'), 'class' => 'editing_roles'); } return $controls; diff --git a/lib/enrollib.php b/lib/enrollib.php index 4691f09cfde..835a07a4b14 100644 --- a/lib/enrollib.php +++ b/lib/enrollib.php @@ -444,7 +444,7 @@ function enrol_add_course_navigation(navigation_node $coursenode, $course) { if ($course->id == SITEID or (!empty($CFG->adminsassignrolesincourse) and is_siteadmin())) { if (has_capability('moodle/role:assign', $coursecontext)) { $url = new moodle_url('/admin/roles/assign.php', array('contextid'=>$coursecontext->id)); - $permissionsnode->add(get_string('assignedroles', 'role'), $url, navigation_node::TYPE_SETTING, null, 'roles', new pix_icon('i/rolesm', '')); + $permissionsnode->add(get_string('assignedroles', 'role'), $url, navigation_node::TYPE_SETTING, null, 'roles', new pix_icon('i/assignroles', '')); } } // Check role permissions @@ -459,7 +459,7 @@ function enrol_add_course_navigation(navigation_node $coursenode, $course) { //TODO, create some new UI for role assignments at course level if (has_capability('moodle/role:assign', $coursecontext)) { $url = new moodle_url('/enrol/otherusers.php', array('id'=>$course->id)); - $usersnode->add(get_string('notenrolledusers', 'enrol'), $url, navigation_node::TYPE_SETTING, null, 'otherusers', new pix_icon('i/rolesm', '')); + $usersnode->add(get_string('notenrolledusers', 'enrol'), $url, navigation_node::TYPE_SETTING, null, 'otherusers', new pix_icon('i/assignroles', '')); } } diff --git a/lib/navigationlib.php b/lib/navigationlib.php index 5ff2d4b3ca8..0fd249691c8 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -3597,7 +3597,7 @@ class settings_navigation extends navigation_node { $returnurl->param('sesskey', sesskey()); foreach ($roles as $key => $name) { $url = new moodle_url('/course/switchrole.php', array('id'=>$course->id,'sesskey'=>sesskey(), 'switchrole'=>$key, 'returnurl'=>$returnurl->out(false))); - $switchroles->add($name, $url, self::TYPE_SETTING, null, $key, new pix_icon('i/rolesm', '')); + $switchroles->add($name, $url, self::TYPE_SETTING, null, $key, new pix_icon('i/switchrole', '')); } } // Return we are done @@ -4064,7 +4064,7 @@ class settings_navigation extends navigation_node { // Assign local roles if (has_capability('moodle/role:assign', $this->context)) { $assignurl = new moodle_url('/'.$CFG->admin.'/roles/assign.php', array('contextid'=>$this->context->id)); - $categorynode->add(get_string('assignroles', 'role'), $assignurl, self::TYPE_SETTING, null, 'roles', new pix_icon('i/rolesm', '')); + $categorynode->add(get_string('assignroles', 'role'), $assignurl, self::TYPE_SETTING, null, 'roles', new pix_icon('i/assignroles', '')); } // Override roles diff --git a/pix/i/roles.png b/pix/i/assignroles.png similarity index 100% rename from pix/i/roles.png rename to pix/i/assignroles.png diff --git a/pix/i/roles.svg b/pix/i/assignroles.svg similarity index 100% rename from pix/i/roles.svg rename to pix/i/assignroles.svg diff --git a/pix/i/rolesm.png b/pix/i/switchrole.png similarity index 100% rename from pix/i/rolesm.png rename to pix/i/switchrole.png diff --git a/pix/i/rolesm.svg b/pix/i/switchrole.svg similarity index 100% rename from pix/i/rolesm.svg rename to pix/i/switchrole.svg diff --git a/pix/t/assignroles.png b/pix/t/assignroles.png new file mode 100644 index 0000000000000000000000000000000000000000..1005da4a8a0e58f114498ed254f527406ab241e3 GIT binary patch literal 233 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWw1G-JULvAr-fhQXH6#)6dP}Um~>N4(H34FI!K1^2z9uo*>ff zz!<`_n@yo3{Q%3yA0`?J7Z)`6Gdnh{OJo!?mHv>Kabyu=wFaZJGlOnRf&!x!J6lhH zAEUr?=8X)KeB~Q<$e;SpP#UGoJz+=x5&^a+jWgss`8V4(vUVp4?BFmJW!~_BV=wQH dCQ*e04B@k7C#`b2KO5*Q22WQ%mvv4FO#tWZO~?QM literal 0 HcmV?d00001 diff --git a/pix/t/assignroles.svg b/pix/t/assignroles.svg new file mode 100644 index 00000000000..f4cc25adb4b --- /dev/null +++ b/pix/t/assignroles.svg @@ -0,0 +1,15 @@ + + + +]> + + + + + diff --git a/theme/upgrade.txt b/theme/upgrade.txt index e85a6e456b6..ce15db20614 100644 --- a/theme/upgrade.txt +++ b/theme/upgrade.txt @@ -6,12 +6,16 @@ information provided here is intended especially for theme designer. required changes: * output course and course content header/footer that may be returned by course format (see MDL-36048) +deprecation: +* i/roles: Use t/assignroles instead + optional changes: * new optional boolean parameter $withlinks for public function login_info() in lib/outputrenderers.php (MDL-31365) * new layout option "nologinlinks" and new page layout "secure" e.g. for safebrowser and securewindow (MDL-31365) * new class 'iconlarge' for 24x24 icons. -* new icons i/export and i/import. Previously export and import actions used i/backup and i/restore. -* new icon i/rolesm (stands for 'roles medium') is 16x16 instead of 12x12 for i/roles +* new icons i/export and i/import (sized 16x16). Previously export and import actions used i/backup and i/restore. +* new icon i/assignroles (sized 16x16), to prevent the use of i/roles which is 12x12. +* new icon i/switchrole (sized 16x16), was previously using i/roles. Now is a copy of the new i/assignroles icon. === 2.3 === -- 2.43.0