Skip to content

Commit

Permalink
MDL-65893 webservice: format site name (handle language tags etc.)
Browse files Browse the repository at this point in the history
Allow web service clients (like the Moodle App) to benefit from a
formatted (filtered) site name. Select the filtered (localized etc.)
string on server side, before it is sent to the web service client.

For example, this translates a site name which uses language tags in
curly braces when using the filter_multilang2 plugin.

Thanks-To: Juan Leyva <[email protected]>
Thanks-To: Kathrin Osswald <[email protected]>
  • Loading branch information
Nicolas Roeser committed Jun 14, 2019
1 parent 5dae8c0 commit 591ece3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion webservice/externallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,15 @@ public static function get_site_info($serviceshortnames = array()) {
array('serviceshortnames'=>$serviceshortnames));

$context = context_user::instance($USER->id);
$systemcontext = context_system::instance();

$userpicture = new user_picture($USER);
$userpicture->size = 1; // Size f1.
$profileimageurl = $userpicture->get_url($PAGE);

// Site information.
$siteinfo = array(
'sitename' => $SITE->fullname,
'sitename' => external_format_string($SITE->fullname, $systemcontext),
'siteurl' => $CFG->wwwroot,
'username' => $USER->username,
'firstname' => $USER->firstname,
Expand Down

0 comments on commit 591ece3

Please sign in to comment.