Spade

Mini Shell

Directory:~$ /home/lmsyaran/public_html/joomla4/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ /home/lmsyaran/public_html/joomla4/search.php.tar

home/lmsyaran/public_html/libraries/regularlabs/helpers/search.php000064400000013547151156430350021540
0ustar00<?php
/**
 * @package         Regular Labs Library
 * @version         21.2.19653
 * 
 * @author          Peter van Westen <info@regularlabs.com>
 * @link            http://www.regularlabs.com
 * @copyright       Copyright © 2021 Regular Labs All Rights Reserved
 * @license         http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 */

/**
 * BASE ON JOOMLA CORE FILE:
 * /components/com_search/models/search.php
 */

/**
 * @package     Joomla.Site
 * @subpackage  com_search
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Factory as JFactory;
use Joomla\CMS\MVC\Model\BaseDatabaseModel as JModel;
use Joomla\CMS\Pagination\Pagination as JPagination;
use Joomla\CMS\Plugin\PluginHelper as JPluginHelper;

/**
 * Search Component Search Model
 *
 * @since  1.5
 */
class SearchModelSearch extends JModel
{
	/**
	 * Search data array
	 *
	 * @var array
	 */
	protected $_data = null;

	/**
	 * Search total
	 *
	 * @var integer
	 */
	protected $_total = null;

	/**
	 * Search areas
	 *
	 * @var integer
	 */
	protected $_areas = null;

	/**
	 * Pagination object
	 *
	 * @var object
	 */
	protected $_pagination = null;

	/**
	 * Constructor
	 *
	 * @since 1.5
	 */
	public function __construct()
	{
		parent::__construct();

		// Get configuration
		$app    = JFactory::getApplication();
		$config = JFactory::getConfig();

		// Get the pagination request variables
		$this->setState('limit',
$app->getUserStateFromRequest('com_search.limit',
'limit', $config->get('list_limit'),
'uint'));
		$this->setState('limitstart',
$app->input->get('limitstart', 0, 'uint'));

		// Get parameters.
		$params = $app->getParams();

		if ($params->get('searchphrase') == 1)
		{
			$searchphrase = 'any';
		}
		elseif ($params->get('searchphrase') == 2)
		{
			$searchphrase = 'exact';
		}
		else
		{
			$searchphrase = 'all';
		}

		// Set the search parameters
		$keyword  =
urldecode($app->input->getString('searchword'));
		$match    = $app->input->get('searchphrase',
$searchphrase, 'word');
		$ordering = $app->input->get('ordering',
$params->get('ordering', 'newest'),
'word');
		$this->setSearch($keyword, $match, $ordering);

		// Set the search areas
		$areas = $app->input->get('areas', null,
'array');
		$this->setAreas($areas);
	}

	/**
	 * Method to set the search parameters
	 *
	 * @param string $keyword  string search string
	 * @param string $match    matching option, exact|any|all
	 * @param string $ordering option, newest|oldest|popular|alpha|category
	 *
	 * @return  void
	 *
	 * @access    public
	 */
	public function setSearch($keyword, $match = 'all', $ordering =
'newest')
	{
		if (isset($keyword))
		{
			$this->setState('origkeyword', $keyword);

			if ($match !== 'exact')
			{
				$keyword = preg_replace('#\xE3\x80\x80#s', ' ',
$keyword);
			}

			$this->setState('keyword', $keyword);
		}

		if (isset($match))
		{
			$this->setState('match', $match);
		}

		if (isset($ordering))
		{
			$this->setState('ordering', $ordering);
		}
	}

	/**
	 * Method to get weblink item data for the category
	 *
	 * @access public
	 * @return array
	 */
	public function getData()
	{
		// Lets load the content if it doesn't already exist
		if (empty($this->_data))
		{
			$areas = $this->getAreas();

			JPluginHelper::importPlugin('search');
			$dispatcher = JEventDispatcher::getInstance();
			$results    = $dispatcher->trigger('onContentSearch', [
					$this->getState('keyword'),
					$this->getState('match'),
					$this->getState('ordering'),
					$areas['active'],
				]
			);

			$rows = [];

			foreach ($results as $result)
			{
				$rows = array_merge((array) $rows, (array) $result);
			}

			$this->_total = count($rows);

			if ($this->getState('limit') > 0)
			{
				$this->_data = array_splice($rows,
$this->getState('limitstart'),
$this->getState('limit'));
			}
			else
			{
				$this->_data = $rows;
			}

			/* >>> ADDED: Run content plugins over results */
			$params =
JFactory::getApplication()->getParams('com_content');
			$params->set('rl_search', 1);
			foreach ($this->_data as $item)
			{
				if (empty($item->text))
				{
					continue;
				}

				$dispatcher->trigger('onContentPrepare',
['com_search.search.article', &$item, &$params, 0]);

				if (empty($item->title))
				{
					continue;
				}

				// strip html tags from title
				$item->title = strip_tags($item->title);
			}
			/* <<< */
		}

		return $this->_data;
	}

	/**
	 * Method to get the total number of weblink items for the category
	 *
	 * @access  public
	 *
	 * @return  integer
	 */
	public function getTotal()
	{
		return $this->_total;
	}

	/**
	 * Method to set the search areas
	 *
	 * @param array $active areas
	 * @param array $search areas
	 *
	 * @return  void
	 *
	 * @access  public
	 */
	public function setAreas($active = [], $search = [])
	{
		$this->_areas['active'] = $active;
		$this->_areas['search'] = $search;
	}

	/**
	 * Method to get a pagination object of the weblink items for the category
	 *
	 * @access public
	 * @return  integer
	 */
	public function getPagination()
	{
		// Lets load the content if it doesn't already exist
		if (empty($this->_pagination))
		{
			$this->_pagination = new JPagination($this->getTotal(),
$this->getState('limitstart'),
$this->getState('limit'));
		}

		return $this->_pagination;
	}

	/**
	 * Method to get the search areas
	 *
	 * @return int
	 *
	 * @since 1.5
	 */
	public function getAreas()
	{
		// Load the Category data
		if (empty($this->_areas['search']))
		{
			$areas = [];

			JPluginHelper::importPlugin('search');
			$dispatcher  = JEventDispatcher::getInstance();
			$searchareas =
$dispatcher->trigger('onContentSearchAreas');

			foreach ($searchareas as $area)
			{
				if (is_array($area))
				{
					$areas = array_merge($areas, $area);
				}
			}

			$this->_areas['search'] = $areas;
		}

		return $this->_areas;
	}
}
home/lmsyaran/public_html/j3/libraries/joomla/mediawiki/search.php000064400000006136151156621120021324
0ustar00<?php
/**
 * @package     Joomla.Platform
 * @subpackage  MediaWiki
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

defined('JPATH_PLATFORM') or die;

/**
 * MediaWiki API Search class for the Joomla Platform.
 *
 * @since  3.1.4
 */
class JMediawikiSearch extends JMediawikiObject
{
	/**
	 * Method to perform a full text search.
	 *
	 * @param   string   $srsearch     Search for all page titles (or content)
that has this value.
	 * @param   array    $srnamespace  The namespace(s) to enumerate.
	 * @param   string   $srwhat       Search inside the text or titles.
	 * @param   array    $srinfo       What metadata to return.
	 * @param   array    $srprop       What properties to return.
	 * @param   boolean  $srredirects  Include redirect pages in the search.
	 * @param   integer  $sroffest     Use this value to continue paging.
	 * @param   integer  $srlimit      How many total pages to return.
	 *
	 * @return  object
	 *
	 * @since   3.1.4
	 */
	public function search($srsearch, array $srnamespace = null, $srwhat =
null, array $srinfo = null, array $srprop = null,
		$srredirects = null, $sroffest = null, $srlimit = null)
	{
		// Build the request.
		$path = '?action=query&list=search';

		if (isset($srsearch))
		{
			$path .= '&srsearch=' . $srsearch;
		}

		if (isset($srnamespace))
		{
			$path .= '&srnamespace=' .
$this->buildParameter($srnamespace);
		}

		if (isset($srwhat))
		{
			$path .= '&srwhat=' . $srwhat;
		}

		if (isset($srinfo))
		{
			$path .= '&srinfo=' . $this->buildParameter($srinfo);
		}

		if (isset($srprop))
		{
			$path .= '&srprop=' . $this->buildParameter($srprop);
		}

		if ($srredirects)
		{
			$path .= '&srredirects=';
		}

		if (isset($sroffest))
		{
			$path .= '&sroffest=' . $sroffest;
		}

		if (isset($srlimit))
		{
			$path .= '&srlimit=' . $srlimit;
		}

		// Send the request.
		$response = $this->client->get($this->fetchUrl($path));

		return $this->validateResponse($response);
	}

	/**
	 * Method to search the wiki using opensearch protocol.
	 *
	 * @param   string   $search     Search string.
	 * @param   integer  $limit	     Maximum amount of results to return.
	 * @param   array    $namespace  Namespaces to search.
	 * @param   string   $suggest    Do nothing if $wgEnableOpenSearchSuggest
is false.
	 * @param   string   $format     Output format.
	 *
	 * @return  object
	 *
	 * @since   3.1.4
	 */
	public function openSearch($search, $limit = null, array $namespace =
null, $suggest = null, $format = null)
	{
		// Build the request.
		$path = '?action=query&list=search';

		if (isset($search))
		{
			$path .= '&search=' . $search;
		}

		if (isset($limit))
		{
			$path .= '&limit=' . $limit;
		}

		if (isset($namespace))
		{
			$path .= '&namespace=' .
$this->buildParameter($namespace);
		}

		if (isset($suggest))
		{
			$path .= '&suggest=' . $suggest;
		}

		if (isset($format))
		{
			$path .= '&format=' . $format;
		}

		// Send the request.
		$response = $this->client->get($this->fetchUrl($path));

		return $this->validateResponse($response);
	}
}
home/lmsyaran/public_html/j3/libraries/joomla/github/package/search.php000064400000006520151156702020022232
0ustar00<?php
/**
 * @package     Joomla.Platform
 * @subpackage  GitHub
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

defined('JPATH_PLATFORM') or die;

/**
 * GitHub API Search class for the Joomla Platform.
 *
 * @documentation https://developer.github.com/v3/search
 *
 * @since       3.1.4
 * @deprecated  4.0  Use the `joomla/github` package via Composer instead
 */
class JGithubPackageSearch extends JGithubPackage
{
	/**
	 * Search issues.
	 *
	 * @param   string  $owner    The name of the owner of the repository.
	 * @param   string  $repo     The name of the repository.
	 * @param   string  $state    The state - open or closed.
	 * @param   string  $keyword  The search term.
	 *
	 * @throws UnexpectedValueException
	 *
	 * @since    3.3 (CMS)
	 *
	 * @return object
	 */
	public function issues($owner, $repo, $state, $keyword)
	{
		if (false == in_array($state, array('open',
'close')))
		{
			throw new UnexpectedValueException('State must be either
"open" or "closed"');
		}

		// Build the request path.
		$path = '/legacy/issues/search/' . $owner . '/' .
$repo . '/' . $state . '/' . $keyword;

		// Send the request.
		return $this->processResponse(
			$this->client->get($this->fetchUrl($path))
		);
	}

	/**
	 * Search repositories.
	 *
	 * Find repositories by keyword. Note, this legacy method does not follow
	 * the v3 pagination pattern.
	 * This method returns up to 100 results per page and pages can be fetched
	 * using the start_page parameter.
	 *
	 * @param   string   $keyword    The search term.
	 * @param   string   $language   Filter results by language
https://github.com/languages
	 * @param   integer  $startPage  Page number to fetch
	 *
	 * @since    3.3 (CMS)
	 *
	 * @return object
	 */
	public function repositories($keyword, $language = '',
$startPage = 0)
	{
		// Build the request path.
		$path = '/legacy/repos/search/' . $keyword . '?';

		$path .= ($language) ? '&language=' . $language :
'';
		$path .= ($startPage) ? '&start_page=' . $startPage :
'';

		// Send the request.
		return $this->processResponse(
			$this->client->get($this->fetchUrl($path))
		);
	}

	/**
	 * Search users.
	 *
	 * Find users by keyword.
	 *
	 * @param   string   $keyword    The search term.
	 * @param   integer  $startPage  Page number to fetch
	 *
	 * @since 3.3 (CMS)
	 *
	 * @return object
	 */
	public function users($keyword, $startPage = 0)
	{
		// Build the request path.
		$path = '/legacy/user/search/' . $keyword . '?';

		$path .= ($startPage) ? '&start_page=' . $startPage :
'';

		// Send the request.
		return $this->processResponse(
			$this->client->get($this->fetchUrl($path))
		);
	}

	/**
	 * Email search.
	 *
	 * This API call is added for compatibility reasons only. There’s no
guarantee
	 * that full email searches will always be available. The @ character in
the
	 * address must be left unencoded. Searches only against public email
addresses
	 * (as configured on the user’s GitHub profile).
	 *
	 * @param   string  $email  The email address(es).
	 *
	 * @since 3.3 (CMS)
	 *
	 * @return object
	 */
	public function email($email)
	{
		// Build the request path.
		$path = '/legacy/user/email/' . $email;

		// Send the request.
		return $this->processResponse(
			$this->client->get($this->fetchUrl($path))
		);
	}
}
home/lmsyaran/public_html/libraries/joomla/github/package/search.php000064400000006520151157144070021724
0ustar00<?php
/**
 * @package     Joomla.Platform
 * @subpackage  GitHub
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

defined('JPATH_PLATFORM') or die;

/**
 * GitHub API Search class for the Joomla Platform.
 *
 * @documentation https://developer.github.com/v3/search
 *
 * @since       3.1.4
 * @deprecated  4.0  Use the `joomla/github` package via Composer instead
 */
class JGithubPackageSearch extends JGithubPackage
{
	/**
	 * Search issues.
	 *
	 * @param   string  $owner    The name of the owner of the repository.
	 * @param   string  $repo     The name of the repository.
	 * @param   string  $state    The state - open or closed.
	 * @param   string  $keyword  The search term.
	 *
	 * @throws UnexpectedValueException
	 *
	 * @since    3.3 (CMS)
	 *
	 * @return object
	 */
	public function issues($owner, $repo, $state, $keyword)
	{
		if (false == in_array($state, array('open',
'close')))
		{
			throw new UnexpectedValueException('State must be either
"open" or "closed"');
		}

		// Build the request path.
		$path = '/legacy/issues/search/' . $owner . '/' .
$repo . '/' . $state . '/' . $keyword;

		// Send the request.
		return $this->processResponse(
			$this->client->get($this->fetchUrl($path))
		);
	}

	/**
	 * Search repositories.
	 *
	 * Find repositories by keyword. Note, this legacy method does not follow
	 * the v3 pagination pattern.
	 * This method returns up to 100 results per page and pages can be fetched
	 * using the start_page parameter.
	 *
	 * @param   string   $keyword    The search term.
	 * @param   string   $language   Filter results by language
https://github.com/languages
	 * @param   integer  $startPage  Page number to fetch
	 *
	 * @since    3.3 (CMS)
	 *
	 * @return object
	 */
	public function repositories($keyword, $language = '',
$startPage = 0)
	{
		// Build the request path.
		$path = '/legacy/repos/search/' . $keyword . '?';

		$path .= ($language) ? '&language=' . $language :
'';
		$path .= ($startPage) ? '&start_page=' . $startPage :
'';

		// Send the request.
		return $this->processResponse(
			$this->client->get($this->fetchUrl($path))
		);
	}

	/**
	 * Search users.
	 *
	 * Find users by keyword.
	 *
	 * @param   string   $keyword    The search term.
	 * @param   integer  $startPage  Page number to fetch
	 *
	 * @since 3.3 (CMS)
	 *
	 * @return object
	 */
	public function users($keyword, $startPage = 0)
	{
		// Build the request path.
		$path = '/legacy/user/search/' . $keyword . '?';

		$path .= ($startPage) ? '&start_page=' . $startPage :
'';

		// Send the request.
		return $this->processResponse(
			$this->client->get($this->fetchUrl($path))
		);
	}

	/**
	 * Email search.
	 *
	 * This API call is added for compatibility reasons only. There’s no
guarantee
	 * that full email searches will always be available. The @ character in
the
	 * address must be left unencoded. Searches only against public email
addresses
	 * (as configured on the user’s GitHub profile).
	 *
	 * @param   string  $email  The email address(es).
	 *
	 * @since 3.3 (CMS)
	 *
	 * @return object
	 */
	public function email($email)
	{
		// Build the request path.
		$path = '/legacy/user/email/' . $email;

		// Send the request.
		return $this->processResponse(
			$this->client->get($this->fetchUrl($path))
		);
	}
}
home/lmsyaran/public_html/j3/htaccess.back/joomla/mediawiki/search.php000064400000006136151160261420022042
0ustar00<?php
/**
 * @package     Joomla.Platform
 * @subpackage  MediaWiki
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

defined('JPATH_PLATFORM') or die;

/**
 * MediaWiki API Search class for the Joomla Platform.
 *
 * @since  3.1.4
 */
class JMediawikiSearch extends JMediawikiObject
{
	/**
	 * Method to perform a full text search.
	 *
	 * @param   string   $srsearch     Search for all page titles (or content)
that has this value.
	 * @param   array    $srnamespace  The namespace(s) to enumerate.
	 * @param   string   $srwhat       Search inside the text or titles.
	 * @param   array    $srinfo       What metadata to return.
	 * @param   array    $srprop       What properties to return.
	 * @param   boolean  $srredirects  Include redirect pages in the search.
	 * @param   integer  $sroffest     Use this value to continue paging.
	 * @param   integer  $srlimit      How many total pages to return.
	 *
	 * @return  object
	 *
	 * @since   3.1.4
	 */
	public function search($srsearch, array $srnamespace = null, $srwhat =
null, array $srinfo = null, array $srprop = null,
		$srredirects = null, $sroffest = null, $srlimit = null)
	{
		// Build the request.
		$path = '?action=query&list=search';

		if (isset($srsearch))
		{
			$path .= '&srsearch=' . $srsearch;
		}

		if (isset($srnamespace))
		{
			$path .= '&srnamespace=' .
$this->buildParameter($srnamespace);
		}

		if (isset($srwhat))
		{
			$path .= '&srwhat=' . $srwhat;
		}

		if (isset($srinfo))
		{
			$path .= '&srinfo=' . $this->buildParameter($srinfo);
		}

		if (isset($srprop))
		{
			$path .= '&srprop=' . $this->buildParameter($srprop);
		}

		if ($srredirects)
		{
			$path .= '&srredirects=';
		}

		if (isset($sroffest))
		{
			$path .= '&sroffest=' . $sroffest;
		}

		if (isset($srlimit))
		{
			$path .= '&srlimit=' . $srlimit;
		}

		// Send the request.
		$response = $this->client->get($this->fetchUrl($path));

		return $this->validateResponse($response);
	}

	/**
	 * Method to search the wiki using opensearch protocol.
	 *
	 * @param   string   $search     Search string.
	 * @param   integer  $limit	     Maximum amount of results to return.
	 * @param   array    $namespace  Namespaces to search.
	 * @param   string   $suggest    Do nothing if $wgEnableOpenSearchSuggest
is false.
	 * @param   string   $format     Output format.
	 *
	 * @return  object
	 *
	 * @since   3.1.4
	 */
	public function openSearch($search, $limit = null, array $namespace =
null, $suggest = null, $format = null)
	{
		// Build the request.
		$path = '?action=query&list=search';

		if (isset($search))
		{
			$path .= '&search=' . $search;
		}

		if (isset($limit))
		{
			$path .= '&limit=' . $limit;
		}

		if (isset($namespace))
		{
			$path .= '&namespace=' .
$this->buildParameter($namespace);
		}

		if (isset($suggest))
		{
			$path .= '&suggest=' . $suggest;
		}

		if (isset($format))
		{
			$path .= '&format=' . $format;
		}

		// Send the request.
		$response = $this->client->get($this->fetchUrl($path));

		return $this->validateResponse($response);
	}
}
home/lmsyaran/public_html/j3/libraries/regularlabs/helpers/search.php000064400000013547151161347530022057
0ustar00<?php
/**
 * @package         Regular Labs Library
 * @version         21.2.19653
 * 
 * @author          Peter van Westen <info@regularlabs.com>
 * @link            http://www.regularlabs.com
 * @copyright       Copyright © 2021 Regular Labs All Rights Reserved
 * @license         http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 */

/**
 * BASE ON JOOMLA CORE FILE:
 * /components/com_search/models/search.php
 */

/**
 * @package     Joomla.Site
 * @subpackage  com_search
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Factory as JFactory;
use Joomla\CMS\MVC\Model\BaseDatabaseModel as JModel;
use Joomla\CMS\Pagination\Pagination as JPagination;
use Joomla\CMS\Plugin\PluginHelper as JPluginHelper;

/**
 * Search Component Search Model
 *
 * @since  1.5
 */
class SearchModelSearch extends JModel
{
	/**
	 * Search data array
	 *
	 * @var array
	 */
	protected $_data = null;

	/**
	 * Search total
	 *
	 * @var integer
	 */
	protected $_total = null;

	/**
	 * Search areas
	 *
	 * @var integer
	 */
	protected $_areas = null;

	/**
	 * Pagination object
	 *
	 * @var object
	 */
	protected $_pagination = null;

	/**
	 * Constructor
	 *
	 * @since 1.5
	 */
	public function __construct()
	{
		parent::__construct();

		// Get configuration
		$app    = JFactory::getApplication();
		$config = JFactory::getConfig();

		// Get the pagination request variables
		$this->setState('limit',
$app->getUserStateFromRequest('com_search.limit',
'limit', $config->get('list_limit'),
'uint'));
		$this->setState('limitstart',
$app->input->get('limitstart', 0, 'uint'));

		// Get parameters.
		$params = $app->getParams();

		if ($params->get('searchphrase') == 1)
		{
			$searchphrase = 'any';
		}
		elseif ($params->get('searchphrase') == 2)
		{
			$searchphrase = 'exact';
		}
		else
		{
			$searchphrase = 'all';
		}

		// Set the search parameters
		$keyword  =
urldecode($app->input->getString('searchword'));
		$match    = $app->input->get('searchphrase',
$searchphrase, 'word');
		$ordering = $app->input->get('ordering',
$params->get('ordering', 'newest'),
'word');
		$this->setSearch($keyword, $match, $ordering);

		// Set the search areas
		$areas = $app->input->get('areas', null,
'array');
		$this->setAreas($areas);
	}

	/**
	 * Method to set the search parameters
	 *
	 * @param string $keyword  string search string
	 * @param string $match    matching option, exact|any|all
	 * @param string $ordering option, newest|oldest|popular|alpha|category
	 *
	 * @return  void
	 *
	 * @access    public
	 */
	public function setSearch($keyword, $match = 'all', $ordering =
'newest')
	{
		if (isset($keyword))
		{
			$this->setState('origkeyword', $keyword);

			if ($match !== 'exact')
			{
				$keyword = preg_replace('#\xE3\x80\x80#s', ' ',
$keyword);
			}

			$this->setState('keyword', $keyword);
		}

		if (isset($match))
		{
			$this->setState('match', $match);
		}

		if (isset($ordering))
		{
			$this->setState('ordering', $ordering);
		}
	}

	/**
	 * Method to get weblink item data for the category
	 *
	 * @access public
	 * @return array
	 */
	public function getData()
	{
		// Lets load the content if it doesn't already exist
		if (empty($this->_data))
		{
			$areas = $this->getAreas();

			JPluginHelper::importPlugin('search');
			$dispatcher = JEventDispatcher::getInstance();
			$results    = $dispatcher->trigger('onContentSearch', [
					$this->getState('keyword'),
					$this->getState('match'),
					$this->getState('ordering'),
					$areas['active'],
				]
			);

			$rows = [];

			foreach ($results as $result)
			{
				$rows = array_merge((array) $rows, (array) $result);
			}

			$this->_total = count($rows);

			if ($this->getState('limit') > 0)
			{
				$this->_data = array_splice($rows,
$this->getState('limitstart'),
$this->getState('limit'));
			}
			else
			{
				$this->_data = $rows;
			}

			/* >>> ADDED: Run content plugins over results */
			$params =
JFactory::getApplication()->getParams('com_content');
			$params->set('rl_search', 1);
			foreach ($this->_data as $item)
			{
				if (empty($item->text))
				{
					continue;
				}

				$dispatcher->trigger('onContentPrepare',
['com_search.search.article', &$item, &$params, 0]);

				if (empty($item->title))
				{
					continue;
				}

				// strip html tags from title
				$item->title = strip_tags($item->title);
			}
			/* <<< */
		}

		return $this->_data;
	}

	/**
	 * Method to get the total number of weblink items for the category
	 *
	 * @access  public
	 *
	 * @return  integer
	 */
	public function getTotal()
	{
		return $this->_total;
	}

	/**
	 * Method to set the search areas
	 *
	 * @param array $active areas
	 * @param array $search areas
	 *
	 * @return  void
	 *
	 * @access  public
	 */
	public function setAreas($active = [], $search = [])
	{
		$this->_areas['active'] = $active;
		$this->_areas['search'] = $search;
	}

	/**
	 * Method to get a pagination object of the weblink items for the category
	 *
	 * @access public
	 * @return  integer
	 */
	public function getPagination()
	{
		// Lets load the content if it doesn't already exist
		if (empty($this->_pagination))
		{
			$this->_pagination = new JPagination($this->getTotal(),
$this->getState('limitstart'),
$this->getState('limit'));
		}

		return $this->_pagination;
	}

	/**
	 * Method to get the search areas
	 *
	 * @return int
	 *
	 * @since 1.5
	 */
	public function getAreas()
	{
		// Load the Category data
		if (empty($this->_areas['search']))
		{
			$areas = [];

			JPluginHelper::importPlugin('search');
			$dispatcher  = JEventDispatcher::getInstance();
			$searchareas =
$dispatcher->trigger('onContentSearchAreas');

			foreach ($searchareas as $area)
			{
				if (is_array($area))
				{
					$areas = array_merge($areas, $area);
				}
			}

			$this->_areas['search'] = $areas;
		}

		return $this->_areas;
	}
}
home/lmsyaran/public_html/libraries/joomla/mediawiki/search.php000064400000006136151161365340021015
0ustar00<?php
/**
 * @package     Joomla.Platform
 * @subpackage  MediaWiki
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

defined('JPATH_PLATFORM') or die;

/**
 * MediaWiki API Search class for the Joomla Platform.
 *
 * @since  3.1.4
 */
class JMediawikiSearch extends JMediawikiObject
{
	/**
	 * Method to perform a full text search.
	 *
	 * @param   string   $srsearch     Search for all page titles (or content)
that has this value.
	 * @param   array    $srnamespace  The namespace(s) to enumerate.
	 * @param   string   $srwhat       Search inside the text or titles.
	 * @param   array    $srinfo       What metadata to return.
	 * @param   array    $srprop       What properties to return.
	 * @param   boolean  $srredirects  Include redirect pages in the search.
	 * @param   integer  $sroffest     Use this value to continue paging.
	 * @param   integer  $srlimit      How many total pages to return.
	 *
	 * @return  object
	 *
	 * @since   3.1.4
	 */
	public function search($srsearch, array $srnamespace = null, $srwhat =
null, array $srinfo = null, array $srprop = null,
		$srredirects = null, $sroffest = null, $srlimit = null)
	{
		// Build the request.
		$path = '?action=query&list=search';

		if (isset($srsearch))
		{
			$path .= '&srsearch=' . $srsearch;
		}

		if (isset($srnamespace))
		{
			$path .= '&srnamespace=' .
$this->buildParameter($srnamespace);
		}

		if (isset($srwhat))
		{
			$path .= '&srwhat=' . $srwhat;
		}

		if (isset($srinfo))
		{
			$path .= '&srinfo=' . $this->buildParameter($srinfo);
		}

		if (isset($srprop))
		{
			$path .= '&srprop=' . $this->buildParameter($srprop);
		}

		if ($srredirects)
		{
			$path .= '&srredirects=';
		}

		if (isset($sroffest))
		{
			$path .= '&sroffest=' . $sroffest;
		}

		if (isset($srlimit))
		{
			$path .= '&srlimit=' . $srlimit;
		}

		// Send the request.
		$response = $this->client->get($this->fetchUrl($path));

		return $this->validateResponse($response);
	}

	/**
	 * Method to search the wiki using opensearch protocol.
	 *
	 * @param   string   $search     Search string.
	 * @param   integer  $limit	     Maximum amount of results to return.
	 * @param   array    $namespace  Namespaces to search.
	 * @param   string   $suggest    Do nothing if $wgEnableOpenSearchSuggest
is false.
	 * @param   string   $format     Output format.
	 *
	 * @return  object
	 *
	 * @since   3.1.4
	 */
	public function openSearch($search, $limit = null, array $namespace =
null, $suggest = null, $format = null)
	{
		// Build the request.
		$path = '?action=query&list=search';

		if (isset($search))
		{
			$path .= '&search=' . $search;
		}

		if (isset($limit))
		{
			$path .= '&limit=' . $limit;
		}

		if (isset($namespace))
		{
			$path .= '&namespace=' .
$this->buildParameter($namespace);
		}

		if (isset($suggest))
		{
			$path .= '&suggest=' . $suggest;
		}

		if (isset($format))
		{
			$path .= '&format=' . $format;
		}

		// Send the request.
		$response = $this->client->get($this->fetchUrl($path));

		return $this->validateResponse($response);
	}
}
home/lmsyaran/public_html/libraries/joomla/twitter/search.php000064400000013072151161444040020544
0ustar00<?php
/**
 * @package     Joomla.Platform
 * @subpackage  Twitter
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

defined('JPATH_PLATFORM') or die();

/**
 * Twitter API Search class for the Joomla Platform.
 *
 * @since       3.1.4
 * @deprecated  4.0  Use the `joomla/twitter` package via Composer instead
 */
class JTwittersearch extends JTwitterObject
{
	/**
	 * Method to get tweets that match a specified query.
	 *
	 * @param   string   $query       Search query. Should be URL encoded.
Queries will be limited by complexity.
	 * @param   string   $callback    If supplied, the response will use the
JSONP format with a callback of the given name
	 * @param   string   $geocode     Returns tweets by users located within a
given radius of the given latitude/longitude. The parameter value is
	 * 								  specified by "latitude,longitude,radius", where
radius units must be specified as either "mi" (miles) or
"km" (kilometers).
	 * @param   string   $lang        Restricts tweets to the given language,
given by an ISO 639-1 code.
	 * @param   string   $locale      Specify the language of the query you
are sending (only ja is currently effective). This is intended for
	 * 								  language-specific clients and the default should work in the
majority of cases.
	 * @param   string   $resultType  Specifies what type of search results
you would prefer to receive. The current default is "mixed."
	 * @param   integer  $count       The number of tweets to return per page,
up to a maximum of 100. Defaults to 15.
	 * @param   string   $until       Returns tweets generated before the
given date. Date should be formatted as YYYY-MM-DD.
	 * @param   integer  $sinceId     Returns results with an ID greater than
(that is, more recent than) the specified ID.
	 * @param   integer  $maxId       Returns results with an ID less than
(that is, older than) or equal to the specified ID.
	 * @param   boolean  $entities    When set to either true, t or 1, each
tweet will include a node called "entities,". This node offers a
	 * 								  variety of metadata about the tweet in a discrete structure,
including: urls, media and hashtags.
	 *
	 * @return  array  The decoded JSON response
	 *
	 * @since   3.1.4
	 */
	public function search($query, $callback = null, $geocode = null, $lang =
null, $locale = null, $resultType = null, $count = 15,
		$until = null, $sinceId = 0, $maxId = 0, $entities = null)
	{
		// Check the rate limit for remaining hits
		$this->checkRateLimit('search', 'tweets');

		// Set the API path
		$path = '/search/tweets.json';

		// Set query parameter.
		$data['q'] = rawurlencode($query);

		// Check if callback is specified.
		if ($callback)
		{
			$data['callback'] = $callback;
		}

		// Check if geocode is specified.
		if ($geocode)
		{
			$data['geocode'] = $geocode;
		}

		// Check if lang is specified.
		if ($lang)
		{
			$data['lang'] = $lang;
		}

		// Check if locale is specified.
		if ($locale)
		{
			$data['locale'] = $locale;
		}

		// Check if result_type is specified.
		if ($resultType)
		{
			$data['result_type'] = $resultType;
		}

		// Check if count is specified.
		if ($count != 15)
		{
			$data['count'] = $count;
		}

		// Check if until is specified.
		if ($until)
		{
			$data['until'] = $until;
		}

		// Check if since_id is specified.
		if ($sinceId > 0)
		{
			$data['since_id'] = $sinceId;
		}

		// Check if max_id is specified.
		if ($maxId > 0)
		{
			$data['max_id'] = $maxId;
		}

		// Check if entities is specified.
		if (!is_null($entities))
		{
			$data['include_entities'] = $entities;
		}

		// Send the request.
		return $this->sendRequest($path, 'GET', $data);
	}

	/**
	 * Method to get the authenticated user's saved search queries.
	 *
	 * @return  array  The decoded JSON response
	 *
	 * @since   3.1.4
	 */
	public function getSavedSearches()
	{
		// Check the rate limit for remaining hits
		$this->checkRateLimit('saved_searches', 'list');

		// Set the API path
		$path = '/saved_searches/list.json';

		// Send the request.
		return $this->sendRequest($path);
	}

	/**
	 * Method to get the information for the saved search represented by the
given id.
	 *
	 * @param   integer  $id  The ID of the saved search.
	 *
	 * @return  array  The decoded JSON response
	 *
	 * @since   3.1.4
	 */
	public function getSavedSearchesById($id)
	{
		// Check the rate limit for remaining hits
		$this->checkRateLimit('saved_searches',
'show/:id');

		// Set the API path
		$path = '/saved_searches/show/' . $id . '.json';

		// Send the request.
		return $this->sendRequest($path);
	}

	/**
	 * Method to create a new saved search for the authenticated user.
	 *
	 * @param   string  $query  The query of the search the user would like to
save.
	 *
	 * @return  array  The decoded JSON response
	 *
	 * @since   3.1.4
	 */
	public function createSavedSearch($query)
	{
		// Set the API path
		$path = '/saved_searches/create.json';

		// Set POST request data
		$data['query'] = rawurlencode($query);

		// Send the request.
		return $this->sendRequest($path, 'POST', $data);
	}

	/**
	 * Method to delete a saved search for the authenticating user.
	 *
	 * @param   integer  $id  The ID of the saved search.
	 *
	 * @return  array  The decoded JSON response
	 *
	 * @since   3.1.4
	 */
	public function deleteSavedSearch($id)
	{
		// Check the rate limit for remaining hits
		$this->checkRateLimit('saved_searches',
'destroy/:id');

		// Set the API path
		$path = '/saved_searches/destroy/' . $id . '.json';

		// Send the request.
		return $this->sendRequest($path, 'POST');
	}
}
home/lmsyaran/public_html/j3/libraries/joomla/twitter/search.php000064400000013072151161504070021060
0ustar00<?php
/**
 * @package     Joomla.Platform
 * @subpackage  Twitter
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

defined('JPATH_PLATFORM') or die();

/**
 * Twitter API Search class for the Joomla Platform.
 *
 * @since       3.1.4
 * @deprecated  4.0  Use the `joomla/twitter` package via Composer instead
 */
class JTwittersearch extends JTwitterObject
{
	/**
	 * Method to get tweets that match a specified query.
	 *
	 * @param   string   $query       Search query. Should be URL encoded.
Queries will be limited by complexity.
	 * @param   string   $callback    If supplied, the response will use the
JSONP format with a callback of the given name
	 * @param   string   $geocode     Returns tweets by users located within a
given radius of the given latitude/longitude. The parameter value is
	 * 								  specified by "latitude,longitude,radius", where
radius units must be specified as either "mi" (miles) or
"km" (kilometers).
	 * @param   string   $lang        Restricts tweets to the given language,
given by an ISO 639-1 code.
	 * @param   string   $locale      Specify the language of the query you
are sending (only ja is currently effective). This is intended for
	 * 								  language-specific clients and the default should work in the
majority of cases.
	 * @param   string   $resultType  Specifies what type of search results
you would prefer to receive. The current default is "mixed."
	 * @param   integer  $count       The number of tweets to return per page,
up to a maximum of 100. Defaults to 15.
	 * @param   string   $until       Returns tweets generated before the
given date. Date should be formatted as YYYY-MM-DD.
	 * @param   integer  $sinceId     Returns results with an ID greater than
(that is, more recent than) the specified ID.
	 * @param   integer  $maxId       Returns results with an ID less than
(that is, older than) or equal to the specified ID.
	 * @param   boolean  $entities    When set to either true, t or 1, each
tweet will include a node called "entities,". This node offers a
	 * 								  variety of metadata about the tweet in a discrete structure,
including: urls, media and hashtags.
	 *
	 * @return  array  The decoded JSON response
	 *
	 * @since   3.1.4
	 */
	public function search($query, $callback = null, $geocode = null, $lang =
null, $locale = null, $resultType = null, $count = 15,
		$until = null, $sinceId = 0, $maxId = 0, $entities = null)
	{
		// Check the rate limit for remaining hits
		$this->checkRateLimit('search', 'tweets');

		// Set the API path
		$path = '/search/tweets.json';

		// Set query parameter.
		$data['q'] = rawurlencode($query);

		// Check if callback is specified.
		if ($callback)
		{
			$data['callback'] = $callback;
		}

		// Check if geocode is specified.
		if ($geocode)
		{
			$data['geocode'] = $geocode;
		}

		// Check if lang is specified.
		if ($lang)
		{
			$data['lang'] = $lang;
		}

		// Check if locale is specified.
		if ($locale)
		{
			$data['locale'] = $locale;
		}

		// Check if result_type is specified.
		if ($resultType)
		{
			$data['result_type'] = $resultType;
		}

		// Check if count is specified.
		if ($count != 15)
		{
			$data['count'] = $count;
		}

		// Check if until is specified.
		if ($until)
		{
			$data['until'] = $until;
		}

		// Check if since_id is specified.
		if ($sinceId > 0)
		{
			$data['since_id'] = $sinceId;
		}

		// Check if max_id is specified.
		if ($maxId > 0)
		{
			$data['max_id'] = $maxId;
		}

		// Check if entities is specified.
		if (!is_null($entities))
		{
			$data['include_entities'] = $entities;
		}

		// Send the request.
		return $this->sendRequest($path, 'GET', $data);
	}

	/**
	 * Method to get the authenticated user's saved search queries.
	 *
	 * @return  array  The decoded JSON response
	 *
	 * @since   3.1.4
	 */
	public function getSavedSearches()
	{
		// Check the rate limit for remaining hits
		$this->checkRateLimit('saved_searches', 'list');

		// Set the API path
		$path = '/saved_searches/list.json';

		// Send the request.
		return $this->sendRequest($path);
	}

	/**
	 * Method to get the information for the saved search represented by the
given id.
	 *
	 * @param   integer  $id  The ID of the saved search.
	 *
	 * @return  array  The decoded JSON response
	 *
	 * @since   3.1.4
	 */
	public function getSavedSearchesById($id)
	{
		// Check the rate limit for remaining hits
		$this->checkRateLimit('saved_searches',
'show/:id');

		// Set the API path
		$path = '/saved_searches/show/' . $id . '.json';

		// Send the request.
		return $this->sendRequest($path);
	}

	/**
	 * Method to create a new saved search for the authenticated user.
	 *
	 * @param   string  $query  The query of the search the user would like to
save.
	 *
	 * @return  array  The decoded JSON response
	 *
	 * @since   3.1.4
	 */
	public function createSavedSearch($query)
	{
		// Set the API path
		$path = '/saved_searches/create.json';

		// Set POST request data
		$data['query'] = rawurlencode($query);

		// Send the request.
		return $this->sendRequest($path, 'POST', $data);
	}

	/**
	 * Method to delete a saved search for the authenticating user.
	 *
	 * @param   integer  $id  The ID of the saved search.
	 *
	 * @return  array  The decoded JSON response
	 *
	 * @since   3.1.4
	 */
	public function deleteSavedSearch($id)
	{
		// Check the rate limit for remaining hits
		$this->checkRateLimit('saved_searches',
'destroy/:id');

		// Set the API path
		$path = '/saved_searches/destroy/' . $id . '.json';

		// Send the request.
		return $this->sendRequest($path, 'POST');
	}
}
home/lmsyaran/public_html/j3/htaccess.back/joomla/twitter/search.php000064400000013072151164077020021603
0ustar00<?php
/**
 * @package     Joomla.Platform
 * @subpackage  Twitter
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

defined('JPATH_PLATFORM') or die();

/**
 * Twitter API Search class for the Joomla Platform.
 *
 * @since       3.1.4
 * @deprecated  4.0  Use the `joomla/twitter` package via Composer instead
 */
class JTwittersearch extends JTwitterObject
{
	/**
	 * Method to get tweets that match a specified query.
	 *
	 * @param   string   $query       Search query. Should be URL encoded.
Queries will be limited by complexity.
	 * @param   string   $callback    If supplied, the response will use the
JSONP format with a callback of the given name
	 * @param   string   $geocode     Returns tweets by users located within a
given radius of the given latitude/longitude. The parameter value is
	 * 								  specified by "latitude,longitude,radius", where
radius units must be specified as either "mi" (miles) or
"km" (kilometers).
	 * @param   string   $lang        Restricts tweets to the given language,
given by an ISO 639-1 code.
	 * @param   string   $locale      Specify the language of the query you
are sending (only ja is currently effective). This is intended for
	 * 								  language-specific clients and the default should work in the
majority of cases.
	 * @param   string   $resultType  Specifies what type of search results
you would prefer to receive. The current default is "mixed."
	 * @param   integer  $count       The number of tweets to return per page,
up to a maximum of 100. Defaults to 15.
	 * @param   string   $until       Returns tweets generated before the
given date. Date should be formatted as YYYY-MM-DD.
	 * @param   integer  $sinceId     Returns results with an ID greater than
(that is, more recent than) the specified ID.
	 * @param   integer  $maxId       Returns results with an ID less than
(that is, older than) or equal to the specified ID.
	 * @param   boolean  $entities    When set to either true, t or 1, each
tweet will include a node called "entities,". This node offers a
	 * 								  variety of metadata about the tweet in a discrete structure,
including: urls, media and hashtags.
	 *
	 * @return  array  The decoded JSON response
	 *
	 * @since   3.1.4
	 */
	public function search($query, $callback = null, $geocode = null, $lang =
null, $locale = null, $resultType = null, $count = 15,
		$until = null, $sinceId = 0, $maxId = 0, $entities = null)
	{
		// Check the rate limit for remaining hits
		$this->checkRateLimit('search', 'tweets');

		// Set the API path
		$path = '/search/tweets.json';

		// Set query parameter.
		$data['q'] = rawurlencode($query);

		// Check if callback is specified.
		if ($callback)
		{
			$data['callback'] = $callback;
		}

		// Check if geocode is specified.
		if ($geocode)
		{
			$data['geocode'] = $geocode;
		}

		// Check if lang is specified.
		if ($lang)
		{
			$data['lang'] = $lang;
		}

		// Check if locale is specified.
		if ($locale)
		{
			$data['locale'] = $locale;
		}

		// Check if result_type is specified.
		if ($resultType)
		{
			$data['result_type'] = $resultType;
		}

		// Check if count is specified.
		if ($count != 15)
		{
			$data['count'] = $count;
		}

		// Check if until is specified.
		if ($until)
		{
			$data['until'] = $until;
		}

		// Check if since_id is specified.
		if ($sinceId > 0)
		{
			$data['since_id'] = $sinceId;
		}

		// Check if max_id is specified.
		if ($maxId > 0)
		{
			$data['max_id'] = $maxId;
		}

		// Check if entities is specified.
		if (!is_null($entities))
		{
			$data['include_entities'] = $entities;
		}

		// Send the request.
		return $this->sendRequest($path, 'GET', $data);
	}

	/**
	 * Method to get the authenticated user's saved search queries.
	 *
	 * @return  array  The decoded JSON response
	 *
	 * @since   3.1.4
	 */
	public function getSavedSearches()
	{
		// Check the rate limit for remaining hits
		$this->checkRateLimit('saved_searches', 'list');

		// Set the API path
		$path = '/saved_searches/list.json';

		// Send the request.
		return $this->sendRequest($path);
	}

	/**
	 * Method to get the information for the saved search represented by the
given id.
	 *
	 * @param   integer  $id  The ID of the saved search.
	 *
	 * @return  array  The decoded JSON response
	 *
	 * @since   3.1.4
	 */
	public function getSavedSearchesById($id)
	{
		// Check the rate limit for remaining hits
		$this->checkRateLimit('saved_searches',
'show/:id');

		// Set the API path
		$path = '/saved_searches/show/' . $id . '.json';

		// Send the request.
		return $this->sendRequest($path);
	}

	/**
	 * Method to create a new saved search for the authenticated user.
	 *
	 * @param   string  $query  The query of the search the user would like to
save.
	 *
	 * @return  array  The decoded JSON response
	 *
	 * @since   3.1.4
	 */
	public function createSavedSearch($query)
	{
		// Set the API path
		$path = '/saved_searches/create.json';

		// Set POST request data
		$data['query'] = rawurlencode($query);

		// Send the request.
		return $this->sendRequest($path, 'POST', $data);
	}

	/**
	 * Method to delete a saved search for the authenticating user.
	 *
	 * @param   integer  $id  The ID of the saved search.
	 *
	 * @return  array  The decoded JSON response
	 *
	 * @since   3.1.4
	 */
	public function deleteSavedSearch($id)
	{
		// Check the rate limit for remaining hits
		$this->checkRateLimit('saved_searches',
'destroy/:id');

		// Set the API path
		$path = '/saved_searches/destroy/' . $id . '.json';

		// Send the request.
		return $this->sendRequest($path, 'POST');
	}
}