Textes statiques

Capabilities

local/statiguitext:edit : People having this capability at system level can edit the content.

Inserting a Static GUI Text call into moodle code

Developpers can rely on a simple single function call to insert a gui text into their outputs :

require_once($CFG->dirroot.'/local/staticguitexts/lib.php');
$key = '<an unique site wide key>';
$returnurl = new moodle_url($ME);
$extracapability = false;
$textinsert = local_print_static_text($key, $returnurl, $extracapability, true);
echo $textinsert;

returnurl should generally call back the same moodle page the text insert is on. As the Static GUI Text is a generic plugin, it may not kown itself how to return back to the calling page after content editing.

An extra capability can be given at call time, specifying a particular capability to match at system level to edit this text.

Revenir à l'index du composant - Revenir au sommaire des composants