<?php
/*
*
*
* Delete file
*
*/
if(@$_GET['delete'] && is_numeric($_GET['delete']))
{
$id = $_GET['delete'];
require_once('core.class.php');
$editor = new Editor();
$editor->delete($id);
}
/*
*
* Edit file
*
*
*/
else if(@$_GET['edit'] && is_numeric($_GET['edit']))
{
$id = $_GET['edit'];
require_once('core.class.php');
$editor = new Editor();
?>
<script type="text/javascript" src="js/nicEdit.js"></script>
<script type="text/javascript">
bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
</script>
<form action="" method="post">
<textarea name="content" cols="100" rows="20">
<?php
$editor->Read($id);
?>
</textarea>
<input type="hidden" name="id" value="<?php echo $editor->id; ?>">
<input type="hidden" name="send">
<input type="submit" value="Update">
</form>
<?php
if(isset($_POST['send'])){
require_once('core.class.php');
$id = $_POST['id'];
$conteudo = $_POST['content'];
$update = new Editor();
$update->update($id, $conteudo);
}
?>
<?php
}
?>
|