MDL-35073 Badges - Set of minor fixes for issues found during integration
This commit is contained in:
@@ -26,7 +26,6 @@
|
||||
*/
|
||||
|
||||
global $SITE;
|
||||
require_once($CFG->libdir . '/badgeslib.php');
|
||||
|
||||
if (!empty($CFG->enablebadges) && ($hassiteconfig || has_any_capability(array(
|
||||
'moodle/badges:viewawarded',
|
||||
@@ -37,6 +36,8 @@ if (!empty($CFG->enablebadges) && ($hassiteconfig || has_any_capability(array(
|
||||
'moodle/badges:configuredetails',
|
||||
'moodle/badges:deletebadge'), $systemcontext))) {
|
||||
|
||||
require_once($CFG->libdir . '/badgeslib.php');
|
||||
|
||||
$globalsettings = new admin_settingpage('badgesettings', new lang_string('badgesettings', 'badges'),
|
||||
array('moodle/badges:manageglobalsettings'));
|
||||
|
||||
|
||||
@@ -91,6 +91,7 @@ if ($delete) {
|
||||
}
|
||||
|
||||
if ($copy) {
|
||||
require_sesskey();
|
||||
require_capability('moodle/badges:createbadge', $context);
|
||||
|
||||
$cloneid = $badge->make_clone();
|
||||
|
||||
@@ -124,6 +124,7 @@ if ($activate && has_capability('moodle/badges:configuredetails', $PAGE->context
|
||||
$badge->set_status(BADGE_STATUS_ACTIVE_LOCKED);
|
||||
$msg = get_string('activatesuccess', 'badges');
|
||||
} else {
|
||||
require_sesskey();
|
||||
$badge->set_status(BADGE_STATUS_ACTIVE);
|
||||
$msg = get_string('activatesuccess', 'badges');
|
||||
}
|
||||
@@ -136,6 +137,7 @@ if ($activate && has_capability('moodle/badges:configuredetails', $PAGE->context
|
||||
$badge->set_status(BADGE_STATUS_INACTIVE_LOCKED);
|
||||
$msg = get_string('deactivatesuccess', 'badges');
|
||||
} else {
|
||||
require_sesskey();
|
||||
$badge->set_status(BADGE_STATUS_INACTIVE);
|
||||
$msg = get_string('deactivatesuccess', 'badges');
|
||||
}
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ $string['allowcoursebadges_desc'] = 'Allow badges to be created and awarded in c
|
||||
$string['allowexternalbackpack'] = 'Enable connection to external backpacks';
|
||||
$string['allowexternalbackpack_desc'] = 'Allow users to set up connections and display badges from their external backpack providers.
|
||||
|
||||
Note: It is recommended to leave this option disabled if the web site cannot be accesed from the internet (e.g. because of the firewall).';
|
||||
Note: It is recommended to leave this option disabled if the web site cannot be accessed from the internet (e.g. because of the firewall).';
|
||||
$string['any'] = 'Any';
|
||||
$string['anymethod'] = 'Any of the selected conditions is met';
|
||||
$string['anymethodactivity'] = 'Any of the selected activities is complete';
|
||||
|
||||
@@ -2182,7 +2182,7 @@ class global_navigation extends navigation_node {
|
||||
$usernode->add(get_string('myfiles'), $url, self::TYPE_SETTING);
|
||||
}
|
||||
|
||||
if ($CFG->enablebadges && $iscurrentuser &&
|
||||
if (!empty($CFG->enablebadges) && $iscurrentuser &&
|
||||
has_capability('moodle/badges:manageownbadges', context_user::instance($USER->id))) {
|
||||
$url = new moodle_url('/badges/mybadges.php');
|
||||
$usernode->add(get_string('mybadges', 'badges'), $url, self::TYPE_SETTING);
|
||||
@@ -2511,7 +2511,7 @@ class global_navigation extends navigation_node {
|
||||
}
|
||||
|
||||
//Badges
|
||||
if ($CFG->enablebadges && has_capability('moodle/badges:viewbadges', $this->page->context)) {
|
||||
if (!empty($CFG->enablebadges) && has_capability('moodle/badges:viewbadges', $this->page->context)) {
|
||||
$url = new moodle_url($CFG->wwwroot . '/badges/view.php', array('type' => 1));
|
||||
$coursenode->add(get_string('sitebadges', 'badges'), $url, navigation_node::TYPE_CUSTOM);
|
||||
}
|
||||
|
||||
+1
-1
@@ -408,7 +408,7 @@ class plugin_manager {
|
||||
),
|
||||
|
||||
'block' => array(
|
||||
'activity_modules', 'admin_bookmarks', 'blog_menu',
|
||||
'activity_modules', 'admin_bookmarks', 'badges', 'blog_menu',
|
||||
'blog_recent', 'blog_tags', 'calendar_month',
|
||||
'calendar_upcoming', 'comments', 'community',
|
||||
'completionstatus', 'course_list', 'course_overview',
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<svg width="150" height="150" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg width="150" height="150" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMid meet">
|
||||
<!-- Created with SVG-edit - http://svg-edit.googlecode.com/ -->
|
||||
<g>
|
||||
<title>Layer 1</title>
|
||||
|
||||
|
Before Width: | Height: | Size: 998 B After Width: | Height: | Size: 1.0 KiB |
+1
-1
@@ -14,7 +14,7 @@
|
||||
id="svg3063"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.3.1 r9886"
|
||||
sodipodi:docname="backpack.svg">
|
||||
sodipodi:docname="backpack.svg" preserveAspectRatio="xMinYMid meet">
|
||||
<defs
|
||||
id="defs3065" />
|
||||
<sodipodi:namedview
|
||||
|
||||
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
Reference in New Issue
Block a user