acf
This commit is contained in:
1
modules/mod_highlights/index.html
Normal file
1
modules/mod_highlights/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
23
modules/mod_highlights/mod_highlights.php
Normal file
23
modules/mod_highlights/mod_highlights.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @version CVS: 1.0.0
|
||||
* @package com_highlights
|
||||
* @subpackage mod_highlights
|
||||
* @author Eddy Prosperi <eddy.prosperi@protocollicreativi.it>
|
||||
* @copyright 2024 Eddy Prosperi
|
||||
* @license GNU General Public License versione 2 o successiva; vedi LICENSE.txt
|
||||
*/
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Helper\ModuleHelper;
|
||||
use Pcrt\Module\Highlights\Site\Helper\HighlightsHelper;
|
||||
|
||||
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
|
||||
$wr = $wa->getRegistry();
|
||||
$wr->addRegistryFile('media/mod_highlights/joomla.asset.json');
|
||||
$wa->useStyle('mod_highlights.style')
|
||||
->useScript('mod_highlights.script');
|
||||
|
||||
require ModuleHelper::getLayoutPath('mod_highlights', $params->get('content_type', 'blank'));
|
||||
193
modules/mod_highlights/mod_highlights.xml
Normal file
193
modules/mod_highlights/mod_highlights.xml
Normal file
@ -0,0 +1,193 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension type="module" version="4.0" method="upgrade" client="site">
|
||||
<name>MOD_HIGHLIGHTS_NAME</name>
|
||||
<creationDate>2024-12-30</creationDate>
|
||||
<copyright>2024 Eddy Prosperi</copyright>
|
||||
<license>GNU General Public License versione 2 o successiva; vedi LICENSE.txt</license>
|
||||
<author>Eddy Prosperi</author>
|
||||
<authorEmail>eddy.prosperi@protocollicreativi.it</authorEmail>
|
||||
<authorUrl>http://</authorUrl>
|
||||
<version>CVS: 1.0.0</version>
|
||||
<description>MOD_HIGHLIGHTS_DESCRIPTION</description>
|
||||
<namespace path="src">Pcrt\Module\Highlights</namespace>
|
||||
|
||||
<files>
|
||||
<filename module="mod_highlights">mod_highlights.php</filename>
|
||||
<filename>index.html</filename>
|
||||
<folder>src</folder>
|
||||
<folder>tmpl</folder>
|
||||
</files>
|
||||
<media destination="mod_highlights" folder="media">
|
||||
<folder>css</folder>
|
||||
<folder>js</folder>
|
||||
<filename>joomla.asset.json</filename>
|
||||
</media>
|
||||
<languages folder="language">
|
||||
|
||||
<language tag="en-GB">en-GB/mod_highlights.ini</language>
|
||||
<language tag="en-GB">en-GB/mod_highlights.sys.ini</language>
|
||||
<language tag="it-IT">it-IT/mod_highlights.ini</language>
|
||||
<language tag="it-IT">it-IT/mod_highlights.sys.ini</language>
|
||||
</languages>
|
||||
<config>
|
||||
<fields name="params">
|
||||
<fieldset
|
||||
name="content_type"
|
||||
label="MOD_HIGHLIGHTS_CONTENT_TYPE_TAB_LBL"
|
||||
description="MOD_HIGHLIGHTS_CONTENT_TYPE_TAB_DESC">
|
||||
<field
|
||||
name="content_type" type="list"
|
||||
label="MOD_HIGHLIGHTS_CONTENT_TYPE_LBL"
|
||||
description="MOD_HIGHLIGHTS_CONTENT_TYPE_DESC">
|
||||
<option value="blank">MOD_HIGHLIGHTS_CUSTOM_CONTENT</option>
|
||||
<option value="list">MOD_HIGHLIGHTS_LIST</option>
|
||||
<option value="item">MOD_HIGHLIGHTS_ITEM</option>
|
||||
<option value="didattica">MOD_HIGHLIGHTS_DIDATTICA</option>
|
||||
<option value="slide">MOD_HIGHLIGHTS_SLIDE</option>
|
||||
<option value="countdown">MOD_HIGHLIGHTS_COUNTDOWN</option>
|
||||
|
||||
</field>
|
||||
</fieldset>
|
||||
<fieldset
|
||||
name="blank_content"
|
||||
label="MOD_HIGHLIGHTS_CUSTOM_CONTENT_TAB_LBL"
|
||||
description="MOD_HIGHLIGHTS_CUSTOM_CONTENT_TAB_DESC">
|
||||
<field
|
||||
name="html_content" type="editor" filter="safehtml"
|
||||
label="MOD_HIGHLIGHTS_HTML_LBL"
|
||||
description="MOD_HIGHLIGHTS_HTML_DESC" />
|
||||
</fieldset>
|
||||
<fieldset
|
||||
name="list_content"
|
||||
label="MOD_HIGHLIGHTS_LIST_CONTENT_TAB_LBL"
|
||||
description="MOD_HIGHLIGHTS_LIST_CONTENT_TAB_DESC">
|
||||
<field
|
||||
name="table" type="list"
|
||||
label="MOD_HIGHLIGHTS_TABLE_LBL"
|
||||
description="MOD_HIGHLIGHTS_TABLE_DESC">
|
||||
|
||||
<option value="#__highlights_">#__highlights_</option>
|
||||
<option value="#__highlights_etichetta">#__highlights_etichetta</option>
|
||||
</field>
|
||||
<field
|
||||
name="field" type="groupedlist" default=""
|
||||
label="MOD_HIGHLIGHTS_FIELD_LBL"
|
||||
description="MOD_HIGHLIGHTS_FIELD_DESC">
|
||||
|
||||
<group label="#__highlights_">
|
||||
<option value="#__highlights_:id">id</option>
|
||||
<option value="#__highlights_:created_by">created_by</option>
|
||||
<option value="#__highlights_:modified_by">modified_by</option>
|
||||
<option value="#__highlights_:etichetta">etichetta</option>
|
||||
<option value="#__highlights_:titolo">titolo</option>
|
||||
<option value="#__highlights_:sottotitolo">sottotitolo</option>
|
||||
<option value="#__highlights_:descrizione">descrizione</option>
|
||||
<option value="#__highlights_:lingua">lingua</option>
|
||||
<option value="#__highlights_:link_pulsante">link_pulsante</option>
|
||||
<option value="#__highlights_:testo_pulsante">testo_pulsante</option>
|
||||
<option value="#__highlights_:data">data</option>
|
||||
<option value="#__highlights_:immagine_main">immagine_main</option>
|
||||
<option value="#__highlights_:immagine_secondaria">immagine_secondaria</option>
|
||||
<option value="#__highlights_:data_inizio_pubblicazione">data_inizio_pubblicazione</option>
|
||||
<option value="#__highlights_:data_fine_pubblicazione">data_fine_pubblicazione</option>
|
||||
</group>
|
||||
<group label="#__highlights_etichetta">
|
||||
<option value="#__highlights_etichetta:id">id</option>
|
||||
<option value="#__highlights_etichetta:created_by">created_by</option>
|
||||
<option value="#__highlights_etichetta:modified_by">modified_by</option>
|
||||
<option value="#__highlights_etichetta:nome">nome</option>
|
||||
<option value="#__highlights_etichetta:lingua">lingua</option>
|
||||
</group>
|
||||
</field>
|
||||
<field
|
||||
name="offset" type="text" default="0" filter="uint" class="input-small"
|
||||
label="MOD_HIGHLIGHTS_OFFSET_LBL"
|
||||
description="MOD_HIGHLIGHTS_OFFSET_DESC" />
|
||||
<field
|
||||
name="limit" type="text" default="10" filter="uint" class="input-small"
|
||||
label="MOD_HIGHLIGHTS_LIMIT_LBL"
|
||||
description="MOD_HIGHLIGHTS_LIMIT_DESC" />
|
||||
</fieldset>
|
||||
<fieldset
|
||||
name="item_content"
|
||||
label="MOD_HIGHLIGHTS_ITEM_CONTENT_TAB"
|
||||
description="MOD_HIGHLIGHTS_ITEM_CONTENT_TAB_DESC">
|
||||
<field
|
||||
name="item_table" type="list"
|
||||
label="MOD_HIGHLIGHTS_TABLE_LBL"
|
||||
description="MOD_HIGHLIGHTS_TABLE_DESC">
|
||||
|
||||
<option value="#__highlights_">#__highlights_</option>
|
||||
<option value="#__highlights_etichetta">#__highlights_etichetta</option>
|
||||
</field>
|
||||
<field
|
||||
name="item_id" type="text" filter="uint" class="input-small"
|
||||
label="MOD_HIGHLIGHTS_ITEM_ID_LBL"
|
||||
description="MOD_HIGHLIGHTS_ITEM_ID_DESC"
|
||||
/>
|
||||
|
||||
</fieldset>
|
||||
<fieldset name="basic">
|
||||
<field
|
||||
name="opacita"
|
||||
type="text"
|
||||
label="Opacità"
|
||||
description="Inserisci un valore decimale con il punto come separatore (es. 0.5)"
|
||||
class="form-control"
|
||||
validate="number"
|
||||
default="1"
|
||||
/>
|
||||
<field
|
||||
name="sfondo"
|
||||
type="text"
|
||||
label="Sfondo"
|
||||
description="Inserisci un valore composto solo da lettere e numeri"
|
||||
class="form-control"
|
||||
default=""
|
||||
/>
|
||||
<field
|
||||
name="filtro_etichetta"
|
||||
type="sql"
|
||||
multiple="true"
|
||||
label="Filtra per Etichetta"
|
||||
description="Seleziona una o più etichette per filtrare gli elementi"
|
||||
class="form-select"
|
||||
query="SELECT DISTINCT COALESCE(nome, '') AS value, COALESCE(nome, 'Nessuna etichetta') AS text FROM zfgey70wb_highlights_etichetta WHERE nome IS NOT NULL"
|
||||
required="false"
|
||||
/>
|
||||
<field
|
||||
name="ordering"
|
||||
type="list"
|
||||
label="Criterio di ordinamento"
|
||||
description="Scegli il criterio con cui ordinare gli elementi"
|
||||
class="form-select"
|
||||
default="id"
|
||||
>
|
||||
<option value="id">ID</option>
|
||||
<option value="titolo">Titolo</option>
|
||||
<option value="data">Data</option>
|
||||
</field>
|
||||
|
||||
<!-- Campo per definire l'ordine crescente/decrescente -->
|
||||
<field
|
||||
name="ordering_direction"
|
||||
type="list"
|
||||
label="Direzione dell'ordinamento"
|
||||
description="Scegli se ordinare in modo crescente o decrescente"
|
||||
class="form-select"
|
||||
default="ASC"
|
||||
>
|
||||
<option value="ASC">Crescente</option>
|
||||
<option value="DESC">Decrescente</option>
|
||||
</field>
|
||||
|
||||
|
||||
|
||||
</fieldset>
|
||||
|
||||
</fields>
|
||||
</config>
|
||||
<updateservers>
|
||||
<server type="extension" priority="1" name="com_highlights">https://www.component-creator.com/index.php?task=builder.preupdatecheckhook&option=com_combuilder&component=NzY0NzgtMjEzOTAw</server>
|
||||
</updateservers>
|
||||
</extension>
|
||||
267
modules/mod_highlights/src/Helper/HighlightsHelper.php
Normal file
267
modules/mod_highlights/src/Helper/HighlightsHelper.php
Normal file
@ -0,0 +1,267 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @version CVS: 1.0.0
|
||||
* @package com_highlights
|
||||
* @subpackage mod_highlights
|
||||
* @author Eddy Prosperi <eddy.prosperi@protocollicreativi.it>
|
||||
* @copyright 2024 Eddy Prosperi
|
||||
* @license GNU General Public License versione 2 o successiva; vedi LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace Pcrt\Module\Highlights\Site\Helper;
|
||||
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
use \Joomla\CMS\Factory;
|
||||
use \Joomla\CMS\Language\Text;
|
||||
use \Joomla\CMS\Language\Language;
|
||||
use \Joomla\CMS\User\UserFactoryInterface;
|
||||
|
||||
/**
|
||||
* Helper for mod_highlights
|
||||
*
|
||||
* @package com_highlights
|
||||
* @subpackage mod_highlights
|
||||
* @since 1.0.0
|
||||
*/
|
||||
Class HighlightsHelper
|
||||
{
|
||||
/**
|
||||
* Retrieve component items
|
||||
*
|
||||
* @param Joomla\Registry\Registry &$params module parameters
|
||||
*
|
||||
* @return array Array with all the elements
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function getList(&$params)
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$db = Factory::getContainer()->get('DatabaseDriver');
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
$tableField = explode(':', $params->get('field'));
|
||||
$table_name = !empty($tableField[0]) ? $tableField[0] : '';
|
||||
$filtroEtichetta = $params->get('filtro_etichetta', []);
|
||||
$ordering = $params->get('ordering', []);
|
||||
$ordering_direction = $params->get('ordering_direction', []);
|
||||
$lingua = \Joomla\CMS\Factory::getLanguage()->getTag();
|
||||
|
||||
|
||||
/* @var $params Joomla\Registry\Registry */
|
||||
$query
|
||||
->select('*')
|
||||
->from($table_name)
|
||||
->where('state = 1');
|
||||
|
||||
if (!empty($filtroEtichetta)) {
|
||||
$query->where(
|
||||
$db->quoteName('etichetta') . ' IN (' . implode(',', array_map([$db, 'quote'], $filtroEtichetta)) . ')'
|
||||
);
|
||||
}
|
||||
|
||||
if (!empty($lingua)) {
|
||||
// Se la lingua è valida, filtra anche per lingua
|
||||
$query->where(
|
||||
$db->quoteName('lingua') . ' LIKE ' . $db->quote($lingua)
|
||||
);
|
||||
}
|
||||
|
||||
if (!empty($ordering)) {
|
||||
$orderingDirection = strtoupper($ordering_direction ?? 'ASC'); // Default ASC
|
||||
$query->order($db->quoteName($ordering) . ' ' . $orderingDirection);
|
||||
}
|
||||
|
||||
$db->setQuery($query, $app->input->getInt('offset', (int) $params->get('offset')), $app->input->getInt('limit', (int) $params->get('limit')));
|
||||
$rows = $db->loadObjectList();
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve component items
|
||||
*
|
||||
* @param Joomla\Registry\Registry &$params module parameters
|
||||
*
|
||||
* @return mixed stdClass object if the item was found, null otherwise
|
||||
*/
|
||||
public static function getItem(&$params)
|
||||
{
|
||||
$db = Factory::getContainer()->get('DatabaseDriver');
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
/* @var $params Joomla\Registry\Registry */
|
||||
$query
|
||||
->select('*')
|
||||
->from($params->get('item_table'))
|
||||
->where('id = ' . intval($params->get('item_id')));
|
||||
|
||||
$db->setQuery($query);
|
||||
$element = $db->loadObject();
|
||||
|
||||
return $element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render element
|
||||
*
|
||||
* @param Joomla\Registry\Registry $table_name Table name
|
||||
* @param string $field_name Field name
|
||||
* @param string $field_value Field value
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function renderElement($table_name, $field_name, $field_value)
|
||||
{
|
||||
$result = '';
|
||||
|
||||
if(strpos($field_name, ':'))
|
||||
{
|
||||
$tableField = explode(':', $field_name);
|
||||
$table_name = !empty($tableField[0]) ? $tableField[0] : '';
|
||||
$field_name = !empty($tableField[1]) ? $tableField[1] : '';
|
||||
}
|
||||
|
||||
switch ($table_name)
|
||||
{
|
||||
|
||||
case '#__highlights_':
|
||||
switch($field_name){
|
||||
case 'id':
|
||||
$result = $field_value;
|
||||
break;
|
||||
case 'created_by':
|
||||
$container = \Joomla\CMS\Factory::getContainer();
|
||||
$userFactory = $container->get(UserFactoryInterface::class);
|
||||
$user = $userFactory->loadUserById($field_value);
|
||||
$result = $user->name;
|
||||
break;
|
||||
case 'modified_by':
|
||||
$container = \Joomla\CMS\Factory::getContainer();
|
||||
$userFactory = $container->get(UserFactoryInterface::class);
|
||||
$user = $userFactory->loadUserById($field_value);
|
||||
$result = $user->name;
|
||||
break;
|
||||
case 'etichetta':
|
||||
$result = self::loadValueFromExternalTable('#__highlights_etichetta', 'nome', 'nome', $field_value);
|
||||
break;
|
||||
case 'titolo':
|
||||
$result = $field_value;
|
||||
break;
|
||||
case 'sottotitolo':
|
||||
$result = $field_value;
|
||||
break;
|
||||
case 'descrizione':
|
||||
$result = $field_value;
|
||||
break;
|
||||
case 'lingua':
|
||||
$result = Language::getInstance($field_value)->getName();
|
||||
break;
|
||||
case 'link_pulsante':
|
||||
$result = $field_value;
|
||||
break;
|
||||
case 'testo_pulsante':
|
||||
$result = $field_value;
|
||||
break;
|
||||
case 'data':
|
||||
$result = $field_value;
|
||||
break;
|
||||
case 'immagine_main':
|
||||
$result = $field_value;
|
||||
break;
|
||||
case 'immagine_secondaria':
|
||||
$result = $field_value;
|
||||
break;
|
||||
case 'data_inizio_pubblicazione':
|
||||
$result = $field_value;
|
||||
break;
|
||||
case 'data_fine_pubblicazione':
|
||||
$result = $field_value;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case '#__highlights_etichetta':
|
||||
switch($field_name){
|
||||
case 'id':
|
||||
$result = $field_value;
|
||||
break;
|
||||
case 'created_by':
|
||||
$container = \Joomla\CMS\Factory::getContainer();
|
||||
$userFactory = $container->get(UserFactoryInterface::class);
|
||||
$user = $userFactory->loadUserById($field_value);
|
||||
$result = $user->name;
|
||||
break;
|
||||
case 'modified_by':
|
||||
$container = \Joomla\CMS\Factory::getContainer();
|
||||
$userFactory = $container->get(UserFactoryInterface::class);
|
||||
$user = $userFactory->loadUserById($field_value);
|
||||
$result = $user->name;
|
||||
break;
|
||||
case 'nome':
|
||||
$result = $field_value;
|
||||
break;
|
||||
case 'lingua':
|
||||
$result = Language::getInstance($field_value)->getName();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the translatable name of the element
|
||||
*
|
||||
* @param string .................. $table_name table name
|
||||
* @param string $field Field name
|
||||
*
|
||||
* @return string Translatable name.
|
||||
*/
|
||||
public static function renderTranslatableHeader($table_name, $field)
|
||||
{
|
||||
return Text::_(
|
||||
'MOD_HIGHLIGHTS_HEADER_FIELD_' . str_replace('#__', '', strtoupper($table_name)) . '_' . strtoupper($field)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if an element should appear in the table/item view
|
||||
*
|
||||
* @param string $field name of the field
|
||||
*
|
||||
* @return boolean True if it should appear, false otherwise
|
||||
*/
|
||||
public static function shouldAppear($field)
|
||||
{
|
||||
$noHeaderFields = array('checked_out_time', 'checked_out', 'ordering', 'state');
|
||||
|
||||
return !in_array($field, $noHeaderFields);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Method to get a value from a external table
|
||||
* @param string $source_table Source table name
|
||||
* @param string $key_field Source key field
|
||||
* @param string $value_field Source value field
|
||||
* @param mixed $key_value Value for the key field
|
||||
* @return mixed The value in the external table or null if it wasn't found
|
||||
*/
|
||||
private static function loadValueFromExternalTable($source_table, $key_field, $value_field, $key_value) {
|
||||
$db = Factory::getContainer()->get('DatabaseDriver');
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
$query
|
||||
->select($db->quoteName($value_field))
|
||||
->from($source_table)
|
||||
->where($db->quoteName($key_field) . ' = ' . $db->quote($key_value));
|
||||
|
||||
|
||||
$db->setQuery($query);
|
||||
return $db->loadResult();
|
||||
}
|
||||
}
|
||||
25
modules/mod_highlights/tmpl/blank.php
Normal file
25
modules/mod_highlights/tmpl/blank.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @version CVS: 1.0.0
|
||||
* @package com_highlights
|
||||
* @subpackage mod_highlights
|
||||
* @author Eddy Prosperi <eddy.prosperi@protocollicreativi.it>
|
||||
* @copyright 2024 Eddy Prosperi
|
||||
* @license GNU General Public License versione 2 o successiva; vedi LICENSE.txt
|
||||
*/
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use \Joomla\CMS\Filter\InputFilter;
|
||||
|
||||
$safe_htmltags = array(
|
||||
'a', 'address', 'em', 'strong', 'b', 'i',
|
||||
'big', 'small', 'sub', 'sup', 'cite', 'code',
|
||||
'img', 'ul', 'ol', 'li', 'dl', 'lh', 'dt', 'dd',
|
||||
'br', 'p', 'table', 'th', 'td', 'tr', 'pre',
|
||||
'blockquote', 'nowiki', 'h1', 'h2', 'h3',
|
||||
'h4', 'h5', 'h6', 'hr');
|
||||
|
||||
/* @var $params Joomla\Registry\Registry */
|
||||
$filter = InputFilter::getInstance($safe_htmltags);
|
||||
echo $filter->clean($params->get('html_content'));
|
||||
56
modules/mod_highlights/tmpl/countdown.php
Normal file
56
modules/mod_highlights/tmpl/countdown.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @version CVS: 1.0.0
|
||||
* @package com_highlights
|
||||
* @subpackage mod_highlights
|
||||
* @author Eddy Prosperi <eddy.prosperi@protocollicreativi.it>
|
||||
* @copyright 2024 Eddy Prosperi
|
||||
* @license GNU General Public License versione 2 o successiva; vedi LICENSE.txt
|
||||
*/
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Pcrt\Module\Highlights\Site\Helper\HighlightsHelper;
|
||||
|
||||
$elements = HighlightsHelper::getList($params);
|
||||
|
||||
$tableField = explode(':', $params->get('field'));
|
||||
$table_name = !empty($tableField[0]) ? $tableField[0] : '';
|
||||
$field_name = !empty($tableField[1]) ? $tableField[1] : '';
|
||||
|
||||
//Come accedere alle variabili generali:
|
||||
$opacita = $params->get('opacita', []);
|
||||
$sfondo = $params->get('sfondo', []);
|
||||
|
||||
?>
|
||||
|
||||
<?php if (!empty($elements)) : ?>
|
||||
<div class="bd-example w-100">
|
||||
<div class="bd-example-tabs">
|
||||
<div class="row">
|
||||
<!-- Macro a sinistra -->
|
||||
<div class="col-4 col-md-3">
|
||||
<div class="nav nav-tabs nav-tabs-vertical nav-tabs-vertical-background" id="nav-vertical-tab-bg" role="tablist" aria-orientation="vertical">
|
||||
<?php foreach ($elements as $index => $element) : ?>
|
||||
<a class="nav-link <?php echo $index === 0 ? 'active' : ''; ?>" id="nav-vertical-tab-<?php echo $index; ?>-tab" data-bs-toggle="tab" href="#nav-vertical-tab-<?php echo $index; ?>" role="tab" aria-controls="nav-vertical-tab-<?php echo $index; ?>" aria-selected="<?php echo $index === 0 ? 'true' : 'false'; ?>">
|
||||
<?php echo $element->sottotitolo; ?>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Contenuto a destra -->
|
||||
<div class="col-8 col-md-9">
|
||||
<div class="tab-content" id="nav-vertical-tab-bgContent">
|
||||
<?php foreach ($elements as $index => $element) : ?>
|
||||
<div class="tab-pane p-3 fade <?php echo $index === 0 ? 'active show' : ''; ?>" id="nav-vertical-tab-<?php echo $index; ?>" role="tabpanel" aria-labelledby="nav-vertical-tab-<?php echo $index; ?>-tab">
|
||||
<div><?php echo $element->titolo; ?></div>
|
||||
<div><?php echo $element->sottotitolo; ?></div>
|
||||
<div><?php echo $element->descrizione; ?></div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
56
modules/mod_highlights/tmpl/didattica.php
Normal file
56
modules/mod_highlights/tmpl/didattica.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @version CVS: 1.0.0
|
||||
* @package com_highlights
|
||||
* @subpackage mod_highlights
|
||||
* @author Eddy Prosperi <eddy.prosperi@protocollicreativi.it>
|
||||
* @copyright 2024 Eddy Prosperi
|
||||
* @license GNU General Public License versione 2 o successiva; vedi LICENSE.txt
|
||||
*/
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Pcrt\Module\Highlights\Site\Helper\HighlightsHelper;
|
||||
|
||||
$elements = HighlightsHelper::getList($params);
|
||||
|
||||
$tableField = explode(':', $params->get('field'));
|
||||
$table_name = !empty($tableField[0]) ? $tableField[0] : '';
|
||||
$field_name = !empty($tableField[1]) ? $tableField[1] : '';
|
||||
|
||||
//Come accedere alle variabili generali:
|
||||
$opacita = $params->get('opacita', []);
|
||||
$sfondo = $params->get('sfondo', []);
|
||||
|
||||
?>
|
||||
|
||||
<?php if (!empty($elements)) : ?>
|
||||
<div class="bd-example w-100">
|
||||
<div class="bd-example-tabs">
|
||||
<div class="row">
|
||||
<!-- Macro a sinistra -->
|
||||
<div class="col-4 col-md-3">
|
||||
<div class="nav nav-tabs nav-tabs-vertical nav-tabs-vertical-background" id="nav-vertical-tab-bg" role="tablist" aria-orientation="vertical">
|
||||
<?php foreach ($elements as $index => $element) : ?>
|
||||
<a class="nav-link <?php echo $index === 0 ? 'active' : ''; ?>" id="nav-vertical-tab-<?php echo $index; ?>-tab" data-bs-toggle="tab" href="#nav-vertical-tab-<?php echo $index; ?>" role="tab" aria-controls="nav-vertical-tab-<?php echo $index; ?>" aria-selected="<?php echo $index === 0 ? 'true' : 'false'; ?>">
|
||||
<?php echo $element->sottotitolo; ?>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Contenuto a destra -->
|
||||
<div class="col-8 col-md-9">
|
||||
<div class="tab-content" id="nav-vertical-tab-bgContent">
|
||||
<?php foreach ($elements as $index => $element) : ?>
|
||||
<div class="tab-pane p-3 fade <?php echo $index === 0 ? 'active show' : ''; ?>" id="nav-vertical-tab-<?php echo $index; ?>" role="tabpanel" aria-labelledby="nav-vertical-tab-<?php echo $index; ?>-tab">
|
||||
<div><?php echo $element->titolo; ?></div>
|
||||
<div><?php echo $element->sottotitolo; ?></div>
|
||||
<div><?php echo $element->descrizione; ?></div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
1
modules/mod_highlights/tmpl/index.html
Normal file
1
modules/mod_highlights/tmpl/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
32
modules/mod_highlights/tmpl/item.php
Normal file
32
modules/mod_highlights/tmpl/item.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* @version CVS: 1.0.0
|
||||
* @package com_highlights
|
||||
* @subpackage mod_highlights
|
||||
* @author Eddy Prosperi <eddy.prosperi@protocollicreativi.it>
|
||||
* @copyright 2024 Eddy Prosperi
|
||||
* @license GNU General Public License versione 2 o successiva; vedi LICENSE.txt
|
||||
*/
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Pcrt\Module\Highlights\Site\Helper\HighlightsHelper;
|
||||
|
||||
$element = HighlightsHelper::getItem($params);
|
||||
?>
|
||||
|
||||
<?php if (!empty($element)) : ?>
|
||||
<div>
|
||||
<?php $fields = get_object_vars($element); ?>
|
||||
<?php foreach ($fields as $field_name => $field_value) : ?>
|
||||
<?php if (HighlightsHelper::shouldAppear($field_name)): ?>
|
||||
<div class="row">
|
||||
<div class="span4">
|
||||
<strong><?php echo HighlightsHelper::renderTranslatableHeader($params->get('item_table'), $field_name); ?></strong>
|
||||
</div>
|
||||
<div
|
||||
class="span8"><?php echo HighlightsHelper::renderElement($params->get('item_table'), $field_name, $field_value); ?></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif;
|
||||
32
modules/mod_highlights/tmpl/list.php
Normal file
32
modules/mod_highlights/tmpl/list.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* @version CVS: 1.0.0
|
||||
* @package com_highlights
|
||||
* @subpackage mod_highlights
|
||||
* @author Eddy Prosperi <eddy.prosperi@protocollicreativi.it>
|
||||
* @copyright 2024 Eddy Prosperi
|
||||
* @license GNU General Public License versione 2 o successiva; vedi LICENSE.txt
|
||||
*/
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Pcrt\Module\Highlights\Site\Helper\HighlightsHelper;
|
||||
|
||||
$elements = HighlightsHelper::getList($params);
|
||||
|
||||
$tableField = explode(':', $params->get('field'));
|
||||
$table_name = !empty($tableField[0]) ? $tableField[0] : '';
|
||||
$field_name = !empty($tableField[1]) ? $tableField[1] : '';
|
||||
?>
|
||||
|
||||
<?php if (!empty($elements)) : ?>
|
||||
<table class="jcc-table">
|
||||
<?php foreach ($elements as $element) : ?>
|
||||
<tr>
|
||||
<th><?php echo HighlightsHelper::renderTranslatableHeader($table_name, $field_name); ?></th>
|
||||
<td><?php echo HighlightsHelper::renderElement(
|
||||
$table_name, $params->get('field'), $element->{$field_name}
|
||||
); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<?php endif;
|
||||
56
modules/mod_highlights/tmpl/slide.php
Normal file
56
modules/mod_highlights/tmpl/slide.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @version CVS: 1.0.0
|
||||
* @package com_highlights
|
||||
* @subpackage mod_highlights
|
||||
* @author Eddy Prosperi <eddy.prosperi@protocollicreativi.it>
|
||||
* @copyright 2024 Eddy Prosperi
|
||||
* @license GNU General Public License versione 2 o successiva; vedi LICENSE.txt
|
||||
*/
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Pcrt\Module\Highlights\Site\Helper\HighlightsHelper;
|
||||
|
||||
$elements = HighlightsHelper::getList($params);
|
||||
|
||||
$tableField = explode(':', $params->get('field'));
|
||||
$table_name = !empty($tableField[0]) ? $tableField[0] : '';
|
||||
$field_name = !empty($tableField[1]) ? $tableField[1] : '';
|
||||
|
||||
//Come accedere alle variabili generali:
|
||||
$opacita = $params->get('opacita', []);
|
||||
$sfondo = $params->get('sfondo', []);
|
||||
|
||||
?>
|
||||
|
||||
<?php if (!empty($elements)) : ?>
|
||||
<div class="bd-example w-100">
|
||||
<div class="bd-example-tabs">
|
||||
<div class="row">
|
||||
<!-- Macro a sinistra -->
|
||||
<div class="col-4 col-md-3">
|
||||
<div class="nav nav-tabs nav-tabs-vertical nav-tabs-vertical-background" id="nav-vertical-tab-bg" role="tablist" aria-orientation="vertical">
|
||||
<?php foreach ($elements as $index => $element) : ?>
|
||||
<a class="nav-link <?php echo $index === 0 ? 'active' : ''; ?>" id="nav-vertical-tab-<?php echo $index; ?>-tab" data-bs-toggle="tab" href="#nav-vertical-tab-<?php echo $index; ?>" role="tab" aria-controls="nav-vertical-tab-<?php echo $index; ?>" aria-selected="<?php echo $index === 0 ? 'true' : 'false'; ?>">
|
||||
<?php echo $element->sottotitolo; ?>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Contenuto a destra -->
|
||||
<div class="col-8 col-md-9">
|
||||
<div class="tab-content" id="nav-vertical-tab-bgContent">
|
||||
<?php foreach ($elements as $index => $element) : ?>
|
||||
<div class="tab-pane p-3 fade <?php echo $index === 0 ? 'active show' : ''; ?>" id="nav-vertical-tab-<?php echo $index; ?>" role="tabpanel" aria-labelledby="nav-vertical-tab-<?php echo $index; ?>-tab">
|
||||
<div><?php echo $element->titolo; ?></div>
|
||||
<div><?php echo $element->sottotitolo; ?></div>
|
||||
<div><?php echo $element->descrizione; ?></div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
Reference in New Issue
Block a user