<?php
JHtml::_('behavior.tabstate');
JHtml::_('behavior.keepalive');
JHtml::_('behavior.calendar');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.modal', 'a.modal_jform_contenthistory');
// Create shortcut to parameters.
$params = $this->state->get('params');
// This checks if the editor config options have ever been saved. If they haven't they will fall back to the original settings.
$editoroptions = isset($params->show_publishing_options);
if (!$editoroptions)
{
$params->show_urls_images_frontend = '0';
}
JFactory::getDocument()->addScriptDeclaration("
Joomla.submitbutton = function(task)
{
if (task == 'article.cancel' || document.formvalidator.isValid(document.getElementById('adminForm')))
{
" . $this->form->getField('articletext')->save() . "
Joomla.submitform(task);
}
}
");
?>
<div class="edit item-page
<?php echo $this->pageclass_sfx; ?>">
<?php if ($params->get('show_page_heading')) : ?>
<div class="page-header">
<h1>
<?php echo $this->escape($params->get('page_heading')); ?> </h1>
</div>
<?php endif; ?>
<form action="
<?php echo JRoute
::_
('index.php?option=com_govarticle&a_id=' . (int
) $this->item->id); ?>" method="post" name="adminForm" id="adminForm" class="form-validate form-vertical">
<div class="btn-toolbar">
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="Joomla.submitbutton('article.save')">
<span class="icon-ok"></span>
<?php echo JText
::_
('JSAVE') ?> </button>
</div>
<div class="btn-group">
<button type="button" class="btn" onclick="Joomla.submitbutton('article.cancel')">
<span class="icon-cancel"></span>
<?php echo JText
::_
('JCANCEL') ?> </button>
</div>
<?php if ($params->get('save_history', 0)) : ?>
<div class="btn-group">
<?php echo $this->form->getInput('contenthistory'); ?> </div>
<?php endif; ?>
</div>
<fieldset>
<!--ZAKLADKI GORA-->
<ul class="nav nav-tabs">
<li class="active"><a href="#editor" data-toggle="tab">
<?php echo JText
::_
('COM_GOVARTICLE_ARTICLE_CONTENT') ?></a></li>
<?php if ($params->get('show_urls_images_frontend') ) : ?>
<li><a href="#images" data-toggle="tab">
<?php echo JText
::_
('COM_GOVARTICLE_IMAGES_AND_URLS') ?></a></li>
<?php endif; ?>
<?php foreach ($this->form->getFieldsets('params') as $name => $fieldSet) : ?>
<li><a href="#params-
<?php echo $name; ?>" data-toggle="tab">
<?php echo JText
::_
($fieldSet->label); ?></a></li>
<?php endforeach; ?>
<li><a href="#publishing" data-toggle="tab">
<?php echo JText
::_
('COM_GOVARTICLE_PUBLISHING') ?></a></li>
<li><a href="#language" data-toggle="tab">
<?php echo JText
::_
('JFIELD_LANGUAGE_LABEL') ?></a></li>
<li><a href="#metadata" data-toggle="tab">
<?php echo JText
::_
('COM_GOVARTICLE_METADATA') ?></a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="editor">
<?php echo $this->form->renderField('title'); ?>
<?php if (is_null($this->item->id)) : ?> <?php echo $this->form->renderField('alias'); ?> <?php endif; ?>
<?php echo $this->form->getInput('articletext'); ?> </div>
<?php if ($params->get('show_urls_images_frontend')): ?>
<div class="tab-pane" id="images">
<?php echo $this->form->renderField('image_intro', 'images'); ?> <?php echo $this->form->renderField('image_intro_alt', 'images'); ?> <?php echo $this->form->renderField('image_intro_caption', 'images'); ?> <?php echo $this->form->renderField('float_intro', 'images'); ?> <?php echo $this->form->renderField('image_fulltext', 'images'); ?> <?php echo $this->form->renderField('image_fulltext_alt', 'images'); ?> <?php echo $this->form->renderField('image_fulltext_caption', 'images'); ?> <?php echo $this->form->renderField('float_fulltext', 'images'); ?> <?php echo $this->form->renderField('urla', 'urls'); ?> <?php echo $this->form->renderField('urlatext', 'urls'); ?> <div class="control-group">
<div class="controls">
<?php echo $this->form->getInput('targeta', 'urls'); ?> </div>
</div>
<?php echo $this->form->renderField('urlb', 'urls'); ?> <?php echo $this->form->renderField('urlbtext', 'urls'); ?> <div class="control-group">
<div class="controls">
<?php echo $this->form->getInput('targetb', 'urls'); ?> </div>
</div>
<?php echo $this->form->renderField('urlc', 'urls'); ?> <?php echo $this->form->renderField('urlctext', 'urls'); ?> <div class="control-group">
<div class="controls">
<?php echo $this->form->getInput('targetc', 'urls'); ?> </div>
</div>
</div>
<?php endif; ?>
<?php foreach ($this->form->getFieldsets('params') as $name => $fieldSet) : ?>
<div class="tab-pane" id="params-
<?php echo $name; ?>">
<?php foreach ($this->form->getFieldset($name) as $field) : ?>
<?php echo $field->renderField(); ?> <?php endforeach; ?>
</div>
<?php endforeach; ?>
<div class="tab-pane" id="publishing">
<?php echo $this->form->renderField('catid'); ?> <?php echo $this->form->renderField('tags'); ?> <?php if ($params->get('save_history', 0)) : ?>
<?php echo $this->form->renderField('version_note'); ?> <?php endif; ?>
<?php echo $this->form->renderField('created_by_alias'); ?> <?php if ($this->item->params->get('access-change')) : ?>
<?php echo $this->form->renderField('state'); ?> <?php echo $this->form->renderField('featured'); ?> <?php echo $this->form->renderField('publish_up'); ?> <?php echo $this->form->renderField('publish_down'); ?> <?php endif; ?>
<?php echo $this->form->renderField('access'); ?> <?php if (is_null($this->item->id)):?> <div class="control-group">
<div class="control-label">
</div>
<div class="controls">
<?php echo JText
::_
('COM_GOVARTICLE_ORDERING'); ?> </div>
</div>
<?php endif; ?>
</div>
<div class="tab-pane" id="language">
<?php echo $this->form->renderField('language'); ?> </div>
<div class="tab-pane" id="metadata">
<?php echo $this->form->renderField('metadesc'); ?> <?php echo $this->form->renderField('metakey'); ?>
<input type="hidden" name="task" value="" />
<input type="hidden" name="return" value="
<?php echo $this->return_page; ?>" />
<?php if ($this->params->get('enable_category', 0) == 1) :?>
<input type="hidden" name="jform[catid]" value="
<?php echo $this->params->get('catid', 1
); ?>" />
<?php endif; ?>
</div>
</div>
<?php echo JHtml
::_
('form.token'); ?> </fieldset>
<fieldset>
<div class="tab-content">
<p>DODAJ ZAŁĄCZNIK</p>
<input id="attachment-title" name="attachments_titles[]" class="attachment_title" placeholder="Podaj tytuł tego załącznika" required="">
<input name="attachments_upload[]" required="" type="file">
<?php if(!empty($_GET['$attachment'])) { // if get id is not empty
}?>
</div>
</fieldset>
</form>
</div>
Witam,
chciałbym w wierszu '171' dodać funkcjonalność exportowania załącznika na serwer.
Jestem w stanie otworzyć okienko i dodać załącznik, lecz po kliknięciu 'Zapisz" załącznik nie ląduje na serwerze.
Jest to plik edit.php '\components\com_govarticle\views\form\tmpl\edit.php'
Rzecz dzieje się od strony widoku strony podczas edytowania artykułu w Joomla (wer. 3.8.3).
Proszę o rady, nakierowanie mnie.
Wstawianie załącznika odbywa się od strony zaplecza Joomla i wszystko działa prawidłowo
<input id="attachment-title" name="attachments_titles[]" class="attachment_title" placeholder="Podaj tytuł tego załącznika" required="">
<input name="attachments_upload[]" required="" type="file">
Ten post edytował michal535 15.01.2018, 12:36:31