Skip to content
Snippets Groups Projects
Commit a32e3d14 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Added sitemap feature to administration pages.  Requested by various
  people including Michael and Moshe.
parent 4028362f
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -129,6 +129,23 @@ function menu_tree($parent = "", $all = 1) {
return $output;
}
function menu_map($parent = "") {
$result = db_query("SELECT * FROM menu WHERE parent = '%s' ORDER BY weight, name", $parent);
if (db_num_rows($result)) {
$output = "<ul>";
while ($item = db_fetch_object($result)) {
$output .= "<li>". menu_item($item) ."</li>";
$output .= menu_map($item->name);
}
$output .= "</ul>";
}
return $output;
}
function menu_add($name, $link, $title = NULL, $help = NULL, $parent = NULL, $weight = 1) {
if (!db_result(db_query("SELECT name FROM menu WHERE link = '%s'", $link))) {
db_query("INSERT INTO menu (name, link, title, help, parent, weight) VALUES ('%s', '%s', '%s', '%s', '%s', '%d')", $name, $link, $title, $help, $parent, $weight);
......
......@@ -9,7 +9,17 @@ function status($message) {
}
}
function admin_page($mod) {
function admin_link($type) {
if ($type == "admin") {
menu_add("sitemap", url("admin/admin/sitemap"), "Sitemap", NULL, NULL, 8);
}
}
function admin_admin() {
print menu_map();
}
function admin_page() {
global $user;
if (user_access("access administration pages")) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment