Diferencia entre revisiones de «Imágenes de emoticones»

De MoodleDocs
m (tidy up)
m (Texto reemplazado: «class="nicetable"» por «class="wikitable"»)
 
(No se muestra una edición intermedia de otro usuario)
Línea 1: Línea 1:
{{Pendiente de traducir}}
{{Pendiente de traducir}}
The list of images that will be used to replace the emoticon text can be defined by a site administrator in ''Settings > Site administration > Appearence > HTML settings''. The images defined here are used by [[Filtro para mostrar emoticones como imágenes]] filter and TinyMCE HTML editor's Insert emoticon popup menu.
La lista de imágenes que serán usadas para remplazar el texto de emoticones puede definirse por un administrador en '' Configuraciones > Administración del sitio > Apariencia > Ajustes HTML''. Las imágenes aquí definidas son usadas por el [[Filtro para mostrar emoticones como imágenes]] y el menú desplegable para insertar emoticones del Editor HTML TinyMCE.
[[Image:emoticon-setting.png|thumb|Emoticon setting page]]
[[Image:emoticon-setting.png|thumb|Página para configurar emoticones]]




== Form table fields ==
== Campos de tabla del formato ==


The form table maps the emoticon characters like <code>:-)</code> 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.
La tabla del formato mapea los caracteres de emoticones como <code>:-)</code> hacia una imagen que será usada para mostrar ese emoticon.Las imágenes pueden ser proporcionadas por el núcleo mismo de Moodle o por algún plugin instalado (como un módulo de actividad, bloque, tema o su plugin local). Por causas de accesibilidad, debe definirse un texto alterno para estas imágenes.


=== Emoticon text ===
=== Texto del emoticon ===


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:
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:
Línea 16: Línea 16:
* It must contain some non-alphanumeric character to prevent from breaking HTML tags in the text
* It must contain some non-alphanumeric character to prevent from breaking HTML tags in the text


=== Image name and component ===
=== Componente y nombre de la imagen ===


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 <code>/pix</code> folder of the given 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 <code>/pix</code> folder of the given component.
Línea 22: Línea 22:
''Example:'' if the image name is set to <code>s/smiley</code> and the image component is set to <code>core</code>, the image file <code>{dirroot}/pix/s/smiley.gif</code> from your Moodle installation folder is used to display that emoticon.
''Example:'' if the image name is set to <code>s/smiley</code> and the image component is set to <code>core</code>, the image file <code>{dirroot}/pix/s/smiley.gif</code> from your Moodle installation folder is used to display that emoticon.


=== Alternative text ===
=== Texto alterno ===


Alternative texts are taken from [[Traducción|paquetes de idioma]] 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).
Alternative texts are taken from [[Traducción|paquetes de idioma]] 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).
Línea 30: Línea 30:
''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


== Custom emoticons ==
== Emoticones personalizados ==


To support your own emoticons, just add another row into the form table. However, if the images and their alternative texts are not available in the Moodle yet, you will have to add them in a form of an installed plugin, typically together with a theme or via your local plugin. The following section illustrates some options how to register emoticons provided by various types of plugins.
To support your own emoticons, just add another row into the form table. However, if the images and their alternative texts are not available in the Moodle yet, you will have to add them in a form of an installed plugin, typically together with a theme or via your local plugin. The following section illustrates some options how to register emoticons provided by various types of plugins.


=== Emoticon provided by activity module ===
=== Emoticon proporcionado por módulo de actividad ===


Let us say we want to use the emoticons system to display [[Módulo de taller] icon instead of <code>(workshopicon)</code> text. As you can see, the icon is located in <code>{dirroot}/mod/workshop/pix/icon.gif</code>. Just add the following row into the emoticons form table:
Let us say we want to use the emoticons system to display [[Módulo de taller] icon instead of <code>(workshopicon)</code> text. As you can see, the icon is located in <code>{dirroot}/mod/workshop/pix/icon.gif</code>. Just add the following row into the emoticons form table:


{| class="nicetable"
{| class="wikitable"
|-
|-
! Text
! Text
Línea 56: Línea 56:
You may want to use the localized term for the Workshop module as the alternative text for that image. Because the Workshop module already contains a string that we can use, just add the following values into the last two columns of the table and save the changes again:
You may want to use the localized term for the Workshop module as the alternative text for that image. Because the Workshop module already contains a string that we can use, just add the following values into the last two columns of the table and save the changes again:


{| class="nicetable"
{| class="wikitable"
|-
|-
! Text
! Text
Línea 70: Línea 70:
|}
|}


=== Emoticon provided by installed theme ===
=== Emoticon proporcionado por tema instalado ===


[https://docs.moodle.org/dev/Themes_2.0 Themes in Moodle 2.0] are able to override any standard image provided by the Moodle core by default. So if a file <code>{themedir}/pix_core/s/biggrin.*</code> exists it is automatically used instead of standard <code>{dirroot}/pix/s/biggrin.*</code>. Themes like any other plugins are also able to extend the standard emoticon set or change the file names or their directories.
[https://docs.moodle.org/dev/Themes_2.0 Themes in Moodle 2.0] are able to override any standard image provided by the Moodle core by default. So if a file <code>{themedir}/pix_core/s/biggrin.*</code> exists it is automatically used instead of standard <code>{dirroot}/pix/s/biggrin.*</code>. Themes like any other plugins are also able to extend the standard emoticon set or change the file names or their directories.
Línea 76: Línea 76:
Let us say you have installed a theme named <code>mychool</code> that comes with its own set of standard emoticons. Those emoticons must be located in the <code>/pix</code> subfolder of that theme, for example in <code>{themedir}/pix/smilies/happy.png</code>. Now you want to use the emoticons provided by this theme instead of the default Moodle emoticon set. Just replace the relevant rows in the table with the new values:
Let us say you have installed a theme named <code>mychool</code> that comes with its own set of standard emoticons. Those emoticons must be located in the <code>/pix</code> subfolder of that theme, for example in <code>{themedir}/pix/smilies/happy.png</code>. Now you want to use the emoticons provided by this theme instead of the default Moodle emoticon set. Just replace the relevant rows in the table with the new values:


{| class="nicetable"
{| class="wikitable"
|-
|-
! Text
! Text
Línea 92: Línea 92:
Note that we replaced just the image name and component. So the alternative text will be taken from the core language pack which is probably already localized into many languages.
Note that we replaced just the image name and component. So the alternative text will be taken from the core language pack which is probably already localized into many languages.


=== Preparing own set of emoticons ===
=== Preparar su propio conjunto de emoticones ===


If you have a set of images you would like to use as emoticons at your site, we recommend you to prepare a local plugin that will just provided these emoticons, without any other functionality. Even though this way involves a bit more work at the beginning, it is preferable over direct modification of the standard Moodle files. By encapsulating your emoticon with a local plugin, you can safely upgrade your site without the risk of overwriting your modifications, deploy the local plugin at multiple servers and share your work easily with the others.
If you have a set of images you would like to use as emoticons at your site, we recommend you to prepare a local plugin that will just provided these emoticons, without any other functionality. Even though this way involves a bit more work at the beginning, it is preferable over direct modification of the standard Moodle files. By encapsulating your emoticon with a local plugin, you can safely upgrade your site without the risk of overwriting your modifications, deploy the local plugin at multiple servers and share your work easily with the others.

Revisión actual - 15:23 10 ago 2021

Nota: Pendiente de Traducir. ¡Anímese a traducir esta página!.     ( y otras páginas pendientes)

La lista de imágenes que serán usadas para remplazar el texto de emoticones puede definirse por un administrador en Configuraciones > Administración del sitio > Apariencia > Ajustes HTML. Las imágenes aquí definidas son usadas por el Filtro para mostrar emoticones como imágenes y el menú desplegable para insertar emoticones del Editor HTML TinyMCE.

Página para configurar emoticones


Campos de tabla del formato

La tabla del formato mapea los caracteres de emoticones como :-) hacia una imagen que será usada para mostrar ese emoticon.Las imágenes pueden ser proporcionadas por el núcleo mismo de Moodle o por algún plugin instalado (como un módulo de actividad, bloque, tema o su plugin local). Por causas de accesibilidad, debe definirse un texto alterno para estas imágenes.

Texto del emoticon

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

Componente y nombre de la imagen

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.

Texto alterno

Alternative texts are taken from paquetes de idioma 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

Emoticones personalizados

To support your own emoticons, just add another row into the form table. However, if the images and their alternative texts are not available in the Moodle yet, you will have to add them in a form of an installed plugin, typically together with a theme or via your local plugin. The following section illustrates some options how to register emoticons provided by various types of plugins.

Emoticon proporcionado por módulo de actividad

Let us say we want to use the emoticons system to display [[Módulo de taller] icon instead of (workshopicon) text. As you can see, the icon is located in {dirroot}/mod/workshop/pix/icon.gif. Just add the following row into the emoticons form table:

Text Image name Image component Alternative text
(workshopicon) icon mod_workshop

Save changes in the form and the icon should appear at the end of the row. If you have the emoticon filter enabled, whenever you or your users type (workshopicon) in the text, it will be replaced with the image.

You may want to use the localized term for the Workshop module as the alternative text for that image. Because the Workshop module already contains a string that we can use, just add the following values into the last two columns of the table and save the changes again:

Text Image name Image component Alternative text
(workshopicon) icon mod_workshop modulename mod_workshop

Emoticon proporcionado por tema instalado

Themes in Moodle 2.0 are able to override any standard image provided by the Moodle core by default. So if a file {themedir}/pix_core/s/biggrin.* exists it is automatically used instead of standard {dirroot}/pix/s/biggrin.*. Themes like any other plugins are also able to extend the standard emoticon set or change the file names or their directories.

Let us say you have installed a theme named mychool that comes with its own set of standard emoticons. Those emoticons must be located in the /pix subfolder of that theme, for example in {themedir}/pix/smilies/happy.png. Now you want to use the emoticons provided by this theme instead of the default Moodle emoticon set. Just replace the relevant rows in the table with the new values:

Text Image name Image component Alternative text
:-) smilies/happy theme_myschool smiley core_pix

Note that we replaced just the image name and component. So the alternative text will be taken from the core language pack which is probably already localized into many languages.

Preparar su propio conjunto de emoticones

If you have a set of images you would like to use as emoticons at your site, we recommend you to prepare a local plugin that will just provided these emoticons, without any other functionality. Even though this way involves a bit more work at the beginning, it is preferable over direct modification of the standard Moodle files. By encapsulating your emoticon with a local plugin, you can safely upgrade your site without the risk of overwriting your modifications, deploy the local plugin at multiple servers and share your work easily with the others.

Writing a local plugin that provides a set of emoticons is not hard even if you are not experienced PHP developers. You can use a published example as a scaffold for your own work.