- Patch #125763 by chx: menu system fixes/enhancements.
parent
b1d492ee98
commit
0cb5532a23
|
@ -385,7 +385,7 @@ function _menu_translate($item, $map, $operation = MENU_HANDLE_REQUEST) {
|
||||||
$map[$index] = $return;
|
$map[$index] = $return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($operation != MENU_HANDLE_REQUEST) {
|
if ($operation == MENU_RENDER_LINK) {
|
||||||
// Re-join the path with the new replacement value.
|
// Re-join the path with the new replacement value.
|
||||||
$path = implode('/', $path_map);
|
$path = implode('/', $path_map);
|
||||||
}
|
}
|
||||||
|
@ -393,39 +393,46 @@ function _menu_translate($item, $map, $operation = MENU_HANDLE_REQUEST) {
|
||||||
else {
|
else {
|
||||||
$path = $item->path;
|
$path = $item->path;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine access callback, which will decide whether or not the current user has
|
// Determine access callback, which will decide whether or not the current user has
|
||||||
// access to this path.
|
// access to this path.
|
||||||
$callback = $item->access_callback;
|
$callback = $item->access_callback;
|
||||||
// Check for a TRUE or FALSE value.
|
// Check for a TRUE or FALSE value.
|
||||||
if (is_numeric($callback)) {
|
if (is_numeric($callback)) {
|
||||||
return array($callback, $map, $path);
|
$access = $callback;
|
||||||
}
|
}
|
||||||
$arguments = menu_unserialize($item->access_arguments, $map);
|
else {
|
||||||
// As call_user_func_array is quite slow and user_access is a very common
|
$arguments = menu_unserialize($item->access_arguments, $map);
|
||||||
// callback, it is worth making a special case for it.
|
// As call_user_func_array is quite slow and user_access is a very common
|
||||||
if ($callback == 'user_access') {
|
// callback, it is worth making a special case for it.
|
||||||
$access = (count($arguments) == 1) ? user_access($arguments[0]) : user_access($arguments[0], $arguments[1]);
|
if ($callback == 'user_access') {
|
||||||
return array($access, $map, $path);
|
$access = (count($arguments) == 1) ? user_access($arguments[0]) : user_access($arguments[0], $arguments[1]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$access = call_user_func_array($callback, $arguments);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return array(call_user_func_array($callback, $arguments), $map, $path);
|
return array($access, $map, $path);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a rendered menu tree.
|
* Returns a rendered menu tree.
|
||||||
*/
|
*/
|
||||||
function menu_tree() {
|
function menu_tree() {
|
||||||
|
global $user;
|
||||||
if ($item = menu_get_item()) {
|
if ($item = menu_get_item()) {
|
||||||
list(, $menu) = _menu_tree(db_query('SELECT * FROM {menu} WHERE pid IN ('. $item->parents .') AND visible = 1 ORDER BY vancode'));
|
list(, $menu) = _menu_tree(db_query('SELECT * FROM {menu} WHERE pid IN ('. $item->parents .') AND visible = 1 ORDER BY mleft'));
|
||||||
return $menu;
|
return $menu;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function _menu_tree($result = NULL, $depth = 0, $link = array('link' => '', 'has_children' => FALSE)) {
|
function _menu_tree($result = NULL, $depth = 0, $link = array('link' => '', 'has_children' => FALSE)) {
|
||||||
static $original_map;
|
static $map;
|
||||||
$remnant = array('link' => '', 'has_children' => FALSE);
|
$remnant = array('link' => '', 'has_children' => FALSE);
|
||||||
$tree = '';
|
$tree = '';
|
||||||
$map = arg(NULL);
|
if (!isset($map)) {
|
||||||
|
$map = arg(NULL);
|
||||||
|
}
|
||||||
|
$old_type = -1;
|
||||||
while ($item = db_fetch_object($result)) {
|
while ($item = db_fetch_object($result)) {
|
||||||
list($access, , $path) = _menu_translate($item, $map, MENU_RENDER_LINK);
|
list($access, , $path) = _menu_translate($item, $map, MENU_RENDER_LINK);
|
||||||
if (!$access) {
|
if (!$access) {
|
||||||
|
@ -434,18 +441,27 @@ function _menu_tree($result = NULL, $depth = 0, $link = array('link' => '', 'has
|
||||||
$menu_link = array('link' => l($item->title, $path), 'has_children' => $item->has_children);
|
$menu_link = array('link' => l($item->title, $path), 'has_children' => $item->has_children);
|
||||||
if ($item->depth > $depth) {
|
if ($item->depth > $depth) {
|
||||||
list($remnant, $menu) = _menu_tree($result, $item->depth, $menu_link);
|
list($remnant, $menu) = _menu_tree($result, $item->depth, $menu_link);
|
||||||
$tree .= theme('menu_tree', $link, $menu);
|
if ($menu) {
|
||||||
|
$tree .= theme('menu_tree', $link, $menu);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$tree .= theme('menu_link', $link);
|
||||||
|
}
|
||||||
$link = $remnant;
|
$link = $remnant;
|
||||||
$remnant = array('link' => '', 'has_children' => FALSE);
|
$remnant = array('link' => '', 'has_children' => FALSE);
|
||||||
}
|
}
|
||||||
elseif ($item->depth == $depth) {
|
elseif ($item->depth == $depth) {
|
||||||
$tree .= theme('menu_link', $link);
|
if ($link['link'] && !($old_type & MENU_VISIBLE_IF_HAS_CHILDREN)) {
|
||||||
|
$tree .= theme('menu_link', $link);
|
||||||
|
}
|
||||||
$link = $menu_link;
|
$link = $menu_link;
|
||||||
}
|
}
|
||||||
|
// it's the end of a submenu
|
||||||
else {
|
else {
|
||||||
$remnant = $menu_link;
|
$remnant = $menu_link;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$old_type = $item->type;
|
||||||
}
|
}
|
||||||
if ($link['link']) {
|
if ($link['link']) {
|
||||||
$tree .= theme('menu_link', $link);
|
$tree .= theme('menu_link', $link);
|
||||||
|
@ -506,7 +522,7 @@ function menu_get_active_help() {
|
||||||
* Populate the database representation of the menu.
|
* Populate the database representation of the menu.
|
||||||
*/
|
*/
|
||||||
function menu_rebuild() {
|
function menu_rebuild() {
|
||||||
$next = array();
|
// TODO: split menu and menu links storage.
|
||||||
db_query('DELETE FROM {menu}');
|
db_query('DELETE FROM {menu}');
|
||||||
$menu = module_invoke_all('menu');
|
$menu = module_invoke_all('menu');
|
||||||
foreach (module_implements('menu_alter') as $module) {
|
foreach (module_implements('menu_alter') as $module) {
|
||||||
|
@ -532,7 +548,6 @@ function menu_rebuild() {
|
||||||
if (empty($matches[1])) {
|
if (empty($matches[1])) {
|
||||||
$match = TRUE;
|
$match = TRUE;
|
||||||
$load_functions[$k] = NULL;
|
$load_functions[$k] = NULL;
|
||||||
$to_arg_functions[$k] = NULL;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (function_exists($matches[1] .'_to_arg')) {
|
if (function_exists($matches[1] .'_to_arg')) {
|
||||||
|
@ -571,6 +586,7 @@ function menu_rebuild() {
|
||||||
'_parts' => $parts,
|
'_parts' => $parts,
|
||||||
'_fit' => $fit,
|
'_fit' => $fit,
|
||||||
'_mid' => $mid++,
|
'_mid' => $mid++,
|
||||||
|
'_children' => array(),
|
||||||
);
|
);
|
||||||
$item += array(
|
$item += array(
|
||||||
'_visible' => (bool)($item['type'] & MENU_VISIBLE_IN_TREE),
|
'_visible' => (bool)($item['type'] & MENU_VISIBLE_IN_TREE),
|
||||||
|
@ -583,37 +599,34 @@ function menu_rebuild() {
|
||||||
else {
|
else {
|
||||||
$new_path = $path;
|
$new_path = $path;
|
||||||
}
|
}
|
||||||
|
$menu_path_map[$path] = $new_path;
|
||||||
$menu[$new_path] = $item;
|
$menu[$new_path] = $item;
|
||||||
}
|
}
|
||||||
// Second pass: find visible parents and prepare for sorting.
|
$menu_path_map[''] = '';
|
||||||
|
// Second pass: prepare for sorting and find parents.
|
||||||
foreach ($menu as $path => $item) {
|
foreach ($menu as $path => $item) {
|
||||||
$item = &$menu[$path];
|
$item = &$menu[$path];
|
||||||
$number_parts = $item['_number_parts'];
|
$number_parts = $item['_number_parts'];
|
||||||
$parents = array($item['_mid']);
|
if (isset($item['parent'])) {
|
||||||
if ($item['_visible'] && isset($item['parent'])) {
|
$parent_parts = explode('/', $menu_path_map[$item['parent']], 6);
|
||||||
$parent_parts = explode('/', $item['parent'], 6);
|
|
||||||
$slashes = count($parent_parts) - 1;
|
$slashes = count($parent_parts) - 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$parent_parts = $item['_parts'];
|
$parent_parts = $item['_parts'];
|
||||||
$slashes = $number_parts -1;
|
$slashes = $number_parts - 1;
|
||||||
}
|
}
|
||||||
$depth = 1;
|
$depth = 1;
|
||||||
|
$parents = array($item['_mid']);
|
||||||
for ($i = $slashes; $i; $i--) {
|
for ($i = $slashes; $i; $i--) {
|
||||||
$parent_path = implode('/', array_slice($parent_parts, 0, $i));
|
$parent_path = implode('/', array_slice($parent_parts, 0, $i));
|
||||||
// We need to calculate depth to be able to sort. depth needs visibility.
|
if (isset($menu[$parent_path]) && $menu[$parent_path]['_visible']) {
|
||||||
if (isset($menu[$parent_path])) {
|
$parent = $menu[$parent_path];
|
||||||
$parent = &$menu[$parent_path];
|
$parents[] = $parent['_mid'];
|
||||||
if ($item['_visible'] && $parent['_visible']) {
|
$depth++;
|
||||||
$parent['_has_children'] = 1;
|
if (!isset($item['_pid'])) {
|
||||||
$depth++;
|
$item['_pid'] = $parent['_mid'];
|
||||||
$parents[] = $parent['_mid'];
|
$item['_visible_parent_path'] = $parent_path;
|
||||||
if (!isset($item['_pid'])) {
|
|
||||||
$item['_pid'] = $parent['_mid'];
|
|
||||||
$item['_visible_parent_path'] = $parent_path;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
unset($parent);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$parents[] = 0;
|
$parents[] = 0;
|
||||||
|
@ -621,15 +634,24 @@ function menu_rebuild() {
|
||||||
// Store variables and set defaults.
|
// Store variables and set defaults.
|
||||||
$item += array(
|
$item += array(
|
||||||
'_pid' => 0,
|
'_pid' => 0,
|
||||||
'_depth' => $item['_visible'] ? $depth : $number_parts,
|
'_depth' => ($item['_visible'] ? $depth : $number_parts),
|
||||||
'_parents' => $parents,
|
'_parents' => $parents,
|
||||||
'_has_children' => 0,
|
'_parent_parts' => $parent_parts,
|
||||||
|
'_slashes' => $slashes,
|
||||||
);
|
);
|
||||||
$sort[$path] = $item['_depth'] . sprintf('%05d', $item['weight']) . $item['title'];
|
$sort[$path] = $item['_depth'] . sprintf('%05d', $item['weight']) . $item['title'];
|
||||||
unset($item);
|
unset($item);
|
||||||
}
|
}
|
||||||
array_multisort($sort, $menu);
|
array_multisort($sort, $menu);
|
||||||
// Third pass: calculate ancestors, vancode and store into the database.
|
// We are now sorted, so let's build the tree.
|
||||||
|
$children = array();
|
||||||
|
foreach ($menu as $path => $item) {
|
||||||
|
if ($item['_pid']) {
|
||||||
|
$menu[$item['_visible_parent_path']]['_children'][] = $path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
menu_renumber($menu);
|
||||||
|
// Apply inheritance rules.
|
||||||
foreach ($menu as $path => $item) {
|
foreach ($menu as $path => $item) {
|
||||||
$item = &$menu[$path];
|
$item = &$menu[$path];
|
||||||
for ($i = $item['_number_parts'] - 1; $i; $i--) {
|
for ($i = $item['_number_parts'] - 1; $i; $i--) {
|
||||||
|
@ -650,28 +672,17 @@ function menu_rebuild() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!isset($item['access callback'])) {
|
if (!isset($item['access callback'])) {
|
||||||
$menu[$path]['access callback'] = isset($item['access arguments']) ? 'user_access' : 0;
|
$item['access callback'] = isset($item['access arguments']) ? 'user_access' : 0;
|
||||||
}
|
}
|
||||||
if (is_bool($item['access callback'])) {
|
if (is_bool($item['access callback'])) {
|
||||||
$item['access callback'] = intval($item['access callback']);
|
$item['access callback'] = intval($item['access callback']);
|
||||||
}
|
}
|
||||||
if ($item['_visible']) {
|
|
||||||
$prefix = isset($item['_visible_parent_path']) ? $menu[$item['_visible_parent_path']]['_prefix'] : '';
|
|
||||||
if (!isset($next[$prefix])) {
|
|
||||||
$next[$prefix] = 0;
|
|
||||||
}
|
|
||||||
$vancode = $prefix . int2vancode($next[$prefix]++);
|
|
||||||
$menu[$path]['_prefix'] = $vancode .'.';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$vancode = '';
|
|
||||||
}
|
|
||||||
if ($item['_tab']) {
|
if ($item['_tab']) {
|
||||||
if (!isset($item['parent'])) {
|
if (!isset($item['parent'])) {
|
||||||
$item['parent'] = implode('/', array_slice($item['_parts'], 0, $item['_number_parts'] - 1));
|
$item['parent'] = implode('/', array_slice($item['_parts'], 0, $item['_number_parts'] - 1));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$item['_depth'] = $item['parent'] ? $menu[$item['parent']]['_depth'] + 1 : 1;
|
$item['_depth'] = $item['parent'] ? $menu[$menu_path_map[$item['parent']]]['_depth'] + 1 : 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -679,32 +690,51 @@ function menu_rebuild() {
|
||||||
// stored in parents, parent stores the tab parent.
|
// stored in parents, parent stores the tab parent.
|
||||||
$item['parent'] = $path;
|
$item['parent'] = $path;
|
||||||
}
|
}
|
||||||
$insert_item = $item + array(
|
$insert_item = $item;
|
||||||
|
unset($item);
|
||||||
|
$item = $insert_item + array(
|
||||||
'access arguments' => array(),
|
'access arguments' => array(),
|
||||||
'access callback' => '',
|
'access callback' => '',
|
||||||
'page arguments' => array(),
|
'page arguments' => array(),
|
||||||
'page callback' => '',
|
'page callback' => '',
|
||||||
|
'_mleft' => 0,
|
||||||
|
'_mright' => 0,
|
||||||
);
|
);
|
||||||
db_query("INSERT INTO {menu} (
|
db_query("INSERT INTO {menu} (
|
||||||
mid, pid, path, load_functions, to_arg_functions,
|
mid, pid, path, load_functions, to_arg_functions,
|
||||||
access_callback, access_arguments, page_callback, page_arguments, fit,
|
access_callback, access_arguments, page_callback, page_arguments, fit,
|
||||||
number_parts, vancode, visible, parents, depth, has_children, tab, title, parent, type)
|
number_parts, visible, parents, depth, has_children, tab, title, parent,
|
||||||
VALUES (%d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d, '%s', %d, %d, %d, '%s', '%s', '%s')",
|
type, mleft, mright)
|
||||||
$insert_item['_mid'], $insert_item['_pid'], $path,
|
VALUES (%d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d,
|
||||||
$insert_item['load_functions'], $insert_item['to_arg_functions'],
|
'%s', %d, %d, %d, '%s', '%s', '%s', %d, %d)",
|
||||||
$insert_item['access callback'], serialize($insert_item['access arguments']),
|
$item['_mid'], $item['_pid'], $path, $item['load_functions'],
|
||||||
$insert_item['page callback'], serialize($insert_item['page arguments']),
|
$item['to_arg_functions'], $item['access callback'],
|
||||||
$insert_item['_fit'], $insert_item['_number_parts'], $vancode .'+',
|
serialize($item['access arguments']), $item['page callback'],
|
||||||
$insert_item['_visible'], $insert_item['_parents'], $insert_item['_depth'],
|
serialize($item['page arguments']), $item['_fit'],
|
||||||
$insert_item['_has_children'], $item['_tab'], $insert_item['title'],
|
$item['_number_parts'], $item['_visible'], $item['_parents'],
|
||||||
$insert_item['parent'], $insert_item['type']);
|
$item['_depth'], !empty($item['_children']), $item['_tab'],
|
||||||
unset($item);
|
$item['title'], $item['parent'], $item['type'], $item['_mleft'],
|
||||||
|
$item['_mright']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function menu_map($arg, $function, $index, $default = FALSE) {
|
function menu_renumber(&$tree) {
|
||||||
$arg[$index] = is_numeric($arg[$index]) ? $function($arg[$index]) : $default;
|
foreach ($tree as $key => $element) {
|
||||||
return $arg[$index] ? $arg : FALSE;
|
if (!isset($tree[$key]['_mleft'])) {
|
||||||
|
_menu_renumber($tree, $key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function _menu_renumber(&$tree, $key) {
|
||||||
|
static $counter = 1;
|
||||||
|
if (!isset($tree[$key]['_mleft'])) {
|
||||||
|
$tree[$key]['_mleft'] = $counter++;
|
||||||
|
foreach ($tree[$key]['_children'] as $child_key) {
|
||||||
|
_menu_renumber($tree, $child_key);
|
||||||
|
}
|
||||||
|
$tree[$key]['_mright'] = $counter++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Placeholders.
|
// Placeholders.
|
||||||
|
@ -741,7 +771,7 @@ function menu_local_tasks($level = 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// This loads all the tabs.
|
// This loads all the tabs.
|
||||||
$result = db_query("SELECT * FROM {menu} WHERE parent = '%s' AND tab = 1 ORDER BY vancode", $parent);
|
$result = db_query("SELECT * FROM {menu} WHERE parent = '%s' AND tab = 1 ORDER BY mleft", $parent);
|
||||||
$tabs_current = '';
|
$tabs_current = '';
|
||||||
while ($item = db_fetch_object($result)) {
|
while ($item = db_fetch_object($result)) {
|
||||||
// This call changes the path from for example user/% to user/123 and
|
// This call changes the path from for example user/% to user/123 and
|
||||||
|
|
|
@ -328,8 +328,8 @@ function system_install() {
|
||||||
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
|
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
|
||||||
|
|
||||||
db_query("CREATE TABLE {menu} (
|
db_query("CREATE TABLE {menu} (
|
||||||
mid int NOT NULL default '0',
|
mid int NOT NULL default 0,
|
||||||
pid int NOT NULL default '0',
|
pid int NOT NULL default 0,
|
||||||
path varchar(255) NOT NULL default '',
|
path varchar(255) NOT NULL default '',
|
||||||
load_functions varchar(255) NOT NULL default '',
|
load_functions varchar(255) NOT NULL default '',
|
||||||
to_arg_functions varchar(255) NOT NULL default '',
|
to_arg_functions varchar(255) NOT NULL default '',
|
||||||
|
@ -337,19 +337,19 @@ function system_install() {
|
||||||
access_arguments text,
|
access_arguments text,
|
||||||
page_callback varchar(255) NOT NULL default '',
|
page_callback varchar(255) NOT NULL default '',
|
||||||
page_arguments text,
|
page_arguments text,
|
||||||
fit int NOT NULL default '0',
|
fit int NOT NULL default 0,
|
||||||
number_parts int NOT NULL default '0',
|
number_parts int NOT NULL default 0,
|
||||||
vancode varchar(255) NOT NULL default '',
|
mleft int NOT NULL default 0,
|
||||||
visible int NOT NULL default '0',
|
mright int NOT NULL default 0,
|
||||||
|
visible int NOT NULL default 0,
|
||||||
parents varchar(255) NOT NULL default '',
|
parents varchar(255) NOT NULL default '',
|
||||||
depth int NOT NULL default '0',
|
depth int NOT NULL default 0,
|
||||||
has_children int NOT NULL default '0',
|
has_children int NOT NULL default 0,
|
||||||
tab int NOT NULL default 0,
|
tab int NOT NULL default 0,
|
||||||
title varchar(255) NOT NULL default '',
|
title varchar(255) NOT NULL default '',
|
||||||
parent varchar(255) NOT NULL default '',
|
parent varchar(255) NOT NULL default '',
|
||||||
type int NOT NULL default 0,
|
type int NOT NULL default 0,
|
||||||
PRIMARY KEY (path),
|
PRIMARY KEY (path),
|
||||||
KEY vancode (vancode),
|
|
||||||
KEY fit (fit),
|
KEY fit (fit),
|
||||||
KEY visible (visible),
|
KEY visible (visible),
|
||||||
KEY pid (pid),
|
KEY pid (pid),
|
||||||
|
@ -803,8 +803,8 @@ function system_install() {
|
||||||
)");
|
)");
|
||||||
|
|
||||||
db_query("CREATE TABLE {menu} (
|
db_query("CREATE TABLE {menu} (
|
||||||
mid int NOT NULL default '0',
|
mid int NOT NULL default 0,
|
||||||
pid int NOT NULL default '0',
|
pid int NOT NULL default 0,
|
||||||
path varchar(255) NOT NULL default '',
|
path varchar(255) NOT NULL default '',
|
||||||
load_functions varchar(255) NOT NULL default '',
|
load_functions varchar(255) NOT NULL default '',
|
||||||
to_arg_functions varchar(255) NOT NULL default '',
|
to_arg_functions varchar(255) NOT NULL default '',
|
||||||
|
@ -812,13 +812,14 @@ function system_install() {
|
||||||
access_arguments text,
|
access_arguments text,
|
||||||
page_callback varchar(255) NOT NULL default '',
|
page_callback varchar(255) NOT NULL default '',
|
||||||
page_arguments text,
|
page_arguments text,
|
||||||
fit int NOT NULL default '0',
|
fit int NOT NULL default 0,
|
||||||
number_parts int NOT NULL default '0',
|
number_parts int NOT NULL default 0,
|
||||||
vancode varchar(255) NOT NULL default '',
|
mleft int NOT NULL default 0,
|
||||||
visible int NOT NULL default '0',
|
mright int NOT NULL default 0,
|
||||||
|
visible int NOT NULL default 0,
|
||||||
parents varchar(255) NOT NULL default '',
|
parents varchar(255) NOT NULL default '',
|
||||||
depth int NOT NULL default '0',
|
depth int NOT NULL default 0,
|
||||||
has_children int NOT NULL default '0',
|
has_children int NOT NULL default 0,
|
||||||
tab int NOT NULL default 0,
|
tab int NOT NULL default 0,
|
||||||
title varchar(255) NOT NULL default '',
|
title varchar(255) NOT NULL default '',
|
||||||
parent varchar(255) NOT NULL default '',
|
parent varchar(255) NOT NULL default '',
|
||||||
|
@ -826,7 +827,6 @@ function system_install() {
|
||||||
PRIMARY KEY (path)
|
PRIMARY KEY (path)
|
||||||
)");
|
)");
|
||||||
|
|
||||||
db_query("CREATE INDEX {menu}_vancode_idx ON {menu} (vancode)");
|
|
||||||
db_query("CREATE INDEX {menu}_fit_idx ON {menu} (fit)");
|
db_query("CREATE INDEX {menu}_fit_idx ON {menu} (fit)");
|
||||||
db_query("CREATE INDEX {menu}_visible_idx ON {menu} (visible)");
|
db_query("CREATE INDEX {menu}_visible_idx ON {menu} (visible)");
|
||||||
db_query("CREATE INDEX {menu}_parent_idx ON {menu} (parent)");
|
db_query("CREATE INDEX {menu}_parent_idx ON {menu} (parent)");
|
||||||
|
|
|
@ -735,6 +735,7 @@ function user_menu() {
|
||||||
'page callback' => 'drupal_get_form',
|
'page callback' => 'drupal_get_form',
|
||||||
'page arguments' => array('user_login'),
|
'page arguments' => array('user_login'),
|
||||||
'access callback' => 'user_is_anonymous',
|
'access callback' => 'user_is_anonymous',
|
||||||
|
'type' => MENU_CALLBACK,
|
||||||
);
|
);
|
||||||
|
|
||||||
$items['user/login'] = array(
|
$items['user/login'] = array(
|
||||||
|
|
Loading…
Reference in New Issue