I am having the following setup function, part of my filter:
The 'setup' function is called, but the YUI-Javascript is not loaded/working.
What can be the reason that the Javascript is not loaded/working?
class filter_woordenlijst extends moodle_text_filter {Thanks for your help,
/** @var int $cachecourseid cache invalidation flag in case content from multiple courses displayed. */
protected $cachecourseid = null;
/** @var int $cacheuserid cache invalidation flag in case user is switched. */
protected $cacheuserid = null;
/** @var array $cacheconceptlist page level filter cache, this should be always faster than MUC */
protected $cacheconceptlist = null;
public function setup($page, $context) {
if ($page->requires->should_create_one_time_item_now('filter_woordenlijst_autolinker')) {
$page->requires->yui_module(
'moodle-filter_woordenlijst-autolinker',
'M.filter_woordenlijst.init_filter_autolinking',
array(array('courseid' => 0)));
$page->requires->strings_for_js(array('ok'), 'moodle');
}
}
Peter Meint