пишу и он создает новый материал, а мне нужно сохранить изменения!
<script type="text/javascript">
Joomla.submitbutton = function(task) {
if (task == 'article.cancel' || document.formvalidator.isValid(document.id('adminForm'))) {
<?php echo $this->form->getField('articletext')->save(); ?>
Joomla.submitform(task);
} else {
alert('<?php echo $this->escape(JText::_('JGLOBAL_VALIDATION_FORM_FAILED'));?>');
}
}
</script>
<div class="edit item-page<?php echo $this->escape($params->get('pageclass_sfx')); ?>">
<?php if ($params->get('show_page_heading', 1)) : ?>
<h1 class="componentheading">
<?php echo $this->escape($params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<form action="<?php echo JRoute::_('index.php?option=com_content'); ?>" method="post" name="adminForm" id="adminForm" class="form-validate">
<fieldset>
<div class="editor-container">
<?php echo $this->form->getInput('articletext'); ?>
</div>
<div class="edit-title">
<?php echo $this->form->getLabel('title'); ?>
<?php echo $this->form->getInput('title'); ?>
</div>
<?php if (is_null($this->item->id)):?>
<div class="formelm">
<?php echo $this->form->getLabel('alias'); ?>
<?php echo $this->form->getInput('alias'); ?>
</div>
<?php endif; ?>
<div class="save">
<button type="button" class="button" onclick="submitbutton('article.save')">
<?php echo JText::_('JSAVE')?>
</button>
<button type="button" class="button" onclick="submitbutton('article.cancel')">
<?php echo JText::_('JCANCEL')?>
</button>
</div>
<div class="editor-container">
<?php echo $this->form->getInput('text'); ?>
</div>
</fieldset>
<fieldset>
<legend><?php echo JText::_('COM_CONTENT_PUBLISHING'); ?></legend>
<div class="sect_cat">
<?php echo $this->form->getLabel('catid'); ?>
<?php echo $this->form->getInput('catid'); ?>
</div>
<div class="sect_cat">
<?php echo $this->form->getLabel('created_by_alias'); ?>
<?php echo $this->form->getInput('created_by_alias'); ?>
</div>
<?php if ($this->user->authorise('core.edit.state', 'com_content.article.'.$this->item->id)): ?>
<div class="sect_cat">
<?php echo $this->form->getLabel('state'); ?>
<?php echo $this->form->getInput('state'); ?>
</div>
<div class="sect_cat">
<?php echo $this->form->getLabel('featured'); ?>
<?php echo $this->form->getInput('featured'); ?>
</div>
<div class="sect_cat">
<?php echo $this->form->getLabel('publish_up'); ?>
<?php echo $this->form->getInput('publish_up'); ?>
</div>
<div class="sect_cat">
<?php echo $this->form->getLabel('publish_down'); ?>
<?php echo $this->form->getInput('publish_down'); ?>
</div>
<?php endif; ?>
<div class="sect_cat">
<?php echo $this->form->getLabel('access'); ?>
<?php echo $this->form->getInput('access'); ?>
</div>
<?php if (is_null($this->item->id)):?>
<div class="form-note">
<p><?php echo JText::_('COM_CONTENT_ORDERING'); ?></p>
</div>
<?php endif; ?>
</fieldset>
<fieldset>
<legend><?php echo JText::_('JFIELD_LANGUAGE_LABEL'); ?></legend>
<div class="sect_cat">
<?php echo $this->form->getLabel('language'); ?>
<?php echo $this->form->getInput('language'); ?>
</div>
</fieldset>
<fieldset class="metadata">
<legend><?php echo JText::_('COM_CONTENT_METADATA'); ?></legend>
<div class="general_row">
<?php echo $this->form->getLabel('metadesc'); ?>
<?php echo $this->form->getInput('metadesc'); ?>
</div>
<div class="general_row">
<?php echo $this->form->getLabel('metakey'); ?>
<?php echo $this->form->getInput('metakey'); ?>
</div>
<input type="hidden" name="task" value="" />
<?php echo JHTML::_( 'form.token' ); ?>
</fieldset>
</form>
</div>