]> git.mjollnir.org Git - moodle.git/commitdiff
admin block: MDL-16693 fix todo.
authortjhunt <tjhunt>
Fri, 17 Jul 2009 07:46:04 +0000 (07:46 +0000)
committertjhunt <tjhunt>
Fri, 17 Jul 2009 07:46:04 +0000 (07:46 +0000)
blocks/admin_tree/block_admin_tree.php

index 30308eaea83b4a27c56ee5dc9bc2a28d68713095..40bebb0f46fe103e0e52fbd921bb91fb3e6364f4 100644 (file)
@@ -16,8 +16,6 @@ class block_admin_tree extends block_base {
         $this->currentdepth = 0;
         $this->divcounter = 1;
         $this->tempcontent = '';
-        global $PAGE; // TODO change this when there is a proper way for blocks to get stuff into head.
-        $PAGE->requires->yui_lib('event');
     }
 
     function applicable_formats() {
@@ -139,6 +137,7 @@ class block_admin_tree extends block_base {
         }
 
         if ($this->tempcontent !== '') {
+            $this->page->requires->yui_lib('event');
             $this->page->requires->js('blocks/admin_tree/admintree.js');
             $this->page->requires->js_function_call('admin_tree.init',
                     array($this->divcounter - 1, $this->expandnodes,