Highlight to cookie

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@156 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2007-07-13 07:07:28 +00:00
parent e0cce46ede
commit 166f9b0b63
2 changed files with 4 additions and 3 deletions

View file

@ -11,7 +11,7 @@ function page_header($title) {
<title><?php echo lang('phpMinAdmin') . " - $title"; ?></title> <title><?php echo lang('phpMinAdmin') . " - $title"; ?></title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" /> <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="default.css" /> <link rel="stylesheet" type="text/css" href="default.css" />
<?php if ($_SESSION["highlight"] == "jush") { ?> <?php if ($_COOKIE["highlight"] == "jush") { ?>
<style type="text/css">@import url(http://jush.info/jush.css);</style> <style type="text/css">@import url(http://jush.info/jush.css);</style>
<script type="text/javascript" src="http://jush.info/jush.js" defer="defer"></script> <script type="text/javascript" src="http://jush.info/jush.js" defer="defer"></script>
<script type="text/javascript">window.onload = function () { jush.highlight_tag('pre'); }</script> <script type="text/javascript">window.onload = function () { jush.highlight_tag('pre'); }</script>

View file

@ -1,6 +1,7 @@
<?php <?php
if (isset($_POST["query"])) { if (isset($_POST["query"])) {
$_SESSION["highlight"] = $_POST["highlight"]; setcookie("highlight", $_POST["highlight"], strtotime("+1 month"));
$_COOKIE["highlight"] = $_POST["highlight"];
} }
page_header(lang('SQL command')); page_header(lang('SQL command'));
@ -54,7 +55,7 @@ if ($_POST && $error) {
<input type="hidden" name="token" value="<?php echo $token; ?>" /> <input type="hidden" name="token" value="<?php echo $token; ?>" />
<input type="submit" value="<?php echo lang('Execute'); ?>" /> <input type="submit" value="<?php echo lang('Execute'); ?>" />
<script type="text/javascript"> <script type="text/javascript">
document.write('<label for="highlight"><input type="checkbox" name="highlight" id="highlight" value="jush"<?php echo ($_SESSION["highlight"] == "jush" ? ' checked="checked"' : ''); ?> /><?php echo addcslashes(lang('Syntax highlighting'), "\r\n'\\"); ?></label>'); document.write('<label for="highlight"><input type="checkbox" name="highlight" id="highlight" value="jush"<?php echo ($_COOKIE["highlight"] == "jush" ? ' checked="checked"' : ''); ?> /><?php echo addcslashes(lang('Syntax highlighting'), "\r\n'\\"); ?></label>');
</script> </script>
</p> </p>
</form> </form>