View source
<?php
define('CURRENT_SEARCH_DISPLAY_KEYS', 0);
define('CURRENT_SEARCH_DISPLAY_ALWAYS', 1);
define('CURRENT_SEARCH_DISPLAY_FILTERS', 2);
define('CURRENT_SEARCH_DISPLAY_KEYS_FILTERS', 3);
require_once dirname(__FILE__) . '/current_search.block.inc';
function current_search_menu() {
$items = array();
$items['admin/config/search/current_search/item/%current_search_item/delete/%'] = array(
'title' => 'Revert current search block configuration',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'current_search_delete_item_form',
5,
7,
),
'access arguments' => array(
'administer search',
),
'type' => MENU_NORMAL_ITEM,
'file' => 'plugins/export_ui/current_search_export_ui.class.php',
);
return $items;
}
function current_search_menu_alter(&$items) {
$base_path = 'admin/config/search/current_search';
foreach ($items as $path => $item) {
if ($base_path == $path || 0 === strpos($path, "{$base_path}/")) {
$items[$path]['access callback'] = 'facetapi_access_callback';
$items[$path]['access arguments'] = array();
}
}
$item =& $items['admin/config/search/current_search/list/%ctools_export_ui/edit'];
$item['title'] = 'Configure current search items';
$item['type'] = MENU_LOCAL_ACTION;
$item['context'] = MENU_CONTEXT_INLINE;
}
function current_search_theme() {
return array(
'current_search_group_title' => array(
'arguments' => array(
'title' => NULL,
),
'file' => 'current_search.theme.inc',
),
'current_search_text' => array(
'arguments' => array(
'text' => NULL,
'wrapper' => NULL,
'element' => NULL,
'css' => NULL,
'class' => array(),
),
'file' => 'current_search.theme.inc',
),
'current_search_link_active' => array(
'arguments' => array(
'text' => NULL,
'path' => NULL,
'options' => array(),
),
'file' => 'current_search.theme.inc',
),
'current_search_keys' => array(
'arguments' => array(
'keys' => NULL,
'adapter' => NULL,
),
'file' => 'current_search.theme.inc',
),
'current_search_deactivate_widget' => array(
'file' => 'current_search.theme.inc',
),
'current_search_item_wrapper' => array(
'render element' => 'element',
'file' => 'current_search.theme.inc',
),
'current_search_group_wrapper' => array(
'render element' => 'element',
'file' => 'current_search.theme.inc',
),
'current_search_sort_settings_table' => array(
'render element' => 'element',
'file' => 'current_search.theme.inc',
),
'current_search_accessible_markup' => array(
'arguments' => array(
'text' => NULL,
'active' => FALSE,
),
'file' => 'current_search.theme.inc',
),
);
}
function current_search_ctools_plugin_api($owner, $api) {
if ('current_search' == $owner && 'current_search' == $api) {
return array(
'version' => 1,
);
}
}
function current_search_ctools_plugin_directory($module, $type) {
if ('export_ui' == $type) {
return 'plugins/export_ui';
}
}
function current_search_ctools_plugin_type() {
return array(
'items' => array(
'use hooks' => TRUE,
),
);
}
function current_search_get_plugins() {
$plugins =& drupal_static(__FUNCTION__, array());
if (!$plugins) {
foreach (ctools_get_plugins('current_search', 'items') as $id => $plugin) {
$plugins[$id] = $plugin['handler']['label'];
}
}
return $plugins;
}
function current_search_get_searcher_options() {
$options = array();
foreach (facetapi_get_searcher_info() as $name => $info) {
$options[$name] = $info['label'];
}
return $options;
}
function current_search_item_load($name) {
ctools_include('export');
$result = ctools_export_crud_load('current_search', $name);
return $result ? $result : FALSE;
}
function current_search_current_search_items() {
return array(
'text' => array(
'handler' => array(
'label' => t('Custom text'),
'class' => 'CurrentSearchItemText',
),
),
'active' => array(
'handler' => array(
'label' => t('Active items'),
'class' => 'CurrentSearchItemActive',
),
),
'group' => array(
'handler' => array(
'label' => t('Field group'),
'class' => 'CurrentSearchGroup',
),
),
);
}