Commit 277ceae5 authored by Dries's avatar Dries

- New menu houskeeping.  Prototyped by Zbynek.

  The following modules need updating:
    * glossary module
    * feed module (Breyten's version)
    * mailhandler module
    * notify module
    * project module
    * smileys module
    * admin module
    * style module
    * taxonomy_dhtml module

  To avoid unexpected problems menu_add() is deprecated (it will print an
  error message when used) and menu() should be used instead.
parent 53deeb18
......@@ -42,7 +42,7 @@
# automatically become the default language. You can add a language
# but make sure your SQL table, called locales is updated
# appropriately.
$languages = array("en" => "English");
$languages = array("en" => "english");
#
# Custom navigation links:
......
<?php
// $Id$
function menu_trail() {
global $QUERY_STRING;
static $trail = NULL;
/*
** Retrieve the currently active link.
*/
if (empty($trail)) {
$path = array();
$item = db_fetch_object(db_query("SELECT * FROM menu WHERE link LIKE '%%%s'", $QUERY_STRING));
/*
** Compile an array of menu objects that represent the path to
** the root link.
*/
function menu_add() {
trigger_error(t("the 'menu_add()' function is depricated"), E_USER_ERROR);
}
if ($item) {
$path[] = $item;
function menu($path, $title, $callback = NULL, $help = NULL, $weight = 0, $hidden = 0) {
global $_gmenu;
while ($item->parent) {
$result = db_query("SELECT * FROM menu WHERE name = '%s' ORDER BY weight, name", $item->parent);
if ($item = db_fetch_object($result)) {
$path[] = $item;
if (isset($_gmenu[$path])) {
if (empty($_gmenu[$path]["callback"])) { // dummy item -> fill in
$_gmenu[$path] = array("title" => $title, "callback" => $callback, "help" => $help, "weight" => $weight, "hidden" => $hidden, "children" => $_gmenu[$path]["children"]);
return true;
}
else { // real item found
trigger_error(t("While trying to add '%path' to menu, item already exists.", array("%path" => $path)), E_USER_ERROR);
return false;
}
}
$trail = array_reverse($path);
// if this is reached we need to create a new item
$_gmenu[$path] = array("title" => $title, "callback" => $callback, "help" => $help, "weight" => $weight, "hidden" => $hidden, "children" => array());
// does the item have an existing parent?
$parent = substr($path, 0, strrpos($path, "/"));
while (!isset($_gmenu[$parent])) {
$_gmenu[$parent] = array("children" => array($path));
$path = $parent;
$parent = substr($parent, 0, strrpos($parent, "/"));
}
$_gmenu[$parent]["children"][] = $path;
return $trail;
return true;
}
function menu_in_trail($item) {
function menu_item($in_path) {
global $_gmenu;
/*
** If you want to theme your links, or if you want to replace them
** by an image, this would be the function to customize.
*/
$trail = menu_trail();
if (end($trail) == $in_path)
return t($_gmenu[$in_path]["title"]);
else
return "<a href=\"".url($in_path)."\">". t($_gmenu[$in_path]["title"]) ."</a>";
}
foreach ($trail as $menu) {
if ($menu->link == $item->link) {
return 1;
}
}
return 0;
function query_string() {
return $GLOBALS["q"];
}
function menu_item($item) {
function menu_trail() {
global $_gmenu;
static $_gmenu_trail; // cache
/*
** If you want to theme your links, or if you want to replace them
** by an image, this would be the function to customize.
*/
if (!isset($_gmenu_trail)) {
$_gmenu_trail = array();
$cuqs = query_string();
if (stristr(request_uri(), $item->link) == $item->link) {
return t($item->name);
while (!empty($cuqs) && !isset($_gmenu[$cuqs])) {
$cuqs = substr($cuqs, 0, strrpos($cuqs, "/"));
}
else if ($item->title) {
return "<a href=\"$item->link\" title=\"". t($item->title) ."\">". t($item->name) ."</a>";
if (!empty($cuqs)) {
do {
$_gmenu_trail[] = $cuqs;
$cuqs = substr($cuqs, 0, strrpos($cuqs, "/"));
} while (!empty($cuqs) && isset($_gmenu[$cuqs]));
}
else {
return "<a href=\"$item->link\">". t($item->name) ."</a>";
$_gmenu_trail = array_reverse($_gmenu_trail);
}
return $_gmenu_trail;
}
function menu_path() {
$path = menu_trail();
$trail = menu_trail();
$links = array();
foreach ($path as $item) {
foreach ($trail as $item) {
$links[] = menu_item($item);
}
return implode(" &gt; ", $links);
}
function menu_menu_row($parent = "") {
$links = array();
$result = db_query("SELECT * FROM menu WHERE parent = '%s' ORDER BY weight, name", $parent);
while ($menu = db_fetch_object($result)) {
$links[] = menu_item($menu);
}
return $links;
}
function menu_menu() {
$path = menu_trail();
if ($path) {
$item = array_pop($path);
$output = implode(" &middot; ", menu_menu_row($item->name));
}
return $output;
}
function menu_help() {
global $_gmenu;
$path = menu_trail();
if ($path) {
$item = array_pop($path);
$output = $item->help;
$output = $_gmenu[$item]["help"];
}
return $output;
return @$output;
}
function menu_tree($parent = "", $all = 1) {
function _menu_sort($a, $b) {
global $_gmenu;
$a = &$_gmenu[$a];
$b = &$_gmenu[$b];
return $a["weight"] < $b["weight"] ? -11 : ($a["weight"] > $b["weight"] ? 1 : ($a["name"] < $b["name"] ? -1 : 1));
}
if ($all) {
$result = db_query("SELECT * FROM menu WHERE parent = '%s' ORDER BY weight, name", $parent);
}
function menu_tree($parent = "") {
global $_gmenu;
if (db_num_rows($result)) {
$output = "<ul>";
while ($item = db_fetch_object($result)) {
$all = (stristr(request_uri(), $item->link) == $item->link) ? 1 : 0;
if ($_gmenu[$parent]["children"]) {
$output = "\n<ul>\n";
usort($_gmenu[$parent]["children"], "_menu_sort");
foreach ($_gmenu[$parent]["children"] as $item) {
if ($_gmenu[$item]["hidden"] == 0) {
$output .= "<li>";
$output .= menu_item($item);
$output .= menu_tree($item->name, menu_in_trail($item));
$output .= "</li>";
if (in_array($item, menu_trail($item))) {
$output .= menu_tree($item);
}
$output .= "</ul>";
$output .= "</li>\n";
}
}
$output .= "</ul>\n";
}
return $output;
}
function menu_map($parent = "") {
global $_gmenu;
$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)) {
usort($_gmenu[$parent]["children"], "_menu_sort");
foreach ($_gmenu[$parent]["children"] as $item) {
if ($_gmenu[$item]["hidden"] == 0) {
$output .= "<li>";
$output .= menu_item($item);
$output .= menu_map($item->name);
$output .= menu_map($item);
$output .= "</li>";
}
$output .= "</ul>";
}
$output .= "</ul>";
return $output;
}
function menu_execute_action() {
global $_gmenu;
$trail = menu_trail();
$selected_menu = array_pop($trail);
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);
if ($_gmenu[$selected_menu]["callback"]) {
return call_user_func_array($_gmenu[$selected_menu]["callback"], explode("/", substr(query_string(), strlen($selected_menu) + 1)));
}
}
......
......@@ -11,10 +11,14 @@ function status($message) {
function admin_link($type) {
if ($type == "admin") {
menu_add("sitemap", url("admin/admin/sitemap"), "Sitemap", NULL, NULL, 8);
menu("admin/sitemap", "sitemap", "sitemap_callback", NULL, 8);
}
}
function sitemap_callback() {
return menu_map('admin');
}
function admin_admin() {
print menu_map();
}
......@@ -48,7 +52,8 @@ function admin_page() {
print "<div id=\"menu\">";
echo "<h1><a href=\"index.php\">". variable_get("site_name", "drupal") ."</a></h1>";
print menu_tree() ;
//print menu_tree('admin') ;
print menu_tree('admin') ;
print "</div>";
......@@ -60,7 +65,7 @@ function admin_page() {
print "<div id=\"main\">";
if ($path = menu_path()) {
print "<h2>". l(t("Administration"), "admin") ." &gt; $path</h2>";
print "<h2>". l(t("Administration"), "admin") ." $path</h2>";
}
else {
print "<h2>". t("Administration") ."</h2>";
......@@ -76,10 +81,11 @@ function admin_page() {
print "<small>$help</small>";
}
print "<hr /><br />";
print "<hr />";
if (arg(1)) {
print module_invoke(arg(1), "admin");
//print module_invoke(arg(1), "admin");
print menu_execute_action();
}
else {
print "<h2>". t("System messages") ."</h2>";
......@@ -88,7 +94,6 @@ function admin_page() {
print "</div>";
db_query("DELETE FROM menu");
?>
</body>
</html>
......
......@@ -3,7 +3,7 @@
function import_help() {
?>
<p>In Drupal you have <i>feeds</i> and <i>bundles</i>. Feeds define news sources and bundles categoriz syndicated content by source, topic or any other heuristic. Bundles provide a generalized way of creating composite feeds. They allow you, for example, to combine various sport-related feeds into one bundle called "Sport".</p>
<p>In Drupal you have <i>feeds</i> and <i>bundles</i>. Feeds define news sources and bundles categorize syndicated content by source, topic or any other heuristic. Bundles provide a generalized way of creating composite feeds. They allow you, for example, to combine various sport-related feeds into one bundle called "Sport".</p>
<p>You can have several providers of news feeds. You can add a feed by clicking the "add feed" link on the import administration pages. Give the feed a name, supply the URI and a comma-separated list of attributes that you want to associate the feed with. The update interval defines how often Drupal should go out to try and grab fresh content. The expiration time defines how long syndicated content is kept in the database. So set the update and expiration time and save your settings. You have just defined your first feed. If you have more feeds repeat as necessary.</p>
<p>To verify whether your feed works, press "update items" at the overview page. The number of news items that have been sucessfully fetched, should then become visible in the third column of the feed overview.</p>
<p>Now you have to define some bundles. Bundles look for feeds that contain one of the keywords associated with the bundle and display those feeds together. To define a bundle you have to give it a name and a comma-separated list of keywords just like this is the case for feeds.</p>
......@@ -35,11 +35,14 @@ function import_link($type) {
}
if ($type == "admin" && user_access("administer news feeds")) {
menu_add("news aggregation", url("admin/import"), "Content syndication through RDF/RSS feeds.", NULL, NULL, 3);
menu_add("add new feed", url("admin/import/add/feed"), "Add new news feed.", NULL, "news aggregation", 2);
menu_add("add new bundle", url("admin/import/add/bundle"), "Create a new bundle.", NULL, "news aggregation", 3);
menu_add("tag news items", url("admin/import/tag"), "Assign bundle attributes to a news item.", NULL, "news aggregation", 4);
menu_add("help", url("admin/import/help"), "More information about news aggregation.", NULL, "news aggregation", 5);
$help["general"] = "Several websites, especially news related sites, syndicate parts of their site content for other web sites to display. Usually, the syndicated content includes the latest headlines with a direct link to that story on the remote site. Some syndicated content also includes a description of the headline. The standard method of syndication is using the XML based Rich Site Summary (RSS).";
$help["bundles"] = "Bundles provide a generalized way of creating composite feeds. They allow you, for example, to combine various sport-related feeds into one bundle called <i>Sport</i>.";
menu("admin/syndication", "content syndication", NULL, NULL, 5);
menu("admin/syndication/news", "news aggregation", "import_admin", $help["general"]);
menu("admin/syndication/news/add feed", "add new feed", "import_admin", NULL, 2);
menu("admin/syndication/news/add bundle", "add new bundle", "import_admin", $help["bundles"], 3);
menu("admin/syndication/news/tag", "tag news items", "import_admin", NULL, 4);
menu("admin/syndication/news/help", "help", "import_help", NULL, 9);
}
return $links ? $links : array();
......@@ -405,7 +408,7 @@ function import_view() {
$header = array(t("title"), t("attributes"), t("items"), t("last update"), t("next update"), array("data" => t("operations"), "colspan" => 3));
unset($rows);
while ($feed = db_fetch_object($result)) {
$rows[] = array($feed->title, $feed->attributes, format_plural($feed->items, "1 item", "%count items"), ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never"), ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never"), l(t("edit feed"), "admin/import/edit/feed/$feed->fid"), l(t("remove items"), "admin/import/remove/$feed->fid"), l(t("update items"), "admin/import/update/$feed->fid"));
$rows[] = array($feed->title, $feed->attributes, format_plural($feed->items, "1 item", "%count items"), ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never"), ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never"), l(t("edit feed"), "admin/syndication/news/edit/feed/$feed->fid"), l(t("remove items"), "admin/syndication/news/remove/$feed->fid"), l(t("update items"), "admin/syndication/news/update/$feed->fid"));
}
$output .= table($header, $rows);
......@@ -416,7 +419,7 @@ function import_view() {
$header = array(t("title"), t("attributes"), t("operations"));
unset($rows);
while ($bundle = db_fetch_object($result)) {
$rows[] = array($bundle->title, $bundle->attributes, l(t("edit bundle"), "admin/import/edit/bundle/$bundle->bid"));
$rows[] = array($bundle->title, $bundle->attributes, l(t("edit bundle"), "admin/syndication/news/edit/bundle/$bundle->bid"));
}
$output .= table($header, $rows);
......@@ -429,7 +432,7 @@ function import_tag() {
$header = array(t("date"), t("feed"), t("news item"));
while ($item = db_fetch_object($result)) {
$rows[] = array(array("data" => format_date($item->timestamp, "small"), "nowrap" => "nowrap", "valign" => "top"), array("data" => l($item->feed, "admin/import/edit/feed/$item->fid"), "valign" => "top"), "<a href=\"$item->link\">$item->title</a>". ($item->description ? "<br /><small><i>$item->description</i></small>" : "") ."<br /><input type=\"text\" name=\"edit[$item->iid]\" value=\"". check_form($item->attributes) ."\" size=\"50\" />");
$rows[] = array(array("data" => format_date($item->timestamp, "small"), "nowrap" => "nowrap", "valign" => "top"), array("data" => l($item->feed, "admin/syndication/news/edit/feed/$item->fid"), "valign" => "top"), "<a href=\"$item->link\">$item->title</a>". ($item->description ? "<br /><small><i>$item->description</i></small>" : "") ."<br /><input type=\"text\" name=\"edit[$item->iid]\" value=\"". check_form($item->attributes) ."\" size=\"50\" />");
}
$output .= table($header, $rows);
......@@ -444,35 +447,30 @@ function import_admin() {
if (user_access("administer news feeds")) {
if (empty($op)) {
$op = arg(2);
$op = arg(3);
}
switch ($op) {
case "help":
print import_help();
break;
case "add":
if (arg(3) == "bundle") {
case "add feed":
print import_form_bundle();
}
else {
break;
case "add bundle":
print import_form_feed();
}
break;
case "edit":
if (arg(3) == "bundle") {
print import_form_bundle(import_get_bundle(arg(4)));
if (arg(4) == "bundle") {
print import_form_bundle(import_get_bundle(arg(5)));
}
else {
print import_form_feed(import_get_feed(arg(4)));
print import_form_feed(import_get_feed(arg(5)));
}
break;
case "remove":
print status(import_remove(import_get_feed(arg(3))));
print status(import_remove(import_get_feed(arg(4))));
print import_view();
break;
case "update":
print status(import_refresh(import_get_feed(arg(3))));
print status(import_refresh(import_get_feed(arg(4))));
print import_view();
break;
case "tag":
......@@ -486,7 +484,7 @@ function import_admin() {
$edit["title"] = 0;
// fall through:
case "Submit":
if (arg(3) == "bundle") {
if (arg(3) == "add bundle") {
print status(import_save_bundle($edit));
}
else {
......@@ -511,7 +509,7 @@ function import_page_info() {
$links[] = l(t("news sources"), "import/sources", array("title" => t("View a list of all the websites we syndicate from.")));
if (user_access("administer news feeds")) {
$links[] = l(t("administer news feeds"), "admin/import", array("title" => t("View the news feed administrative pages.")));
$links[] = l(t("administer news feeds"), "admin/syndication/news", array("title" => t("View the news feed administrative pages.")));
}
return "<div align=\"center\">". theme("links", $links) ."</div>";
......
......@@ -3,7 +3,7 @@
function import_help() {
?>
<p>In Drupal you have <i>feeds</i> and <i>bundles</i>. Feeds define news sources and bundles categoriz syndicated content by source, topic or any other heuristic. Bundles provide a generalized way of creating composite feeds. They allow you, for example, to combine various sport-related feeds into one bundle called "Sport".</p>
<p>In Drupal you have <i>feeds</i> and <i>bundles</i>. Feeds define news sources and bundles categorize syndicated content by source, topic or any other heuristic. Bundles provide a generalized way of creating composite feeds. They allow you, for example, to combine various sport-related feeds into one bundle called "Sport".</p>
<p>You can have several providers of news feeds. You can add a feed by clicking the "add feed" link on the import administration pages. Give the feed a name, supply the URI and a comma-separated list of attributes that you want to associate the feed with. The update interval defines how often Drupal should go out to try and grab fresh content. The expiration time defines how long syndicated content is kept in the database. So set the update and expiration time and save your settings. You have just defined your first feed. If you have more feeds repeat as necessary.</p>
<p>To verify whether your feed works, press "update items" at the overview page. The number of news items that have been sucessfully fetched, should then become visible in the third column of the feed overview.</p>
<p>Now you have to define some bundles. Bundles look for feeds that contain one of the keywords associated with the bundle and display those feeds together. To define a bundle you have to give it a name and a comma-separated list of keywords just like this is the case for feeds.</p>
......@@ -35,11 +35,14 @@ function import_link($type) {
}
if ($type == "admin" && user_access("administer news feeds")) {
menu_add("news aggregation", url("admin/import"), "Content syndication through RDF/RSS feeds.", NULL, NULL, 3);
menu_add("add new feed", url("admin/import/add/feed"), "Add new news feed.", NULL, "news aggregation", 2);
menu_add("add new bundle", url("admin/import/add/bundle"), "Create a new bundle.", NULL, "news aggregation", 3);
menu_add("tag news items", url("admin/import/tag"), "Assign bundle attributes to a news item.", NULL, "news aggregation", 4);
menu_add("help", url("admin/import/help"), "More information about news aggregation.", NULL, "news aggregation", 5);
$help["general"] = "Several websites, especially news related sites, syndicate parts of their site content for other web sites to display. Usually, the syndicated content includes the latest headlines with a direct link to that story on the remote site. Some syndicated content also includes a description of the headline. The standard method of syndication is using the XML based Rich Site Summary (RSS).";
$help["bundles"] = "Bundles provide a generalized way of creating composite feeds. They allow you, for example, to combine various sport-related feeds into one bundle called <i>Sport</i>.";
menu("admin/syndication", "content syndication", NULL, NULL, 5);
menu("admin/syndication/news", "news aggregation", "import_admin", $help["general"]);
menu("admin/syndication/news/add feed", "add new feed", "import_admin", NULL, 2);
menu("admin/syndication/news/add bundle", "add new bundle", "import_admin", $help["bundles"], 3);
menu("admin/syndication/news/tag", "tag news items", "import_admin", NULL, 4);
menu("admin/syndication/news/help", "help", "import_help", NULL, 9);
}
return $links ? $links : array();
......@@ -405,7 +408,7 @@ function import_view() {
$header = array(t("title"), t("attributes"), t("items"), t("last update"), t("next update"), array("data" => t("operations"), "colspan" => 3));
unset($rows);
while ($feed = db_fetch_object($result)) {
$rows[] = array($feed->title, $feed->attributes, format_plural($feed->items, "1 item", "%count items"), ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never"), ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never"), l(t("edit feed"), "admin/import/edit/feed/$feed->fid"), l(t("remove items"), "admin/import/remove/$feed->fid"), l(t("update items"), "admin/import/update/$feed->fid"));
$rows[] = array($feed->title, $feed->attributes, format_plural($feed->items, "1 item", "%count items"), ($feed->timestamp ? format_interval(time() - $feed->timestamp) ." ago" : "never"), ($feed->timestamp ? format_interval($feed->timestamp + $feed->refresh - time()) ." left" : "never"), l(t("edit feed"), "admin/syndication/news/edit/feed/$feed->fid"), l(t("remove items"), "admin/syndication/news/remove/$feed->fid"), l(t("update items"), "admin/syndication/news/update/$feed->fid"));
}
$output .= table($header, $rows);
......@@ -416,7 +419,7 @@ function import_view() {
$header = array(t("title"), t("attributes"), t("operations"));
unset($rows);
while ($bundle = db_fetch_object($result)) {
$rows[] = array($bundle->title, $bundle->attributes, l(t("edit bundle"), "admin/import/edit/bundle/$bundle->bid"));
$rows[] = array($bundle->title, $bundle->attributes, l(t("edit bundle"), "admin/syndication/news/edit/bundle/$bundle->bid"));
}
$output .= table($header, $rows);
......@@ -429,7 +432,7 @@ function import_tag() {
$header = array(t("date"), t("feed"), t("news item"));
while ($item = db_fetch_object($result)) {
$rows[] = array(array("data" => format_date($item->timestamp, "small"), "nowrap" => "nowrap", "valign" => "top"), array("data" => l($item->feed, "admin/import/edit/feed/$item->fid"), "valign" => "top"), "<a href=\"$item->link\">$item->title</a>". ($item->description ? "<br /><small><i>$item->description</i></small>" : "") ."<br /><input type=\"text\" name=\"edit[$item->iid]\" value=\"". check_form($item->attributes) ."\" size=\"50\" />");
$rows[] = array(array("data" => format_date($item->timestamp, "small"), "nowrap" => "nowrap", "valign" => "top"), array("data" => l($item->feed, "admin/syndication/news/edit/feed/$item->fid"), "valign" => "top"), "<a href=\"$item->link\">$item->title</a>". ($item->description ? "<br /><small><i>$item->description</i></small>" : "") ."<br /><input type=\"text\" name=\"edit[$item->iid]\" value=\"". check_form($item->attributes) ."\" size=\"50\" />");
}
$output .= table($header, $rows);
......@@ -444,35 +447,30 @@ function import_admin() {
if (user_access("administer news feeds")) {
if (empty($op)) {
$op = arg(2);
$op = arg(3);
}
switch ($op) {
case "help":
print import_help();
break;
case "add":
if (arg(3) == "bundle") {
case "add feed":
print import_form_bundle();
}
else {
break;
case "add bundle":
print import_form_feed();
}
break;
case "edit":
if (arg(3) == "bundle") {
print import_form_bundle(import_get_bundle(arg(4)));
if (arg(4) == "bundle") {
print import_form_bundle(import_get_bundle(arg(5)));
}
else {
print import_form_feed(import_get_feed(arg(4)));
print import_form_feed(import_get_feed(arg(5)));
}
break;
case "remove":
print status(import_remove(import_get_feed(arg(3))));
print status(import_remove(import_get_feed(arg(4))));
print import_view();
break;
case "update":
print status(import_refresh(import_get_feed(arg(3))));
print status(import_refresh(import_get_feed(arg(4))));
print import_view();
break;
case "tag":
......@@ -486,7 +484,7 @@ function import_admin() {
$edit["title"] = 0;
// fall through:
case "Submit":
if (arg(3) == "bundle") {
if (arg(3) == "add bundle") {
print status(import_save_bundle($edit));
}
else {
......@@ -511,7 +509,7 @@ function import_page_info() {
$links[] = l(t("news sources"), "import/sources", array("title" => t("View a list of all the websites we syndicate from.")));
if (user_access("administer news feeds")) {
$links[] = l(t("administer news feeds"), "admin/import", array("title" => t("View the news feed administrative pages.")));
$links[] = l(t("administer news feeds"), "admin/syndication/news", array("title" => t("View the news feed administrative pages.")));
}
return "<div align=\"center\">". theme("links", $links) ."</div>";
......
......@@ -51,10 +51,10 @@ function block_link($type) {
if ($type == "admin" && user_access("administer blocks")) {
$help["block"] = "Blocks are the boxes visible in the side bars on the left- and right-hand side of the website. They are either exported by the Drupal or by any of the active modules. Adminstrators can enable or disable block, as well control the block placement by assigning them a region and/or by assigning each block (within a region) a weight to sort them vertically. The path setting lets you define which pages you want the specific blocks to be shown.";
menu_add("block management", url("admin/block"), "Block management", $help["block"], NULL, 2);
menu_add("add new block", url("admin/block/add"), "Create a new block", $help["block"], "block management", 2);
menu_add("preview placement", url("admin/block/preview"), "Preview the block placement", $help["block"], "block management", 3);
menu_add("help", url("admin/block/help"), "More information about blocks", NULL, "block management", 5);
menu("admin/block", "block management", block_admin, $help["block"], 3);
menu("admin/block/add", "create new block", block_admin, $help["block"], 2);
menu("admin/block/preview", "preview placement", block_admin, $help["block"], 3);
menu("admin/block/help", "help", block_help, NULL, 9);
}
}
......@@ -267,9 +267,6 @@ function block_admin() {
}
switch ($op) {
case "help":
block_help();
break;
case "preview":
block_admin_preview();
break;
......
......@@ -51,10 +51,10 @@ function block_link($type) {
if ($type == "admin" && user_access("administer blocks")) {
$help["block"] = "Blocks are the boxes visible in the side bars on the left- and right-hand side of the website. They are either exported by the Drupal or by any of the active modules. Adminstrators can enable or disable block, as well control the block placement by assigning them a region and/or by assigning each block (within a region) a weight to sort them vertically. The path setting lets you define which pages you want the specific blocks to be shown.";
menu_add("block management", url("admin/block"), "Block management", $help["block"], NULL, 2);
menu_add("add new block", url("admin/block/add"), "Create a new block", $help["block"], "block management", 2);
menu_add("preview placement", url("admin/block/preview"), "Preview the block placement", $help["block"], "block management", 3);
menu_add("help", url("admin/block/help"), "More information about blocks", NULL, "block management", 5);
menu("admin/block", "block management", block_admin, $help["block"], 3);
menu("admin/block/add", "