summaryrefslogtreecommitdiffstats
path: root/usr/local/www/edit.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-07-02 05:13:16 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-07-02 05:13:16 +0000
commit2e8eada098c43e53c79a2aa9a4627267006b9a26 (patch)
tree00b22ccf1f884bdbbeaaf8ab9e9e912afde5007f /usr/local/www/edit.php
parent540b0ca74bc19669c7e03c65c1e62a5795c9b232 (diff)
downloadpfsense-2e8eada098c43e53c79a2aa9a4627267006b9a26.zip
pfsense-2e8eada098c43e53c79a2aa9a4627267006b9a26.tar.gz
Add source code highlighting support
Diffstat (limited to 'usr/local/www/edit.php')
-rwxr-xr-xusr/local/www/edit.php31
1 files changed, 29 insertions, 2 deletions
diff --git a/usr/local/www/edit.php b/usr/local/www/edit.php
index a9f45a1..e8a1949 100755
--- a/usr/local/www/edit.php
+++ b/usr/local/www/edit.php
@@ -36,6 +36,12 @@ if (($_POST['submit'] == "Load") && file_exists($_POST['savetopath'])) {
fclose($fd);
$edit_area="";
$loadmsg = "Loaded text from " . $_POST['savetopath'];
+ if(stristr($_POST['savetopath'], ".php" == true)
+ $language = "php";
+ else if(stristr($_POST['savetopath'], ".sh" == true)
+ $language = "php";
+ else if(stristr($_POST['savetopath'], ".xml" == true)
+ $language = "xml";
} else if (($_POST['submit'] == "Save")) {
conf_mount_rw();
$content = ereg_replace("\r","",$_POST['content']) ;
@@ -97,9 +103,30 @@ $arrDT = localtime();
$intYear = $arrDT[5] + 1900;
$pgtitle = "Diagnostics: Edit File";
-include("head.inc");
?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <title><?=gentitle($pgtitle);?></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <link rel="stylesheet" type="text/css" href="/niftycssCode.css">
+ <link rel="stylesheet" type="text/css" href="/niftycssprintCode.css" media="print">
+ <link href="gui.css" rel="stylesheet" type="text/css">
+ <link type="text/css" rel="stylesheet" href="SyntaxHighlighter.css"></link>
+ <script type="text/javascript" src="/niftyjsCode.js"></script>
+ <style>
+ /* @import url(SyntaxHighlighter.css); */
+
+ body {
+ font-family: Arial;
+ font-size: 12px;
+ }
+ </style>
+
+</head>
+
+
<script language="Javascript">
function sf() { document.forms[0].savetopath.focus(); }
</script>
@@ -120,7 +147,7 @@ function sf() { document.forms[0].savetopath.focus(); }
</tr>
<tr>
<td valign="top" class="label">
- <textarea rows="<?php echo $rows; ?>" cols="<?php echo $cols; ?>" name="content"><?php echo htmlentities($content); ?></textarea><br>
+ <textarea name="code" language="{$language}" rows="<?php echo $rows; ?>" cols="<?php echo $cols; ?>" name="content"><?php echo htmlentities($content); ?></textarea><br>
<p>
</td>
</tr>
OpenPOWER on IntegriCloud