Aquesta pàgina forma part de la documentació de Moodle en català, tot i que no ha estat traduïda encara. Podeu contribuir obertament a les tasques de traducció. Podeu consultar la Guia d'edició de la documentació i també participar ens els debats del fòrum de traductors de la documentació a moodle.org

Emoticon images: diferència entre les revisions

De MoodleDocs
Salta a:navegació, cerca
m (New page: {{Moodle 2.0}} The list of images that will be used to replace the emoticon text can be defined at HTML settings admin page. The images defined here are used by [[Display emoticons as...)
 
mCap resum de modificació
Línia 29: Línia 29:


'''Technical note:''' these two values are passed as the parameters to the <code>get_string()</code> function to obtain the alternative text
'''Technical note:''' these two values are passed as the parameters to the <code>get_string()</code> function to obtain the alternative text
[[Category:Administrator]]

Revisió del 09:50, 2 nov 2010

Plantilla:Moodle 2.0

The list of images that will be used to replace the emoticon text can be defined at HTML settings admin page. The images defined here are used by Display emoticons as images filter and TinyMCE HTML editor's Insert emoticon popup menu.

Emoticon setting page

Form table fields

The form table maps the emoticon characters like :-) to an image that will be used to display that emoticon. Images can be provided either by the Moodle core itself or by any other installed plugin (like an activity module, block, theme or your plocal plugin). For accessibility reasons, alternative texts for these images should be defined, too.

Emoticon text

Into the first column, insert the text representation of the emoticon. The emoticon filter converts these texts into images. The text must pass the following constraints:

  • It must be at least two characters long
  • It can not contain :/ and // substring to avoid accidental breaking of URL addresses
  • It must contain some non-alphanumeric character to prevent from breaking HTML tags in the text

Image name and component

The default set of emoticons are provided by Moodle core itself. In that case, the image component is set to core. The image name is a relative path to a file without the trailing slash and without the file extension. The image must be located in the /pix folder of the given component.

Example: if the image name is set to s/smiley and the image component is set to core, the image file {dirroot}/pix/s/smiley.gif from your Moodle installation folder is used to display that emoticon.

Alternative text

Alternative texts are taken from language packs that can be again provided by either the core or a plugin. The first field value is the string identifier and the second field value is the name of the component providing that string (see the language packs documentation for details).

Example: if the emoticon has the alternative text set to smiley and core_pix, then the localized text will be obtained from the file {dataroot}/lang/XX/pix.php where XX is the current language code. If that translation is available, the value from the English pack {dirroot}/lang/en/pix.php will be used.

Technical note: these two values are passed as the parameters to the get_string() function to obtain the alternative text