]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-8364 moved javascript into print_header
authorskodak <skodak>
Tue, 30 Jan 2007 21:41:52 +0000 (21:41 +0000)
committerskodak <skodak>
Tue, 30 Jan 2007 21:41:52 +0000 (21:41 +0000)
blog/tags.php

index 3345851b9f7142c34e4aac2713d3c06e95106d18..2f133b6a0181f958b1b0c27492d19e707326a9fd 100755 (executable)
@@ -20,6 +20,7 @@ $sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID);
 
 $error = '';
 
+$script = '';
 switch ($action) {
     /// Adding an official tag from submitted value
     case 'addofficial':
@@ -56,11 +57,13 @@ switch ($action) {
             }
 
             /// Write newly added tags back into window opener.
-            echo '<script type="text/javascript">
+            $script = '<script type="text/javascript">
+//<![CDATA[
             var o = opener.document.createElement("option");
             o.innerHTML = "<option>'.$tag->text.'</option>";
             o.value = '.$tagid.';
             opener.document.entry[\'otags[]\'].insertBefore(o, null);
+//]]>
             </script>';
         }
 
@@ -105,7 +108,8 @@ switch ($action) {
                 }
 
                 /// Remove parent window option via javascript.
-                echo '<script>
+                $script = '<script>
+//<![CDATA[
                 var i=0;
                 while (i < window.opener.document.entry[\'otags[]\'].length) {
                     if (window.opener.document.entry[\'otags[]\'].options[i].value == '.$tagid.') {
@@ -121,7 +125,7 @@ switch ($action) {
                     }
                     i++;
                 }
-
+//]]>
                 </script>';
             }
 
@@ -135,7 +139,7 @@ switch ($action) {
 
 
 /// Print the table.
-print_header();
+print_header (get_string('tagmanagement'), '', '', '', $script);
 include_once('tags.html');
 print_footer();