Skip to content

bfh/moodle-tiny_fontcolor

Repository files navigation

moodle-tiny_fontcolor

Release Moodle Plugin CI PHP Support Moodle Support License GPL-3.0 GitHub contributors

Installation

  • Unzip the contents of the zip archive into the Moodle .../lib/editor/tiny/plugins/fontcolor directory.
  • As a Moodle Admin go to Site Administration -> Plugins -> Text Editors -> TinyMCE editor -> Tiny text color/text background color settings and add a view color names and color codes for at least on of the setting "Available text colors" or "Available text background colors".
  • You may also enable the color picker for text color or background color.

If no colors are available and the color picker is disabled then the menu item and button in the TinyMCE editor will not appear. This is valid for both, the text color setting and the background color setting.

The color name can be an arbitrary string e.g. Red or Dark Green or whatever you name your color. The name can be also the "corporate name" e.g. that is used in any style guides of the corporate identity at your institution.

Colorscheme

If you want a predefined color scheme, then you may add the json from the file colorscheme.json into the settings textcolors and/or backgroundcolors in the plugin settings. This can be done by e.g.

UPDATE config_plugins
SET value = '<json_string>'
WHERE plugin = 'tiny_fontcolor' AND name = 'textcolors';

Multilanguage support

Color names may also use language tags for the color names. Text filters are applied. For example setting black and white with German and English labels would look like this:

[
    {
        "name": "<span class=\"multilang\" lang=\"de\">Schwarz</span><span class=\"multilang\" lang=\"en\">Black</span>",
        "value": "#000000"
    },
    {
        "name": "<span class=\"multilang\" lang=\"de\">Weiss</span><span class=\"multilang\" lang=\"en\">White</span>",
        "value": "#ffffff"
    }
]

The value of the name property can be copied as it is, in the admin settings area.

The name of the color is used as a tooltip in the editor when hovering over the appropriate color square.

Version History

0.5

  • Add support for Moodle 4.4 and PHP 8.3.
  • Add json for a comprehensive color scheme (thanks to Joseph Rézeau).

0.4

  • Add CI stack for Moodle 4.3

0.3

0.2.3

0.2.2

0.2.1

  • Add behat test for the admin settings page and reorganize tests.
  • Remove function str_contains to be PHP7.x compliant.
  • Change maturity of plugin to release candidate.
  • Privacy Provider was added.

0.2.0

Initial release