security update core+modules

This commit is contained in:
Bachir Soussi Chiadmi
2015-04-26 18:38:56 +02:00
parent 2f45ea820a
commit 7c96373038
1022 changed files with 30319 additions and 11259 deletions

View File

@@ -55,7 +55,6 @@
<?php endif; ?>
<?php if ($info) : ?>
<p class="search-info"><?php print $info; ?></p>
<?php endif; ?>
<?php //print '<pre>'. check_plain(print_r($info_split, 1)) .'</pre>'; ?>
<?php endif; ?>
</div>
</li>

View File

@@ -22,19 +22,19 @@
?>
<?php if ($search_results) : ?>
<h2><?php print t('Search results');?></h2>
<?php if (isset($filter) && $filter != '' && $filter_position == 'above') { ?>
<?php if (isset($filter) && $filter != '' && $filter_position == 'above') : ?>
<div class="custom-search-filter">
<?php print $filter; ?>
</div>
<?php } ?>
<?php endif; ?>
<ol class="search-results <?php print $module; ?>-results">
<?php print $search_results; ?>
</ol>
<?php if (isset($filter) && $filter != '' && $filter_position == 'below') { ?>
<?php if (isset($filter) && $filter != '' && $filter_position == 'below') : ?>
<div class="custom-search-filter">
<?php print $filter; ?>
</div>
<?php } ?>
<?php endif; ?>
<?php print $pager; ?>
<?php else : ?>
<h2><?php print t('Your search yielded no results');?></h2>

View File

@@ -9,15 +9,17 @@
'block' => array('title' => t('Block'), 'count' => 0),
'popup' => array('title' => t('Popup'), 'count' => 0),
);
foreach (element_children($form) as $element) $element_regions[$form[$element]['region']['#value']]['count']++;
foreach (element_children($form) as $element) :
$element_regions[$form[$element]['region']['#value']]['count']++;
endforeach;
// Add table javascript.
drupal_add_js('misc/tableheader.js');
drupal_add_js(drupal_get_path('module', 'custom_search') . '/js/custom_search_sort.js');
foreach ($element_regions as $region => $title) {
foreach ($element_regions as $region => $title) :
drupal_add_tabledrag('elements', 'match', 'sibling', 'region-select', 'region-select-' . $region, NULL, FALSE);
drupal_add_tabledrag('elements', 'order', 'sibling', 'sort-select', 'sort-select-' . $region);
}
endforeach;
?>
<table id="elements" class="sticky-enabled">
<thead>
@@ -33,7 +35,7 @@
<tr class="region-title region-title-<?php print $region?>">
<td colspan="3"><?php print $region_data['title']; ?></td>
</tr>
<tr class="region-message region-<?php print $region?>-message <?php print((!$region_data['count']) ? 'region-empty' : 'region-populated'); ?>">
<tr class="region-message region-<?php print $region?>-message <?php print ((!$region_data['count']) ? 'region-empty' : 'region-populated'); ?>">
<td colspan="3"><em><?php print t('No elements in this region'); ?></em></td>
</tr>
<?php foreach (element_children($form) as $element):
@@ -49,4 +51,4 @@
endforeach;
endforeach; ?>
</tbody>
</table>
</table>

View File

@@ -11,37 +11,49 @@
function custom_search_preprocess_search_results(&$variables) {
if ($variables['module'] == 'node') {
$variables['filter_position'] = variable_get('custom_search_filter', 'disabled');
// save # of results for collapsing advanced search
// Save # of results for collapsing advanced search.
$GLOBALS['custom_search_nb_results'] = count($variables['results']);
// generate the filter
// Generate the filter.
if (user_access('use custom search') && $variables['filter_position'] != 'disabled') {
// Get search words (minus type:node_type)
// Get search words (minus type:node_type).
$path = explode('/', $_GET['q'], 3);
$keys = empty($_REQUEST['keys']) ? '' : $_REQUEST['keys'];
if (count($path) == 3) $keys = $path[2];
if (strpos($keys, 'type:') !== FALSE) {
$keys = drupal_substr($keys, 0, strpos($keys, 'type:')-1);
if (count($path) == 3) {
$keys = $path[2];
}
// Get Custom Search authorized types
if (strpos($keys, 'type:') !== FALSE) {
$keys = drupal_substr($keys, 0, strpos($keys, 'type:') - 1);
}
// Get Custom Search authorized types.
$searchable_node_types = variable_get('custom_search_node_types', array());
$searchable_node_types = array_keys(array_filter($searchable_node_types, 'custom_search_filter_array'));
if (!count($searchable_node_types)) $searchable_node_types = array_keys(node_type_get_names());
if (!count($searchable_node_types)) {
$searchable_node_types = array_keys(node_type_get_names());
}
$node_types = db_query("SELECT type, name FROM {node_type} WHERE type IN (:ntypes)", array(':ntypes' => $searchable_node_types));
// Build menu
// Build menu.
$items = array();
$items[] = l(variable_get('custom_search_type_selector_all', CUSTOM_SEARCH_ALL_TEXT_DEFAULT), 'search/node/' . $keys);
foreach ($node_types as $node_type) {
// count # of results per type
// Count # of results per type.
$nbresults = 0;
foreach ($variables['results'] as $result) {
if ($result['node']->type == $node_type->type) $nbresults++;
if ($result['node']->type == $node_type->type) {
$nbresults++;
}
}
if ($nbresults) {
$items[] = l($node_type->name, 'search/node/' . $keys . ' type:' . $node_type->type);
}
if ($nbresults) $items[] = l($node_type->name, 'search/node/' . $keys . ' type:' . $node_type->type);
}
if (!isset($variables['filter-title'])) $variables['filter-title'] = variable_get('custom_search_filter_label', CUSTOM_SEARCH_FILTER_LABEL_DEFAULT);
if (count($items) > 2) $variables['filter'] = theme('item_list', array('items' => $items, 'title' => $variables['filter-title']));
if (!isset($variables['filter-title'])) {
$variables['filter-title'] = filter_xss(variable_get('custom_search_filter_label', CUSTOM_SEARCH_FILTER_LABEL_DEFAULT));
}
if (count($items) > 2) {
$variables['filter'] = theme('item_list', array('items' => $items, 'title' => $variables['filter-title']));
}
}
$variables['theme_hook_suggestions'][] = 'custom_search_results';
$variables['theme_hook_suggestions'][] = 'custom_search_results';
}
}
@@ -63,4 +75,4 @@ function custom_search_preprocess_search_result(&$variables) {
}
$variables['info'] = implode(' - ', $infos);
$variables['theme_hook_suggestions'][] = 'custom_search_result';
}
}