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; +?> +