acf
This commit is contained in:
117
components/com_highlights/tmpl/highlightform/default.php
Normal file
117
components/com_highlights/tmpl/highlightform/default.php
Normal file
@ -0,0 +1,117 @@
|
||||
<?php
|
||||
/**
|
||||
* @version CVS: 1.0.0
|
||||
* @package Com_Highlights
|
||||
* @author Eddy Prosperi <eddy.prosperi@protocollicreativi.it>
|
||||
* @copyright 2024 Eddy Prosperi
|
||||
* @license GNU General Public License versione 2 o successiva; vedi LICENSE.txt
|
||||
*/
|
||||
// No direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use \Joomla\CMS\HTML\HTMLHelper;
|
||||
use \Joomla\CMS\Factory;
|
||||
use \Joomla\CMS\Uri\Uri;
|
||||
use \Joomla\CMS\Router\Route;
|
||||
use \Joomla\CMS\Language\Text;
|
||||
use \Pcrt\Component\Highlights\Site\Helper\HighlightsHelper;
|
||||
|
||||
$wa = $this->document->getWebAssetManager();
|
||||
$wa->useScript('keepalive')
|
||||
->useScript('form.validate');
|
||||
HTMLHelper::_('bootstrap.tooltip');
|
||||
|
||||
// Load admin language file
|
||||
$lang = Factory::getLanguage();
|
||||
$lang->load('com_highlights', JPATH_SITE);
|
||||
|
||||
$user = Factory::getApplication()->getIdentity();
|
||||
$canEdit = HighlightsHelper::canUserEdit($this->item, $user);
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<div class="highlight-edit front-end-edit">
|
||||
|
||||
<?php if ($this->params->get('show_page_heading')) : ?>
|
||||
<div class="page-header">
|
||||
<h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php if (!$canEdit) : ?>
|
||||
<h3>
|
||||
<?php throw new \Exception(Text::_('COM_HIGHLIGHTS_ERROR_MESSAGE_NOT_AUTHORISED'), 403); ?>
|
||||
</h3>
|
||||
<?php else : ?>
|
||||
<?php if (!empty($this->item->id)): ?>
|
||||
<h1><?php echo Text::sprintf('COM_HIGHLIGHTS_EDIT_ITEM_TITLE', $this->item->id); ?></h1>
|
||||
<?php else: ?>
|
||||
<h1><?php echo Text::_('COM_HIGHLIGHTS_ADD_ITEM_TITLE'); ?></h1>
|
||||
<?php endif; ?>
|
||||
|
||||
<form id="form-highlight"
|
||||
action="<?php echo Route::_('index.php?option=com_highlights&task=highlightform.save'); ?>"
|
||||
method="post" class="form-validate form-horizontal" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="jform[id]" value="<?php echo isset($this->item->id) ? $this->item->id : ''; ?>" />
|
||||
|
||||
<input type="hidden" name="jform[state]" value="<?php echo isset($this->item->state) ? $this->item->state : ''; ?>" />
|
||||
|
||||
<?php echo $this->form->getInput('created_by'); ?>
|
||||
<?php echo $this->form->getInput('modified_by'); ?>
|
||||
<?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', array('active' => 'highlight')); ?>
|
||||
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'highlight', Text::_('COM_HIGHLIGHTS_TAB_HIGHLIGHT', true)); ?>
|
||||
<?php echo $this->form->renderField('etichetta'); ?>
|
||||
|
||||
<?php echo $this->form->renderField('titolo'); ?>
|
||||
|
||||
<?php echo $this->form->renderField('sottotitolo'); ?>
|
||||
|
||||
<?php echo $this->form->renderField('descrizione'); ?>
|
||||
|
||||
<?php echo $this->form->renderField('lingua'); ?>
|
||||
|
||||
<?php echo $this->form->renderField('link_pulsante'); ?>
|
||||
|
||||
<?php echo $this->form->renderField('testo_pulsante'); ?>
|
||||
|
||||
<?php echo $this->form->renderField('data'); ?>
|
||||
|
||||
<?php echo HTMLHelper::_('uitab.endTab'); ?>
|
||||
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'Immagini', Text::_('COM_HIGHLIGHTS_TAB_IMMAGINI', true)); ?>
|
||||
<?php echo $this->form->renderField('immagine_main'); ?>
|
||||
|
||||
<?php echo $this->form->renderField('immagine_secondaria'); ?>
|
||||
|
||||
<?php echo HTMLHelper::_('uitab.endTab'); ?>
|
||||
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'Pubblicazione', Text::_('COM_HIGHLIGHTS_TAB_PUBBLICAZIONE', true)); ?>
|
||||
<?php echo $this->form->renderField('data_inizio_pubblicazione'); ?>
|
||||
|
||||
<?php echo $this->form->renderField('data_fine_pubblicazione'); ?>
|
||||
|
||||
<?php echo HTMLHelper::_('uitab.endTab'); ?>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
|
||||
<?php if ($this->canSave): ?>
|
||||
<button type="submit" class="validate btn btn-primary">
|
||||
<span class="fas fa-check" aria-hidden="true"></span>
|
||||
<?php echo Text::_('JSUBMIT'); ?>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<a class="btn btn-danger"
|
||||
href="<?php echo Route::_('index.php?option=com_highlights&task=highlightform.cancel'); ?>"
|
||||
title="<?php echo Text::_('JCANCEL'); ?>">
|
||||
<span class="fas fa-times" aria-hidden="true"></span>
|
||||
<?php echo Text::_('JCANCEL'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="option" value="com_highlights"/>
|
||||
<input type="hidden" name="task"
|
||||
value="highlightform.save"/>
|
||||
<?php echo HTMLHelper::_('form.token'); ?>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
24
components/com_highlights/tmpl/highlightform/default.xml
Normal file
24
components/com_highlights/tmpl/highlightform/default.xml
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata>
|
||||
<layout title="COM_HIGHLIGHTS_TITLE_FORM_VIEW_HIGHLIGHT" option="View">
|
||||
<message>
|
||||
<![CDATA[COM_HIGHLIGHTS_TITLE_FORM_VIEW_HIGHLIGHT_DESC]]>
|
||||
</message>
|
||||
</layout>
|
||||
<fields name="params">
|
||||
<fieldset
|
||||
name="basic"
|
||||
label="COM_HIGHLIGHTS_FIELDSET_ITEM_ID_SELECT_LABEL">
|
||||
<field
|
||||
name="item_id"
|
||||
query="SELECT 0 as `id` UNION SELECT `id` FROM #__highlights_ ORDER BY `id`"
|
||||
type="sql"
|
||||
key_field="id"
|
||||
value_field="id"
|
||||
label="COM_HIGHLIGHTS_ITEM_ID_SELECT_LABEL_FORM"
|
||||
require="true"
|
||||
description="JGLOBAL_SHOW_TITLE_DESC">
|
||||
</field>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</metadata>
|
||||
1
components/com_highlights/tmpl/highlightform/index.html
Normal file
1
components/com_highlights/tmpl/highlightform/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body></body></html>
|
||||
Reference in New Issue
Block a user