File: /var/www/vhosts/onlinedev.com/httpdocs/admin/templates/edit.phtml
<script type="text/javascript" src="include/ckeditor/ckeditor.js"></script>
<div class="head">
<h1>Editer le news</h1>
</div>
<form action="<?php echo App::getUrl('news', 'edit') ?>" name="f" method="post" id="f">
<input type="hidden" name="sent" value="1" />
<input type="hidden" name="id" id="id" value="<?php echo $news->id ?>" />
<input type="hidden" id="created_at" name="created_at" value="<?php echo $news->created_at ?>" />
<input type="hidden" name="parent_id" value="<?php echo $_REQUEST['parent_id'] ? $_REQUEST['parent_id'] : $news->parent_id ?>" />
<table border="0" cellspacing="0" cellpadding="0" class="list4">
<tr>
<th>Titre:</th>
<td><input name="title" type="text" value="<?php echo $news->title; ?>" class="inp1" /></td>
</tr>
<tr>
<th>Lien:</th>
<td>/news/<input type="text" name="url" value="<?php echo $news->url; ?>" />.html</td>
</tr>
<tr class="r1">
<th valign="top">Description:</th>
<td>
<textarea cols="80" class="ckeditor" id="editeur" name="body" rows="10"><?php echo $news->body; ?></textarea>
</td>
</tr>
<tr class="r2">
<td> </td>
<td height="25"><a href="#" title="Envoyer" class="but2" onclick="submitForm()">Envoyer</a></td>
</tr>
</table>
</form>
<script type="text/javascript" src="include/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
function submitForm()
{
if(document.getElementById('id').value > 0) {
if(confirm('Mettre la date du jour ?')) {
if(confirm('Etes vous s�r(e) de vouloir changer la date de cette News ?')) {
document.getElementById('created_at').value='<?php echo date('Y-m-d H:i:s')?>';
}
}
}
document.getElementById('f').submit();
}
tinyMCE.init({
mode: "exact",
elements: "pcontent",
theme : "advanced",
width: 680,
language: "fr",
plugins : "table,advhr,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,paste,directionality,fullscreen,noneditable,contextmenu",
theme_advanced_buttons1_add_before : "save,newdocument,separator",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor,liststyle",
theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
plugin_insertdate_dateFormat : "%Y-%m-%d",
plugin_insertdate_timeFormat : "%H:%M:%S",
extended_valid_elements : "hr[class|width|size|noshade]",
file_browser_callback : "fileBrowserCallBack",
paste_use_dialog : false,
convert_urls: false
});
function fileBrowserCallBack(field_name, url, type, win) {
tinyfck_field = field_name;
tinyfck = win;
window.open("<?php echo App::getBaseUrl() ?>include/tiny_mce/filemanager/browser.html?Connector=connectors/php/connector.php", "tinyfck", "modal,width=600,height=400");
}
</script>