Skip to content

Commit

Permalink
MDL-36323 usability: New icon names to assign and switch roles
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Massart committed Nov 14, 2012
1 parent 57dba02 commit fbb207c
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion course/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
);
Expand Down
2 changes: 1 addition & 1 deletion lib/blocklib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ public function edit_controls($block) {

$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;
Expand Down
4 changes: 2 additions & 2 deletions lib/enrollib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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', ''));
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/navigationlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3597,7 +3597,7 @@ protected function load_course_settings($forceopen = false) {
$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
Expand Down Expand Up @@ -4064,7 +4064,7 @@ protected function load_category_settings() {
// 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
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added pix/t/assignroles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions pix/t/assignroles.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions theme/upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ===

Expand Down

0 comments on commit fbb207c

Please sign in to comment.