-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from hr-it-solutions/dev
Release v1.1.1.4
- Loading branch information
Showing
12 changed files
with
324 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
/** | ||
* @package DD_GMaps_Module | ||
* | ||
* @author HR IT-Solutions Florian Häusler <[email protected]> | ||
* @copyright Copyright (C) 2017 - 2017 Didldu e.K. | HR IT-Solutions | ||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only | ||
**/ | ||
|
||
defined('_JEXEC') or die('Restricted access'); | ||
|
||
JFormHelper::loadFieldClass('list'); | ||
|
||
jimport('joomla.application.categories'); | ||
|
||
class JFormFieldExtCPlugins extends JFormFieldList { | ||
|
||
protected $type = 'ExtCPlugins'; | ||
|
||
/** | ||
* Get Options | ||
* | ||
* @return array | ||
* | ||
* @since Version 1.0.0.0 | ||
*/ | ||
public function getOptions() | ||
{ | ||
$categories = JCategories::getInstance('DD_GMaps_Locations'); | ||
$subCategories = $categories->get()->getChildren(true); | ||
|
||
// Default field | ||
$options[0] = new StdClass; | ||
$options[0]->value = 0; | ||
$options[0]->text = JText::_('MOD_DD_GMAPS_MODULE_ADDON_DDGMAPS_LOCATIONS_EXTCID_SELECT'); | ||
|
||
$i = 1; | ||
|
||
$db = JFactory::getDbo(); | ||
$query = $db->getQuery(true); | ||
$query->select($db->qn('element')) | ||
->from($db->qn('#__extensions')) | ||
->where($db->qn('folder') . ' = ' . $db->quote('dd_gmaps_locations')) | ||
->where($db->qn('element') . ' LIKE ' . $db->quote('dd_ext_c_%')); | ||
$db->setQuery($query); | ||
$rows = $db->loadObjectList(); | ||
|
||
foreach( $rows as $row ) { | ||
$options[$i] = new StdClass; | ||
$options[$i]->value = 'com_' . trim($row->element, 'dd_ext_c_'); | ||
$options[$i]->text = strtoupper(trim($row->element, 'dd_ext_c_')) . ' Component'; | ||
++$i; | ||
} | ||
|
||
return $options; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
/** | ||
* @package DD_GMaps_Module | ||
* | ||
* @author HR IT-Solutions Florian Häusler <[email protected]> | ||
* @copyright Copyright (C) 2017 - 2017 Didldu e.K. | HR IT-Solutions | ||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only | ||
**/ | ||
|
||
defined('_JEXEC') or die('Restricted access'); | ||
|
||
JFormHelper::loadFieldClass('list'); | ||
|
||
jimport('joomla.application.categories'); | ||
|
||
class JFormFieldLocationCategory extends JFormFieldList { | ||
|
||
protected $type = 'LocationCategory'; | ||
|
||
/** | ||
* Get Options | ||
* | ||
* @return array | ||
* | ||
* @since Version 1.0.0.0 | ||
*/ | ||
public function getOptions() | ||
{ | ||
$categories = JCategories::getInstance('DD_GMaps_Locations'); | ||
$subCategories = $categories->get()->getChildren(true); | ||
|
||
// Default field | ||
$options[0] = new StdClass; | ||
$options[0]->value = 0; | ||
$options[0]->text = JText::_('JOPTION_SELECT_CATEGORY'); | ||
|
||
$i = 1; | ||
|
||
// If DD GMaps Locations | ||
if (file_exists(JPATH_ADMINISTRATOR . '/components/com_dd_gmaps_locations/dd_gmaps_locations.php') | ||
&& JComponentHelper::getComponent('com_dd_gmaps_locations', true)->enabled) | ||
{ | ||
foreach ($subCategories as $category) | ||
{ | ||
$options[$i] = new StdClass; | ||
$options[$i]->value = $category->id; | ||
$options[$i]->text = $category->title; | ||
++$i; | ||
} | ||
} | ||
|
||
return $options; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.