MDL-22061 workaround for missing alttext of some emoticons
This commit is contained in:
+6
-1
@@ -5905,7 +5905,12 @@ class amos_string_manager implements string_manager {
|
||||
$string = $this->load_component_strings($component, $lang);
|
||||
|
||||
if (!isset($string[$identifier])) {
|
||||
if ($identifier !== 'parentlanguage' and $component !== 'pix') {
|
||||
if ($component === 'pix' or $component === 'core_pix') {
|
||||
// this component contains only alt tags for emoticons,
|
||||
// not all of them are supposed to be defined
|
||||
return '';
|
||||
}
|
||||
if ($identifier !== 'parentlanguage') {
|
||||
debugging("Invalid get_string() identifier: '$identifier' or component '$component'", DEBUG_DEVELOPER);
|
||||
}
|
||||
return "[[$identifier]]";
|
||||
|
||||
+3
-1
@@ -1628,7 +1628,9 @@ function replace_smilies(&$text) {
|
||||
$img[$lang] = array();
|
||||
foreach ($emoticons as $emoticon => $image){
|
||||
$alttext = get_string($image, 'pix');
|
||||
$alttext = preg_replace('/^\[\[(.*)\]\]$/', '$1', $alttext); /// Clean alttext in case there isn't lang string for it.
|
||||
if ($alttext === '') {
|
||||
$alttext = $image;
|
||||
}
|
||||
$e[$lang][] = $emoticon;
|
||||
$img[$lang][] = '<img alt="'. $alttext .'" width="15" height="15" src="'. $OUTPUT->pix_url('s/' . $image) . '" />';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user