security update core+modules
This commit is contained in:
@@ -8,7 +8,9 @@
|
||||
* Default admin form.
|
||||
*/
|
||||
function _custom_search_default_admin_form($delta = '') {
|
||||
if ($delta != '') $delta = 'blocks_' . $delta . '_';
|
||||
if ($delta != '') {
|
||||
$delta = 'blocks_' . $delta . '_';
|
||||
}
|
||||
|
||||
// Labels & default text.
|
||||
$form['search_box'] = array(
|
||||
@@ -33,10 +35,28 @@ function _custom_search_default_admin_form($delta = '') {
|
||||
);
|
||||
$form['search_box']['custom_search_' . $delta . 'text'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Search box default text'),
|
||||
'#title' => t('Search box placeholder text'),
|
||||
'#default_value' => variable_get('custom_search_' . $delta . 'text', ''),
|
||||
'#description' => t('This will change the default text inside the search form. Leave blank for no text. This field is blank by default.'),
|
||||
'#description' => t('This will change the default text inside the search form. This is the <a href="http://www.w3schools.com/tags/att_input_placeholder.asp" target="_blank">placeholder</a> attribute for the TextField. Leave blank for no text. This field is blank by default.'),
|
||||
);
|
||||
$form['search_box']['custom_search_' . $delta . 'hint_text'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Search box hint text'),
|
||||
'#default_value' => variable_get('custom_search_' . $delta . 'hint_text', CUSTOM_SEARCH_HINT_TEXT_DEFAULT),
|
||||
'#description' => t('Enter the text that will be displayed when hovering the input field (HTML <em>title</em> attritube).'),
|
||||
);
|
||||
if (module_exists('elements')) {
|
||||
$form['search_box']['custom_search_' . $delta . 'element'] = array(
|
||||
'#type' => 'select',
|
||||
'#title' => t('Search box input type'),
|
||||
'#options' => array(
|
||||
'textfield' => 'text',
|
||||
'searchfield' => 'search (HTML5)',
|
||||
),
|
||||
'#default_value' => variable_get('custom_search_' . $delta . 'element', 'textfield'),
|
||||
'#description' => t('The default value is "text".'),
|
||||
);
|
||||
}
|
||||
$form['search_box']['custom_search_' . $delta . 'size'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Search box size'),
|
||||
@@ -73,7 +93,7 @@ function _custom_search_default_admin_form($delta = '') {
|
||||
$form['submit_button']['custom_search_image'] = array(
|
||||
'#type' => 'file',
|
||||
'#title' => t('Submit image'),
|
||||
'#description' => t('If you don\'t have direct file access to the server, use this field to upload your image.'),
|
||||
'#description' => t("If you don't have direct file access to the server, use this field to upload your image."),
|
||||
);
|
||||
|
||||
// Criteria.
|
||||
@@ -144,11 +164,10 @@ function _custom_search_default_admin_form($delta = '') {
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
if (module_exists('search_api_page')) {
|
||||
$search_api_pages = search_api_page_load_multiple();
|
||||
$options[0] = t('None');
|
||||
foreach($search_api_pages as $page) {
|
||||
foreach ($search_api_pages as $page) {
|
||||
$options[$page->id] = $page->name;
|
||||
}
|
||||
$form['searchapi'] = array(
|
||||
@@ -172,12 +191,14 @@ function _custom_search_default_admin_form($delta = '') {
|
||||
* Content admin form.
|
||||
*/
|
||||
function _custom_search_content_admin_form($delta = '') {
|
||||
if ($delta != '') $delta = 'blocks_' . $delta . '_';
|
||||
if ($delta != '') {
|
||||
$delta = 'blocks_' . $delta . '_';
|
||||
}
|
||||
|
||||
$form['content_selector'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Content selector'),
|
||||
'#description' => t('Select the search types to present as search options in the search block. If none is selected, no selector will be displayed. <strong>Note</strong>: if there\'s only one type checked, the selector won\'t be displayed BUT only this type will be searched.'),
|
||||
'#description' => t("Select the search types to present as search options in the search block. If none is selected, no selector will be displayed. <strong>Note</strong>: if there's only one type checked, the selector won't be displayed BUT only this type will be searched."),
|
||||
);
|
||||
$form['content_selector']['custom_search_' . $delta . 'node_types'] = array(
|
||||
'#type' => 'checkboxes',
|
||||
@@ -255,7 +276,7 @@ function _custom_search_content_admin_form($delta = '') {
|
||||
$form['custom_search_' . $delta . 'node_types_excluded'] = array(
|
||||
'#type' => 'checkboxes',
|
||||
'#title' => t('Content exclusion'),
|
||||
'#description' => t('Select the content types you don\'t want to be displayed as results.'),
|
||||
'#description' => t("Select the content types you don't want to be displayed as results.<br/><strong>Notice</strong>: content exclusion only works with the core Search module."),
|
||||
'#default_value' => variable_get('custom_search_' . $delta . 'node_types_excluded', array()),
|
||||
'#options' => node_type_get_names(),
|
||||
);
|
||||
@@ -267,7 +288,9 @@ function _custom_search_content_admin_form($delta = '') {
|
||||
* Custom paths admin form.
|
||||
*/
|
||||
function _custom_search_custom_paths_admin_form($delta = '') {
|
||||
if ($delta != '') $delta = 'blocks_' . $delta . '_';
|
||||
if ($delta != '') {
|
||||
$delta = 'blocks_' . $delta . '_';
|
||||
}
|
||||
$form['custom_search_paths_admin'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Custom search paths'),
|
||||
@@ -300,18 +323,20 @@ function _custom_search_custom_paths_admin_form($delta = '') {
|
||||
'#title' => t('Paths'),
|
||||
'#default_value' => variable_get('custom_search_' . $delta . 'paths', ''),
|
||||
'#rows' => 3,
|
||||
'#description' => t('If you want to use custom search paths, enter them here in the form <em>path</em>|<em>label</em>, one per line (if only one path is specified, the selector will be hidden). The [key] token will be replaced by what is entered in the search box. Ie: mysearch/[key]|My custom search label.'),
|
||||
'#description' => t('If you want to use custom search paths, enter them here in the form <em>path</em>|<em>label</em>, one per line (if only one path is specified, the selector will be hidden). The [key] token will be replaced by what is entered in the search box. Ie: mysearch/[key]|My custom search label. The [current_path] token can be used to use the current URL path of the page beeing viewed.'),
|
||||
);
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ordering admin form
|
||||
* Ordering admin form.
|
||||
*/
|
||||
function _custom_search_ordering_admin_form($delta = '') {
|
||||
drupal_add_css(drupal_get_path('module', 'custom_search') . '/custom_search.css');
|
||||
|
||||
if ($delta != '') $delta = 'blocks_' . $delta . '_';
|
||||
if ($delta != '') {
|
||||
$delta = 'blocks_' . $delta . '_';
|
||||
}
|
||||
$form['order'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => t('Elements ordering'),
|
||||
@@ -330,8 +355,9 @@ function _custom_search_ordering_admin_form($delta = '') {
|
||||
'custom_paths' => array('title' => t('Custom search paths'), 'default_weight' => 9),
|
||||
'submit_button' => array('title' => t('Submit button'), 'default_weight' => 10),
|
||||
);
|
||||
if (count(array_filter(array_merge(variable_get('custom_search_' . $delta . 'node_types', array()), variable_get('custom_search_' . $delta . 'other', array())))))
|
||||
if (count(array_filter(array_merge(variable_get('custom_search_' . $delta . 'node_types', array()), variable_get('custom_search_' . $delta . 'other', array()))))) {
|
||||
$elements['content_types'] = array('title' => t('Content Types'), 'default_weight' => 0);
|
||||
}
|
||||
|
||||
foreach ($elements as $element => $data) {
|
||||
$form['order']['custom_search_' . $delta . 'order'][$element] = array(
|
||||
@@ -341,17 +367,27 @@ function _custom_search_ordering_admin_form($delta = '') {
|
||||
$form['order']['custom_search_' . $delta . 'order'][$element]['sort'] = array(
|
||||
'#type' => 'weight',
|
||||
'#default_value' => variable_get('custom_search_' . $delta . $element . '_weight', $data['default_weight']),
|
||||
'#attributes' => array('class' => array('sort-select', 'sort-select-' . variable_get('custom_search_' . $delta . $element . '_region', 'block'))),
|
||||
'#attributes' => array(
|
||||
'class' => array(
|
||||
'sort-select',
|
||||
'sort-select-' . variable_get('custom_search_' . $delta . $element . '_region', 'block'),
|
||||
),
|
||||
),
|
||||
);
|
||||
$form['order']['custom_search_' . $delta . 'order'][$element]['region'] = array(
|
||||
'#type' => 'select',
|
||||
'#options' => array(
|
||||
'block' => t('Block'),
|
||||
'popup' => t('Popup')
|
||||
'popup' => t('Popup'),
|
||||
),
|
||||
'#default_value' => variable_get('custom_search_' . $delta . $element . '_region', 'block'),
|
||||
'#attributes' => array('class' => array('region-select', 'region-select-' . variable_get('custom_search_' . $delta . $element . '_region', 'block'))),
|
||||
'#attributes' => array(
|
||||
'class' => array(
|
||||
'region-select',
|
||||
'region-select-' . variable_get('custom_search_' . $delta . $element . '_region', 'block'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return $form;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user