26 require_once(
"../class/config.php");
29 define(
"NOCSRF",
true);
32 "editfile" => array (
"request",
"string",
""),
33 "texte" => array (
"post",
"string",
""),
34 "save" => array (
"post",
"string",
""),
35 "saveret" => array (
"post",
"string",
""),
36 "cancel" => array (
"post",
"string",
""),
37 "R" => array (
"request",
"string",
""),
48 if (isset($cancel) && $cancel) {
49 include(
"bro_main.php");
53 if (isset($saveret) && $saveret) {
67 $msg->raise(
"INFO",
"bro", _(
"Your file %s has been saved").
" (".
format_date(_(
'%3$d-%2$d-%1$d %4$d:%5$d'),date(
"Y-m-d H:i:s")).
")",
$editfile);
68 include(
"bro_main.php");
72 if (isset($save) && $save) {
74 $msg->raise(
"INFO",
"bro", _(
"Your file %s has been saved").
" (".
format_date(_(
'%3$d-%2$d-%1$d %4$d:%5$d'),date(
"Y-m-d H:i:s")).
")",
$editfile);
78 $addhead[
'css'][]=
'<link rel="stylesheet" href="/javascript/prettify/prettify.css" type="text/css" />';
79 $addhead[
'js'][]=
'<script src="/javascript/prettify/prettify.js" type="text/javascript"></script>';
80 include_once(
"head.php");
85 echo
$msg->msg_html_all();
87 <h3><?php echo _(
"File editing").
" <code>".
ehe(
$R,
false).
"/<b>".
ehe(
$editfile,
false).
"</b></code><br />"; ?></h3>
94 <form action=
"bro_editor.php" method=
"post"><br />
98 <li
class=
"view"><a href=
"#tabsfile-view"><?php
__(
"View"); ?></a></li>
99 <li
class=
"edit"><a href=
"#tabsfile-edit"><?php
__(
"Edit"); ?></a></li>
102 <div
id=
"tabsfile-view">
104 echo
"<pre class='prettyprint' id='file_content_view' >$content</pre>";
108 <div
id=
"tabsfile-edit">
109 <textarea
id=
'file_content_editor' class=
"int" style=
"font-family: <?php echo $p["editor_font
"]; ?>; font-size: <?php echo $p["editor_size
"]; ?>; width: 90%; height: 400px;" name=
"texte"><?php
111 $error=_(
"This file is empty");
117 </div><!-- tabsfile -->
119 <?php
if (!empty(
$error)) echo
"<p class=\"alert alert-danger\">".$error.
"</p>"; ?>
120 <input type=
"hidden" name=
"editfile" value=
"<?php ehe($editfile); ?>" />
121 <input type=
"hidden" name=
"R" value=
"<?php ehe($R); ?>" />
123 <input type=
"submit" class=
"inb" value=
"<?php __("Save
"); ?>" name=
"save" />
124 <input type=
"submit" class=
"inb" value=
"<?php __("Save & Quit
"); ?>" name=
"saveret" />
125 <input type=
"submit" class=
"inb" value=
"<?php __("Quit
"); ?>" name=
"cancel" />
129 <script type=
"text/javascript">
132 $(
"#tabsfile" ).tabs();
134 $(
"#tabsfile-edit" ).tabs(
"option",
"active", 1 );
138 $(
'#tabsfile').on(
'tabsbeforeactivate',
function(event, ui){
139 var b = $(
'#file_content_editor').val();
140 $(
'#file_content_view').text( b );
141 $(
'#file_content_view').removeClass(
'prettyprinted');
147 <?php include_once(
"foot.php"); ?>
if(isset($cancel) && $cancel) if(isset($saveret) && $saveret) if(isset($save) && $save) $addhead['css'][]
ehe($str, $display=TRUE)
Echo the HTMLSpecialChars version of a value.
format_date($format, $date)
ssla($str)
Strip slashes if needed :
getFields($fields, $requestOnly=false)
Get the Fields of the posted form from $_REQUEST or POST or GET and check their type.
csrf_get($return=false)
Give a new CSRF uniq token for a form the session must be up since the CSRF is linked to the session ...