本文整理汇总了PHP中getExtraConfigArray函数的典型用法代码示例。如果您正苦于以下问题:PHP getExtraConfigArray函数的具体用法?PHP getExtraConfigArray怎么用?PHP getExtraConfigArray使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getExtraConfigArray函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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');
}
示例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();
}
示例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());
}
示例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');
}
示例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);
}
示例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;
}
示例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']);
}
}
示例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']);
}
示例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']);
}
示例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();
}
示例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);
}
示例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']);
}
}
示例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);
}
}
示例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);
}