本文整理汇总了PHP中getExtraConfigArray函数的典型用法代码示例。如果您正苦于以下问题:PHP getExtraConfigArray函数的具体用法?PHP getExtraConfigArray怎么用?PHP getExtraConfigArray使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getExtraConfigArray函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor. Initialise some details about the server
*
* @access public
*/
public function __construct()
{
// Standard logic from parent class:
parent::__construct();
// Set up appropriate results action:
$this->resultsModule = 'WorldCat';
$this->resultsAction = 'Search';
// Set up basic and advanced WorldCat search types; default to basic.
$this->searchType = $this->basicSearchType = 'WorldCat';
$this->advancedSearchType = 'WorldCatAdvanced';
// Set up sort options
$config = getExtraConfigArray('WorldCat');
$this->sortOptions = $config['Sorting'];
if (isset($config['General']['default_sort'])) {
$this->defaultSort = $config['General']['default_sort'];
}
// Set up search options
$this->basicTypes = $config['Basic_Searches'];
if (isset($config['Advanced_Searches'])) {
$this->advancedTypes = $config['Advanced_Searches'];
}
$this->defaultIndex = 'srw.kw';
// Set up recommendations options -- settings are found in WorldCat.ini:
$this->recommendIni = 'WorldCat';
// Connect to WorldCat
$this->worldcat = new Worldcat();
}
开发者ID:bryandease,项目名称:VuFind-Plus,代码行数:32,代码来源:WorldCat.php
示例2: launch
/**
* Display the page.
*
* @return void
* @access public
*/
public function launch()
{
global $interface;
global $configArray;
global $user;
// Load a saved search, if any:
$savedSearch = $this->_loadSavedSearch();
// Send search type settings to the template
$interface->assign('advSearchTypes', $this->searchObject->getAdvancedTypes());
// Get checkbox filters to present narrow options; this may also strip some
// filters out of the $savedSearch object to prevent redundant information
// being retrieved via the getFilterList() method.
$interface->assign('checkboxFilters', $this->_getCheckboxFilters($savedSearch));
// Process settings to control special-purpose facets not supported by the
// more generic configuration options.
$config = getExtraConfigArray('PCI');
$special = isset($config['Advanced_Facet_Settings']['special_facets']) ? $config['Advanced_Facet_Settings']['special_facets'] : '';
if (stristr($special, 'daterange')) {
$interface->assign('dateRangeLimit', $this->_getDateRangeSettings($savedSearch));
}
// If we found a saved search, let's assign some details to the interface:
if ($savedSearch) {
$interface->assign('searchDetails', $savedSearch->getSearchTerms());
$interface->assign('searchFilters', $savedSearch->getFilterList());
}
$interface->setPageTitle('Advanced Search');
$interface->setTemplate('advanced.tpl');
$interface->display('layout.tpl');
}
开发者ID:bharatm,项目名称:NDL-VuFind,代码行数:35,代码来源:Advanced.php
示例3: __construct
/**
* Constructor. Initialise details about the server
*
* @access public
*/
public function __construct()
{
parent::__construct();
$this->resultsModule = 'PCI';
$this->resultsAction = 'Search';
$config = getExtraConfigArray("PCI");
foreach ($config['Facets'] as $key => $value) {
$parts = explode(',', $key);
$facetName = trim($parts[0]);
$this->facetConfig[$facetName] = $value;
}
$this->translatedFacets = isset($config['Facet_Settings']['translated_facets']) ? $config['Facet_Settings']['translated_facets'] : null;
$this->facetTranslationPrefix = isset($config['Facet_Settings']['facet_translation_prefix']) ? $config['Facet_Settings']['facet_translation_prefix'] : null;
// Set up basic and advanced PCI search types; default to basic.
$this->searchType = $this->basicSearchType = 'PCI';
$this->advancedSearchType = 'PCIAdvanced';
// Set up search options
$this->basicTypes = $config['Basic_Searches'];
if (isset($config['Advanced_Searches'])) {
$this->advancedTypes = $config['Advanced_Searches'];
}
$this->recommendIni = 'PCI';
$this->params['institution'] = $config['General']['institution'];
$this->params['highlight'] = $config['General']['highlight'];
$this->params['db'] = isset($config['General']['db']) ? $config['General']['db'] : null;
// Set up sort options
$this->sortOptions = $config['Sorting'];
// default sort for PCI is empty string
$this->defaultSort = "";
// Connect to PCI
$this->PCI = new PCI();
}
开发者ID:bharatm,项目名称:NDL-VuFind,代码行数:37,代码来源:PCI.php
示例4: __construct
/**
* Constructor
*
* @access public
*/
public function __construct()
{
global $interface;
global $configArray;
// Call parent constructor
parent::__construct();
// Fetch Record
$config = getExtraConfigArray('MetaLib');
$metalib = new MetaLib();
$this->record = $metalib->getRecord($_REQUEST['id']);
if (PEAR::isError($this->record)) {
PEAR::raiseError($this->record);
}
// Get record driver
$this->recordDriver = RecordDriverFactory::initRecordDriver($this->record);
// Set Proxy URL
$interface->assign('proxy', isset($configArray['EZproxy']['host']) ? $configArray['EZproxy']['host'] : false);
// Whether RSI is enabled
if (isset($configArray['OpenURL']['use_rsi']) && $configArray['OpenURL']['use_rsi']) {
$interface->assign('rsi', true);
}
// Whether embedded openurl autocheck is enabled
if (isset($configArray['OpenURL']['autocheck']) && $configArray['OpenURL']['autocheck']) {
$interface->assign('openUrlAutoCheck', true);
}
// Send record ID to template
$interface->assign('id', $_REQUEST['id']);
// Send down legal export formats (if any):
$interface->assign('exportFormats', array('RefWorks', 'EndNote'));
// Set AddThis User
$interface->assign('addThis', isset($configArray['AddThis']['key']) ? $configArray['AddThis']['key'] : false);
// Get core metadata
$interface->assign('coreMetadata', $this->recordDriver->getCoreMetadata());
}
开发者ID:bharatm,项目名称:NDL-VuFind,代码行数:39,代码来源:Record.php
示例5: this
/**
* Constructor
*
* @param string $mainDir The main VuFind directory.
Each web directory must reside
under this (default: ..)
* @param string $errEmail Email address for error reporting.
*
* @return void
*/
function __construct($mainDir, $errEmail)
{
$this->mainDir = $mainDir;
$this->errEmail = $errEmail;
$this->mainConfig = readConfig();
$this->datasourceConfig = getExtraConfigArray('datasources');
}
开发者ID:bharatm,项目名称:NDL-VuFind,代码行数:17,代码来源:reminder_task.php
示例6: __construct
/**
* Constructor
*
* Establishes base settings for making recommendations.
*
* @param object $searchObject The SearchObject requesting recommendations.
* @param string $params Additional settings from searches.ini.
*
* @access public
*/
public function __construct($searchObject, $params)
{
$this->_searchObject = $searchObject;
$params = explode(':', $params);
$iniName = isset($params[0]) && $params[0] != "" ? $params[0] : 'facets';
// Load the desired facet information...
$config = getExtraConfigArray($iniName);
}
开发者ID:bharatm,项目名称:NDL-VuFind,代码行数:18,代码来源:ResultGoogleMapAjax.php
示例7: __construct
/**
* Constructor
*
* Establishes base settings for making recommendations.
*
* @param object $searchObject The SearchObject requesting recommendations.
* @param string $params Additional settings from searches.ini.
*
* @access public
*/
public function __construct($searchObject, $params)
{
// Save the passed-in SearchObject:
$this->_searchObject = $searchObject;
// Parse the additional settings:
$params = explode(':', $params);
$mainSection = empty($params[0]) ? 'Results' : $params[0];
$checkboxSection = isset($params[1]) ? $params[1] : false;
$iniName = isset($params[2]) ? $params[2] : 'facets';
// Load the desired facet information...
$config = getExtraConfigArray($iniName);
// All standard facets to display:
$this->_mainFacets = isset($config[$mainSection]) ? $config[$mainSection] : array();
// Get a list of fields that should be displayed as date ranges rather than
// standard facet lists.
if (isset($config['SpecialFacets']['dateRange'])) {
$this->_dateFacets = is_array($config['SpecialFacets']['dateRange']) ? $config['SpecialFacets']['dateRange'] : array($config['SpecialFacets']['dateRange']);
}
// Get a list of fields that should be displayed as a hierarchy.
if (isset($config['SpecialFacets']['hierarchical'])) {
$this->_hierarchicalFacets = $config['SpecialFacets']['hierarchical'];
}
// Get a list of fields that should be open on default.
if (isset($config['SpecialFacets']['default'])) {
$this->_defaultFacets = $config['SpecialFacets']['default'];
} else {
$this->_defaultFacets = array();
}
// Get a list of facetfields that should not be displayed.
if (isset($config['SpecialFacets']['hidden'])) {
$this->_hiddenFacets = $config['SpecialFacets']['hidden'];
} else {
$this->_hiddenFacets = array();
}
// Checkbox facets:
$checkboxFacets = $checkboxSection && isset($config[$checkboxSection]) ? $config[$checkboxSection] : array();
$this->_checkboxFacets = array();
foreach ($checkboxFacets as $key => $val) {
$this->_checkboxFacets[$key] = array('desc' => $val, 'data' => array());
}
// Checkbox facets inside facet sections
foreach ($this->_mainFacets as $key => $val) {
$section = "{$checkboxSection}:{$key}";
if (isset($config[$section])) {
$data = $config[$section];
$this->_checkboxFacetsSection[$val] = $data;
foreach ($data as $filter => $translationKey) {
$sectionKey = is_array($filter) ? array_pop(array_keys($filter)) : $filter;
// Store facet section id as 'parent'
$this->_checkboxFacets[$filter] = array('desc' => $translationKey, 'data' => array('parent' => $key));
}
}
}
//collection keyword filter
$this->_collectionKeywordFilter = isset($config['Collection_Keyword']['search']) ? $config['Collection_Keyword']['search'] : false;
}
开发者ID:bharatm,项目名称:NDL-VuFind,代码行数:66,代码来源:SideFacets.php
示例8: __construct
/**
* Constructor.
*
* @access public
*/
public function __construct()
{
parent::__construct();
$this->_searchObject = SearchObjectFactory::initSearchObject();
// Load the desired facet information...
$config = getExtraConfigArray('facets');
if (isset($config['MapFacets']['location'])) {
$this->_locationFacet = is_array($config['MapFacets']['location']) ? $config['MapFacets']['location'] : array($config['MapFacets']['location']);
}
}
开发者ID:bharatm,项目名称:NDL-VuFind,代码行数:15,代码来源:JSON_GoogleMap.php
示例9: __construct
public function __construct($searchObject, $params)
{
global $library;
global $configArray;
// Save the basic parameters:
$this->searchObject = $searchObject;
// Parse the additional parameters:
$params = explode(':', $params);
$section = empty($params[0]) ? 'ResultsTop' : $params[0];
$iniFile = isset($params[1]) ? $params[1] : 'facets';
// Load the desired facet information:
$searchLibrary = Library::getActiveLibrary();
$searchLocation = Location::getActiveLocation();
$config = getExtraConfigArray($iniFile);
if ($searchObject->getSearchType() == 'genealogy') {
$this->mainFacets = array();
} else {
$searchLibrary = Library::getActiveLibrary();
$searchLocation = Location::getActiveLocation();
$userLocation = Location::getUserHomeLocation();
$hasSearchLibraryFacets = $searchLibrary != null && count($searchLibrary->facets) > 0;
$hasSearchLocationFacets = $searchLocation != null && count($searchLocation->facets) > 0;
if ($hasSearchLocationFacets) {
$facets = $searchLocation->facets;
} elseif ($hasSearchLibraryFacets) {
$facets = $searchLibrary->facets;
} else {
$facets = Library::getDefaultFacets();
}
foreach ($facets as $facet) {
if ($facet->showAboveResults == 1) {
$facetName = $facet->facetName;
if (isset($searchLibrary)) {
if ($facet->facetName == 'availability_toggle' && $configArray['Index']['enableDetailedAvailability']) {
$facetName = 'availability_toggle_' . $searchLibrary->subdomain;
}
}
if (isset($userLocation)) {
if ($facet->facetName == 'availability_toggle' && $configArray['Index']['enableDetailedAvailability']) {
$facetName = 'availability_toggle_' . $userLocation->code;
}
}
if (isset($searchLocation)) {
if ($facet->facetName == 'availability_toggle' && $configArray['Index']['enableDetailedAvailability']) {
$facetName = 'availability_toggle_' . $searchLocation->code;
}
}
$this->facets[$facetName] = $facet->displayName;
$this->facetSettings[$facetName] = $facet;
}
}
}
// Load other relevant settings:
$this->baseSettings = array('rows' => $config['Results_Settings']['top_rows'], 'cols' => $config['Results_Settings']['top_cols']);
}
开发者ID:bryandease,项目名称:VuFind-Plus,代码行数:55,代码来源:TopFacets.php
示例10: __construct
public function __construct($searchObject, $params)
{
global $configArray;
// Save the basic parameters:
/** @var SearchObject_Solr|SearchObject_Base searchObject */
$this->searchObject = $searchObject;
// Parse the additional parameters:
$params = explode(':', $params);
$iniFile = isset($params[1]) ? $params[1] : 'facets';
// Load the desired facet information:
$config = getExtraConfigArray($iniFile);
if ($this->searchObject->getSearchType() == 'genealogy') {
$this->mainFacets = array();
} else {
$searchLibrary = Library::getActiveLibrary();
global $locationSingleton;
$searchLocation = $locationSingleton->getActiveLocation();
$userLocation = Location::getUserHomeLocation();
$hasSearchLibraryFacets = $searchLibrary != null && count($searchLibrary->facets) > 0;
$hasSearchLocationFacets = $searchLocation != null && count($searchLocation->facets) > 0;
if ($hasSearchLocationFacets) {
$facets = $searchLocation->facets;
} elseif ($hasSearchLibraryFacets) {
$facets = $searchLibrary->facets;
} else {
$facets = Library::getDefaultFacets();
}
global $solrScope;
foreach ($facets as $facet) {
if ($facet->showAboveResults == 1) {
$facetName = $facet->facetName;
if ($solrScope) {
if ($facet->facetName == 'availability_toggle' && $configArray['Index']['enableDetailedAvailability']) {
$facetName = 'availability_toggle_' . $solrScope;
} else {
if ($facet->facetName == 'format_category' && $configArray['Index']['enableDetailedFormats']) {
$facetName = 'format_category_' . $solrScope;
}
}
}
$this->facets[$facetName] = $facet->displayName;
$this->facetSettings[$facetName] = $facet;
if (!$solrScope && $facet->facetName == 'availability_toggle') {
//Don't do availability toggles in the global scope.
//TODO: Base this off the default scope (i.e. mercury/responsive).
unset($this->facets[$facetName]);
unset($this->facetSettings[$facetName]);
}
}
}
}
// Load other relevant settings:
$this->baseSettings = array('rows' => $config['Results_Settings']['top_rows'], 'cols' => $config['Results_Settings']['top_cols']);
}
开发者ID:victorfcm,项目名称:VuFind-Plus,代码行数:54,代码来源:TopFacets.php
示例11: __construct
/**
* Constructor
*
* Establishes base settings for making recommendations.
*
* @param object $searchObject The SearchObject requesting recommendations.
* @param string $params Additional settings from searches.ini.
*
* @access public
*/
public function __construct($searchObject, $params)
{
// Save the basic parameters:
$this->_searchObject = $searchObject;
// Parse the additional parameters:
$params = explode(':', $params);
$section = empty($params[0]) ? 'ResultsTop' : $params[0];
$iniFile = isset($params[1]) ? $params[1] : 'facets';
// Load the desired facet information:
$config = getExtraConfigArray($iniFile);
$this->_facets = isset($config[$section]) ? $config[$section] : array();
}
开发者ID:bharatm,项目名称:NDL-VuFind,代码行数:22,代码来源:FacetCloud.php
示例12: __construct
/**
* Constructor
*
* Establishes base settings for making recommendations.
*
* @param object $searchObject The SearchObject requesting recommendations.
* @param string $params Additional settings from searches.ini.
*
* @access public
*/
public function __construct($searchObject, $params)
{
// Save the basic parameters:
$this->_searchObject = $searchObject;
// Parse the additional parameters:
$params = explode(':', $params);
$section = empty($params[0]) ? 'ResultsTop' : $params[0];
$iniFile = isset($params[1]) ? $params[1] : 'facets';
// Load the desired facet information:
$config = getExtraConfigArray($iniFile);
$this->_facets = isset($config[$section]) ? $config[$section] : array();
// Load other relevant settings:
$this->_baseSettings = array('rows' => isset($config['Results_Settings']['top_rows']) ? $config['Results_Settings']['top_rows'] : 1, 'cols' => isset($config['Results_Settings']['top_cols']) ? $config['Results_Settings']['top_cols'] : 1);
}
开发者ID:bharatm,项目名称:NDL-VuFind,代码行数:24,代码来源:TopFacets.php
示例13: __construct
/**
* Constructor.
*
* @access public
*/
public function __construct()
{
global $action;
parent::__construct();
if (isset($_REQUEST['collection'])) {
$this->_searchObject = SearchObjectFactory::initSearchObject('SolrCollection');
$action = isset($_REQUEST['collectionAction']) ? $_REQUEST['collectionAction'] : 'Home';
} else {
$this->_searchObject = SearchObjectFactory::initSearchObject();
}
// Load the desired facet information...
$config = getExtraConfigArray('facets');
if (isset($config['SpecialFacets']['dateVis'])) {
$this->_dateFacets = is_array($config['SpecialFacets']['dateVis']) ? $config['SpecialFacets']['dateVis'] : array($config['SpecialFacets']['dateVis']);
}
}
开发者ID:bharatm,项目名称:NDL-VuFind,代码行数:21,代码来源:JSON_Vis.php
示例14: __construct
/**
* Constructor
*
* @access public
*/
public function __construct()
{
global $action;
parent::__construct();
if (isset($_REQUEST['collection'])) {
$this->searchObject = SearchObjectFactory::initSearchObject('SolrCollection');
$action = isset($_REQUEST['collectionAction']) ? $_REQUEST['collectionAction'] : 'Home';
} else {
$this->searchObject = SearchObjectFactory::initSearchObject();
}
// Load the desired facet information...
$config = getExtraConfigArray('facets');
if (isset($config['SpecialFacets']['dateRangeVis'])) {
list($this->filterField, $this->dateFacet) = explode(':', $config['SpecialFacets']['dateRangeVis'], 2);
}
}
开发者ID:bharatm,项目名称:NDL-VuFind,代码行数:21,代码来源:JSON_DateRangeVis.php
示例15: __construct
/**
* Constructor. Initialise some details about the server
*
* @access public
*/
public function __construct()
{
global $configArray;
// Standard logic from parent class:
parent::__construct();
// Set up appropriate results action:
$this->resultsModule = 'Summon';
$this->resultsAction = 'Search';
// Set up basic and advanced Summon search types; default to basic.
$this->searchType = $this->basicSearchType = 'Summon';
$this->advancedSearchType = 'SummonAdvanced';
// Set up facet configuration -- note that we may need to strip extra
// parameters from the facet names (hence the extra processing):
$config = getExtraConfigArray('Summon');
foreach ($config['Facets'] as $key => $value) {
$parts = explode(',', $key);
$facetName = trim($parts[0]);
$this->facetConfig[$facetName] = $value;
}
// Set up spelling preference
if (isset($config['Spelling']['enabled'])) {
$this->spellcheck = $config['Spelling']['enabled'];
}
// Set up sort options
$this->sortOptions = $config['Sorting'];
if (isset($config['General']['default_sort'])) {
$this->defaultSort = $config['General']['default_sort'];
}
// Set up search options
$this->basicTypes = $config['Basic_Searches'];
if (isset($config['Advanced_Searches'])) {
$this->advancedTypes = $config['Advanced_Searches'];
}
// Account for "retain filters" setting:
if (isset($config['General']['retain_filters_by_default'])) {
$this->retainFiltersByDefault = $config['General']['retain_filters_by_default'];
}
// Set up recommendations options -- settings are found in Summon.ini:
$this->recommendIni = 'Summon';
// Connect to Summon
$id = isset($configArray['Summon']['apiId']) ? $configArray['Summon']['apiId'] : null;
$key = isset($configArray['Summon']['apiKey']) ? $configArray['Summon']['apiKey'] : null;
$this->_summon = new Summon($id, $key);
}
开发者ID:bharatm,项目名称:NDL-VuFind,代码行数:49,代码来源:Summon.php
示例16: __construct
/**
* Constructor. Initialise some details about the server
*
* @access public
*/
public function __construct()
{
// Standard logic from parent class:
parent::__construct();
global $configArray;
// Connect to the index
$this->_indexEngine = ConnectionManager::connectToIndex('SolrReserves');
// Set up appropriate results action:
$this->resultsModule = 'Search';
$this->resultsAction = 'Reserves';
// Set up basic and advanced search types; default to basic.
$this->searchType = $this->basicSearchType = 'Reserves';
// Get default facet settings
$this->facetConfig = array();
$this->recommendIni = 'reserves';
// Load search preferences:
$searchSettings = getExtraConfigArray('reserves');
if (isset($searchSettings['General']['facet_limit'])) {
$this->_facetLimit = $searchSettings['General']['facet_limit'];
}
if (isset($searchSettings['General']['default_handler'])) {
$this->defaultIndex = $searchSettings['General']['default_handler'];
}
if (isset($searchSettings['General']['default_sort'])) {
$this->defaultSort = $searchSettings['General']['default_sort'];
}
if (isset($searchSettings['Basic_Searches'])) {
$this->basicTypes = $searchSettings['Basic_Searches'];
}
if (isset($searchSettings['Advanced_Searches'])) {
$this->advancedTypes = $searchSettings['Advanced_Searches'];
}
if (isset($searchSettings['Autocomplete']['enabled'])) {
$this->autocompleteStatus = $searchSettings['Autocomplete']['enabled'];
}
// Load sort preferences (or defaults if none in .ini file):
if (isset($searchSettings['Sorting'])) {
$this->sortOptions = $searchSettings['Sorting'];
} else {
$this->sortOptions = array('instructor_str' => 'sort_instructor', 'course_str' => 'sort_course', 'department_str' => 'sort_department');
}
}
开发者ID:bharatm,项目名称:NDL-VuFind,代码行数:47,代码来源:SolrReserves.php
示例17: getSuggestions
/**
* getSuggestions
*
* This returns an array of suggestions based on current $_REQUEST parameters.
* This logic is present in the factory class so that it can be easily shared
* by multiple AJAX handlers.
*
* @param string $typeParam Name of $_REQUEST parameter containing search type
* @param string $queryParam Name of $_REQUEST parameter containing query string
*
* @return array
* @access public
*/
public static function getSuggestions($typeParam = 'type', $queryParam = 'q')
{
// Process incoming parameters:
$type = isset($_REQUEST[$typeParam]) ? $_REQUEST[$typeParam] : '';
$query = isset($_REQUEST[$queryParam]) ? $_REQUEST[$queryParam] : '';
// Figure out which handler to use:
$searchSettings = getExtraConfigArray('searches');
if (!empty($type) && isset($searchSettings['Autocomplete_Types'][$type])) {
$module = $searchSettings['Autocomplete_Types'][$type];
} else {
if (isset($searchSettings['Autocomplete']['default_handler'])) {
$module = $searchSettings['Autocomplete']['default_handler'];
} else {
$module = false;
}
}
// Get suggestions:
if ($module) {
@(list($name, $params) = explode(':', $module, 2));
$handler = self::initAutocomplete($name, $params);
}
return isset($handler) && is_object($handler) ? $handler->getSuggestions($query) : array();
}
开发者ID:bryandease,项目名称:VuFind-Plus,代码行数:36,代码来源:AutocompleteFactory.php
示例18: getSuggestions
/**
* Process search query and display suggestion as a JSON object.
*
* @return void
* @access public
*/
public function getSuggestions()
{
$autocomplete = true;
$prefilters = getExtraConfigArray('prefilters');
if (isset($_REQUEST['prefilter']) && $_REQUEST['prefilter'] && isset($prefilters[$_REQUEST['prefilter']])) {
$prefilter = $prefilters[$_REQUEST['prefilter']];
if ($prefilter && $_REQUEST['prefilter'] != '-') {
$params = $_REQUEST;
$params['prefiltered'] = $params['prefilter'];
unset($params['prefilter']);
foreach ($prefilter as $key => $value) {
if ($key == 'module' || $key == 'action') {
if ($key == 'module' && ($value != 'Search' && $value != 'Browse')) {
// only autocomplete on local index and browse
$autocomplete = false;
break;
}
continue;
}
if (is_array($value)) {
foreach ($value as $v) {
$params[$key][] = $v;
}
} else {
$params[$key] = $value;
}
}
$_REQUEST = $params;
}
}
if ($autocomplete) {
$this->output(array_values(AutocompleteFactory::getSuggestions()), JSON::STATUS_OK);
} else {
$this->output('', JSON::STATUS_ERROR);
}
}
开发者ID:bharatm,项目名称:NDL-VuFind,代码行数:42,代码来源:JSON_Autocomplete.php
示例19: __construct
/**
* Constructor. Initialise some details about the server
*
* @access public
*/
public function __construct()
{
// Call base class constructor
parent::__construct();
global $configArray;
global $timer;
// Include our solr index
$class = $configArray['Genealogy']['engine'];
require_once "sys/{$class}.php";
$this->searchType = 'genealogy';
$this->basicSearchType = 'genealogy';
// Initialise the index
$this->indexEngine = new $class($configArray['Genealogy']['url'], $configArray['Genealogy']['default_core']);
$timer->logTime('Created Index Engine for Genealogy');
//Make sure to turn off sharding for genealogy
$this->indexEngine->setShards(array());
// Get default facet settings
$this->allFacetSettings = getExtraConfigArray('genealogyFacets');
$this->facetConfig = array();
$facetLimit = $this->getFacetSetting('Results_Settings', 'facet_limit');
if (is_numeric($facetLimit)) {
$this->facetLimit = $facetLimit;
}
$translatedFacets = $this->getFacetSetting('Advanced_Settings', 'translated_facets');
if (is_array($translatedFacets)) {
$this->translatedFacets = $translatedFacets;
}
// Load search preferences:
$searchSettings = getExtraConfigArray('genealogySearches');
if (isset($searchSettings['General']['default_handler'])) {
$this->defaultIndex = $searchSettings['General']['default_handler'];
}
if (isset($searchSettings['General']['default_sort'])) {
$this->defaultSort = $searchSettings['General']['default_sort'];
}
if (isset($searchSettings['DefaultSortingByType']) && is_array($searchSettings['DefaultSortingByType'])) {
$this->defaultSortByType = $searchSettings['DefaultSortingByType'];
}
if (isset($searchSettings['Basic_Searches'])) {
$this->basicTypes = $searchSettings['Basic_Searches'];
}
if (isset($searchSettings['Advanced_Searches'])) {
$this->advancedTypes = $searchSettings['Advanced_Searches'];
}
// Load sort preferences (or defaults if none in .ini file):
if (isset($searchSettings['Sorting'])) {
$this->sortOptions = $searchSettings['Sorting'];
} else {
$this->sortOptions = array('relevance' => 'sort_relevance', 'year' => 'sort_year', 'year asc' => 'sort_year asc', 'title' => 'sort_title');
}
// Load Spelling preferences
$this->spellcheck = $configArray['Spelling']['enabled'];
$this->spellingLimit = $configArray['Spelling']['limit'];
$this->spellSimple = $configArray['Spelling']['simple'];
$this->spellSkipNumeric = isset($configArray['Spelling']['skip_numeric']) ? $configArray['Spelling']['skip_numeric'] : true;
// Debugging
if ($configArray['System']['debugSolr']) {
$this->indexEngine->debug = true;
} else {
$this->indexEngine->debug = false;
}
$this->recommendIni = 'genealogySearches';
$timer->logTime('Setup Solr Search Object');
}
开发者ID:bryandease,项目名称:VuFind-Plus,代码行数:69,代码来源:Genealogy.php
示例20: send
/**
* Send scheduled alerts
*
* @return void
*/
public function send()
{
global $configArray;
global $interface;
global $translator;
$iso8601 = 'Y-m-d\\TH:i:s\\Z';
ini_set('display_errors', true);
$configArray = $mainConfig = readConfig();
$datasourceConfig = getExtraConfigArray('datasources');
$siteLocal = $configArray['Site']['local'];
// Set up time zone. N.B. Don't use msg() or other functions requiring date before this.
date_default_timezone_set($configArray['Site']['timezone']);
$this->msg('Sending scheduled alerts');
// Setup Local Database Connection
ConnectionManager::connectToDatabase();
// Initialize Mailer
$mailer = new VuFindMailer();
// Find all scheduled alerts
$sql = 'SELECT * FROM "search" WHERE "schedule" > 0 ORDER BY user_id';
$s = new SearchEntry();
$s->query($sql);
$this->msg('Processing ' . $s->N . ' searches');
$user = false;
$interface = false;
$institution = false;
$todayTime = new DateTime();
while ($s->fetch()) {
$lastTime = new DateTime($s->last_executed);
if ($s->schedule == 1) {
// Daily
if ($todayTime->format('Y-m-d') == $lastTime->format('Y-m-d')) {
$this->msg('Bypassing search ' . $s->id . ': previous execution too recent (daily, ' . $lastTime->format($iso8601) . ')');
continue;
}
} elseif ($s->schedule == 2) {
// Weekly
$diff = $todayTime->diff($lastTime);
if ($diff->days < 6) {
$this->msg('Bypassing search ' . $s->id . ': previous execution too recent (weekly, ' . $lastTime->format($iso8601) . ')');
continue;
}
} else {
$this->msg('Search ' . $s->id . ': unknown schedule: ' . $s->schedule);
continue;
}
if ($user === false || $s->user_id != $user->id) {
$user = User::staticGet($s->user_id);
}
if (!$user->email || trim($user->email) == '') {
$this->msg('User ' . $user->username . ' does not have an email address, bypassing alert ' . $s->id);
continue;
}
$userInstitution = reset(explode(':', $user->username, 2));
if (!$institution || $institution != $userInstitution) {
$institution = $userInstitution;
if (!isset($datasourceConfig[$institution])) {
foreach ($datasourceConfig as $code => $values) {
if (isset($values['institution']) && strcasecmp($values['institution'], $institution) == 0) {
$institution = $code;
break;
}
}
}
if (!($configArray = $this->readInstitutionConfig($institution))) {
continue;
}
$configArray['Site']['url'] = $s->schedule_base_url;
// Start Interface
$interface = new UInterface($siteLocal);
$validLanguages = array_keys($configArray['Languages']);
$dateFormat = new VuFindDate();
}
$language = $user->language;
if (!in_array($user->language, $validLanguages)) {
$language = $configArray['Site']['language'];
}
$translator = new I18N_Translator(array($configArray['Site']['local'] . '/lang', $configArray['Site']['local'] . '/lang_local'), $language, $configArray['System']['debug']);
$interface->setLanguage($language);
$minSO = unserialize($s->search_object);
// Check minified search object type
$searchObject = SearchObjectFactory::deminify($minSO);
if (!$searchObject instanceof SearchObject_Solr) {
$this->msg('Search ' . $s->id . ': search object type not supported');
continue;
}
// Create a new search object to avoid cached defaults for e.g.
// hidden filters.
$searchObject = SearchObjectFactory::initSearchObject();
$searchObject->deminify($minSO);
$searchObject->setSort('first_indexed desc');
$searchTime = time();
$searchDate = gmdate($iso8601, time());
$searchObject->setLimit(50);
$searchObject->disableLogging();
$results = $searchObject->processSearch();
//.........这里部分代码省略.........
开发者ID:bharatm,项目名称:NDL-VuFind,代码行数:101,代码来源:scheduled_alerts.php
注:本文中的getExtraConfigArray函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论