134 lines
		
	
	
		
			4.6 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			134 lines
		
	
	
		
			4.6 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?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('link_pdf'); ?>
 | |
| 
 | |
| 	<?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', 'Stile', Text::_('COM_HIGHLIGHTS_TAB_STILE', true)); ?>
 | |
| 	<?php echo $this->form->renderField('classe'); ?>
 | |
| 
 | |
| 	<?php echo $this->form->renderField('colore_testo'); ?>
 | |
| 
 | |
| 	<?php echo $this->form->renderField('colore_sfondo'); ?>
 | |
| 
 | |
| 	<?php echo $this->form->renderField('opacita'); ?>
 | |
| 
 | |
| 	<?php echo $this->form->renderField('colore_sfondo_bottone'); ?>
 | |
| 
 | |
| 	<?php echo $this->form->renderField('colore_testo_bottone'); ?>
 | |
| 
 | |
| 	<?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>
 |