$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]]";
$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) . '" />';
}