21 Commits

Author SHA1 Message Date
Sara Arjona
1cedbd1e19 MDL-74784 core_badges: Fix exception with related badges
System badges with related badges were displaying an error before this patch,
because the is_guest($context) function expects a context_course.
2022-05-18 08:18:33 +02:00
Sara Arjona
bc7dec8c2b MDL-66940 badges: Create page to display badges info
The OBv2.0 specification includes a field "Criteria" for
BadgeClass. Until now, this field was filled using the
URL of the badge assertion, but that is causing some issues
in Badgr because it linked to the badge assertion of the
first user sending this badge to the Badgr backpack (so then,
the following users linked to the first user assertion page
too).

This patch adds a new page, badgeclass.php which will be
used from now to display any badge information which is
not related to any assertion (like happens with the criteria
in BadgeClass).
2022-03-04 12:18:59 +01:00
abgreeve
f1d22c9830 MDL-72930 navigation: Update to badges navigation.
This allows navigation nodes injected into the badges section
to be displayed as either a button or a dropdown url_select.
2022-01-04 15:58:52 +08:00
Peter Dias
96dd6c9c94 MDL-72904 core_badges: Introduce tertiary navigation for badges 2021-12-23 21:02:01 +08:00
Sara Arjona
dc631407b5 MDL-73153 badges: get image when it has more data
In some cases, image might have more fields rather than the URL.
This patch is for taking them into account and displaying the image
and also these information properly.
2021-11-24 10:27:15 +01:00
Sara Arjona
88c31c7551 MDL-72141 badges: simplify external badges page
Apart from reorganising the information displayed in the external badges
page, this information has been moved to reuse the template created in
MDL-71937, to make it easier to modify and maintain.
2021-11-24 09:40:19 +01:00
Paul Holden
374114e0f8 MDL-72857 badges: filter site/course name when showing issued badge. 2021-11-01 10:43:10 +00:00
Sara Arjona
24fcc7ebea MDL-71937 badges: simplify badges page
Apart from reorganising the information displayed in the badges page,
this information has been moved to a template in order to make it
easier to modify and maintain.
2021-08-10 15:59:06 +02:00
sam marshall
5e72715e4f MDL-71099 Lib: Move new user_fields class from core to core_user
This class would belong more appropriately within the 'user' API
(core_user) instead of within the 'core' API, since it is
directly related to user data.

Since the class has only just been added to Moodle, now is a good
time to move it.
2021-03-25 13:47:23 +00:00
Jun Pataleta
5a7c629f7c Merge branch 'MDL-45242-master' of https://github.com/sammarshallou/moodle 2021-03-10 23:39:30 +08:00
sam marshall
558cc1b85e MDL-45242 Lib: Replace calls to deprecated functions
In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
2021-03-10 10:57:10 +00:00
Sara Arjona
49c1d41a60 MDL-70911 core_badges: Remove $CFG->badges_site_backpack
The $CFG->badges_site_backpack setting has been completely removed
because it's not required anymore. From now, the primary site
backpack will be the first one in the "Manage backpacks" list (so,
the one with lower sortorder value).
2021-03-10 09:09:05 +01:00
Sara Arjona
066e998400 MDL-70911 core_badges: Add support to backpacks sortorder
Before removing $CFG->badges_site_backpack setting, admins should be
able to re-order the existing site-backpacks (because then, the first
one will be treated as the default one).
This patch adds the sort order feature to the backpack list.
2021-03-10 08:29:47 +01:00
Sara Arjona
705c94a98b MDL-69054 core_badges: allow editing OBv1.0 backpacks 2020-08-14 17:09:10 +02:00
Sara Arjona
92219c8ffd MDL-69002 core_badges: move backpack validation to a separate page
Instead of running the site backpack validation every time badges/backpacks.php
page is loaded, an action button has been added to the backpacks with OB set
to 2.0 to let admins running manually this verification when needed.
2020-06-10 13:02:44 +02:00
Sara Arjona
a80541ea90 MDL-68567 badges: add/remove site backpacks 2020-05-22 09:01:59 +02:00
Tung Thai
15a00bead1 MDL-66992 core_badges: Add support to Open Badges 2.1 2020-05-17 20:01:55 +07:00
Sara Arjona
d03d11095f MDL-67451 badges: use the site OB version as default 2019-12-04 21:01:09 +01:00
Damyon Wiese
d48a52ddb1 MDL-65518 badges: Admin settings warning
If the backpack is changed to Open Badges V2 backpack,
attempt the authenticate with the site settings and return a warning
if it fails.
2019-05-09 14:56:21 +08:00
Damyon Wiese
1837b1d5fd MDL-63262 badges: Coding style 2019-05-03 15:00:00 +08:00
Damyon Wiese
aae219acce MDL-63262 badges: Add badgr.io
Upgrade the support for Open Badges 2 to support a real open badges 2 backpack.
Moodle can only talk to one backpack at a time, so after switching backpacks, users
will have to manually disconnect and then reconnect their backpack to the new one.

This commit combines several changes:
* Split classes into badges namespace
* Publish expiry data with a badge
* Publish badge alignments in badges exported to the backpack.
* Export the criteria for a badge to the backpack.
2019-05-03 15:00:00 +08:00