30
1
mirror of https://github.com/joomla-extensions/weblinks.git synced 2024-06-01 22:10:50 +00:00
weblinks/src/administrator/components/com_weblinks/tmpl/weblink/edit.php
2021-07-01 21:55:05 +07:00

96 lines
3.4 KiB
PHP

<?php
/**
* @package Joomla.Administrator
* @subpackage Weblinks
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
HTMLHelper::_('behavior.formvalidator');
$app = Factory::getApplication();
$input = $app->input;
$assoc = JLanguageAssociations::isEnabled();
// Fieldsets to not automatically render by /layouts/joomla/edit/params.php
$this->ignore_fieldsets = array('details', 'images', 'item_associations', 'jmetadata');
$this->useCoreUI = true;
// In case of modal
$isModal = $input->get('layout') == 'modal' ? true : false;
$layout = $isModal ? 'modal' : 'edit';
$tmpl = $isModal || $input->get('tmpl', '', 'cmd') === 'component' ? '&tmpl=component' : '';
?>
<form action="<?php echo Route::_('index.php?option=com_weblinks&layout=' . $layout . $tmpl . '&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="weblink-form" class="form-validate">
<?php echo JLayoutHelper::render('joomla.edit.title_alias', $this); ?>
<div class="form-horizontal">
<?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', array('active' => 'details')); ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'details', empty($this->item->id) ? Text::_('COM_WEBLINKS_NEW_WEBLINK', true) : Text::_('COM_WEBLINKS_EDIT_WEBLINK', true)); ?>
<div class="row">
<div class="col-md-9">
<div class="form-vertical">
<?php echo $this->form->renderField('url'); ?>
<?php echo $this->form->renderField('description'); ?>
</div>
</div>
<div class="col-md-3">
<?php echo JLayoutHelper::render('joomla.edit.global', $this); ?>
</div>
</div>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'images', Text::_('JGLOBAL_FIELDSET_IMAGE_OPTIONS', true)); ?>
<div class="row">
<div class="col-md-6">
<?php echo $this->form->renderField('images'); ?>
<?php foreach ($this->form->getGroup('images') as $field) : ?>
<?php echo $field->renderField(); ?>
<?php endforeach; ?>
</div>
</div>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'publishing', Text::_('JGLOBAL_FIELDSET_PUBLISHING', true)); ?>
<div class="row form-horizontal-desktop">
<div class="col-md-6">
<?php echo JLayoutHelper::render('joomla.edit.publishingdata', $this); ?>
</div>
<div class="col-md-6">
<?php echo JLayoutHelper::render('joomla.edit.metadata', $this); ?>
</div>
</div>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php if (!$isModal && $assoc) : ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'associations', Text::_('JGLOBAL_FIELDSET_ASSOCIATIONS')); ?>
<?php echo $this->loadTemplate('associations'); ?>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php elseif ($isModal && $assoc) : ?>
<div class="hidden"><?php echo $this->loadTemplate('associations'); ?></div>
<?php endif; ?>
<?php echo HTMLHelper::_('uitab.endTabSet'); ?>
</div>
<input type="hidden" name="task" value="" />
<input type="hidden" name="forcedLanguage" value="<?php echo $input->get('forcedLanguage', '', 'cmd'); ?>" />
<?php echo HTMLHelper::_('form.token'); ?>
</form>