You've already forked joomla_test
							
							first commit
This commit is contained in:
		| @ -0,0 +1,95 @@ | ||||
| <?php | ||||
| /** | ||||
|  * @package     Joomla.Administrator | ||||
|  * @subpackage  com_finder | ||||
|  * | ||||
|  * @copyright   Copyright (C) 2005 - 2013 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'); | ||||
|  | ||||
| // Load the base adapter. | ||||
| require_once JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer/adapter.php'; | ||||
|  | ||||
| /** | ||||
|  * Renders a list of directories. | ||||
|  * | ||||
|  * @package     Joomla.Administrator | ||||
|  * @subpackage  com_finder | ||||
|  * @since       2.5 | ||||
|  */ | ||||
| class JFormFieldDirectories extends JFormFieldList | ||||
| { | ||||
| 	/** | ||||
| 	 * The form field type. | ||||
| 	 * | ||||
| 	 * @var    string | ||||
| 	 * @since  2.5 | ||||
| 	 */ | ||||
| 	protected $type = 'Directories'; | ||||
|  | ||||
| 	/** | ||||
| 	 * Method to get the field options. | ||||
| 	 * | ||||
| 	 * @return  array  The field option objects. | ||||
| 	 * | ||||
| 	 * @since   2.5 | ||||
| 	 */ | ||||
| 	public function getOptions() | ||||
| 	{ | ||||
| 		$values = array(); | ||||
| 		$options = array(); | ||||
| 		$exclude = array( | ||||
| 			JPATH_ADMINISTRATOR, | ||||
| 			JPATH_INSTALLATION, | ||||
| 			JPATH_LIBRARIES, | ||||
| 			JPATH_PLUGINS, | ||||
| 			JPATH_SITE . '/cache', | ||||
| 			JPATH_SITE . '/components', | ||||
| 			JPATH_SITE . '/includes', | ||||
| 			JPATH_SITE . '/language', | ||||
| 			JPATH_SITE . '/modules', | ||||
| 			JPATH_THEMES, | ||||
| 			JFactory::getApplication()->getCfg('log_path'), | ||||
| 			JFactory::getApplication()->getCfg('tmp_path') | ||||
| 		); | ||||
|  | ||||
| 		// Get the base directories. | ||||
| 		jimport('joomla.filesystem.folder'); | ||||
| 		$dirs = JFolder::folders(JPATH_SITE, '.', false, true); | ||||
|  | ||||
| 		// Iterate through the base directories and find the subdirectories. | ||||
| 		foreach ($dirs as $dir) | ||||
| 		{ | ||||
| 			// Check if the directory should be excluded. | ||||
| 			if (in_array($dir, $exclude)) | ||||
| 			{ | ||||
| 				continue; | ||||
| 			} | ||||
|  | ||||
| 			// Get the child directories. | ||||
| 			$return = JFolder::folders($dir, '.', true, true); | ||||
|  | ||||
| 			// Merge the directories. | ||||
| 			if (is_array($return)) | ||||
| 			{ | ||||
| 				$values[] = $dir; | ||||
| 				$values = array_merge($values, $return); | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		// Convert the values to options. | ||||
| 		foreach ($values as $value) | ||||
| 		{ | ||||
| 			$options[] = JHtml::_('select.option', str_replace(JPATH_SITE . '/', '', $value), str_replace(JPATH_SITE . '/', '', $values)); | ||||
| 		} | ||||
|  | ||||
| 		// Add a null option. | ||||
| 		array_unshift($options, JHtml::_('select.option', '', '- ' . JText::_('JNONE') . ' -')); | ||||
|  | ||||
| 		return $options; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1 @@ | ||||
| <!DOCTYPE html><title></title> | ||||
| @ -0,0 +1,54 @@ | ||||
| <?php | ||||
| /** | ||||
|  * @package     Joomla.Administrator | ||||
|  * @subpackage  com_finder | ||||
|  * | ||||
|  * @copyright   Copyright (C) 2005 - 2013 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. | ||||
|  * | ||||
|  * @package     Joomla.Administrator | ||||
|  * @subpackage  com_finder | ||||
|  * @since       2.5 | ||||
|  */ | ||||
| class JFormFieldSearchFilter extends JFormFieldList | ||||
| { | ||||
| 	/** | ||||
| 	 * The form field type. | ||||
| 	 * | ||||
| 	 * @var    string | ||||
| 	 * @since  2.5 | ||||
| 	 */ | ||||
| 	protected $type = 'SearchFilter'; | ||||
|  | ||||
| 	/** | ||||
| 	 * Method to get the field options. | ||||
| 	 * | ||||
| 	 * @return  array  The field option objects. | ||||
| 	 * | ||||
| 	 * @since   2.5 | ||||
| 	 */ | ||||
| 	public function getOptions() | ||||
| 	{ | ||||
| 		// Build the query. | ||||
| 		$db = JFactory::getDbo(); | ||||
| 		$query = $db->getQuery(true) | ||||
| 			->select('f.title AS text, f.filter_id AS value') | ||||
| 			->from($db->quoteName('#__finder_filters') . ' AS f') | ||||
| 			->where('f.state = 1') | ||||
| 			->order('f.title ASC'); | ||||
| 		$db->setQuery($query); | ||||
| 		$options = $db->loadObjectList(); | ||||
|  | ||||
| 		array_unshift($options, JHtml::_('select.option', '', JText::_('COM_FINDER_SELECT_SEARCH_FILTER'), 'value', 'text')); | ||||
|  | ||||
| 		return $options; | ||||
| 	} | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 alazhar
					alazhar