- Committed the admin menu integration patch. Thanks Adrian, Stefan and others.
parent
645d026e09
commit
f104d3cc12
|
@ -46,6 +46,17 @@ function menu_item($in_path) {
|
|||
return "<a href=\"". url($in_path) ."\"$css>". t($_gmenu[$in_path]["title"]) ."</a>";
|
||||
}
|
||||
|
||||
function menu_title($in_path = null) {
|
||||
global $_gmenu;
|
||||
|
||||
if ($in_path == null) {
|
||||
$trail = menu_trail();
|
||||
$in_path = array_pop($trail);
|
||||
}
|
||||
|
||||
return ucfirst($_gmenu[$in_path]["title"]);
|
||||
}
|
||||
|
||||
function menu_trail() {
|
||||
global $_gmenu;
|
||||
static $trail; // cache
|
||||
|
@ -72,13 +83,13 @@ function menu_path() {
|
|||
|
||||
$trail = menu_trail();
|
||||
|
||||
$links = array();
|
||||
$links[] = l(t("Home"), "");
|
||||
|
||||
foreach ($trail as $item) {
|
||||
$links[] = menu_item($item);
|
||||
}
|
||||
|
||||
return implode(" » ", $links);
|
||||
return $links;
|
||||
}
|
||||
|
||||
function menu_help() {
|
||||
|
|
131
misc/admin.css
131
misc/admin.css
|
@ -1,131 +0,0 @@
|
|||
/* $Id */
|
||||
|
||||
body {
|
||||
font-size: 90%;
|
||||
margin: 0;
|
||||
background-color: #fff;
|
||||
}
|
||||
body, th, td, h1, h2, h3, h4, #menu, #main {
|
||||
font-family: helvetica, arial;
|
||||
}
|
||||
a:link {
|
||||
color: #059;
|
||||
}
|
||||
a:visited {
|
||||
color: #049;
|
||||
}
|
||||
h1 {
|
||||
font-size: 1.3em;
|
||||
font-weight: bold;
|
||||
color: #006;
|
||||
}
|
||||
h2 {
|
||||
font-size: 1.2em;
|
||||
font-weight: bold;
|
||||
color: #006;
|
||||
margin: 0;
|
||||
padding: 0.5em 0 0 0;
|
||||
}
|
||||
h3 {
|
||||
font-size: 1.2em;
|
||||
font-weight: bold;
|
||||
color: #006;
|
||||
margin: 0;
|
||||
padding: 1em 0 0 0;
|
||||
}
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
th {
|
||||
text-align: left;
|
||||
padding-right: 1em;
|
||||
color: #006;
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
td {
|
||||
padding: 5px;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
hr {
|
||||
clear: both;
|
||||
margin: .5em 0;
|
||||
height: 1px;
|
||||
color: #ccc;
|
||||
}
|
||||
dt {
|
||||
font-weight: bold;
|
||||
}
|
||||
dd {
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
#menu {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
margin: 0 0 0 0;
|
||||
padding: 0 0 .85em 0;
|
||||
width: 14em;
|
||||
z-index: 1;
|
||||
overflow: hidden;
|
||||
background-color: #69c;
|
||||
border-right: 1px solid #999;
|
||||
border-bottom: 1px solid #999;
|
||||
}
|
||||
#menu h1 {
|
||||
background-color: #369;
|
||||
display: block;
|
||||
margin: 0 0 .85em 0;
|
||||
padding: 1em 0 .2em .6em;
|
||||
border-top: 1px solid #69c;
|
||||
border-bottom: 1px solid #90bade;
|
||||
}
|
||||
#menu h1 a {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
#menu ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0 0 0.25em 1.5em;
|
||||
border: none;
|
||||
}
|
||||
#menu li {
|
||||
margin: 0;
|
||||
padding: 0.2em 0.5em 0 0;
|
||||
}
|
||||
#menu li a {
|
||||
display: block;
|
||||
width: 100%;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
#menu li a.current {
|
||||
color: #000;
|
||||
}
|
||||
#menu li a:hover {
|
||||
color: #009;
|
||||
}
|
||||
#menu li.expanded {
|
||||
list-style-image: url(menu-expanded.gif);
|
||||
}
|
||||
#menu li.collapsed {
|
||||
list-style-image: url(menu-collapsed.gif);
|
||||
}
|
||||
#menu li.leaf {
|
||||
list-style-image: url(menu-leaf.gif);
|
||||
}
|
||||
#main {
|
||||
margin: 0 0 0 16em;
|
||||
padding: 1em 1em 1em 0;
|
||||
z-index: 2;
|
||||
}
|
||||
#logo {
|
||||
padding: 1em 1em 0 1em;
|
||||
float: right;
|
||||
}
|
||||
#logo img {
|
||||
border: 0;
|
||||
}
|
||||
#update {
|
||||
padding: 1em 1em 1em 1em;
|
||||
}
|
|
@ -258,3 +258,13 @@ pre, code {
|
|||
.queue-user-numeral {
|
||||
color: red;
|
||||
}
|
||||
|
||||
#menu { padding: 0 0 0 0.5em; }
|
||||
#menu ul { list-style: none; margin: 0; padding: 0 0 0.25em 1em; border: none; text-align:left;}
|
||||
#menu li { margin: 0; padding: 0.2em 0.5em 0 0; }
|
||||
#menu li a { display: block; width: 100%; text-decoration: none; }
|
||||
#menu li a.current { color: #000; }
|
||||
#menu li a:hover { color: #009; }
|
||||
#menu li.expanded { list-style-image: url(menu-expanded.gif); }
|
||||
#menu li.collapsed { list-style-image: url(menu-collapsed.gif); }
|
||||
#menu li.leaf { list-style-image: url(menu-leaf.gif); }
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 53 B After Width: | Height: | Size: 53 B |
Binary file not shown.
Before Width: | Height: | Size: 52 B After Width: | Height: | Size: 826 B |
Binary file not shown.
Before Width: | Height: | Size: 54 B After Width: | Height: | Size: 829 B |
|
@ -13,112 +13,73 @@ function admin_help($section) {
|
|||
$output = "";
|
||||
|
||||
switch ($section) {
|
||||
case 'admin/system/modules':
|
||||
case "admin/system/modules":
|
||||
$output .= "Handles the administration pages.";
|
||||
break;
|
||||
case 'admin':
|
||||
case "admin":
|
||||
$output .= "Welcome to the administration section. Below are the most recent system events. To get started please choose an item in the left column. If there is an arrow it will expand into a submenu. To jump up a level use the link,bread crumbs, above this block of text. To return to the home page click on the site name, and to go to Drupal's home page click on Druplicon, the drop on to the right.";
|
||||
break;
|
||||
case 'admin':
|
||||
case "admin":
|
||||
$output = "This is a complete overview of the site administration page.";
|
||||
break;
|
||||
}
|
||||
|
||||
return t($output);
|
||||
}
|
||||
|
||||
function admin_system($field){
|
||||
$output = "";
|
||||
|
||||
if ($field == "description") { $output = admin_help("admin/system/modules"); }
|
||||
if ($field == "description") {
|
||||
$output = admin_help("admin/system/modules");
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
function admin_link($type) {
|
||||
if ($type == "admin") {
|
||||
menu("admin", "Administration", NULL, admin_help("admin"));
|
||||
if ($type == "system") {
|
||||
menu("admin", t("administer %a", array("%a" => variable_get("site_name", "drupal"))) , NULL, NULL, 9);
|
||||
menu("admin/overview", "sitemap", "overview_callback", admin_help("admin/overview"), 8);
|
||||
}
|
||||
}
|
||||
|
||||
function overview_callback() {
|
||||
return menu_map("admin");
|
||||
return menu_map();
|
||||
}
|
||||
|
||||
function admin_admin() {
|
||||
print menu_map();
|
||||
return menu_map();
|
||||
}
|
||||
|
||||
|
||||
function admin_page() {
|
||||
global $base_url;
|
||||
|
||||
if (user_access("access administration pages")) {
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title><?php echo t("%sitename administration pages", array("%sitename" => variable_get("site_name", "drupal"))); ?></title>
|
||||
<?php print theme_head(); ?>
|
||||
<link rel="shortcut icon" type="image/ico" href="favicon.ico" />
|
||||
<link rel="stylesheet" type="text/css" media="print" href="misc/print.css" />
|
||||
<style type="text/css" title="layout" media="Screen">
|
||||
@import url("misc/admin.css");
|
||||
</style>
|
||||
</head>
|
||||
<body<?php print theme_onload_attribute(); ?>>
|
||||
<?php
|
||||
// NOTE: we include a dummy "print.css" to remove the "flash of unstyled content" (FUOC) problems in IE.
|
||||
if (!isset($GLOBALS["_gmenu"])) {
|
||||
menu_build("system");
|
||||
}
|
||||
if ($help = menu_help()) {
|
||||
$contents = "<small>$help</small><hr />";
|
||||
}
|
||||
if (arg(1)) {
|
||||
$contents .= menu_execute_action();
|
||||
}
|
||||
else {
|
||||
$contents.= watchdog_overview("actions");
|
||||
$title = t("System messages");
|
||||
}
|
||||
|
||||
menu_build("admin");
|
||||
$breadcrumb = menu_path();
|
||||
array_pop($breadcrumb);
|
||||
$title = menu_title();
|
||||
|
||||
/*
|
||||
** Body:
|
||||
*/
|
||||
|
||||
print "<div id=\"logo\"><a href=\"http://drupal.org/\"><img src=\"misc/druplicon-small.gif\" alt=\"Druplicon - Drupal logo\" title=\"Druplicon - Drupal logo\" /></a></div>";
|
||||
print "<div id=\"main\">";
|
||||
|
||||
if ($path = menu_path()) {
|
||||
print "<h2>$path</h2>";
|
||||
}
|
||||
|
||||
if ($help = menu_help()) {
|
||||
print "<small>$help</small>";
|
||||
}
|
||||
|
||||
print "<hr />";
|
||||
|
||||
if (arg(1)) {
|
||||
//print module_invoke(arg(1), "admin");
|
||||
print menu_execute_action();
|
||||
}
|
||||
else {
|
||||
print "<h2>". t("System messages") ."</h2>";
|
||||
print watchdog_overview("actions");
|
||||
}
|
||||
|
||||
print "</div>";
|
||||
|
||||
/*
|
||||
** Menu:
|
||||
** We rebuild the admin menu once more because one might have
|
||||
** enabled/disabled themes or modules, changed permissions, etc.
|
||||
*/
|
||||
|
||||
menu_build("admin");
|
||||
|
||||
print "<div id=\"menu\">";
|
||||
echo "<h1><a href=\"$base_url/\">". variable_get("site_name", "drupal") ."</a></h1>";
|
||||
print menu_tree("admin") ;
|
||||
print "</div>";
|
||||
print theme_footer();
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
theme("header");
|
||||
theme("breadcrumb", $breadcrumb);
|
||||
theme("box", $title, $contents);
|
||||
theme("footer");
|
||||
}
|
||||
else {
|
||||
print message_access();
|
||||
theme("header");
|
||||
theme("box", t("Access denied"), message_access());
|
||||
theme("footer");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -105,14 +105,16 @@ function import_link($type) {
|
|||
$links[] = l(t("news feeds"), "import", array("title" => t("Read the latest news from syndicated web sites.")));
|
||||
}
|
||||
|
||||
if ($type == "admin" && user_access("administer news feeds")) {
|
||||
if ($type == "system") {
|
||||
if (user_access("administer news feeds")) {
|
||||
|
||||
menu("admin/syndication", "content syndication", NULL, NULL, 5);
|
||||
menu("admin/syndication/news", "news aggregation", "import_admin", import_help("admin/syndication/news") );
|
||||
menu("admin/syndication/news/add/feed", "add new feed", "import_admin", import_help("admin/syndication/news/add/feed"), 2);
|
||||
menu("admin/syndication/news/add/bundle", "add new bundle", "import_admin", import_help("admin/syndication/news/add/bundle"), 3);
|
||||
menu("admin/syndication/news/tag", "tag news items", "import_admin", import_help("admin/syndication/news/tag"), 4);
|
||||
menu("admin/syndication/news/help", "help", "import_help", NULL, 9);
|
||||
menu("admin/syndication", "content syndication", NULL, NULL, 5);
|
||||
menu("admin/syndication/news", "news aggregation", "import_admin", import_help("admin/syndication/news") );
|
||||
menu("admin/syndication/news/add/feed", "add new feed", "import_admin", import_help("admin/syndication/news/add/feed"), 2);
|
||||
menu("admin/syndication/news/add/bundle", "add new bundle", "import_admin", import_help("admin/syndication/news/add/bundle"), 3);
|
||||
menu("admin/syndication/news/tag", "tag news items", "import_admin", import_help("admin/syndication/news/tag"), 4);
|
||||
menu("admin/syndication/news/help", "help", "import_help", NULL, 9);
|
||||
}
|
||||
}
|
||||
|
||||
return $links;
|
||||
|
|
|
@ -105,14 +105,16 @@ function import_link($type) {
|
|||
$links[] = l(t("news feeds"), "import", array("title" => t("Read the latest news from syndicated web sites.")));
|
||||
}
|
||||
|
||||
if ($type == "admin" && user_access("administer news feeds")) {
|
||||
if ($type == "system") {
|
||||
if (user_access("administer news feeds")) {
|
||||
|
||||
menu("admin/syndication", "content syndication", NULL, NULL, 5);
|
||||
menu("admin/syndication/news", "news aggregation", "import_admin", import_help("admin/syndication/news") );
|
||||
menu("admin/syndication/news/add/feed", "add new feed", "import_admin", import_help("admin/syndication/news/add/feed"), 2);
|
||||
menu("admin/syndication/news/add/bundle", "add new bundle", "import_admin", import_help("admin/syndication/news/add/bundle"), 3);
|
||||
menu("admin/syndication/news/tag", "tag news items", "import_admin", import_help("admin/syndication/news/tag"), 4);
|
||||
menu("admin/syndication/news/help", "help", "import_help", NULL, 9);
|
||||
menu("admin/syndication", "content syndication", NULL, NULL, 5);
|
||||
menu("admin/syndication/news", "news aggregation", "import_admin", import_help("admin/syndication/news") );
|
||||
menu("admin/syndication/news/add/feed", "add new feed", "import_admin", import_help("admin/syndication/news/add/feed"), 2);
|
||||
menu("admin/syndication/news/add/bundle", "add new bundle", "import_admin", import_help("admin/syndication/news/add/bundle"), 3);
|
||||
menu("admin/syndication/news/tag", "tag news items", "import_admin", import_help("admin/syndication/news/tag"), 4);
|
||||
menu("admin/syndication/news/help", "help", "import_help", NULL, 9);
|
||||
}
|
||||
}
|
||||
|
||||
return $links;
|
||||
|
|
|
@ -66,7 +66,7 @@ function block_perm() {
|
|||
}
|
||||
|
||||
function block_link($type) {
|
||||
if ($type == "admin" && user_access("administer blocks")) {
|
||||
if ($type == "system" && user_access("administer blocks")) {
|
||||
|
||||
menu("admin/block", "block management", "block_admin", block_help("admin/block"), 3);
|
||||
menu("admin/block/add", "create new block", "block_admin", block_help("admin/block/add"), 2);
|
||||
|
@ -169,10 +169,7 @@ function block_admin_display() {
|
|||
$delete = "";
|
||||
}
|
||||
|
||||
$status = form_checkbox(NULL, $block["module"]."][".$block["delta"]."][status", 1, $block["status"]);
|
||||
$custom = form_checkbox(NULL, $block["module"]."][".$block["delta"]."][custom", 1, $block["custom"]);
|
||||
|
||||
$rows[] = array($block["info"], array("data" => $status, "align" => "center"), array("data" => $custom, "align" => "center"), form_weight(NULL, $block["module"]."][".$block["delta"]."][weight", $block["weight"]), form_select(NULL, $block["module"]."][".$block["delta"]."][region", $block["region"], array(t("left"), t("right"))), form_textfield(NULL, $block["module"]."][".$block["delta"]."][path", $block["path"], 10, 255), $edit, $delete);
|
||||
$rows[] = array($block["info"], array("data" => form_checkbox(NULL, $block["module"]."][".$block["delta"]."][status", 1, $block["status"]), "align" => "center"), array("data" => form_checkbox(NULL, $block["module"]."][".$block["delta"]."][custom", 1, $block["custom"]), "align" => "center"), form_weight(NULL, $block["module"]."][".$block["delta"]."][weight", $block["weight"]), form_select(NULL, $block["module"]."][".$block["delta"]."][region", $block["region"], array(t("left"), t("right"))), form_textfield(NULL, $block["module"]."][".$block["delta"]."][path", $block["path"], 10, 255), $edit, $delete);
|
||||
}
|
||||
|
||||
$output = table($header, $rows);
|
||||
|
|
|
@ -66,7 +66,7 @@ function block_perm() {
|
|||
}
|
||||
|
||||
function block_link($type) {
|
||||
if ($type == "admin" && user_access("administer blocks")) {
|
||||
if ($type == "system" && user_access("administer blocks")) {
|
||||
|
||||
menu("admin/block", "block management", "block_admin", block_help("admin/block"), 3);
|
||||
menu("admin/block/add", "create new block", "block_admin", block_help("admin/block/add"), 2);
|
||||
|
@ -169,10 +169,7 @@ function block_admin_display() {
|
|||
$delete = "";
|
||||
}
|
||||
|
||||
$status = form_checkbox(NULL, $block["module"]."][".$block["delta"]."][status", 1, $block["status"]);
|
||||
$custom = form_checkbox(NULL, $block["module"]."][".$block["delta"]."][custom", 1, $block["custom"]);
|
||||
|
||||
$rows[] = array($block["info"], array("data" => $status, "align" => "center"), array("data" => $custom, "align" => "center"), form_weight(NULL, $block["module"]."][".$block["delta"]."][weight", $block["weight"]), form_select(NULL, $block["module"]."][".$block["delta"]."][region", $block["region"], array(t("left"), t("right"))), form_textfield(NULL, $block["module"]."][".$block["delta"]."][path", $block["path"], 10, 255), $edit, $delete);
|
||||
$rows[] = array($block["info"], array("data" => form_checkbox(NULL, $block["module"]."][".$block["delta"]."][status", 1, $block["status"]), "align" => "center"), array("data" => form_checkbox(NULL, $block["module"]."][".$block["delta"]."][custom", 1, $block["custom"]), "align" => "center"), form_weight(NULL, $block["module"]."][".$block["delta"]."][weight", $block["weight"]), form_select(NULL, $block["module"]."][".$block["delta"]."][region", $block["region"], array(t("left"), t("right"))), form_textfield(NULL, $block["module"]."][".$block["delta"]."][path", $block["path"], 10, 255), $edit, $delete);
|
||||
}
|
||||
|
||||
$output = table($header, $rows);
|
||||
|
|
|
@ -259,18 +259,19 @@ function blog_link($type, $node = 0, $main) {
|
|||
|
||||
$links = array();
|
||||
|
||||
if ($type == "system") {
|
||||
if (user_access("maintain personal blog")) {
|
||||
menu("node/add/blog", t("create blog entry"), NULL, NULL, 0);
|
||||
}
|
||||
if (user_access("maintain personal blog")) {
|
||||
menu("blog/" . $user->uid,t("view personal blog"), NULL, NULL, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if ($type == "page" && user_access("access content")) {
|
||||
$links[] = l(t("blogs"), "blog", array("title" => t("Read the latest blog entries.")));
|
||||
}
|
||||
|
||||
if ($type == "menu.create" && user_access("maintain personal blog")) {
|
||||
$links[] = l(t("create blog entry"), "node/add/blog", array("title" => t("Add a new personal blog entry.")));
|
||||
}
|
||||
|
||||
if ($type == "menu.view" && user_access("maintain personal blog")) {
|
||||
$links[] = l(t("view personal blog"), "blog/$user->uid", array("title" => t("Read your latest blog entries.")));
|
||||
}
|
||||
|
||||
if ($type == "node" && $node->type == "blog") {
|
||||
global $mod, $op, $id;
|
||||
|
||||
|
|
|
@ -259,18 +259,19 @@ function blog_link($type, $node = 0, $main) {
|
|||
|
||||
$links = array();
|
||||
|
||||
if ($type == "system") {
|
||||
if (user_access("maintain personal blog")) {
|
||||
menu("node/add/blog", t("create blog entry"), NULL, NULL, 0);
|
||||
}
|
||||
if (user_access("maintain personal blog")) {
|
||||
menu("blog/" . $user->uid,t("view personal blog"), NULL, NULL, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if ($type == "page" && user_access("access content")) {
|
||||
$links[] = l(t("blogs"), "blog", array("title" => t("Read the latest blog entries.")));
|
||||
}
|
||||
|
||||
if ($type == "menu.create" && user_access("maintain personal blog")) {
|
||||
$links[] = l(t("create blog entry"), "node/add/blog", array("title" => t("Add a new personal blog entry.")));
|
||||
}
|
||||
|
||||
if ($type == "menu.view" && user_access("maintain personal blog")) {
|
||||
$links[] = l(t("view personal blog"), "blog/$user->uid", array("title" => t("Read your latest blog entries.")));
|
||||
}
|
||||
|
||||
if ($type == "node" && $node->type == "blog") {
|
||||
global $mod, $op, $id;
|
||||
|
||||
|
|
|
@ -68,10 +68,6 @@ function book_link($type, $node = 0, $main = 0) {
|
|||
$links[] = l(t("books"), "book", array("title" => t("Read and contribute to the collaborative books.")));
|
||||
}
|
||||
|
||||
if ($type == "menu.create" && user_access("maintain books")) {
|
||||
$links[] = l(t("create book page"), "node/add/book", array("title" => t("Add a new book page.")));
|
||||
}
|
||||
|
||||
if ($type == "node" && $node->type == "book") {
|
||||
if (book_access("update", $node)) {
|
||||
$links[] = l(t("edit this page"), "node/edit/$node->nid", array("title" => t("Suggest an update for this book page.")));
|
||||
|
@ -81,15 +77,20 @@ function book_link($type, $node = 0, $main = 0) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($type == "admin" && user_access("maintain books")) {
|
||||
menu("admin/node/book", "books", "book_admin", book_help("admin/node/book"), 4);
|
||||
menu("admin/node/book/orphan", "orphan pages", "book_admin", book_help("admin/node/book/orphan"), 8);
|
||||
menu("admin/node/book/help", "help", "book_help", NULL, 9);
|
||||
if ($type == "system") {
|
||||
if (user_access("maintain books")) {
|
||||
menu("node/add/book",t("create book page"),NULL, NULL,0);
|
||||
|
||||
$result = db_query("SELECT n.nid, n.title FROM {node} n INNER JOIN {book} b ON n.nid = b.nid WHERE b.parent = 0 ORDER BY b.weight, n.title");
|
||||
while ($book = db_fetch_object($result)) {
|
||||
menu("admin/node/book/$book->nid", "'$book->title' book", "book_admin");
|
||||
menu("admin/node/book", "books", NULL, NULL, 4);
|
||||
menu("admin/node/book/orphan", "orphan pages", NULL, NULL, 8);
|
||||
menu("admin/node/book/help", "help", NULL, NULL, 9);
|
||||
|
||||
$result = db_query("SELECT n.nid, n.title FROM {node} n INNER JOIN {book} b ON n.nid = b.nid WHERE b.parent = 0 ORDER BY b.weight, n.title");
|
||||
while ($book = db_fetch_object($result)) {
|
||||
menu("admin/node/book/$book->nid", "'$book->title' book", "book_admin");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $links;
|
||||
|
|
|
@ -68,10 +68,6 @@ function book_link($type, $node = 0, $main = 0) {
|
|||
$links[] = l(t("books"), "book", array("title" => t("Read and contribute to the collaborative books.")));
|
||||
}
|
||||
|
||||
if ($type == "menu.create" && user_access("maintain books")) {
|
||||
$links[] = l(t("create book page"), "node/add/book", array("title" => t("Add a new book page.")));
|
||||
}
|
||||
|
||||
if ($type == "node" && $node->type == "book") {
|
||||
if (book_access("update", $node)) {
|
||||
$links[] = l(t("edit this page"), "node/edit/$node->nid", array("title" => t("Suggest an update for this book page.")));
|
||||
|
@ -81,15 +77,20 @@ function book_link($type, $node = 0, $main = 0) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($type == "admin" && user_access("maintain books")) {
|
||||
menu("admin/node/book", "books", "book_admin", book_help("admin/node/book"), 4);
|
||||
menu("admin/node/book/orphan", "orphan pages", "book_admin", book_help("admin/node/book/orphan"), 8);
|
||||
menu("admin/node/book/help", "help", "book_help", NULL, 9);
|
||||
if ($type == "system") {
|
||||
if (user_access("maintain books")) {
|
||||
menu("node/add/book",t("create book page"),NULL, NULL,0);
|
||||
|
||||
$result = db_query("SELECT n.nid, n.title FROM {node} n INNER JOIN {book} b ON n.nid = b.nid WHERE b.parent = 0 ORDER BY b.weight, n.title");
|
||||
while ($book = db_fetch_object($result)) {
|
||||
menu("admin/node/book/$book->nid", "'$book->title' book", "book_admin");
|
||||
menu("admin/node/book", "books", NULL, NULL, 4);
|
||||
menu("admin/node/book/orphan", "orphan pages", NULL, NULL, 8);
|
||||
menu("admin/node/book/help", "help", NULL, NULL, 9);
|
||||
|
||||
$result = db_query("SELECT n.nid, n.title FROM {node} n INNER JOIN {book} b ON n.nid = b.nid WHERE b.parent = 0 ORDER BY b.weight, n.title");
|
||||
while ($book = db_fetch_object($result)) {
|
||||
menu("admin/node/book/$book->nid", "'$book->title' book", "book_admin");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $links;
|
||||
|
|
|
@ -58,11 +58,13 @@ function cloud_link($type) {
|
|||
$links[] = l(t("site cloud"), "cloud", array("title" => t("Monitor other sites in the cloud.")));
|
||||
}
|
||||
|
||||
if ($type == "admin" && user_access("administer site cloud")) {
|
||||
menu("admin/syndication", "content syndication", NULL, NULL, 5);
|
||||
menu("admin/syndication/cloud", "site cloud", "cloud_admin", cloud_help("admin/syndication/cloud"));
|
||||
menu("admin/syndication/cloud/add", "add new site", "cloud_admin", cloud_help("admin/syndication/cloud/add"));
|
||||
menu("admin/syndication/cloud/help", "help", "cloud_help", NULL, 9);
|
||||
if ($type == "system") {
|
||||
if (user_access("administer site cloud")) {
|
||||
menu("admin/syndication", "content syndication", NULL, NULL, 5);
|
||||
menu("admin/syndication/cloud", "site cloud", "cloud_admin", cloud_help("admin/syndication/cloud"));
|
||||
menu("admin/syndication/cloud/add", "add new site", "cloud_admin", cloud_help("admin/syndication/cloud/add"));
|
||||
menu("admin/syndication/cloud/help", "help", "cloud_help", NULL, 9);
|
||||
}
|
||||
}
|
||||
|
||||
return $links;
|
||||
|
|
|
@ -813,23 +813,25 @@ function comment_link($type, $node = 0, $main = 0) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($type == "admin" && user_access("administer comments")) {
|
||||
if ($type == "system") {
|
||||
if (user_access("administer comments")) {
|
||||
|
||||
menu("admin/comment", "comment management", "comment_admin", comment_help("admin/comment"), 2);
|
||||
menu("admin/comment/comments", "comment overview",NULL, comment_help("admin/comment/comments"), 2);
|
||||
menu("admin/comment/comments/0", "new or updated comments", "comment_admin", comment_help("admin/comment/comments/0"), 1);
|
||||
menu("admin/comment/comments/1", "comment approval queue", "comment_admin", comment_help("admin/comment/comments/1"), 2);
|
||||
menu("admin/comment/search", "search comments", "comment_admin", comment_help("admin/comment/search"), 8);
|
||||
menu("admin/comment/help", "help", "comment_help", NULL, 9);
|
||||
menu("admin/comment/edit", "edit comment", "comment_admin", NULL, 0, 1);
|
||||
menu("admin/comment", "comment management", "comment_admin", comment_help("admin/comment"), 2);
|
||||
menu("admin/comment/comments", "comment overview",NULL, comment_help("admin/comment/comments"), 2);
|
||||
menu("admin/comment/comments/0", "new or updated comments", "comment_admin", comment_help("admin/comment/comments/0"), 1);
|
||||
menu("admin/comment/comments/1", "comment approval queue", "comment_admin", comment_help("admin/comment/comments/1"), 2);
|
||||
menu("admin/comment/search", "search comments", "comment_admin", comment_help("admin/comment/search"), 8);
|
||||
menu("admin/comment/help", "help", "comment_help", NULL, 9);
|
||||
menu("admin/comment/edit", "edit comment", "comment_admin", NULL, 0, 1);
|
||||
|
||||
// comment settings:
|
||||
if (user_access("administer moderation")) {
|
||||
menu("admin/comment/moderation", "comment moderation", NULL, comment_help("admin/comment/moderation"), 3);
|
||||
menu("admin/comment/moderation/votes", "votes", "comment_admin", comment_help("admin/comment/moderation/votes"));
|
||||
menu("admin/comment/moderation/matrix", "matrix", "comment_admin", comment_help("admin/comment/moderation/matrix"));
|
||||
menu("admin/comment/moderation/filters", "thresholds", "comment_admin", comment_help("admin/comment/moderation/filters"));
|
||||
menu("admin/comment/moderation/roles", "initial comment scores", "comment_admin", comment_help("admin/comment/roles"), 6);
|
||||
// comment settings:
|
||||
if (user_access("administer moderation")) {
|
||||
menu("admin/comment/moderation", "comment moderation", NULL, comment_help("admin/comment/moderation"), 3);
|
||||
menu("admin/comment/moderation/votes", "votes", "comment_admin", comment_help("admin/comment/moderation/votes"));
|
||||
menu("admin/comment/moderation/matrix", "matrix", "comment_admin", comment_help("admin/comment/moderation/matrix"));
|
||||
menu("admin/comment/moderation/filters", "thresholds", "comment_admin", comment_help("admin/comment/moderation/filters"));
|
||||
menu("admin/comment/moderation/roles", "initial comment scores", "comment_admin", comment_help("admin/comment/roles"), 6);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -813,23 +813,25 @@ function comment_link($type, $node = 0, $main = 0) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($type == "admin" && user_access("administer comments")) {
|
||||
if ($type == "system") {
|
||||
if (user_access("administer comments")) {
|
||||
|
||||
menu("admin/comment", "comment management", "comment_admin", comment_help("admin/comment"), 2);
|
||||
menu("admin/comment/comments", "comment overview",NULL, comment_help("admin/comment/comments"), 2);
|
||||
menu("admin/comment/comments/0", "new or updated comments", "comment_admin", comment_help("admin/comment/comments/0"), 1);
|
||||
menu("admin/comment/comments/1", "comment approval queue", "comment_admin", comment_help("admin/comment/comments/1"), 2);
|
||||
menu("admin/comment/search", "search comments", "comment_admin", comment_help("admin/comment/search"), 8);
|
||||
menu("admin/comment/help", "help", "comment_help", NULL, 9);
|
||||
menu("admin/comment/edit", "edit comment", "comment_admin", NULL, 0, 1);
|
||||
menu("admin/comment", "comment management", "comment_admin", comment_help("admin/comment"), 2);
|
||||
menu("admin/comment/comments", "comment overview",NULL, comment_help("admin/comment/comments"), 2);
|
||||
menu("admin/comment/comments/0", "new or updated comments", "comment_admin", comment_help("admin/comment/comments/0"), 1);
|
||||
menu("admin/comment/comments/1", "comment approval queue", "comment_admin", comment_help("admin/comment/comments/1"), 2);
|
||||
menu("admin/comment/search", "search comments", "comment_admin", comment_help("admin/comment/search"), 8);
|
||||
menu("admin/comment/help", "help", "comment_help", NULL, 9);
|
||||
menu("admin/comment/edit", "edit comment", "comment_admin", NULL, 0, 1);
|
||||
|
||||
// comment settings:
|
||||
if (user_access("administer moderation")) {
|
||||
menu("admin/comment/moderation", "comment moderation", NULL, comment_help("admin/comment/moderation"), 3);
|
||||
menu("admin/comment/moderation/votes", "votes", "comment_admin", comment_help("admin/comment/moderation/votes"));
|
||||
menu("admin/comment/moderation/matrix", "matrix", "comment_admin", comment_help("admin/comment/moderation/matrix"));
|
||||
menu("admin/comment/moderation/filters", "thresholds", "comment_admin", comment_help("admin/comment/moderation/filters"));
|
||||
menu("admin/comment/moderation/roles", "initial comment scores", "comment_admin", comment_help("admin/comment/roles"), 6);
|
||||
// comment settings:
|
||||
if (user_access("administer moderation")) {
|
||||
menu("admin/comment/moderation", "comment moderation", NULL, comment_help("admin/comment/moderation"), 3);
|
||||
menu("admin/comment/moderation/votes", "votes", "comment_admin", comment_help("admin/comment/moderation/votes"));
|
||||
menu("admin/comment/moderation/matrix", "matrix", "comment_admin", comment_help("admin/comment/moderation/matrix"));
|
||||
menu("admin/comment/moderation/filters", "thresholds", "comment_admin", comment_help("admin/comment/moderation/filters"));
|
||||
menu("admin/comment/moderation/roles", "initial comment scores", "comment_admin", comment_help("admin/comment/roles"), 6);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ function help_system($field){
|
|||
}
|
||||
|
||||
function help_link($type) {
|
||||
if ($type == "admin") {
|
||||
if ($type == "system") {
|
||||
menu("admin/help/glossary", "glossary", "help_glossary", NULL, 8);
|
||||
menu("admin/help", "help", "help_admin", NULL, 9);
|
||||
}
|
||||
|
@ -48,7 +48,6 @@ function help_admin() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
$output = "<small>". implode(" · ", $links) ."</small><hr />". $output;
|
||||
return $output;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ function help_system($field){
|
|||
}
|
||||
|
||||
function help_link($type) {
|
||||
if ($type == "admin") {
|
||||
if ($type == "system") {
|
||||
menu("admin/help/glossary", "glossary", "help_glossary", NULL, 8);
|
||||
menu("admin/help", "help", "help_admin", NULL, 9);
|
||||
}
|
||||
|
@ -48,7 +48,6 @@ function help_admin() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
$output = "<small>". implode(" · ", $links) ."</small><hr />". $output;
|
||||
return $output;
|
||||
}
|
||||
|
|
|
@ -105,14 +105,16 @@ function import_link($type) {
|
|||
$links[] = l(t("news feeds"), "import", array("title" => t("Read the latest news from syndicated web sites.")));
|
||||
}
|
||||
|
||||
if ($type == "admin" && user_access("administer news feeds")) {
|
||||
if ($type == "system") {
|
||||
if (user_access("administer news feeds")) {
|
||||
|
||||
menu("admin/syndication", "content syndication", NULL, NULL, 5);
|
||||
menu("admin/syndication/news", "news aggregation", "import_admin", import_help("admin/syndication/news") );
|
||||
menu("admin/syndication/news/add/feed", "add new feed", "import_admin", import_help("admin/syndication/news/add/feed"), 2);
|
||||
menu("admin/syndication/news/add/bundle", "add new bundle", "import_admin", import_help("admin/syndication/news/add/bundle"), 3);
|
||||
menu("admin/syndication/news/tag", "tag news items", "import_admin", import_help("admin/syndication/news/tag"), 4);
|
||||
menu("admin/syndication/news/help", "help", "import_help", NULL, 9);
|
||||
menu("admin/syndication", "content syndication", NULL, NULL, 5);
|
||||
menu("admin/syndication/news", "news aggregation", "import_admin", import_help("admin/syndication/news") );
|
||||
menu("admin/syndication/news/add/feed", "add new feed", "import_admin", import_help("admin/syndication/news/add/feed"), 2);
|
||||
menu("admin/syndication/news/add/bundle", "add new bundle", "import_admin", import_help("admin/syndication/news/add/bundle"), 3);
|
||||
menu("admin/syndication/news/tag", "tag news items", "import_admin", import_help("admin/syndication/news/tag"), 4);
|
||||
menu("admin/syndication/news/help", "help", "import_help", NULL, 9);
|
||||
}
|
||||
}
|
||||
|
||||
return $links;
|
||||
|
|
|
@ -69,18 +69,20 @@ function locale_perm() {
|
|||
function locale_link($type) {
|
||||
global $languages;
|
||||
|
||||
if ($type == "admin" && user_access("administer locales")) {
|
||||
if ($type == "system") {
|
||||
if (user_access("administer locales")) {
|
||||
|
||||
menu("admin/locale", "localization", NULL, locale_help("admin/locale"), 5);
|
||||
menu("admin/locale/search", "search string", "locale_admin", locale_help("admin/locale/search"), 8);
|
||||
menu("admin/locale/help", "help", "locale_help", NULL, 9);
|
||||
menu("admin/locale/edit", "edit string", "locale_admin", NULL, 0, 1); // hidden menu
|
||||
menu("admin/locale/delete", "delete string", "locale_admin", NULL, 0, 1); // hidden menu
|
||||
menu("admin/locale", "localization", NULL, locale_help("admin/locale"), 5);
|
||||
menu("admin/locale/search", "search string", "locale_admin", locale_help("admin/locale/search"), 8);
|
||||
menu("admin/locale/help", "help", "locale_help", NULL, 9);
|
||||
menu("admin/locale/edit", "edit string", "locale_admin", NULL, 0, 1); // hidden menu
|
||||
menu("admin/locale/delete", "delete string", "locale_admin", NULL, 0, 1); // hidden menu
|
||||
|
||||
foreach ($languages as $key => $value) {
|
||||
menu("admin/locale/$key", "$value", NULL, locale_help("admin/locale"));
|
||||
menu("admin/locale/$key/translated", "translated strings", "locale_admin", locale_help("admin/locale/translated"));
|
||||
menu("admin/locale/$key/untranslated", "untranslated strings", "locale_admin", locale_help("admin/locale/untranslated"));
|
||||
foreach ($languages as $key => $value) {
|
||||
menu("admin/locale/$key", "$value", NULL, locale_help("admin/locale"));
|
||||
menu("admin/locale/$key/translated", "translated strings", "locale_admin", locale_help("admin/locale/translated"));
|
||||
menu("admin/locale/$key/untranslated", "untranslated strings", "locale_admin", locale_help("admin/locale/untranslated"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,18 +69,20 @@ function locale_perm() {
|
|||
function locale_link($type) {
|
||||
global $languages;
|
||||
|
||||
if ($type == "admin" && user_access("administer locales")) {
|
||||
if ($type == "system") {
|
||||
if (user_access("administer locales")) {
|
||||
|
||||
menu("admin/locale", "localization", NULL, locale_help("admin/locale"), 5);
|
||||
menu("admin/locale/search", "search string", "locale_admin", locale_help("admin/locale/search"), 8);
|
||||
menu("admin/locale/help", "help", "locale_help", NULL, 9);
|
||||
menu("admin/locale/edit", "edit string", "locale_admin", NULL, 0, 1); // hidden menu
|
||||
menu("admin/locale/delete", "delete string", "locale_admin", NULL, 0, 1); // hidden menu
|
||||
menu("admin/locale", "localization", NULL, locale_help("admin/locale"), 5);
|
||||
menu("admin/locale/search", "search string", "locale_admin", locale_help("admin/locale/search"), 8);
|
||||
menu("admin/locale/help", "help", "locale_help", NULL, 9);
|
||||
menu("admin/locale/edit", "edit string", "locale_admin", NULL, 0, 1); // hidden menu
|
||||
menu("admin/locale/delete", "delete string", "locale_admin", NULL, 0, 1); // hidden menu
|
||||
|
||||
foreach ($languages as $key => $value) {
|
||||
menu("admin/locale/$key", "$value", NULL, locale_help("admin/locale"));
|
||||
menu("admin/locale/$key/translated", "translated strings", "locale_admin", locale_help("admin/locale/translated"));
|
||||
menu("admin/locale/$key/untranslated", "untranslated strings", "locale_admin", locale_help("admin/locale/untranslated"));
|
||||
foreach ($languages as $key => $value) {
|
||||
menu("admin/locale/$key", "$value", NULL, locale_help("admin/locale"));
|
||||
menu("admin/locale/$key/translated", "translated strings", "locale_admin", locale_help("admin/locale/translated"));
|
||||
menu("admin/locale/$key/untranslated", "untranslated strings", "locale_admin", locale_help("admin/locale/untranslated"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -570,13 +570,14 @@ function node_link($type, $node = 0, $main = 0) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($type == "admin" && user_access("administer nodes")) {
|
||||
|
||||
menu("admin/node", "content management", "node_admin", node_help("admin/node"));
|
||||
menu("admin/node/search", "search posts", "node_admin", node_help("admin/node/search"), 8);
|
||||
menu("admin/node/help", "help", "node_help", NULL, 9);
|
||||
menu("admin/node/edit", "edit node", "node_admin", NULL, 0, 1);
|
||||
menu("admin/node/settings", "content settings", "node_admin", node_help("admin/node/settings"), 8);
|
||||
if ($type == "system") {
|
||||
if (user_access("administer nodes")) {
|
||||
menu("admin/node", "content management", "node_admin", node_help("admin/node"));
|
||||
menu("admin/node/search", "search posts", "node_admin", node_help("admin/node/search"), 8);
|
||||
menu("admin/node/help", "help", "node_help", NULL, 9);
|
||||
menu("admin/node/edit", "edit node", "node_admin", NULL, 0, 1);
|
||||
menu("admin/node/settings", "content settings", "node_admin", node_help("admin/node/settings"), 8);
|
||||
}
|
||||
}
|
||||
|
||||
return $links;
|
||||
|
|
|
@ -570,13 +570,14 @@ function node_link($type, $node = 0, $main = 0) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($type == "admin" && user_access("administer nodes")) {
|
||||
|
||||
menu("admin/node", "content management", "node_admin", node_help("admin/node"));
|
||||
menu("admin/node/search", "search posts", "node_admin", node_help("admin/node/search"), 8);
|
||||
menu("admin/node/help", "help", "node_help", NULL, 9);
|
||||
menu("admin/node/edit", "edit node", "node_admin", NULL, 0, 1);
|
||||
menu("admin/node/settings", "content settings", "node_admin", node_help("admin/node/settings"), 8);
|
||||
if ($type == "system") {
|
||||
if (user_access("administer nodes")) {
|
||||
menu("admin/node", "content management", "node_admin", node_help("admin/node"));
|
||||
menu("admin/node/search", "search posts", "node_admin", node_help("admin/node/search"), 8);
|
||||
menu("admin/node/help", "help", "node_help", NULL, 9);
|
||||
menu("admin/node/edit", "edit node", "node_admin", NULL, 0, 1);
|
||||
menu("admin/node/settings", "content settings", "node_admin", node_help("admin/node/settings"), 8);
|
||||
}
|
||||
}
|
||||
|
||||
return $links;
|
||||
|
|
|
@ -95,8 +95,10 @@ function page_link($type) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($type == "menu.create" && user_access("maintain static pages")) {
|
||||
$links[] = l(t("create static page"), "node/add/page", array("title" => t("Add a new static page.")));
|
||||
if ($type == "system") {
|
||||
if (user_access("maintain static pages")) {
|
||||
menu("node/add/page", t("create static page"), NULL, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return $links;
|
||||
|
|
|
@ -95,8 +95,10 @@ function page_link($type) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($type == "menu.create" && user_access("maintain static pages")) {
|
||||
$links[] = l(t("create static page"), "node/add/page", array("title" => t("Add a new static page.")));
|
||||
if ($type == "system") {
|
||||
if (user_access("maintain static pages")) {
|
||||
menu("node/add/page", t("create static page"), NULL, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return $links;
|
||||
|
|
|
@ -161,8 +161,10 @@ function poll_insert($node) {
|
|||
function poll_link($type, $node = 0, $main) {
|
||||
$links = array();
|
||||
|
||||
if ($type == "menu.create" && user_access("create polls")) {
|
||||
$links[] = l(t("create poll"), "node/add/poll", array("title" => t("Add a new poll.")));
|
||||
if ($type == "system") {
|
||||
if (user_access("create polls")) {
|
||||
menu("node/add/poll",t("create poll"), NULL, NULL, 0);
|
||||
}
|
||||
}
|
||||
else if ($type == "page" && user_access("access content")) {
|
||||
$links[] = l(t("polls"), "poll", array("title" => t("View the list of polls on this site.")));
|
||||
|
|
|
@ -161,8 +161,10 @@ function poll_insert($node) {
|
|||
function poll_link($type, $node = 0, $main) {
|
||||
$links = array();
|
||||
|
||||
if ($type == "menu.create" && user_access("create polls")) {
|
||||
$links[] = l(t("create poll"), "node/add/poll", array("title" => t("Add a new poll.")));
|
||||
if ($type == "system") {
|
||||
if (user_access("create polls")) {
|
||||
menu("node/add/poll",t("create poll"), NULL, NULL, 0);
|
||||
}
|
||||
}
|
||||
else if ($type == "page" && user_access("access content")) {
|
||||
$links[] = l(t("polls"), "poll", array("title" => t("View the list of polls on this site.")));
|
||||
|
|
|
@ -42,8 +42,10 @@ function queue_perm() {
|
|||
}
|
||||
|
||||
function queue_link($type) {
|
||||
if ($type == "menu.view" && user_access("access submission queue")) {
|
||||
$links[] = l(t("view submissions"), "queue", array("title" => t("Moderate the content in the submission queue."))) ." (<span class=\"queue-user-numeral\">". queue_count() ."</span>)";
|
||||
if ($type == "system") {
|
||||
if (user_access("access submission queue")) {
|
||||
menu("queue", t("view submissions"), NULL, NULL, 1);
|
||||
}
|
||||
}
|
||||
|
||||
return $links ? $links : array();
|
||||
|
|
|
@ -114,22 +114,24 @@ function statistics_link($type, $node = 0, $main = 0) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($type == "admin" && (user_access("administer statistics module") || (user_access("administer statistics")))) {
|
||||
if ($type == "system") {
|
||||
if ((user_access("administer statistics module") || (user_access("administer statistics")))) {
|
||||
|
||||
menu("admin/statistics", "site statistics", "statistics_admin", statistics_help("admin/statistics"), 6);
|
||||
menu("admin/statistics/referrers", "referrer log", "statistics_admin", statistics_help("admin/statistics/referrers") );
|
||||
menu("admin/statistics/referrers/internal", "internal referrers only", "statistics_admin", statistics_help("admin/statistics/referrers/internal") );
|
||||
menu("admin/statistics/referrers/external", "external referrers only", "statistics_admin", statistics_help("admin/statistics/referrers/external") );
|
||||
menu("admin/statistics/log", "access log", "statistics_admin", statistics_help("admin/statistics/log") );
|
||||
menu("admin/statistics/log/node", "track node", "statistics_admin", statistics_help("admin/statistics/log/node"), 0, 1); //hidden
|
||||
menu("admin/statistics/log/user", "track user", "statistics_admin", statistics_help("admin/statistics/log/user"), 0, 1); //hidden
|
||||
menu("admin/statistics/log/host", "track host", "statistics_admin", statistics_help("admin/statistics/log/host"), 0, 1); //hidden
|
||||
menu("admin/statistics/top nodes page", "configure 'top nodes' page", "statistics_admin", statistics_help("admin/statistics/top nodes page"), 5);
|
||||
menu("admin/statistics/help", "help", "statistics_help", NULL, 9);
|
||||
menu("admin/statistics", "site statistics", "statistics_admin", statistics_help("admin/statistics"), 6);
|
||||
menu("admin/statistics/referrers", "referrer log", "statistics_admin", statistics_help("admin/statistics/referrers") );
|
||||
menu("admin/statistics/referrers/internal", "internal referrers only", "statistics_admin", statistics_help("admin/statistics/referrers/internal") );
|
||||
menu("admin/statistics/referrers/external", "external referrers only", "statistics_admin", statistics_help("admin/statistics/referrers/external") );
|
||||
menu("admin/statistics/log", "access log", "statistics_admin", statistics_help("admin/statistics/log") );
|
||||
menu("admin/statistics/log/node", "track node", "statistics_admin", statistics_help("admin/statistics/log/node"), 0, 1); //hidden
|
||||
menu("admin/statistics/log/user", "track user", "statistics_admin", statistics_help("admin/statistics/log/user"), 0, 1); //hidden
|
||||
menu("admin/statistics/log/host", "track host", "statistics_admin", statistics_help("admin/statistics/log/host"), 0, 1); //hidden
|
||||
menu("admin/statistics/top nodes page", "configure 'top nodes' page", "statistics_admin", statistics_help("admin/statistics/top nodes page"), 5);
|
||||
menu("admin/statistics/help", "help", "statistics_help", NULL, 9);
|
||||
|
||||
// block configuration:
|
||||
menu("admin/block/top nodes block", "configure 'top nodes' block", "statistics_admin", statistics_help("admin/block/top nodes/block"), 5);
|
||||
menu("admin/block/whos online block", "configure 'who is online' block", "statistics_admin", statistics_help("admin/block/whos online block"), 5);
|
||||
// block configuration:
|
||||
menu("admin/block/top nodes block", "configure 'top nodes' block", "statistics_admin", statistics_help("admin/block/top nodes/block"), 5);
|
||||
menu("admin/block/whos online block", "configure 'who is online' block", "statistics_admin", statistics_help("admin/block/whos online block"), 5);
|
||||
}
|
||||
}
|
||||
|
||||
return $links;
|
||||
|
|
|
@ -114,22 +114,24 @@ function statistics_link($type, $node = 0, $main = 0) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($type == "admin" && (user_access("administer statistics module") || (user_access("administer statistics")))) {
|
||||
if ($type == "system") {
|
||||
if ((user_access("administer statistics module") || (user_access("administer statistics")))) {
|
||||
|
||||
menu("admin/statistics", "site statistics", "statistics_admin", statistics_help("admin/statistics"), 6);
|
||||
menu("admin/statistics/referrers", "referrer log", "statistics_admin", statistics_help("admin/statistics/referrers") );
|
||||
menu("admin/statistics/referrers/internal", "internal referrers only", "statistics_admin", statistics_help("admin/statistics/referrers/internal") );
|
||||
menu("admin/statistics/referrers/external", "external referrers only", "statistics_admin", statistics_help("admin/statistics/referrers/external") );
|
||||
menu("admin/statistics/log", "access log", "statistics_admin", statistics_help("admin/statistics/log") );
|
||||
menu("admin/statistics/log/node", "track node", "statistics_admin", statistics_help("admin/statistics/log/node"), 0, 1); //hidden
|
||||
menu("admin/statistics/log/user", "track user", "statistics_admin", statistics_help("admin/statistics/log/user"), 0, 1); //hidden
|
||||
menu("admin/statistics/log/host", "track host", "statistics_admin", statistics_help("admin/statistics/log/host"), 0, 1); //hidden
|
||||
menu("admin/statistics/top nodes page", "configure 'top nodes' page", "statistics_admin", statistics_help("admin/statistics/top nodes page"), 5);
|
||||
menu("admin/statistics/help", "help", "statistics_help", NULL, 9);
|
||||
menu("admin/statistics", "site statistics", "statistics_admin", statistics_help("admin/statistics"), 6);
|
||||
menu("admin/statistics/referrers", "referrer log", "statistics_admin", statistics_help("admin/statistics/referrers") );
|
||||
menu("admin/statistics/referrers/internal", "internal referrers only", "statistics_admin", statistics_help("admin/statistics/referrers/internal") );
|
||||
menu("admin/statistics/referrers/external", "external referrers only", "statistics_admin", statistics_help("admin/statistics/referrers/external") );
|
||||
menu("admin/statistics/log", "access log", "statistics_admin", statistics_help("admin/statistics/log") );
|
||||
menu("admin/statistics/log/node", "track node", "statistics_admin", statistics_help("admin/statistics/log/node"), 0, 1); //hidden
|
||||
menu("admin/statistics/log/user", "track user", "statistics_admin", statistics_help("admin/statistics/log/user"), 0, 1); //hidden
|
||||
menu("admin/statistics/log/host", "track host", "statistics_admin", statistics_help("admin/statistics/log/host"), 0, 1); //hidden
|
||||
menu("admin/statistics/top nodes page", "configure 'top nodes' page", "statistics_admin", statistics_help("admin/statistics/top nodes page"), 5);
|
||||
menu("admin/statistics/help", "help", "statistics_help", NULL, 9);
|
||||
|
||||
// block configuration:
|
||||
menu("admin/block/top nodes block", "configure 'top nodes' block", "statistics_admin", statistics_help("admin/block/top nodes/block"), 5);
|
||||
menu("admin/block/whos online block", "configure 'who is online' block", "statistics_admin", statistics_help("admin/block/whos online block"), 5);
|
||||
// block configuration:
|
||||
menu("admin/block/top nodes block", "configure 'top nodes' block", "statistics_admin", statistics_help("admin/block/top nodes/block"), 5);
|
||||
menu("admin/block/whos online block", "configure 'who is online' block", "statistics_admin", statistics_help("admin/block/whos online block"), 5);
|
||||
}
|
||||
}
|
||||
|
||||
return $links;
|
||||
|
|
|
@ -54,8 +54,10 @@ function story_access($op, $node) {
|
|||
function story_link($type) {
|
||||
$links = array();
|
||||
|
||||
if ($type == "menu.create" && user_access("create stories")) {
|
||||
$links[] = l(t("create story"), "node/add/story", array("title" => t("Add a new story.")));
|
||||
if ($type == "system") {
|
||||
if (user_access("create stories")) {
|
||||
menu("node/add/story", t("create story"), NULL, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return $links;
|
||||
|
|
|
@ -54,8 +54,10 @@ function story_access($op, $node) {
|
|||
function story_link($type) {
|
||||
$links = array();
|
||||
|
||||
if ($type == "menu.create" && user_access("create stories")) {
|
||||
$links[] = l(t("create story"), "node/add/story", array("title" => t("Add a new story.")));
|
||||
if ($type == "system") {
|
||||
if (user_access("create stories")) {
|
||||
menu("node/add/story", t("create story"), NULL, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return $links;
|
||||
|
|
|
@ -52,33 +52,35 @@ function system_perm() {
|
|||
}
|
||||
|
||||
function system_link($type) {
|
||||
if ($type == "admin" && user_access("administer site configuration")) {
|
||||
$help["general"] = t("General configuration options for your site. Set up the name of the site, e-mail address used in mail-outs, clean URL options, caching, etc.");
|
||||
$help["themes"] = t("Select which themes are available to your users and specify the default theme.");
|
||||
$help["modules"] = t("Modules are plugins for Drupal that extend its core functionality. Here you can select which modules are enabled. On the left hand side click on the name of the module for their individual configurations. Once a module is enabled, you will need to grant permissions to users in user management.");
|
||||
$help["filters"] = t("Filters fit between the raw text in a node and the HTML output. They allow you to replace text selectively. Uses include automatic conversion of emoticons into graphics and filtering HTML content from users' submissions.");
|
||||
if ($type == "system") {
|
||||
if (user_access("administer site configuration")) {
|
||||
$help["general"] = t("General configuration options for your site. Set up the name of the site, e-mail address used in mail-outs, clean URL options, caching, etc.");
|
||||
$help["themes"] = t("Select which themes are available to your users and specify the default theme.");
|
||||
$help["modules"] = t("Modules are plugins for Drupal that extend its core functionality. Here you can select which modules are enabled. On the left hand side click on the name of the module for their individual configurations. Once a module is enabled, you will need to grant permissions to users in user management.");
|
||||
$help["filters"] = t("Filters fit between the raw text in a node and the HTML output. They allow you to replace text selectively. Uses include automatic conversion of emoticons into graphics and filtering HTML content from users' submissions.");
|
||||
|
||||
menu("admin/system", "site configuration", "system_admin", system_help("admin/system"), 3);
|
||||
menu("admin/system/themes", "themes", "system_admin", system_help("admin/system/themes"), 2);
|
||||
menu("admin/system", "site configuration", "system_admin", system_help("admin/system"), 3);
|
||||
menu("admin/system/themes", "themes", "system_admin", system_help("admin/system/themes"), 2);
|
||||
|
||||
foreach (theme_list(1) as $theme) {
|
||||
// NOTE: refresh the list because some themes might have been enabled/disabled.
|
||||
include_once "$theme->filename";
|
||||
$function = $theme->name ."_settings";
|
||||
if (function_exists($function)) {
|
||||
menu("admin/system/themes/$theme->name", $theme->name, "system_admin");
|
||||
foreach (theme_list(1) as $theme) {
|
||||
// NOTE: refresh the list because some themes might have been enabled/disabled.
|
||||
include_once "$theme->filename";
|
||||
$function = $theme->name ."_settings";
|
||||
if (function_exists($function)) {
|
||||
menu("admin/system/themes/$theme->name", $theme->name, "system_admin");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
menu("admin/system/modules", "modules", "system_admin", system_help("admin/system/modules"), 3);
|
||||
foreach (module_list(1) as $name) {
|
||||
// NOTE: refresh the list because some modules might have been enabled/disabled.
|
||||
if (module_hook($name, "settings")) {
|
||||
menu("admin/system/modules/$name", $name, "system_admin", module_invoke($name, "system", "admin_help"));
|
||||
menu("admin/system/modules", "modules", "system_admin", system_help("admin/system/modules"), 3);
|
||||
foreach (module_list(1) as $name) {
|
||||
// NOTE: refresh the list because some modules might have been enabled/disabled.
|
||||
if (module_hook($name, "settings")) {
|
||||
menu("admin/system/modules/$name", $name, "system_admin", module_invoke($name, "system", "admin_help"));
|
||||
}
|
||||
}
|
||||
menu("admin/system/filters", "filters", "system_admin", system_help("admin/system/filters"), 4);
|
||||
menu("admin/system/help", "help", "system_help", NULL, 9);
|
||||
}
|
||||
menu("admin/system/filters", "filters", "system_admin", system_help("admin/system/filters"), 4);
|
||||
menu("admin/system/help", "help", "system_help", NULL, 9);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -52,33 +52,35 @@ function system_perm() {
|
|||
}
|
||||
|
||||
function system_link($type) {
|
||||
if ($type == "admin" && user_access("administer site configuration")) {
|
||||
$help["general"] = t("General configuration options for your site. Set up the name of the site, e-mail address used in mail-outs, clean URL options, caching, etc.");
|
||||
$help["themes"] = t("Select which themes are available to your users and specify the default theme.");
|
||||
$help["modules"] = t("Modules are plugins for Drupal that extend its core functionality. Here you can select which modules are enabled. On the left hand side click on the name of the module for their individual configurations. Once a module is enabled, you will need to grant permissions to users in user management.");
|
||||
$help["filters"] = t("Filters fit between the raw text in a node and the HTML output. They allow you to replace text selectively. Uses include automatic conversion of emoticons into graphics and filtering HTML content from users' submissions.");
|
||||
if ($type == "system") {
|
||||
if (user_access("administer site configuration")) {
|
||||
$help["general"] = t("General configuration options for your site. Set up the name of the site, e-mail address used in mail-outs, clean URL options, caching, etc.");
|
||||
$help["themes"] = t("Select which themes are available to your users and specify the default theme.");
|
||||
$help["modules"] = t("Modules are plugins for Drupal that extend its core functionality. Here you can select which modules are enabled. On the left hand side click on the name of the module for their individual configurations. Once a module is enabled, you will need to grant permissions to users in user management.");
|
||||
$help["filters"] = t("Filters fit between the raw text in a node and the HTML output. They allow you to replace text selectively. Uses include automatic conversion of emoticons into graphics and filtering HTML content from users' submissions.");
|
||||
|
||||
menu("admin/system", "site configuration", "system_admin", system_help("admin/system"), 3);
|
||||
menu("admin/system/themes", "themes", "system_admin", system_help("admin/system/themes"), 2);
|
||||
menu("admin/system", "site configuration", "system_admin", system_help("admin/system"), 3);
|
||||
menu("admin/system/themes", "themes", "system_admin", system_help("admin/system/themes"), 2);
|
||||
|
||||
foreach (theme_list(1) as $theme) {
|
||||
// NOTE: refresh the list because some themes might have been enabled/disabled.
|
||||
include_once "$theme->filename";
|
||||
$function = $theme->name ."_settings";
|
||||
if (function_exists($function)) {
|
||||
menu("admin/system/themes/$theme->name", $theme->name, "system_admin");
|
||||
foreach (theme_list(1) as $theme) {
|
||||
// NOTE: refresh the list because some themes might have been enabled/disabled.
|
||||
include_once "$theme->filename";
|
||||
$function = $theme->name ."_settings";
|
||||
if (function_exists($function)) {
|
||||
menu("admin/system/themes/$theme->name", $theme->name, "system_admin");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
menu("admin/system/modules", "modules", "system_admin", system_help("admin/system/modules"), 3);
|
||||
foreach (module_list(1) as $name) {
|
||||
// NOTE: refresh the list because some modules might have been enabled/disabled.
|
||||
if (module_hook($name, "settings")) {
|
||||
menu("admin/system/modules/$name", $name, "system_admin", module_invoke($name, "system", "admin_help"));
|
||||
menu("admin/system/modules", "modules", "system_admin", system_help("admin/system/modules"), 3);
|
||||
foreach (module_list(1) as $name) {
|
||||
// NOTE: refresh the list because some modules might have been enabled/disabled.
|
||||
if (module_hook($name, "settings")) {
|
||||
menu("admin/system/modules/$name", $name, "system_admin", module_invoke($name, "system", "admin_help"));
|
||||
}
|
||||
}
|
||||
menu("admin/system/filters", "filters", "system_admin", system_help("admin/system/filters"), 4);
|
||||
menu("admin/system/help", "help", "system_help", NULL, 9);
|
||||
}
|
||||
menu("admin/system/filters", "filters", "system_admin", system_help("admin/system/filters"), 4);
|
||||
menu("admin/system/help", "help", "system_help", NULL, 9);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,10 +27,12 @@ function taxonomy_perm() {
|
|||
}
|
||||
|
||||
function taxonomy_link($type, $node = NULL) {
|
||||
if ($type == "admin" && user_access("administer taxonomy")) {
|
||||
menu("admin/taxonomy", "taxonomy", "taxonomy_admin", taxonomy_help("admin/taxonomy"), 3);
|
||||
menu("admin/taxonomy/add/vocabulary", "create new vocabulary", "taxonomy_admin", taxonomy_help("admin/taxonomy/add/vocabulary"));
|
||||
menu("admin/taxonomy/help", "help", "taxonomy_admin", NULL, 9);
|
||||
if ($type == "system") {
|
||||
if (user_access("administer taxonomy")) {
|
||||
menu("admin/taxonomy", "taxonomy", "taxonomy_admin", taxonomy_help("admin/taxonomy"), 3);
|
||||
menu("admin/taxonomy/add/vocabulary", "create new vocabulary", "taxonomy_admin", taxonomy_help("admin/taxonomy/add/vocabulary"));
|
||||
menu("admin/taxonomy/help", "help", "taxonomy_admin", NULL, 9);
|
||||
}
|
||||
}
|
||||
else if ($type == "taxonomy terms" && $node != NULL) {
|
||||
|
||||
|
|
|
@ -27,10 +27,12 @@ function taxonomy_perm() {
|
|||
}
|
||||
|
||||
function taxonomy_link($type, $node = NULL) {
|
||||
if ($type == "admin" && user_access("administer taxonomy")) {
|
||||
menu("admin/taxonomy", "taxonomy", "taxonomy_admin", taxonomy_help("admin/taxonomy"), 3);
|
||||
menu("admin/taxonomy/add/vocabulary", "create new vocabulary", "taxonomy_admin", taxonomy_help("admin/taxonomy/add/vocabulary"));
|
||||
menu("admin/taxonomy/help", "help", "taxonomy_admin", NULL, 9);
|
||||
if ($type == "system") {
|
||||
if (user_access("administer taxonomy")) {
|
||||
menu("admin/taxonomy", "taxonomy", "taxonomy_admin", taxonomy_help("admin/taxonomy"), 3);
|
||||
menu("admin/taxonomy/add/vocabulary", "create new vocabulary", "taxonomy_admin", taxonomy_help("admin/taxonomy/add/vocabulary"));
|
||||
menu("admin/taxonomy/help", "help", "taxonomy_admin", NULL, 9);
|
||||
}
|
||||
}
|
||||
else if ($type == "taxonomy terms" && $node != NULL) {
|
||||
|
||||
|
|
|
@ -18,8 +18,10 @@ function tracker_link($type) {
|
|||
|
||||
$links = array();
|
||||
|
||||
if ($type == "menu.view" && user_access("access content")) {
|
||||
$links[] = l(t("view recent posts"), "tracker", array("title" => t("Display an overview of the recent posts.")));
|
||||
if ($type == "system") {
|
||||
if (user_access("access content")) {
|
||||
menu("tracker", t("view recent posts"), NULL, NULL, 1);
|
||||
}
|
||||
}
|
||||
|
||||
return $links;
|
||||
|
@ -106,4 +108,4 @@ function tracker_page() {
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -18,8 +18,10 @@ function tracker_link($type) {
|
|||
|
||||
$links = array();
|
||||
|
||||
if ($type == "menu.view" && user_access("access content")) {
|
||||
$links[] = l(t("view recent posts"), "tracker", array("title" => t("Display an overview of the recent posts.")));
|
||||
if ($type == "system") {
|
||||
if (user_access("access content")) {
|
||||
menu("tracker", t("view recent posts"), NULL, NULL, 1);
|
||||
}
|
||||
}
|
||||
|
||||
return $links;
|
||||
|
@ -106,4 +108,4 @@ function tracker_page() {
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -427,15 +427,11 @@ function user_block($op = "list", $delta = 0) {
|
|||
break;
|
||||
case 1:
|
||||
if ($user->uid) {
|
||||
$output = "<div class=\"user-information-block\">\n";
|
||||
$output .= theme("theme_menu_list", module_invoke_all("link", "menu.create"));
|
||||
$output .= theme("theme_menu_list", module_invoke_all("link", "menu.view"));
|
||||
$output .= theme("theme_menu_list", module_invoke_all("link", "menu.settings"));
|
||||
$output .= theme("theme_menu_list", module_invoke_all("link", "menu.misc"));
|
||||
$output .= "</div>\n";
|
||||
|
||||
$block["subject"] = $user->name;
|
||||
$block["content"] = "<div class=\"user-login-link\">$output</div>";
|
||||
menu_build("system");
|
||||
$block["content"] .= "<div id=\"menu\">". menu_tree()."</div>";
|
||||
|
||||
return $block;
|
||||
}
|
||||
break;
|
||||
|
@ -472,35 +468,27 @@ function user_link($type) {
|
|||
$links[] = l(t("user account"), "user", array("title" => t("Create a user account, request a new password or edit your account settings.")));
|
||||
}
|
||||
|
||||
if ($type == "menu.settings") {
|
||||
$links[] = l(t("edit account"), "user/edit", array("title" => t("View and edit your account information.")));
|
||||
}
|
||||
if ($type == "system") {
|
||||
menu("user/edit", t("edit account"), NULL, NULL, 8);
|
||||
menu("user/logout", t("logout"), NULL, NULL, 10);
|
||||
if (user_access("administer users")) {
|
||||
menu("admin/user", "user management", "user_admin", user_help("admin/user"), 2);
|
||||
menu("admin/user/create", "create new account", "user_admin", user_help("admin/user/create"), 1);
|
||||
menu("admin/user/account", "view user accounts", "user_admin", user_help("admin/user/account"), 2);
|
||||
menu("admin/user/access", "access rules", NULL, user_help("admin/user/access"), 3);
|
||||
menu("admin/user/access/mail", "e-mail rules", "user_admin", user_help("admin/user/access/mail"));
|
||||
menu("admin/user/access/user", "username rules", "user_admin", user_help("admin/user/access/user"));
|
||||
menu("admin/user/role", "user roles", "user_admin", user_help("admin/user/role"), 4);
|
||||
menu("admin/user/permission", "user permissions", "user_admin", user_help("admin/user/permission"), 5);
|
||||
menu("admin/user/search", "search accounts", "user_admin", user_help("admin/user/search"), 8);
|
||||
menu("admin/user/help", "help", "user_help", NULL, 9);
|
||||
menu("admin/user/edit", "edit user account", "user_admin", NULL, 0, 1); // hidden menu
|
||||
menu("admin/user/account/1", "blocked users", "user_admin", user_help("admin/user/account/1"), 3);
|
||||
|
||||
if ($type == "menu.misc") {
|
||||
if (user_access("access administration pages")) {
|
||||
$links[] = l(t("administer %a", array("%a" => variable_get("site_name", "drupal"))), "admin", array("title" => t("Access administration pages.")));
|
||||
}
|
||||
|
||||
$links[] = l(t("logout"), "user/logout", array("title" => t("Logout.")));
|
||||
}
|
||||
|
||||
if ($type == "admin" && user_access("administer users")) {
|
||||
menu("admin/user", "user management", "user_admin", user_help("admin/user"), 2);
|
||||
menu("admin/user/create", "create new account", "user_admin", user_help("admin/user/create"), 1);
|
||||
menu("admin/user/account", "view user accounts", "user_admin", user_help("admin/user/account"), 2);
|
||||
menu("admin/user/access", "access rules", NULL, user_help("admin/user/access"), 3);
|
||||
menu("admin/user/access/mail", "e-mail rules", "user_admin", user_help("admin/user/access/mail"));
|
||||
menu("admin/user/access/user", "username rules", "user_admin", user_help("admin/user/access/user"));
|
||||
menu("admin/user/role", "user roles", "user_admin", user_help("admin/user/role"), 4);
|
||||
menu("admin/user/permission", "user permissions", "user_admin", user_help("admin/user/permission"), 5);
|
||||
menu("admin/user/search", "search accounts", "user_admin", user_help("admin/user/search"), 8);
|
||||
menu("admin/user/help", "help", "user_help", NULL, 9);
|
||||
menu("admin/user/edit", "edit user account", "user_admin", NULL, 0, 1); // hidden menu
|
||||
menu("admin/user/account/1", "blocked users", "user_admin", user_help("admin/user/account/1"), 3);
|
||||
|
||||
$i = 2;
|
||||
foreach (user_roles(1) as $key => $value) {
|
||||
menu("admin/user/account/". $i++, "users with role '$value'", "user_admin", NULL, 4);
|
||||
$i = 2;
|
||||
foreach (user_roles(1) as $key => $value) {
|
||||
menu("admin/user/account/". $i++, "users with role '$value'", "user_admin", NULL, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -427,15 +427,11 @@ function user_block($op = "list", $delta = 0) {
|
|||
break;
|
||||
case 1:
|
||||
if ($user->uid) {
|
||||
$output = "<div class=\"user-information-block\">\n";
|
||||
$output .= theme("theme_menu_list", module_invoke_all("link", "menu.create"));
|
||||
$output .= theme("theme_menu_list", module_invoke_all("link", "menu.view"));
|
||||
$output .= theme("theme_menu_list", module_invoke_all("link", "menu.settings"));
|
||||
$output .= theme("theme_menu_list", module_invoke_all("link", "menu.misc"));
|
||||
$output .= "</div>\n";
|
||||
|
||||
$block["subject"] = $user->name;
|
||||
$block["content"] = "<div class=\"user-login-link\">$output</div>";
|
||||
menu_build("system");
|
||||
$block["content"] .= "<div id=\"menu\">". menu_tree()."</div>";
|
||||
|
||||
return $block;
|
||||
}
|
||||
break;
|
||||
|
@ -472,35 +468,27 @@ function user_link($type) {
|
|||
$links[] = l(t("user account"), "user", array("title" => t("Create a user account, request a new password or edit your account settings.")));
|
||||
}
|
||||
|
||||
if ($type == "menu.settings") {
|
||||
$links[] = l(t("edit account"), "user/edit", array("title" => t("View and edit your account information.")));
|
||||
}
|
||||
if ($type == "system") {
|
||||
menu("user/edit", t("edit account"), NULL, NULL, 8);
|
||||
menu("user/logout", t("logout"), NULL, NULL, 10);
|
||||
if (user_access("administer users")) {
|
||||
menu("admin/user", "user management", "user_admin", user_help("admin/user"), 2);
|
||||
menu("admin/user/create", "create new account", "user_admin", user_help("admin/user/create"), 1);
|
||||
menu("admin/user/account", "view user accounts", "user_admin", user_help("admin/user/account"), 2);
|
||||
menu("admin/user/access", "access rules", NULL, user_help("admin/user/access"), 3);
|
||||
menu("admin/user/access/mail", "e-mail rules", "user_admin", user_help("admin/user/access/mail"));
|
||||
menu("admin/user/access/user", "username rules", "user_admin", user_help("admin/user/access/user"));
|
||||
menu("admin/user/role", "user roles", "user_admin", user_help("admin/user/role"), 4);
|
||||
menu("admin/user/permission", "user permissions", "user_admin", user_help("admin/user/permission"), 5);
|
||||
menu("admin/user/search", "search accounts", "user_admin", user_help("admin/user/search"), 8);
|
||||
menu("admin/user/help", "help", "user_help", NULL, 9);
|
||||
menu("admin/user/edit", "edit user account", "user_admin", NULL, 0, 1); // hidden menu
|
||||
menu("admin/user/account/1", "blocked users", "user_admin", user_help("admin/user/account/1"), 3);
|
||||
|
||||
if ($type == "menu.misc") {
|
||||
if (user_access("access administration pages")) {
|
||||
$links[] = l(t("administer %a", array("%a" => variable_get("site_name", "drupal"))), "admin", array("title" => t("Access administration pages.")));
|
||||
}
|
||||
|
||||
$links[] = l(t("logout"), "user/logout", array("title" => t("Logout.")));
|
||||
}
|
||||
|
||||
if ($type == "admin" && user_access("administer users")) {
|
||||
menu("admin/user", "user management", "user_admin", user_help("admin/user"), 2);
|
||||
menu("admin/user/create", "create new account", "user_admin", user_help("admin/user/create"), 1);
|
||||
menu("admin/user/account", "view user accounts", "user_admin", user_help("admin/user/account"), 2);
|
||||
menu("admin/user/access", "access rules", NULL, user_help("admin/user/access"), 3);
|
||||
menu("admin/user/access/mail", "e-mail rules", "user_admin", user_help("admin/user/access/mail"));
|
||||
menu("admin/user/access/user", "username rules", "user_admin", user_help("admin/user/access/user"));
|
||||
menu("admin/user/role", "user roles", "user_admin", user_help("admin/user/role"), 4);
|
||||
menu("admin/user/permission", "user permissions", "user_admin", user_help("admin/user/permission"), 5);
|
||||
menu("admin/user/search", "search accounts", "user_admin", user_help("admin/user/search"), 8);
|
||||
menu("admin/user/help", "help", "user_help", NULL, 9);
|
||||
menu("admin/user/edit", "edit user account", "user_admin", NULL, 0, 1); // hidden menu
|
||||
menu("admin/user/account/1", "blocked users", "user_admin", user_help("admin/user/account/1"), 3);
|
||||
|
||||
$i = 2;
|
||||
foreach (user_roles(1) as $key => $value) {
|
||||
menu("admin/user/account/". $i++, "users with role '$value'", "user_admin", NULL, 4);
|
||||
$i = 2;
|
||||
foreach (user_roles(1) as $key => $value) {
|
||||
menu("admin/user/account/". $i++, "users with role '$value'", "user_admin", NULL, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,15 +45,17 @@ function watchdog_perm() {
|
|||
}
|
||||
|
||||
function watchdog_link($type) {
|
||||
if ($type == "admin" && user_access("administer watchdog")) {
|
||||
menu("admin/watchdog", "site monitoring", "watchdog_admin", watchdog_help("admin/watchdog"), 6);
|
||||
menu("admin/watchdog/user", "user messages", "watchdog_admin", watchdog_help("admin/watchdog/user"));
|
||||
menu("admin/watchdog/regular", "regular messages", "watchdog_admin", watchdog_help("admin/watchdog/regular"));
|
||||
menu("admin/watchdog/special", "special messages", "watchdog_admin", watchdog_help("admin/watchdog/special"));
|
||||
menu("admin/watchdog/warning", "warning messages", "watchdog_admin", watchdog_help("admin/watchdog/warning"));
|
||||
menu("admin/watchdog/error", "error messages", "watchdog_admin", watchdog_help("admin/watchdog/error"));
|
||||
menu("admin/watchdog/httpd", "httpd messages", "watchdog_admin", watchdog_help("admin/watchdog/httpd"));
|
||||
menu("admin/watchdog/view", "view details", "watchdog_admin", NULL, 0, 1); // hidden menu
|
||||
if ($type == "system") {
|
||||
if (user_access("administer watchdog")) {
|
||||
menu("admin/watchdog", "site monitoring", "watchdog_admin", watchdog_help("admin/watchdog"), 6);
|
||||
menu("admin/watchdog/user", "user messages", "watchdog_admin", watchdog_help("admin/watchdog/user"));
|
||||
menu("admin/watchdog/regular", "regular messages", "watchdog_admin", watchdog_help("admin/watchdog/regular"));
|
||||
menu("admin/watchdog/special", "special messages", "watchdog_admin", watchdog_help("admin/watchdog/special"));
|
||||
menu("admin/watchdog/warning", "warning messages", "watchdog_admin", watchdog_help("admin/watchdog/warning"));
|
||||
menu("admin/watchdog/error", "error messages", "watchdog_admin", watchdog_help("admin/watchdog/error"));
|
||||
menu("admin/watchdog/httpd", "httpd messages", "watchdog_admin", watchdog_help("admin/watchdog/httpd"));
|
||||
menu("admin/watchdog/view", "view details", "watchdog_admin", NULL, 0, 1); // hidden menu
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,15 +45,17 @@ function watchdog_perm() {
|
|||
}
|
||||
|
||||
function watchdog_link($type) {
|
||||
if ($type == "admin" && user_access("administer watchdog")) {
|
||||
menu("admin/watchdog", "site monitoring", "watchdog_admin", watchdog_help("admin/watchdog"), 6);
|
||||
menu("admin/watchdog/user", "user messages", "watchdog_admin", watchdog_help("admin/watchdog/user"));
|
||||
menu("admin/watchdog/regular", "regular messages", "watchdog_admin", watchdog_help("admin/watchdog/regular"));
|
||||
menu("admin/watchdog/special", "special messages", "watchdog_admin", watchdog_help("admin/watchdog/special"));
|
||||
menu("admin/watchdog/warning", "warning messages", "watchdog_admin", watchdog_help("admin/watchdog/warning"));
|
||||
menu("admin/watchdog/error", "error messages", "watchdog_admin", watchdog_help("admin/watchdog/error"));
|
||||
menu("admin/watchdog/httpd", "httpd messages", "watchdog_admin", watchdog_help("admin/watchdog/httpd"));
|
||||
menu("admin/watchdog/view", "view details", "watchdog_admin", NULL, 0, 1); // hidden menu
|
||||
if ($type == "system") {
|
||||
if (user_access("administer watchdog")) {
|
||||
menu("admin/watchdog", "site monitoring", "watchdog_admin", watchdog_help("admin/watchdog"), 6);
|
||||
menu("admin/watchdog/user", "user messages", "watchdog_admin", watchdog_help("admin/watchdog/user"));
|
||||
menu("admin/watchdog/regular", "regular messages", "watchdog_admin", watchdog_help("admin/watchdog/regular"));
|
||||
menu("admin/watchdog/special", "special messages", "watchdog_admin", watchdog_help("admin/watchdog/special"));
|
||||
menu("admin/watchdog/warning", "warning messages", "watchdog_admin", watchdog_help("admin/watchdog/warning"));
|
||||
menu("admin/watchdog/error", "error messages", "watchdog_admin", watchdog_help("admin/watchdog/error"));
|
||||
menu("admin/watchdog/httpd", "httpd messages", "watchdog_admin", watchdog_help("admin/watchdog/httpd"));
|
||||
menu("admin/watchdog/view", "view details", "watchdog_admin", NULL, 0, 1); // hidden menu
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue