-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
pe7er
committed
Nov 4, 2015
1 parent
1a321f0
commit 069aa85
Showing
2 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
administrator/components/com_finder/models/fields/branches.php
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,52 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Administrator | ||
* @subpackage com_finder | ||
* | ||
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE | ||
*/ | ||
|
||
defined('JPATH_BASE') or die(); | ||
|
||
JFormHelper::loadFieldClass('list'); | ||
|
||
/** | ||
* Search Filter field for the Finder package. | ||
* | ||
* @since 3.5 | ||
*/ | ||
class JFormFieldBranches extends JFormFieldList | ||
{ | ||
/** | ||
* The form field type. | ||
* | ||
* @var string | ||
* @since 3.5 | ||
*/ | ||
protected $type = 'Branches'; | ||
|
||
/** | ||
* Method to get the field options. | ||
* | ||
* @return array The field option objects. | ||
* | ||
* @since 3.5 | ||
*/ | ||
public function getOptions() | ||
{ | ||
// Build the query. | ||
$db = JFactory::getDbo(); | ||
$query = $db->getQuery(true) | ||
->select('id AS value, title AS text') | ||
->from($db->quoteName('#__finder_taxonomy')) | ||
->where('parent_id = 1') | ||
->order('title ASC'); | ||
$db->setQuery($query); | ||
$options = $db->loadObjectList(); | ||
|
||
array_unshift($options, JHtml::_('select.option', '', JText::_('COM_FINDER_MAPS_SELECT_BRANCHE'), 'value', 'text')); | ||
|
||
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