Merge branch 'MDL-46867' of git://github.com/timhunt/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 25 Aug 2014 23:37:34 +0000 (01:37 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 25 Aug 2014 23:37:34 +0000 (01:37 +0200)
filter/glossary/filter.php

index 016efd6..5c4ba44 100644 (file)
@@ -41,15 +41,12 @@ class filter_glossary extends moodle_text_filter {
     protected $cacheconceptlist = null;
 
     public function setup($page, $context) {
-        // This only requires execution once per request.
-        static $jsinitialised = false;
-        if (empty($jsinitialised)) {
+        if ($page->requires->should_create_one_time_item_now('filter_glossary_autolinker')) {
             $page->requires->yui_module(
                     'moodle-filter_glossary-autolinker',
                     'M.filter_glossary.init_filter_autolinking',
                     array(array('courseid' => 0)));
             $page->requires->strings_for_js(array('ok'), 'moodle');
-            $jsinitialised = true;
         }
     }