Skip to content

Commit

Permalink
MDL-61573 user: Changes to pix path for better support of fa mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Kathrin84 committed Sep 18, 2018
1 parent 674ef9b commit df8eec5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
6 changes: 3 additions & 3 deletions admin/settings/appearance.php
Expand Up @@ -32,9 +32,9 @@
'customusermenuitems',
new lang_string('customusermenuitems', 'admin'),
new lang_string('configcustomusermenuitems', 'admin'),
'grades,grades|/grade/report/mygrades.php|grades
messages,message|/message/index.php|message
preferences,moodle|/user/preferences.php|preferences',
'grades,grades|/grade/report/mygrades.php|t/grades
messages,message|/message/index.php|t/message
preferences,moodle|/user/preferences.php|t/preferences',
PARAM_RAW,
'50',
'10'
Expand Down
2 changes: 1 addition & 1 deletion lang/en/admin.php
Expand Up @@ -192,7 +192,7 @@
-Moodle development|https://moodle.org/development
Moodle.com|http://moodle.com/
</pre>';
$string['configcustomusermenuitems'] = 'You can configure the contents of the user menu (with the exception of the log out link, which is automatically added). Each line is separated by pipe characters and consists of 1) a string in "langstringname, componentname" form or as plain text, 2) a URL, and 3) an icon either as a pix icon (in the folder pix/t, or prefix the icon name with ../ if icon is in another pix folder) or as a URL. Dividers can be used by adding a line of one or more # characters where desired.';
$string['configcustomusermenuitems'] = 'You can configure the contents of the user menu (with the exception of the log out link, which is automatically added). Each line is separated by pipe characters and consists of 1) a string in "langstringname, componentname" form or as plain text, 2) a URL, and 3) an icon either as a pix icon (in the folder pix with the structure [subfoldername]/[iconname], e.g. i/publish) or as a URL. Dividers can be used by adding a line of one or more # characters where desired.';
$string['configdbsessions'] = 'If enabled, this setting will use the database to store information about current sessions. Note that changing this setting now will log out all current users (including you). If you are using MySQL please make sure that \'max_allowed_packet\' in my.cnf (or my.ini) is at least 4M. Other session drivers can be configured directly in config.php, see config-dist.php for more information. This option disappears if you specify session driver in config.php file.';
$string['configdebug'] = 'If you turn this on, then PHP\'s error_reporting will be increased so that more warnings are printed. This is only useful for developers.';
$string['configdebugdisplay'] = 'Set to on, the error reporting will go to the HTML page. This is practical, but breaks XHTML, JS, cookies and HTTP headers in general. Set to off, it will send the output to your server logs, allowing better debugging. The PHP setting error_log controls which log this goes to.';
Expand Down
12 changes: 11 additions & 1 deletion user/lib.php
Expand Up @@ -753,7 +753,17 @@ function user_convert_text_to_menu_items($text, $page) {
$child->pix = $pixpath;
} else {
// Check for the specified image existing.
$pixpath = "t/" . $bits[2];
if (strpos($bits[2], '../') === 0) {
// The string starts with '../'.
// Strip off the first three characters - this should be the pix path.
$pixpath = substr($bits[2], 3);
} else if (strpos($bits[2], '/') === false) {
// There is no / in the path. Prefix it with 't/', which is the default path.
$pixpath = "t/{$bits[2]}";
} else {
// There is a '/' in the path - this is either a URL, or a standard pix path with no changes required.
$pixpath = $bits[2];
}
if ($page->theme->resolve_image_location($pixpath, 'moodle', true)) {
// Use the image.
$child->pix = $pixpath;
Expand Down

0 comments on commit df8eec5

Please sign in to comment.