diff --git a/helper.php b/helper.php new file mode 100644 index 0000000..411eeaf --- /dev/null +++ b/helper.php @@ -0,0 +1,119 @@ + true)); + + // Set application parameters in model + $app = JFactory::getApplication(); + $appParams = $app->getParams(); + $model->setState('params', $appParams); + + // Set the filters based on the module params + $model->setState('list.start', 0); + $model->setState('list.limit', (int) $params->get('count', 5)); + $model->setState('filter.published', 1); + + // This module does not use tags data + $model->setState('load_tags', false); + + // Access filter + $access = !JComponentHelper::getParams('com_content')->get('show_noauth'); + $authorised = JAccess::getAuthorisedViewLevels(JFactory::getUser()->get('id')); + $model->setState('filter.access', $access); + + // Category filter + $model->setState('filter.category_id', $params->get('catid', array())); + +/* + $ordering = 'a.ordering'; + $dir = 'ASC'; +*/ + // Set ordering + $order_map = array( + 'm_dsc' => 'a.modified DESC, a.created', + 'c_dsc' => 'a.created', + 'p_dsc' => 'a.publish_up', + 'ordering' => 'a.ordering ASC, a.id', + 'random' => $db->getQuery(true)->Rand(), + ); + + $ordering = ArrayHelper::getValue($order_map, $params->get('ordering'), 'a.publish_up'); + $dir = 'DESC'; + + $model->setState('list.ordering', $ordering); + $model->setState('list.direction', $dir); + + $items = $model->getItems(); + + + foreach ($items as &$item) + { + $item->slug = $item->id . ':' . $item->alias; + + /** @deprecated Catslug is deprecated, use catid instead. 4.0 */ + $item->catslug = $item->catid . ':' . $item->category_alias; + + if ($access || in_array($item->access, $authorised)) + { + // We know that user has the privilege to view the article + $item->link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); + } + else + { + $item->link = JRoute::_('index.php?option=com_users&view=login'); + } + + $fields = FieldsHelper::getFields('com_content.article', $item, true); + + foreach ($fields as $field) + { + $item->fields[$field->name] = $field; + } + } + +/* + echo '
';
+		print_r($items[0]->fields['agx-btnstyle']);
+		echo '
'; +*/ + return $items; + } +} diff --git a/languages/en-GB/en-GB.mod_agx_slideshow.ini b/languages/en-GB/en-GB.mod_agx_slideshow.ini new file mode 100644 index 0000000..67223f6 --- /dev/null +++ b/languages/en-GB/en-GB.mod_agx_slideshow.ini @@ -0,0 +1,7 @@ +; Joomla! Project +; Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 + +MOD_AGX_SLIDESHOW="Agerix - Slideshow" +MOD_AGX_SLIDESHOW_XML_DESCRIPTION="
Ce module vous permet d'utiliser les articles de Joomla pour créer un slideshow compatible UiKit v2 & 3
" \ No newline at end of file diff --git a/languages/en-GB/en-GB.mod_agx_slideshow.sys.ini b/languages/en-GB/en-GB.mod_agx_slideshow.sys.ini new file mode 100644 index 0000000..d661e35 --- /dev/null +++ b/languages/en-GB/en-GB.mod_agx_slideshow.sys.ini @@ -0,0 +1,7 @@ +; Joomla! Project +; Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 + +MOD_AGX_SLIDESHOW="Agerix - Slideshow" +MOD_AGX_SLIDESHOW_XML_DESCRIPTION="Ce module vous permet d'utiliser les articles de Joomla pour créer un slideshow compatible UiKit v2 & 3" diff --git a/mod_agx_slideshow.php b/mod_agx_slideshow.php new file mode 100644 index 0000000..9239f42 --- /dev/null +++ b/mod_agx_slideshow.php @@ -0,0 +1,18 @@ +get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8'); + +require JModuleHelper::getLayoutPath('mod_agx_slideshow', $params->get('layout', 'default')); diff --git a/mod_agx_slideshow.xml b/mod_agx_slideshow.xml new file mode 100644 index 0000000..91d4bc4 --- /dev/null +++ b/mod_agx_slideshow.xml @@ -0,0 +1,260 @@ + + + mod_agx_slideshow + Joomla! Project + October 2018 + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + emmanuel.danan@agerix.fr + www.agerix.fr + 1.0.1 + MOD_AGX_SLIDESHOW_XML_DESCRIPTION + + + mod_agx_slideshow.php + helper.php + tmpl + languages + + + languages/en-GB/en-GB.mod_agx_slideshow.ini + languages/en-GB/en-GB.mod_agx_slideshow.sys.ini + + + + +
+ + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + +
+
+
+
diff --git a/tmpl/default.php b/tmpl/default.php new file mode 100644 index 0000000..953f691 --- /dev/null +++ b/tmpl/default.php @@ -0,0 +1,136 @@ +get('agx_animation', 'fade') . '\''; +$slideshow_params[] = 'duration:' . $params->get('agx_duration', '500'); +$slideshow_params[] = 'height:' . '\'' . $params->get('agx_height', 'auto') . '\''; +$slideshow_params[] = 'autoplayInterval:' . $params->get('agx_autoplayInterval', '7000'); +$slideshow_params[] = 'autoplay:' . ($params->get('agx_autoplay', '1') ? 'true' : 'false'); +$slideshow_params[] = 'pauseOnHover:' . ($params->get('agx_pauseOnHover', '1') ? 'true' : 'false'); +$slideshow_params[] = 'videoautoplay:' . ($params->get('agx_videoautoplay', '1') ? 'true' : 'false'); +$slideshow_params[] = 'videomute:' . ($params->get('agx_videomute', '1') ? 'true' : 'false'); +$slideshow_params[] = 'kenburns:' . ($params->get('agx_kenburns', '1') ? 'true' : 'false'); +?> + +
+ + get('agx_nav_arrows', '1')) : ?> + + + + get('agx_nav_bubbles', '1')) : ?> + + +
diff --git a/tmpl/sans-overlay-interne.php b/tmpl/sans-overlay-interne.php new file mode 100644 index 0000000..c2a2561 --- /dev/null +++ b/tmpl/sans-overlay-interne.php @@ -0,0 +1,56 @@ +get('agx_animation', 'fade') . '\''; +$slideshow_params[] = 'duration:' . $params->get('agx_duration', '500'); +$slideshow_params[] = 'height:' . '\'' . $params->get('agx_height', 'auto') . '\''; +$slideshow_params[] = 'autoplayInterval:' . $params->get('agx_autoplayInterval', '7000'); +$slideshow_params[] = 'autoplay:' . ($params->get('agx_autoplay', '1') ? 'true' : 'false'); +$slideshow_params[] = 'pauseOnHover:' . ($params->get('agx_pauseOnHover', '1') ? 'true' : 'false'); +$slideshow_params[] = 'videoautoplay:' . ($params->get('agx_videoautoplay', '1') ? 'true' : 'false'); +$slideshow_params[] = 'videomute:' . ($params->get('agx_videomute', '1') ? 'true' : 'false'); +$slideshow_params[] = 'kenburns:' . ($params->get('agx_kenburns', '1') ? 'true' : 'false'); +?> + +
+ + get('agx_nav_arrows', '1')) : ?> + + + + get('agx_nav_bubbles', '1')) : ?> + + +
diff --git a/tmpl/sans-overlay.php b/tmpl/sans-overlay.php new file mode 100644 index 0000000..063973d --- /dev/null +++ b/tmpl/sans-overlay.php @@ -0,0 +1,56 @@ +get('agx_animation', 'fade') . '\''; +$slideshow_params[] = 'duration:' . $params->get('agx_duration', '500'); +$slideshow_params[] = 'height:' . '\'' . $params->get('agx_height', 'auto') . '\''; +$slideshow_params[] = 'autoplayInterval:' . $params->get('agx_autoplayInterval', '7000'); +$slideshow_params[] = 'autoplay:' . ($params->get('agx_autoplay', '1') ? 'true' : 'false'); +$slideshow_params[] = 'pauseOnHover:' . ($params->get('agx_pauseOnHover', '1') ? 'true' : 'false'); +$slideshow_params[] = 'videoautoplay:' . ($params->get('agx_videoautoplay', '1') ? 'true' : 'false'); +$slideshow_params[] = 'videomute:' . ($params->get('agx_videomute', '1') ? 'true' : 'false'); +$slideshow_params[] = 'kenburns:' . ($params->get('agx_kenburns', '1') ? 'true' : 'false'); +?> + +
+ + get('agx_nav_arrows', '1')) : ?> + + + + get('agx_nav_bubbles', '1')) : ?> + + +