View file www/adm/admin/red_menu.php

File size: 963B
<?php
Defined('ADMIN_S_S') or die ('Доступ запрещен!!!');
echo
'<span class="ramka">
Редактировать меню.
</span><br />';

if ($_POST['pokas'] != 1)
{
$fp = fopen ($cms.'menu/menu.txt', "r");
$buffer = fread($fp, filesize($cms.'menu/menu.txt'));
fclose ($fp);
$buffer = str_replace('<!--//line//-->',"\r\n",$buffer);
echo
'
<form name="" action="" method="post">
<textarea name="menu" rows=15 cols=60>'.$buffer.'</textarea>
<input name="pokas" type="hidden" value="1">
<br />
<input class="knopka" type="submit" value="Изменить">
</form>
';
}
else
{
 $buffer = $_POST['menu'];
 $buffer = str_replace('\"','"',$buffer);
 $buffer = str_replace('\'','"',$buffer);
 $buffer = str_replace("\r\n",'<!--//line//-->',$buffer);
 $fp = fopen ($cms.'menu/menu.txt', "w+");
 fwrite ($fp, stripslashes($buffer));
 fclose ($fp);
 echo '
   <span class="ramka">
   Успешно!
   </span>
   <META HTTP-EQUIV="Refresh" CONTENT="1;">
   ';
}


?>