From 338cff68eccf8c8e03967f9ebeda3d4c9b0e2e36 Mon Sep 17 00:00:00 2001 From: vistamedia Date: Sat, 6 Apr 2019 23:38:46 +0200 Subject: [PATCH] Initial commit --- helper.php | 119 ++++++++ languages/en-GB/en-GB.mod_agx_slideshow.ini | 7 + .../en-GB/en-GB.mod_agx_slideshow.sys.ini | 7 + mod_agx_slideshow.php | 18 ++ mod_agx_slideshow.xml | 260 ++++++++++++++++++ tmpl/default.php | 136 +++++++++ tmpl/sans-overlay-interne.php | 56 ++++ tmpl/sans-overlay.php | 56 ++++ 8 files changed, 659 insertions(+) create mode 100644 helper.php create mode 100644 languages/en-GB/en-GB.mod_agx_slideshow.ini create mode 100644 languages/en-GB/en-GB.mod_agx_slideshow.sys.ini create mode 100644 mod_agx_slideshow.php create mode 100644 mod_agx_slideshow.xml create mode 100644 tmpl/default.php create mode 100644 tmpl/sans-overlay-interne.php create mode 100644 tmpl/sans-overlay.php 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')) : ?> + + +