non security modules update

This commit is contained in:
Bachir Soussi Chiadmi
2015-04-20 16:32:07 +02:00
parent 6a8d30db08
commit 37fbabab56
466 changed files with 32690 additions and 9652 deletions

View File

@@ -241,7 +241,8 @@ function menu_links_features_export_render($module, $data, $export = NULL) {
// Don't show new identifier unless we are actually exporting.
$link['options']['identifier'] = $new_identifier;
// identifiers are renewed, => that means we need to update them in the db
menu_link_save($temp = $link);
$temp = $link;
menu_link_save($temp);
}
unset($link['plid']);
@@ -295,19 +296,27 @@ function menu_links_features_rebuild_ordered($menu_links, $reset = FALSE) {
foreach ($unordered as $key => $link) {
$identifier = menu_links_features_identifier($link);
$parent = isset($link['parent_identifier']) ? $link['parent_identifier'] : '';
if (empty($parent)) {
$ordered[$identifier] = 0;
$all_links[$identifier] = $link;
unset($unordered[$key]);
$weight = 0;
// Parent has been seen, so weigh this above parent.
if (isset($ordered[$parent])) {
$weight = $ordered[$parent] + 1;
}
elseif (isset($ordered[$parent])) {
$ordered[$identifier] = $ordered[$parent] + 1;
$all_links[$identifier] = $link;
unset($unordered[$key]);
// Next loop will try to find parent weight instead.
elseif ($parent) {
continue;
}
$ordered[$identifier] = $weight;
$all_links[$identifier] = $link;
unset($unordered[$key]);
}
// Exit out when the above does no changes this loop.
} while (count($unordered) < $current);
}
// Add all remaining unordered items to the ordered list.
foreach ($unordered as $link) {
$identifier = menu_links_features_identifier($link);
$ordered[$identifier] = 0;
}
asort($ordered);
}
@@ -356,10 +365,11 @@ function features_menu_link_load($identifier) {
list($menu_name, $link_path) = explode(':', $identifier, 2);
}
$links = db_select('menu_links')
->fields('menu_links', array('menu_name', 'mlid', 'plid', 'link_path', 'router_path', 'link_title', 'options', 'module', 'hidden', 'external', 'has_children', 'expanded', 'weight', 'customized'))
->condition('menu_name', $menu_name)
->condition('link_path', $link_path)
->execute()
->fields('menu_links', array('menu_name', 'mlid', 'plid', 'link_path', 'router_path', 'link_title', 'options', 'module', 'hidden', 'external', 'has_children', 'expanded', 'weight', 'customized'))
->condition('menu_name', $menu_name)
->condition('link_path', $link_path)
->addTag('features_menu_link')
->execute()
->fetchAllAssoc('mlid');
foreach($links as $link) {
@@ -391,11 +401,14 @@ function features_menu_link_load($identifier) {
foreach($links as $link) {
$link->options = unserialize($link->options);
// title or previous identifier matches
if ((isset($link->options['identifier']) && strcmp($link->options['identifier'], $identifier) == 0)
|| (isset($clean_title) && strcmp(features_clean_title($link->link_title), $clean_title) == 0)) {
// Links with a stored identifier must only be matched on that identifier,
// to prevent cross over assumptions.
if (isset($link->options['identifier'])) {
if (strcmp($link->options['identifier'], $identifier) == 0) {
return (array)$link;
}
}
elseif ((strcmp(features_clean_title($link->link_title), $clean_title) == 0)) {
return (array)$link;
}
}