Tfe

Ongi etorri tfe-ren webgunera...

Old stuff/old_sites/epik/include/modifcss.php

(Deskargatu)
<div class="article">
<h2>Modifications css</h2>
<div class="element">

<?
$chemin[2] = preg_replace("/[^\w]/","",$chemin[2]);
$f_css = $_POST['css'];
if ($axx < 3) 
{
    echo "<h2>Erreur</h2>
    <div><p>Vous n'avez pas la permission</p></div></div></div>";
}

else
{
    if (empty($chemin[2]) or !file_exists(dirname(__FILE__)."/../css/$chemin[2].css")) 
	{ 
        echo "<h2>Pas de fichier choisi</h2>
	<div>
	<p>vous devez passer par le menu pour editer un fichier css</p>"; 
        }
    else {
	echo "<h2>Edition de $chemin[2]</h2><div>";
    	if (!empty($f_css)) { 
	    $handle = fopen((dirname(__FILE__)."/../css/".$chemin[2].".css"),"w") or die("fatal");
	    if (fwrite($handle,stripcslashes($_POST['css'])) == false) { echo "<p>error?</p>"; }
	    else { echo "<p>Modification effectuee</p>"; }
	    fclose($handle);
	
	 }
	else 
	{
    echo "<form method=\"post\" action=\"/site/modifcss/$chemin[2]\">";
        $handle = fopen(dirname(__FILE__)."/../css/".$chemin[2].".css","r") or die("eror opening");
        $contenu = fread($handle,filesize("css/$chemin[2].css"));
	$contenu= str_replace("//","/",$contenu);
        fclose($handle);
        echo "
	<p>
        <textarea rows=\"30\" cols=\"70\" name=\"css\">$contenu</textarea></p>
        <p><input class=\"button\" type=\"submit\" value=\"Enregistrer\" /></p>
        ";
        }
    }
    echo "</div></div></div>";
}
?>