Skip to content

Commit

Permalink
MDL-8364 moved javascript into print_header
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jan 30, 2007
1 parent 39de90a commit 9d17f1d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions blog/tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

$error = '';

$script = '';
switch ($action) {
/// Adding an official tag from submitted value
case 'addofficial':
Expand Down Expand Up @@ -56,11 +57,13 @@
}

/// 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>';
}

Expand Down Expand Up @@ -105,7 +108,8 @@
}

/// 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.') {
Expand All @@ -121,7 +125,7 @@
}
i++;
}
//]]>
</script>';
}

Expand All @@ -135,7 +139,7 @@


/// Print the table.
print_header();
print_header (get_string('tagmanagement'), '', '', '', $script);
include_once('tags.html');
print_footer();

Expand Down

0 comments on commit 9d17f1d

Please sign in to comment.