]> git.mjollnir.org Git - moodle.git/commitdiff
MOre fixes to remove erros due to JS
authormoodler <moodler>
Fri, 6 Oct 2006 05:28:57 +0000 (05:28 +0000)
committermoodler <moodler>
Fri, 6 Oct 2006 05:28:57 +0000 (05:28 +0000)
blocks/admin_tree/block_admin_tree.php

index 39eddc04c1c5c610d296fa213805eed6b2b9d90b..ed2f377d01f1b34dc69b0093c60bae8f2966f0f4 100644 (file)
@@ -123,7 +123,8 @@ class block_admin_tree extends block_base {
 
         if ($this->tempcontent !== '') {
             $this->content = new stdClass;
-            $this->content->text = '<script type="text/javascript">' . "\n\n";
+            $this->content->text  = '<script type="text/javascript">'."\n";
+            $this->content->text .= '<!--' . "\n";
             $this->content->text .= 'var vh_numspans = ' . ($this->spancounter - 1) . ';' . "\n";
             $this->content->text .= 'var vh_content = new Array();' . "\n";
             $this->content->text .= 'function getspan(spanid) {' . "\n";
@@ -166,11 +167,12 @@ class block_admin_tree extends block_base {
             $this->content->text .= '}' . "\n";
 
             $this->content->text .= 'function collapseall() {' . "\n";
-            $this->content->text .= '  for (i = vh_numspans; i > 0; i--) {' . "\n";
+            $this->content->text .= '  for (i = vh_numspans; i > 0; i=i-1 ) {' . "\n";
             $this->content->text .= '    collapse("vh_span" + String(i));' . "\n";
             $this->content->text .= '  }' . "\n";
             $this->content->text .= '}' . "\n";
 
+            $this->content->text .= '-->' . "\n";
             $this->content->text .= '</script>' . "\n";
             $this->content->text .= '<div align="left">' . "\n";
 
@@ -178,9 +180,11 @@ class block_admin_tree extends block_base {
 
             $this->content->text .= '</div>' . "\n";
             $this->content->text .= '<script type="text/javascript">' . "\n";
+            $this->content->text .= '<!--' . "\n";
             $this->content->text .= 'collapseall();' . "\n";
             $this->content->text .= $this->expandjavascript;
 
+            $this->content->text .= '-->' . "\n";
             $this->content->text .= '</script>' . "\n";
 
             $searchcontent = isset($CFG->adminsearchquery) ? $CFG->adminsearchquery : '';