diff --git a/admin/config.xml b/admin/config.xml index fcffd17..4b05b7d 100644 --- a/admin/config.xml +++ b/admin/config.xml @@ -37,6 +37,7 @@ label="COM_DD_GMAPS_LOCATIONS_COMPONENT_MARK_AS_NEW_SELECTION_LABEL" description="COM_DD_GMAPS_LOCATIONS_COMPONENT_MARK_AS_NEW_SELECTION_DESC" > + diff --git a/admin/language/de-DE/de-DE.com_dd_gmaps_locations.sys.ini b/admin/language/de-DE/de-DE.com_dd_gmaps_locations.sys.ini index 5760366..4eac12f 100644 --- a/admin/language/de-DE/de-DE.com_dd_gmaps_locations.sys.ini +++ b/admin/language/de-DE/de-DE.com_dd_gmaps_locations.sys.ini @@ -65,6 +65,8 @@ COM_DD_GMAPS_LOCATIONS_HEADING_LOCATION="Adressee" COM_DD_GMAPS_LOCATIONS_HEADING_ZIP="PLZ" COM_DD_GMAPS_LOCATIONS_HEADING_COUNTRY="Land" +COM_DD_GMAPS_LOCATIONS_CATEGORIES_VIEW_DEFAULT_OPTIONS="Kategorien" +COM_DD_GMAPS_LOCATIONS_CATEGORIES_VIEW_DEFAULT_DESC="Zeige Kategorien" COM_DD_GMAPS_LOCATIONS_LOCATIONS_VIEW_DEFAULT_TITLE="Zeigt Standorte an" COM_DD_GMAPS_LOCATIONS_LOCATIONS_VIEW_DEFAULT_DESC="Zeigt Standorte an" COM_DD_GMAPS_LOCATIONS_LOCATIONS_VIEW_DEFAULT_OPTION="Default" diff --git a/admin/language/en-GB/en-GB.com_dd_gmaps_locations.sys.ini b/admin/language/en-GB/en-GB.com_dd_gmaps_locations.sys.ini index 71e3eba..5960718 100644 --- a/admin/language/en-GB/en-GB.com_dd_gmaps_locations.sys.ini +++ b/admin/language/en-GB/en-GB.com_dd_gmaps_locations.sys.ini @@ -65,6 +65,8 @@ COM_DD_GMAPS_LOCATIONS_HEADING_LOCATION="Addresse" COM_DD_GMAPS_LOCATIONS_HEADING_ZIP="ZIP" COM_DD_GMAPS_LOCATIONS_HEADING_COUNTRY="Country" +COM_DD_GMAPS_LOCATIONS_CATEGORIES_VIEW_DEFAULT_OPTIONS="Categories" +COM_DD_GMAPS_LOCATIONS_CATEGORIES_VIEW_DEFAULT_DESC="Shows Categories" COM_DD_GMAPS_LOCATIONS_LOCATIONS_VIEW_DEFAULT_TITLE="Shows Locations" COM_DD_GMAPS_LOCATIONS_LOCATIONS_VIEW_DEFAULT_DESC="Shows Locations" COM_DD_GMAPS_LOCATIONS_LOCATIONS_VIEW_DEFAULT_OPTION="Default" diff --git a/admin/language/ru-RU/ru-RU.com_dd_gmaps_locations.sys.ini b/admin/language/ru-RU/ru-RU.com_dd_gmaps_locations.sys.ini index 0244d93..84018cd 100644 --- a/admin/language/ru-RU/ru-RU.com_dd_gmaps_locations.sys.ini +++ b/admin/language/ru-RU/ru-RU.com_dd_gmaps_locations.sys.ini @@ -66,6 +66,9 @@ COM_DD_GMAPS_LOCATIONS_HEADING_LOCATION="Адрес" COM_DD_GMAPS_LOCATIONS_HEADING_ZIP="Почтовый индекс" COM_DD_GMAPS_LOCATIONS_HEADING_COUNTRY="Страна" +; todo: translate +COM_DD_GMAPS_LOCATIONS_CATEGORIES_VIEW_DEFAULT_OPTIONS="Categories" +COM_DD_GMAPS_LOCATIONS_CATEGORIES_VIEW_DEFAULT_DESC="Shows Categories" COM_DD_GMAPS_LOCATIONS_LOCATIONS_VIEW_DEFAULT_TITLE="Показывает географические положения" COM_DD_GMAPS_LOCATIONS_LOCATIONS_VIEW_DEFAULT_DESC="Показывает географические положения" COM_DD_GMAPS_LOCATIONS_LOCATIONS_VIEW_DEFAULT_OPTION="По умолчанию" diff --git a/admin/views/location/tmpl/edit.php b/admin/views/location/tmpl/edit.php index 1c2bf95..b42d49d 100644 --- a/admin/views/location/tmpl/edit.php +++ b/admin/views/location/tmpl/edit.php @@ -302,7 +302,7 @@ class="btn btn-small btn-danger" -

diff --git a/admin/views/locations/tmpl/modal.php b/admin/views/locations/tmpl/modal.php index b9a797a..2590b1c 100644 --- a/admin/views/locations/tmpl/modal.php +++ b/admin/views/locations/tmpl/modal.php @@ -109,7 +109,7 @@ . ' data-title="' . $this->escape(addslashes($item->title)) . '"' . ' data-uri="' . $this->escape('index.php?option=com_dd_gmaps_locations&view=profile&id=' . (int) $item->id) . '"' ?> - > + > escape($item->title); ?> diff --git a/site/models/categories.php b/site/models/categories.php new file mode 100644 index 0000000..85cf070 --- /dev/null +++ b/site/models/categories.php @@ -0,0 +1,66 @@ + + * @copyright Copyright (C) 2011 - 2018 Didldu e.K. | HR IT-Solutions + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only + **/ + +defined('_JEXEC') or die; + +class DD_GMaps_LocationsModelCategories extends JModelList +{ + + /** + * populateState + * + * @param string $ordering An optional ordering field. + * @param string $direction An optional direction (asc|desc). + * + * @return void + * + * @since Version 1.1.1.8 + */ + protected function populateState($ordering = null, $direction = null, $listlimit = true) + { + parent::populateState($ordering, $direction); + + $catid = (int) JFactory::getApplication()->input->get('catid'); + + // Category + if ($catid) + { + $this->setState('dd_filter.catid', $catid); + } + } + + /** + * getListQuery + * + * @since Version 1.1.1.8 + * + * @return JDatabaseQuery + */ + public function getListQuery() + { + $db = $this->getDbo(); + $query = $db->getQuery(true); + + $catid = (int) $this->getState('dd_filter.catid'); + + $select = $db->qn(array('c.id', 'c.title', 'c.description', 'c.params')); + + $query->select($select); + + $query->from($db->qn('#__categories', 'c')) + ->join('INNER', $db->qn('#__categories', 'cc') . ' ON ' . $db->qn('c.parent_id') . ' = ' . $db->qn('cc.id')) + ->where($db->qn('c.parent_id') . ' != 1') + ->where($db->qn('cc.id') . ' = ' . $db->q($catid)) + ->where($db->qn('c.published') . '= 1 OR' . ($db->qn('c.id') . ' = ' . $db->q($catid))); + + $db->setQuery($query); + + return $query; + } +} diff --git a/site/models/profile.php b/site/models/profile.php index 8be9af6..630a028 100644 --- a/site/models/profile.php +++ b/site/models/profile.php @@ -41,6 +41,7 @@ public function getItem($id = null) array( 'a.id', 'a.title', + 'a.alias', 'a.catid', 'a.state', 'a.profileimage', diff --git a/site/router.php b/site/router.php index 43f555e..45fcea3 100644 --- a/site/router.php +++ b/site/router.php @@ -92,7 +92,8 @@ public function preprocess($query) $allowed_views = array( 'locations', - 'profile' + 'profile', + 'categories' ); if (!isset($query['view']) || !in_array($query['view'], $allowed_views)) diff --git a/site/views/categories/tmpl/default.php b/site/views/categories/tmpl/default.php new file mode 100644 index 0000000..d44b1b6 --- /dev/null +++ b/site/views/categories/tmpl/default.php @@ -0,0 +1,30 @@ + + * @copyright Copyright (C) 2011 - 2018 Didldu e.K. | HR IT-Solutions + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only + **/ + +defined('_JEXEC') or die; +?> +

+
+ items as $i => $item): ?> +
'; } ?> +
+
escape($item->title); ?>
+ <?php echo json_decode($item->params)->image_alt; ?> +
+
+ description; ?> +
+
+ + +
+
+ +
+
diff --git a/site/views/categories/tmpl/default.xml b/site/views/categories/tmpl/default.xml new file mode 100644 index 0000000..a6e120f --- /dev/null +++ b/site/views/categories/tmpl/default.xml @@ -0,0 +1,23 @@ + + + + + + + + + + +
+ + + + + +
+
+
\ No newline at end of file diff --git a/site/views/categories/view.html.php b/site/views/categories/view.html.php new file mode 100644 index 0000000..d5bbe6d --- /dev/null +++ b/site/views/categories/view.html.php @@ -0,0 +1,73 @@ + + * @copyright Copyright (C) 2011 - 2018 Didldu e.K. | HR IT-Solutions + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only + **/ + +defined('_JEXEC') or die; + +class DD_GMaps_LocationsViewCategories extends JViewLegacy +{ + protected $app; + + protected $items; + + protected $params; + + /** + * Execute and display a template script. + * + * @param string $tpl The name of the template file to parse + * + * @return boolean | mixed + * + * @since Version 1.1.0.0 + * @throws Exception + */ + public function display($tpl = null) + { + $this->app = JFactory::getApplication(); + + $this->items = $this->get('Items'); + + $this->params = $this->app->getParams(); + + // Active menu + $activeMenu = $this->app->getMenu()->getItem($this->app->getMenu()->getActive()->id); + + if (method_exists($activeMenu, 'getParams')) // Joomla 3.7.xx + { + // Active menu params + $activeMenuParams = $activeMenu->getParams(); + + // Get meta data from menu + $metadesc = $activeMenuParams->get('menu-meta_description'); + $metakey = $activeMenuParams->get('menu-meta_keywords'); + $robots = $activeMenuParams->get('robots'); + } + else // Joomla 3.5.xx + { + // Get meta data from menu + $metadesc = $activeMenu->{'menu-meta_description'}; + $metakey = $activeMenu->{'menu-meta_keywords'}; + $robots = $activeMenu->robots; + } + + // Set meta data haeder from menu : default from item + $doc = JFactory::getDocument(); + $doc->setMetaData('description', $metadesc); + $doc->setMetaData('keywords', $metakey); + $doc->setMetaData('robots', $robots); + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new Exception(implode("\n", $errors), 500); + } + + return parent::display($tpl); + } +} diff --git a/site/views/locations/tmpl/default_items.php b/site/views/locations/tmpl/default_items.php index ca37a5a..617f81c 100644 --- a/site/views/locations/tmpl/default_items.php +++ b/site/views/locations/tmpl/default_items.php @@ -45,7 +45,7 @@ get('mark_as_new', 0); - if( strtotime("-$mark_as_new days") < strtotime($item->created)):?> + if($mark_as_new AND strtotime("-$mark_as_new days") < strtotime($item->created)):?> get('show_on_map')):?> - + diff --git a/site/views/profile/tmpl/default.php b/site/views/profile/tmpl/default.php index 82acd3d..e0f13dc 100644 --- a/site/views/profile/tmpl/default.php +++ b/site/views/profile/tmpl/default.php @@ -30,7 +30,7 @@ params->get('mark_as_new', 0); - if( strtotime("-$mark_as_new days") < strtotime($this->item->created)):?> + if($mark_as_new AND strtotime("-$mark_as_new days") < strtotime($this->item->created)):?>