- 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.
4.2.x
Dries Buytaert 2003-02-20 22:44:51 +00:00
parent 53deeb188a
commit 277ceae515
29 changed files with 459 additions and 488 deletions

View File

@ -42,7 +42,7 @@ $base_url = "http://localhost";
# 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:

View File

@ -1,160 +1,156 @@
<?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.
*/
if ($item) {
$path[] = $item;
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;
}
}
}
$trail = array_reverse($path);
}
return $trail;
function menu_add() {
trigger_error(t("the 'menu_add()' function is depricated"), E_USER_ERROR);
}
function menu_in_trail($item) {
$trail = menu_trail();
function menu($path, $title, $callback = NULL, $help = NULL, $weight = 0, $hidden = 0) {
global $_gmenu;
foreach ($trail as $menu) {
if ($menu->link == $item->link) {
return 1;
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;
}
}
return 0;
// 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 true;
}
function menu_item($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>";
}
if (stristr(request_uri(), $item->link) == $item->link) {
return t($item->name);
}
else if ($item->title) {
return "<a href=\"$item->link\" title=\"". t($item->title) ."\">". t($item->name) ."</a>";
}
else {
return "<a href=\"$item->link\">". t($item->name) ."</a>";
function query_string() {
return $GLOBALS["q"];
}
function menu_trail() {
global $_gmenu;
static $_gmenu_trail; // cache
if (!isset($_gmenu_trail)) {
$_gmenu_trail = array();
$cuqs = query_string();
while (!empty($cuqs) && !isset($_gmenu[$cuqs])) {
$cuqs = substr($cuqs, 0, strrpos($cuqs, "/"));
}
if (!empty($cuqs)) {
do {
$_gmenu_trail[] = $cuqs;
$cuqs = substr($cuqs, 0, strrpos($cuqs, "/"));
} while (!empty($cuqs) && isset($_gmenu[$cuqs]));
}
$_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;
$output .= "<li>";
$output .= menu_item($item);
$output .= menu_tree($item->name, menu_in_trail($item));
$output .= "</li>";
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);
if (in_array($item, menu_trail($item))) {
$output .= menu_tree($item);
}
$output .= "</li>\n";
}
}
$output .= "</ul>";
$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)) {
$output = "<ul>";
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)));
}
}
?>
?>

View File

@ -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>

View File

@ -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();
case "add feed":
print import_form_bundle();
break;
case "add":
if (arg(3) == "bundle") {
print import_form_bundle();
}
else {
print import_form_feed();
}
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>";

View File

@ -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();
case "add feed":
print import_form_bundle();
break;
case "add":
if (arg(3) == "bundle") {
print import_form_bundle();
}
else {
print import_form_feed();
}
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>";

View File

@ -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;
@ -335,4 +332,4 @@ function block_user($type, &$edit, &$user) {
}
}
?>
?>

View File

@ -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;
@ -335,4 +332,4 @@ function block_user($type, &$edit, &$user) {
}
}
?>
?>

View File

@ -117,13 +117,13 @@ function book_link($type, $node = 0, $main = 0) {
$help["book"] = "The collaborative book offers a mean to organize content, authored by many users, in an online manual, outline or FAQ.";
$help["orphan"] = "As pages in a book are edited, reorganized and removed, child pages might be left behind. We refer to such pages as 'orphan pages'. On this page, administrators can review their books for orphans and reaffiliate those pages as desired.";
menu_add("collaborative books", url("admin/book"), "Maintain collaborative books.", $help["book"], "content management");
menu_add("orphan pages", url("admin/book/orphan"), "Display all orphan pages.", $orphan, "collaborative books", 8);
menu_add("help", url("admin/book/help"), "More information about the collaborative book.", NULL, "collaborative books", 9);
menu("admin/node/book", "collaborative books", "book_admin", $help["book"], 4);
menu("admin/node/book/orphan", "orphan pages", "book_admin", $help["orphan"], 8);
menu("admin/node/book/help", "help", "book_help", NULL, 9);
$result = db_query("SELECT n.nid, n.title FROM node n LEFT 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_add("administer book '$book->title'", url("admin/book/view/$book->nid"), "Display a book outline.", NULL, "collaborative books");
menu("admin/node/book/$book->nid", "'$book->title' book", "book_admin");
}
}
@ -621,12 +621,7 @@ function book_print_recurse($parent = "", $depth = 1) {
function book_admin_view_line($node, $depth = 0) {
$row = array(
"<div style=\"padding-left: ". (25 * $depth) ."px;\">". form_textfield(NULL, "$node->nid][title", $node->title, 64, 255) ."</div>",
form_weight(NULL, "$node->nid][weight", $node->weight),
l(t("view node"), "node/view/$node->nid"),
l(t("edit node"), "admin/node/edit/$node->nid"),
l(t("delete node"), "admin/node/delete/$node->nid"));
$row = array("<div style=\"padding-left: ". (25 * $depth) ."px;\">". form_textfield(NULL, "$node->nid][title", $node->title, 64, 255) ."</div>", form_weight(NULL, "$node->nid][weight", $node->weight), l(t("view node"), "node/view/$node->nid"), l(t("edit node"), "admin/node/edit/$node->nid"), l(t("delete node"), "admin/node/delete/$node->nid"));
return $row;
}
@ -719,7 +714,7 @@ function book_admin() {
if (user_access("administer nodes")) {
if (empty($op)) {
$op = arg(2);
$op = arg(3);
}
switch ($op) {
@ -735,13 +730,9 @@ function book_admin() {
case t("Save book pages");
print status(book_admin_save(arg(3), $edit));
// fall through:
case "view":
default:
print book_admin_view(arg(3));
break;
case "help":
book_help();
break;
default:
}
}
}

View File

@ -117,13 +117,13 @@ function book_link($type, $node = 0, $main = 0) {
$help["book"] = "The collaborative book offers a mean to organize content, authored by many users, in an online manual, outline or FAQ.";
$help["orphan"] = "As pages in a book are edited, reorganized and removed, child pages might be left behind. We refer to such pages as 'orphan pages'. On this page, administrators can review their books for orphans and reaffiliate those pages as desired.";
menu_add("collaborative books", url("admin/book"), "Maintain collaborative books.", $help["book"], "content management");
menu_add("orphan pages", url("admin/book/orphan"), "Display all orphan pages.", $orphan, "collaborative books", 8);
menu_add("help", url("admin/book/help"), "More information about the collaborative book.", NULL, "collaborative books", 9);
menu("admin/node/book", "collaborative books", "book_admin", $help["book"], 4);
menu("admin/node/book/orphan", "orphan pages", "book_admin", $help["orphan"], 8);
menu("admin/node/book/help", "help", "book_help", NULL, 9);
$result = db_query("SELECT n.nid, n.title FROM node n LEFT 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_add("administer book '$book->title'", url("admin/book/view/$book->nid"), "Display a book outline.", NULL, "collaborative books");
menu("admin/node/book/$book->nid", "'$book->title' book", "book_admin");
}
}
@ -621,12 +621,7 @@ function book_print_recurse($parent = "", $depth = 1) {
function book_admin_view_line($node, $depth = 0) {
$row = array(
"<div style=\"padding-left: ". (25 * $depth) ."px;\">". form_textfield(NULL, "$node->nid][title", $node->title, 64, 255) ."</div>",
form_weight(NULL, "$node->nid][weight", $node->weight),
l(t("view node"), "node/view/$node->nid"),
l(t("edit node"), "admin/node/edit/$node->nid"),
l(t("delete node"), "admin/node/delete/$node->nid"));
$row = array("<div style=\"padding-left: ". (25 * $depth) ."px;\">". form_textfield(NULL, "$node->nid][title", $node->title, 64, 255) ."</div>", form_weight(NULL, "$node->nid][weight", $node->weight), l(t("view node"), "node/view/$node->nid"), l(t("edit node"), "admin/node/edit/$node->nid"), l(t("delete node"), "admin/node/delete/$node->nid"));
return $row;
}
@ -719,7 +714,7 @@ function book_admin() {
if (user_access("administer nodes")) {
if (empty($op)) {
$op = arg(2);
$op = arg(3);
}
switch ($op) {
@ -735,13 +730,9 @@ function book_admin() {
case t("Save book pages");
print status(book_admin_save(arg(3), $edit));
// fall through:
case "view":
default:
print book_admin_view(arg(3));
break;
case "help":
book_help();
break;
default:
}
}
}

View File

@ -40,11 +40,12 @@ function cloud_link($type) {
}
if ($type == "admin" && user_access("administer site cloud")) {
$cloud = "The cloud monitor tracks or crawls other interesting websites and displays their last modification dates. Visitors to the host site learn about relevant sites and can easily see if there is new content.";
$help["general"] = "The cloud monitor tracks or crawls other interesting websites and displays their last modification dates. Visitors to the host site learn about relevant sites and can easily see if there is new content.";
menu_add("blogrolling", url("admin/cloud"), "Maintain the sites in your blogroll.", $cloud, NULL, 3);
menu_add("add new site", url("admin/cloud/add"), "Add a new sites to your blogroll.", NULL, "blogrolling", 3);
menu_add("help", url("admin/cloud/help"), "More information about the site cloud.", NULL, "blogrolling", 9);
menu("admin/syndication", "content syndication", NULL, NULL, 5);
menu("admin/syndication/cloud", "blogrolling", "cloud_admin", $help["general"]);
menu("admin/syndication/cloud/add", "add new site", "cloud_admin", $help["general"]);
menu("admin/syndication/cloud/help", "help", "cloud_help", NULL, 9);
}
return $links ? $links : array();
@ -57,11 +58,11 @@ function cloud_update($site) {
*/
if (!ereg("^http://|https://|ftp://", $site["link"])) {
watchdog("warning", "cloud: invalid or missing URL for '". $site["name"] ."'", l(t("edit site"), "admin/cloud/edit/". $site["sid"]));
watchdog("warning", "cloud: invalid or missing URL for '". $site["name"] ."'", l(t("edit site"), "admin/syndication/cloud/edit/". $site["sid"]));
}
if (!ereg("^http://|https://|ftp://", $site["feed"])) {
watchdog("warning", "cloud: invalid or missing URL to monitor for '". $site["name"] ."'", l(t("edit site"), "admin/cloud/edit/". $site["sid"]));
watchdog("warning", "cloud: invalid or missing URL to monitor for '". $site["name"] ."'", l(t("edit site"), "admin/syndication/cloud/edit/". $site["sid"]));
}
/*
@ -126,7 +127,7 @@ function cloud_display() {
$header = array(t("site"), t("last update"), array("data" => t("operations"), "colspan" => 2));
while ($site = db_fetch_object($result)) {
$rows[] = array("<a href=\"$site->link\">$site->name</a>", ($site->timestamp ? format_interval(time() - $site->timestamp) ." ago" : "never"), l(t("edit site"), "admin/cloud/edit/$site->sid"), l(t("update site"), "admin/cloud/update/$site->sid"));
$rows[] = array("<a href=\"$site->link\">$site->name</a>", ($site->timestamp ? format_interval(time() - $site->timestamp) ." ago" : "never"), l(t("edit site"), "admin/syndication/cloud/edit/$site->sid"), l(t("update site"), "admin/syndication/cloud/update/$site->sid"));
}
return table($header, $rows);
@ -185,7 +186,7 @@ function cloud_admin() {
global $op, $edit;
if (empty($op)) {
$op = arg(2);
$op = arg(3);
}
if (user_access("administer site cloud")) {
@ -194,16 +195,13 @@ function cloud_admin() {
print cloud_form();
break;
case "edit":
print cloud_form(cloud_get_site(arg(3)));
print cloud_form(cloud_get_site(arg(4)));
break;
case "update":
print status(cloud_update(cloud_get_site(arg(3))));
print status(cloud_update(cloud_get_site(arg(4))));
print cloud_display();
break;
case "help":
print cloud_help();
break;
case "Delete":
case "Delete":
$edit["name"] = 0;
// fall through:
case "Submit":

View File

@ -658,20 +658,22 @@ function comment_link($type, $node = 0, $main = 0) {
}
if ($type == "admin" && user_access("administer comments")) {
$settings = "If you really have a lot of comments, you can enable moderation. You assign moderation permissions to role(s), then setup some 'moderation votes'; these votes will appear to moderators in a dropdown menu near the comment. You also have to assign, for every role and every vote, a value, which can be either positive or negative; use the moderation matrix to do this. This allows for some roles having greater 'weight' in their moderation, if you wish. If you set a value to 0, that vote won't be available to that role. When a user moderates, the value of their vote is added or subtracted to the score of that comment. Finally, you may want to setup the comment thresholds: these are floor/ceiling values which users see in the comment control panel. Threshholds are useful for hiding poorly rated comments while reading your site.";
$help["general"] = "To be written: description of comment module. Anyone?";
$help["settings"] = "If you really have a lot of comments, you can enable moderation. You assign moderation permissions to role(s), then setup some 'moderation votes'; these votes will appear to moderators in a dropdown menu near the comment. You also have to assign, for every role and every vote, a value, which can be either positive or negative; use the moderation matrix to do this. This allows for some roles having greater 'weight' in their moderation, if you wish. If you set a value to 0, that vote won't be available to that role. When a user moderates, the value of their vote is added or subtracted to the score of that comment. Finally, you may want to setup the comment thresholds: these are floor/ceiling values which users see in the comment control panel. Threshholds are useful for hiding poorly rated comments while reading your site.";
menu_add("comment management", url("admin/comment"), "Administer comments.", $help["comment"], "content management", 1);
menu_add("new or updated comments", url("admin/comment&amp;status=0"), "Display new or updated comments.", NULL, "comment management");
menu_add("comments that await approval", url("admin/comment&amp;status=1"), "Display comments that await approval.", NULL, "comment management");
menu_add("search comment", url("admin/comment/search"), "Search a comment.", NULL, "comment management", 8);
menu_add("help", url("admin/comment/help"), "More information about the comment system.", NULL, "comment management", 9);
menu("admin/comment", "comment management", "comment_admin", $help["general"], 2);
menu("admin/comment/0", "new or updated comments", "comment_admin");
menu("admin/comment/1", "comments that await approval", "comment_admin");
menu("admin/comment/search", "search comment", "comment_admin", NULL, 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_add("comment moderation votes", url("admin/comment/votes"), "Configure the comment moderation votes.", $settings, "site configuration", 5);
menu_add("comment moderation matrix", url("admin/comment/matrix"), "Configure the comment moderation matrix.", $settings, "site configuration", 5);
menu_add("comment moderation thresholds", url("admin/comment/filters"), "Configure the comment moderation thresholds.", $settings, "site configuration", 5);
menu_add("initial comment scores", url("admin/comment/roles"), "Configure the initial comment score.", $settings, "site configuration", 5);
menu("admin/comment/votes", "comment moderation votes", "comment_admin", $help["settings"], 5);
menu("admin/comment/matrix", "ccomment moderation matrix", "comment_admin", $help["settings"], 5);
menu("admin/comment/filters", "comment moderation thresholds", "comment_admin", $help["settings"], 5);
menu("admin/comment/roles", "initial comment scores", "comment_admin", $help["settings"], 5);
}
}
@ -990,10 +992,7 @@ function comment_admin() {
if (user_access("administer comments")) {
switch ($op) {
case "help":
print comment_help();
break;
case "edit":
case "edit":
print comment_admin_edit(arg(3));
break;
case "search":
@ -1036,7 +1035,7 @@ function comment_admin() {
$status = $comment_settings["status"];
$comment_page = $comment_settings["comment_page"];
}
print comment_admin_overview($status, $comment_page);
print comment_admin_overview(0, $comment_page);
break;
case t("Submit"):
print status(comment_save(check_query(arg(3)), $edit));
@ -1044,10 +1043,10 @@ function comment_admin() {
$status = $comment_settings["status"];
$comment_page = $comment_settings["comment_page"];
}
print comment_admin_overview($status, $comment_page);
print comment_admin_overview(0, $comment_page);
break;
default:
print comment_admin_overview($status, $comment_page);
print comment_admin_overview(arg(2), $comment_page);
}
}
else {
@ -1502,4 +1501,4 @@ function comment_nodeapi(&$node, $op, $arg = 0) {
}
}
?>
?>

View File

@ -658,20 +658,22 @@ function comment_link($type, $node = 0, $main = 0) {
}
if ($type == "admin" && user_access("administer comments")) {
$settings = "If you really have a lot of comments, you can enable moderation. You assign moderation permissions to role(s), then setup some 'moderation votes'; these votes will appear to moderators in a dropdown menu near the comment. You also have to assign, for every role and every vote, a value, which can be either positive or negative; use the moderation matrix to do this. This allows for some roles having greater 'weight' in their moderation, if you wish. If you set a value to 0, that vote won't be available to that role. When a user moderates, the value of their vote is added or subtracted to the score of that comment. Finally, you may want to setup the comment thresholds: these are floor/ceiling values which users see in the comment control panel. Threshholds are useful for hiding poorly rated comments while reading your site.";
$help["general"] = "To be written: description of comment module. Anyone?";
$help["settings"] = "If you really have a lot of comments, you can enable moderation. You assign moderation permissions to role(s), then setup some 'moderation votes'; these votes will appear to moderators in a dropdown menu near the comment. You also have to assign, for every role and every vote, a value, which can be either positive or negative; use the moderation matrix to do this. This allows for some roles having greater 'weight' in their moderation, if you wish. If you set a value to 0, that vote won't be available to that role. When a user moderates, the value of their vote is added or subtracted to the score of that comment. Finally, you may want to setup the comment thresholds: these are floor/ceiling values which users see in the comment control panel. Threshholds are useful for hiding poorly rated comments while reading your site.";
menu_add("comment management", url("admin/comment"), "Administer comments.", $help["comment"], "content management", 1);
menu_add("new or updated comments", url("admin/comment&amp;status=0"), "Display new or updated comments.", NULL, "comment management");
menu_add("comments that await approval", url("admin/comment&amp;status=1"), "Display comments that await approval.", NULL, "comment management");
menu_add("search comment", url("admin/comment/search"), "Search a comment.", NULL, "comment management", 8);
menu_add("help", url("admin/comment/help"), "More information about the comment system.", NULL, "comment management", 9);
menu("admin/comment", "comment management", "comment_admin", $help["general"], 2);
menu("admin/comment/0", "new or updated comments", "comment_admin");
menu("admin/comment/1", "comments that await approval", "comment_admin");
menu("admin/comment/search", "search comment", "comment_admin", NULL, 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_add("comment moderation votes", url("admin/comment/votes"), "Configure the comment moderation votes.", $settings, "site configuration", 5);
menu_add("comment moderation matrix", url("admin/comment/matrix"), "Configure the comment moderation matrix.", $settings, "site configuration", 5);
menu_add("comment moderation thresholds", url("admin/comment/filters"), "Configure the comment moderation thresholds.", $settings, "site configuration", 5);
menu_add("initial comment scores", url("admin/comment/roles"), "Configure the initial comment score.", $settings, "site configuration", 5);
menu("admin/comment/votes", "comment moderation votes", "comment_admin", $help["settings"], 5);
menu("admin/comment/matrix", "ccomment moderation matrix", "comment_admin", $help["settings"], 5);
menu("admin/comment/filters", "comment moderation thresholds", "comment_admin", $help["settings"], 5);
menu("admin/comment/roles", "initial comment scores", "comment_admin", $help["settings"], 5);
}
}
@ -990,10 +992,7 @@ function comment_admin() {
if (user_access("administer comments")) {
switch ($op) {
case "help":
print comment_help();
break;
case "edit":
case "edit":
print comment_admin_edit(arg(3));
break;
case "search":
@ -1036,7 +1035,7 @@ function comment_admin() {
$status = $comment_settings["status"];
$comment_page = $comment_settings["comment_page"];
}
print comment_admin_overview($status, $comment_page);
print comment_admin_overview(0, $comment_page);
break;
case t("Submit"):
print status(comment_save(check_query(arg(3)), $edit));
@ -1044,10 +1043,10 @@ function comment_admin() {
$status = $comment_settings["status"];
$comment_page = $comment_settings["comment_page"];
}
print comment_admin_overview($status, $comment_page);
print comment_admin_overview(0, $comment_page);
break;
default:
print comment_admin_overview($status, $comment_page);
print comment_admin_overview(arg(2), $comment_page);
}
}
else {
@ -1502,4 +1501,4 @@ function comment_nodeapi(&$node, $op, $arg = 0) {
}
}
?>
?>

View File

@ -8,7 +8,7 @@ function help_system($field){
function help_link($type) {
if ($type == "admin") {
menu_add("help", url("admin/help"), "Help", NULL, NULL, 9);
menu("admin/help", "help", "help_admin", NULL, 9);
}
}

View File

@ -8,7 +8,7 @@ function help_system($field){
function help_link($type) {
if ($type == "admin") {
menu_add("help", url("admin/help"), "Help", NULL, NULL, 9);
menu("admin/help", "help", "help_admin", NULL, 9);
}
}

View File

@ -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();
case "add feed":
print import_form_bundle();
break;
case "add":
if (arg(3) == "bundle") {
print import_form_bundle();
}
else {
print import_form_feed();
}
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>";

View File

@ -48,13 +48,18 @@ function locale_link($type) {
global $languages;
if ($type == "admin" && user_access("administer locales")) {
menu_add("locale", url("admin/locale"), "Translate this site.", NULL, NULL, 3);
menu_add("search string", url("admin/locale/search"), "Search a string.", NULL, "locale", 8);
menu_add("help", url("admin/locale/help"), "More information about the locale system.", NULL, "locale", 9);
$help["general"] = "To be written: description of locale module. Anyone?";
menu("admin/locale", "localization", NULL, $help["general"], 5);
menu("admin/locale/search", "search string", "locale_admin", NULL, 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_add("translated '$key' strings", url("admin/locale/translated/$key"), "Display translated '$key' strings.", NULL, "locale");
menu_add("untranslated '$key' strings", url("admin/locale/untranslated/$key"), "Display untranslated '$key' strings.", NULL, "locale");
menu("admin/locale/$key", "$value", NULL, $help["general"]);
menu("admin/locale/$key/translated", "translated strings", "locale_admin");
menu("admin/locale/$key/untranslated", "untranslated strings", "locale_admin");
}
}
}
@ -62,6 +67,8 @@ function locale_link($type) {
function locale_delete($lid) {
db_query("DELETE FROM locales WHERE lid = '%d'", $lid);
locale_refresh_cache();
return t("deleted string");
}
function locale_save($lid) {
@ -72,6 +79,8 @@ function locale_save($lid) {
locale_refresh_cache();
// delete form data so it will remember where it came from
$edit = '';
return t("saved string");
}
function locale_refresh_cache() {
@ -194,12 +203,9 @@ function locale_admin() {
switch ($op) {
case "delete":
locale_delete(check_query(arg(3)));
print status(locale_delete(check_query(arg(3))));
print locale_seek();
break;
case "help":
print locale_help();
break;
case "edit":
print locale_edit(check_query(arg(3)));
break;
@ -207,20 +213,21 @@ function locale_admin() {
case t("Search"):
print locale_seek();
break;
case "translated":
$edit["status"] = 1;
$edit["language"] = arg(3);
print locale_seek();
break;
case "untranslated":
$edit["status"] = 2;
$edit["language"] = arg(3);
print locale_seek();
break;
case t("Save translations"):
print locale_save(check_query(arg(3)));
default:
print status(locale_save(check_query(arg(3))));
print locale_seek();
break;
default:
if (arg(3) == "translated") {
$edit["status"] = 1;
$edit["language"] = arg(2);
print locale_seek();
}
else {
$edit["status"] = 2;
$edit["language"] = arg(2);
print locale_seek();
}
}
}
else {

View File

@ -48,13 +48,18 @@ function locale_link($type) {
global $languages;
if ($type == "admin" && user_access("administer locales")) {
menu_add("locale", url("admin/locale"), "Translate this site.", NULL, NULL, 3);
menu_add("search string", url("admin/locale/search"), "Search a string.", NULL, "locale", 8);
menu_add("help", url("admin/locale/help"), "More information about the locale system.", NULL, "locale", 9);
$help["general"] = "To be written: description of locale module. Anyone?";
menu("admin/locale", "localization", NULL, $help["general"], 5);
menu("admin/locale/search", "search string", "locale_admin", NULL, 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_add("translated '$key' strings", url("admin/locale/translated/$key"), "Display translated '$key' strings.", NULL, "locale");
menu_add("untranslated '$key' strings", url("admin/locale/untranslated/$key"), "Display untranslated '$key' strings.", NULL, "locale");
menu("admin/locale/$key", "$value", NULL, $help["general"]);
menu("admin/locale/$key/translated", "translated strings", "locale_admin");
menu("admin/locale/$key/untranslated", "untranslated strings", "locale_admin");
}
}
}
@ -62,6 +67,8 @@ function locale_link($type) {
function locale_delete($lid) {
db_query("DELETE FROM locales WHERE lid = '%d'", $lid);
locale_refresh_cache();
return t("deleted string");
}
function locale_save($lid) {
@ -72,6 +79,8 @@ function locale_save($lid) {
locale_refresh_cache();
// delete form data so it will remember where it came from
$edit = '';
return t("saved string");
}
function locale_refresh_cache() {
@ -194,12 +203,9 @@ function locale_admin() {
switch ($op) {
case "delete":
locale_delete(check_query(arg(3)));
print status(locale_delete(check_query(arg(3))));
print locale_seek();
break;
case "help":
print locale_help();
break;
case "edit":
print locale_edit(check_query(arg(3)));
break;
@ -207,20 +213,21 @@ function locale_admin() {
case t("Search"):
print locale_seek();
break;
case "translated":
$edit["status"] = 1;
$edit["language"] = arg(3);
print locale_seek();
break;
case "untranslated":
$edit["status"] = 2;
$edit["language"] = arg(3);
print locale_seek();
break;
case t("Save translations"):
print locale_save(check_query(arg(3)));
default:
print status(locale_save(check_query(arg(3))));
print locale_seek();
break;
default:
if (arg(3) == "translated") {
$edit["status"] = 1;
$edit["language"] = arg(2);
print locale_seek();
}
else {
$edit["status"] = 2;
$edit["language"] = arg(2);
print locale_seek();
}
}
}
else {

View File

@ -466,14 +466,15 @@ function node_link($type, $node = 0, $main = 0) {
}
if ($type == "admin" && user_access("administer nodes")) {
$search = "On this page you can search for a post. For example, one may search for 'br' and Drupal might return 'bread brakers', 'our daily bread' and 'brenda'.";
$help["search"] = "On this page you can search for a post. For example, one may search for 'br' and Drupal might return 'bread brakers', 'our daily bread' and 'brenda'.";
menu_add("content management", url("admin/node"), "Content management.", NULL, NULL);
menu_add("submit new content", url("node/add"), "Submit new content.", NULL, "content management", -1);
menu_add("new or updated posts", url("admin/node/nodes/0"), "Display all new or updated posts.", NULL, "content management", 0);
menu_add("posts that await approval", url("admin/node/nodes/1"), "Display posts that await approval.", NULL, "content management", 0);
menu_add("search content", url("admin/node/search"), "Search a post.", $search, "content management", 5);
menu_add("help", url("admin/node/help"), "More information about content management.", NULL, "content management", 7);
menu("admin/node", "node management", "node_admin");
menu("admin/node/nodes", "post overview");
menu("admin/node/nodes/0", "new or updated posts", "node_admin", NULL, 0);
menu("admin/node/nodes/1", "posts that away approval", "node_admin", NULL, 1);
menu("admin/node/search", "search post", "node_admin", $help["search"], 8);
menu("admin/node/help", "help", "node_help", NULL, 9);
menu("admin/node/edit", "edit node", "node_admin", NULL, 0, 1);
}
return $links ? $links : array();
@ -653,9 +654,6 @@ function node_admin() {
*/
switch ($op) {
case "help":
print node_help();
break;
case "search":
print search_type("node", url("admin/node/search"));
break;
@ -1316,4 +1314,4 @@ function node_nodeapi(&$node, $op, $arg = 0) {
}
}
?>
?>

View File

@ -466,14 +466,15 @@ function node_link($type, $node = 0, $main = 0) {
}
if ($type == "admin" && user_access("administer nodes")) {
$search = "On this page you can search for a post. For example, one may search for 'br' and Drupal might return 'bread brakers', 'our daily bread' and 'brenda'.";
$help["search"] = "On this page you can search for a post. For example, one may search for 'br' and Drupal might return 'bread brakers', 'our daily bread' and 'brenda'.";
menu_add("content management", url("admin/node"), "Content management.", NULL, NULL);
menu_add("submit new content", url("node/add"), "Submit new content.", NULL, "content management", -1);
menu_add("new or updated posts", url("admin/node/nodes/0"), "Display all new or updated posts.", NULL, "content management", 0);
menu_add("posts that await approval", url("admin/node/nodes/1"), "Display posts that await approval.", NULL, "content management", 0);
menu_add("search content", url("admin/node/search"), "Search a post.", $search, "content management", 5);
menu_add("help", url("admin/node/help"), "More information about content management.", NULL, "content management", 7);
menu("admin/node", "node management", "node_admin");
menu("admin/node/nodes", "post overview");
menu("admin/node/nodes/0", "new or updated posts", "node_admin", NULL, 0);
menu("admin/node/nodes/1", "posts that away approval", "node_admin", NULL, 1);
menu("admin/node/search", "search post", "node_admin", $help["search"], 8);
menu("admin/node/help", "help", "node_help", NULL, 9);
menu("admin/node/edit", "edit node", "node_admin", NULL, 0, 1);
}
return $links ? $links : array();
@ -653,9 +654,6 @@ function node_admin() {
*/
switch ($op) {
case "help":
print node_help();
break;
case "search":
print search_type("node", url("admin/node/search"));
break;
@ -1316,4 +1314,4 @@ function node_nodeapi(&$node, $op, $arg = 0) {
}
}
?>
?>

View File

@ -116,19 +116,19 @@ function statistics_link($type, $node = 0, $main = 0) {
$help["top nodes block"] = "The statistics module exports a block that can display the day's top viewed nodes, the all time top viewed nodes and the last nodes viewed. Each of these links can be enabled or disabled individually, and the number of nodes displayed for each can be configured with a drop down menu. If you disable all sections of this block, it will not appear.";
$help["who is online block"] = "This statistics module exports a block that can display how many user's and guests are currently online. You can configure the name of the block, the name of a sub-block for displaying names of user's currently online, how recently a user must have been active to be considered online, the maximum characters to display from a user's name and the maximum number of user names to display.";
menu_add("popular posts", url("admin/statistics/statistics"), "Display the top nodes.", $help["statistics"], "site monitoring", 2, 1);
menu_add("referrer log", url("admin/statistics/referrers"), "Display the referrers.", $help["referrers"], "site monitoring", 3, 1);
menu_add("view all referrers", url("admin/statistics/referrers/all"), "Display all referrers.", $help["referrers"], "referrer log", 1);
menu_add("view internal referrers", url("admin/statistics/referrers/internal"), "Display internal referrers.", $help["referrers"], "referrer log", 1);
menu_add("view external referrers", url("admin/statistics/referrers/external"), "Display external referrers.", $help["referrers"], "referrer log", 1);
menu_add("access log", url("admin/statistics/log"), "Display the access log.", $help["access"], "site monitoring", 4);
menu_add("configure 'top nodes' page", url("admin/statistics/top+nodes+page"), "Configure the top node page.", $help["top nodes page"], "site monitoring", 5);
menu_add("help", url("admin/statistics/help"), "More information about the statistics.", NULL, "site monitoring", 6);
menu("admin/statistics", "site statistics", "statistics_admin", $help["statistics"], 6);
menu("admin/statistics/statistics", "post popular posts", "statistics_admin", $help["statistics"]);
menu("admin/statistics/referrers", "referrer log", "statistics_admin", $help["referrers"]);
menu("admin/statistics/referrers/internal", "internal referrers only", "statistics_admin", $help["referrers"]);
menu("admin/statistics/referrers/external", "external referrers only", "statistics_admin", $help["referrers"]);
menu("admin/statistics/log", "access log", "statistics_admin", $help["access"]);
menu("admin/statistics/top nodes page", "configure 'top nodes' page", "statistics_admin", $help["top nodes page"], 5);
menu("admin/statistics/help", "help", "statistics_help", NULL, 9);
// block configuration:
menu_add("configure 'top nodes' block", url("admin/statistics/top+nodes+block"), "Configure the 'top nodes block'", $help["top nodes block"], "block management", 2);
menu_add("configure 'who is online' block", url("admin/statistics/whos+online+block"), "Configure the 'top nodes block'", $help["who is online block"], "block management", 2);
}
menu("admin/block/top nodes block", "configure 'top nodes' block", "statistics_admin", $help["top nodes block"], 5);
menu("admin/block/whos online block", "configure 'who is online' block", "statistics_admin", $help["who is online block"], 5);
}
return $links ? $links : array();
}
@ -265,9 +265,6 @@ function statistics_admin() {
/* non-configuration admin pages */
switch ($op) {
case "help":
print statistics_help();
exit;
case "statistics":
print statistics_admin_displaycounts();
exit;
@ -527,6 +524,7 @@ function statistics_admin_displaycounts() {
function statistics_admin_displaylog() {
global $uid, $nid, $hostname;
// TODO: this is broken due to the URL changes
if ($uid) {
$user = user_load(array("uid" => $uid));

View File

@ -116,19 +116,19 @@ function statistics_link($type, $node = 0, $main = 0) {
$help["top nodes block"] = "The statistics module exports a block that can display the day's top viewed nodes, the all time top viewed nodes and the last nodes viewed. Each of these links can be enabled or disabled individually, and the number of nodes displayed for each can be configured with a drop down menu. If you disable all sections of this block, it will not appear.";
$help["who is online block"] = "This statistics module exports a block that can display how many user's and guests are currently online. You can configure the name of the block, the name of a sub-block for displaying names of user's currently online, how recently a user must have been active to be considered online, the maximum characters to display from a user's name and the maximum number of user names to display.";
menu_add("popular posts", url("admin/statistics/statistics"), "Display the top nodes.", $help["statistics"], "site monitoring", 2, 1);
menu_add("referrer log", url("admin/statistics/referrers"), "Display the referrers.", $help["referrers"], "site monitoring", 3, 1);
menu_add("view all referrers", url("admin/statistics/referrers/all"), "Display all referrers.", $help["referrers"], "referrer log", 1);
menu_add("view internal referrers", url("admin/statistics/referrers/internal"), "Display internal referrers.", $help["referrers"], "referrer log", 1);
menu_add("view external referrers", url("admin/statistics/referrers/external"), "Display external referrers.", $help["referrers"], "referrer log", 1);
menu_add("access log", url("admin/statistics/log"), "Display the access log.", $help["access"], "site monitoring", 4);
menu_add("configure 'top nodes' page", url("admin/statistics/top+nodes+page"), "Configure the top node page.", $help["top nodes page"], "site monitoring", 5);
menu_add("help", url("admin/statistics/help"), "More information about the statistics.", NULL, "site monitoring", 6);
menu("admin/statistics", "site statistics", "statistics_admin", $help["statistics"], 6);
menu("admin/statistics/statistics", "post popular posts", "statistics_admin", $help["statistics"]);
menu("admin/statistics/referrers", "referrer log", "statistics_admin", $help["referrers"]);
menu("admin/statistics/referrers/internal", "internal referrers only", "statistics_admin", $help["referrers"]);
menu("admin/statistics/referrers/external", "external referrers only", "statistics_admin", $help["referrers"]);
menu("admin/statistics/log", "access log", "statistics_admin", $help["access"]);
menu("admin/statistics/top nodes page", "configure 'top nodes' page", "statistics_admin", $help["top nodes page"], 5);
menu("admin/statistics/help", "help", "statistics_help", NULL, 9);
// block configuration:
menu_add("configure 'top nodes' block", url("admin/statistics/top+nodes+block"), "Configure the 'top nodes block'", $help["top nodes block"], "block management", 2);
menu_add("configure 'who is online' block", url("admin/statistics/whos+online+block"), "Configure the 'top nodes block'", $help["who is online block"], "block management", 2);
}
menu("admin/block/top nodes block", "configure 'top nodes' block", "statistics_admin", $help["top nodes block"], 5);
menu("admin/block/whos online block", "configure 'who is online' block", "statistics_admin", $help["who is online block"], 5);
}
return $links ? $links : array();
}
@ -265,9 +265,6 @@ function statistics_admin() {
/* non-configuration admin pages */
switch ($op) {
case "help":
print statistics_help();
exit;
case "statistics":
print statistics_admin_displaycounts();
exit;
@ -527,6 +524,7 @@ function statistics_admin_displaycounts() {
function statistics_admin_displaylog() {
global $uid, $nid, $hostname;
// TODO: this is broken due to the URL changes
if ($uid) {
$user = user_load(array("uid" => $uid));

View File

@ -34,13 +34,20 @@ function system_perm() {
function system_link($type) {
if ($type == "admin" && user_access("administer site configuration")) {
menu_add("site configuration", url("admin/system"), "Site configuration.", NULL, NULL, 2);
menu_add("module selector", url("admin/system/modules/selector"), "Module selector.", NULL, "site configuration", 1);
menu_add("module settings", url("admin/system/modules/settings"), "Site settings.", NULL, "site configuration", 2);
menu_add("theme selector", url("admin/system/themes/selector"), "Theme selector.", NULL, "site configuration", 3);
menu_add("theme settings", url("admin/system/themes/settings"), "Theme selector.", NULL, "site configuration", 4);
menu_add("content filters", url("admin/system/filters"), "Content filters.", NULL, "site configuration", 5);
menu_add("help", url("admin/system/help"), "Help.", NULL, "site configuration", 9);
$help["general"] = "General configuration help: to be written. Anyone?";
$help["themes"] = "Theme help: to be written. Anyone?";
$help["modules"] = "Module help: to be written. Anyone?";
$help["filters"] = "Filter help: to be written. Anyone?";
menu("admin/system", "site configuration", NULL, $help["general"], 3);
menu("admin/system/themes", "themes", NULL, $help["themes"], 1);
menu("admin/system/themes/selector", "theme selector", "system_admin", $help["themes"]);
menu("admin/system/themes/settings", "theme settings", "system_admin", $help["themes"]);
menu("admin/system/modules", "modules", NULL, $help["modules"], 2);
menu("admin/system/modules/selector", "module selector", "system_admin", $help["modules"]);
menu("admin/system/modules/settings", "module settings", "system_admin", $help["modules"]);
menu("admin/system/filters", "filters", "system_admin", $help["filters"], 3);
menu("admin/system/help", "help", "system_help", NULL, 9);
}
}
@ -285,9 +292,6 @@ function system_admin() {
}
switch ($op) {
case "help":
print system_help();
break;
case "modules":
if (arg(3) == "settings") {
print system_view("modules");

View File

@ -34,13 +34,20 @@ function system_perm() {
function system_link($type) {
if ($type == "admin" && user_access("administer site configuration")) {
menu_add("site configuration", url("admin/system"), "Site configuration.", NULL, NULL, 2);
menu_add("module selector", url("admin/system/modules/selector"), "Module selector.", NULL, "site configuration", 1);
menu_add("module settings", url("admin/system/modules/settings"), "Site settings.", NULL, "site configuration", 2);
menu_add("theme selector", url("admin/system/themes/selector"), "Theme selector.", NULL, "site configuration", 3);
menu_add("theme settings", url("admin/system/themes/settings"), "Theme selector.", NULL, "site configuration", 4);
menu_add("content filters", url("admin/system/filters"), "Content filters.", NULL, "site configuration", 5);
menu_add("help", url("admin/system/help"), "Help.", NULL, "site configuration", 9);
$help["general"] = "General configuration help: to be written. Anyone?";
$help["themes"] = "Theme help: to be written. Anyone?";
$help["modules"] = "Module help: to be written. Anyone?";
$help["filters"] = "Filter help: to be written. Anyone?";
menu("admin/system", "site configuration", NULL, $help["general"], 3);
menu("admin/system/themes", "themes", NULL, $help["themes"], 1);
menu("admin/system/themes/selector", "theme selector", "system_admin", $help["themes"]);
menu("admin/system/themes/settings", "theme settings", "system_admin", $help["themes"]);
menu("admin/system/modules", "modules", NULL, $help["modules"], 2);
menu("admin/system/modules/selector", "module selector", "system_admin", $help["modules"]);
menu("admin/system/modules/settings", "module settings", "system_admin", $help["modules"]);
menu("admin/system/filters", "filters", "system_admin", $help["filters"], 3);
menu("admin/system/help", "help", "system_help", NULL, 9);
}
}
@ -285,9 +292,6 @@ function system_admin() {
}
switch ($op) {
case "help":
print system_help();
break;
case "modules":
if (arg(3) == "settings") {
print system_view("modules");

View File

@ -31,9 +31,9 @@ function taxonomy_link($type, $node = NULL) {
$help["taxonomy"] = "The taxonomy module allows you to classify post into categories and subcategories; it allows multiple lists of categories for classification (controlled vocabularies) and offers the possibility of creating thesauri (controlled vocabularies that indicate the relationship of terms) and taxonomies (controlled vocabularies where relationships are indicated hierarchically).";
$help["vocabulary"] = "When you create a controlled vocabulary you are creating a set of terms to use for describing content (known as descriptors in indexing lingo). Drupal allows you to describe each node of content (blog, story, etc.) using one or many of these terms. For simple implementations, you might create a set of categories without subcategories, similar to Slashdot.org's or Kuro5hin.org's sections. For more complex implementations, you might create a hierarchical list of categories.";
menu_add("taxonomy", url("admin/taxonomy"), "Administer taxonomies.", $help["taxonomy"], "content management", 1);
menu_add("add new vocabulary", url("admin/taxonomy/add/vocabulary"), "Add a new vocabulary.", $help["vocabulary"], "taxonomy");
menu_add("help", url("admin/taxonomy/help"), "More information about taxonomies.", NULL, "taxonomy", 9);
menu("admin/taxonomy", "taxonomy", "taxonomy_admin", $help["taxonomy"], 3);
menu("admin/taxonomy/create vocabulary", "create new vocabulary", "taxonomy_admin", $help["vocabulary"]);
menu("admin/taxonomy/help", "help", "taxonomy_admin", NULL, 9);
}
else if ($type == "taxonomy terms" && $node != NULL) {
/*
@ -274,7 +274,7 @@ function taxonomy_overview() {
foreach ($vocabularies as $vocabulary) {
$links = array();
$rows[] = array($vocabulary->name, array("data" => $vocabulary->types, "align" => "center"), l(t("edit vocabulary"), "admin/taxonomy/edit/vocabulary/$vocabulary->vid"), l(t("add term"), "admin/taxonomy/add/term/$vocabulary->vid"), l(t("preview form"), "admin/taxonomy/preview/vocabulary/$vocabulary->vid"));
$rows[] = array($vocabulary->name, array("data" => $vocabulary->types, "align" => "center"), l(t("edit vocabulary"), "admin/taxonomy/edit/vocabulary/$vocabulary->vid"), l(t("add term"), "admin/taxonomy/add term/$vocabulary->vid"), l(t("preview form"), "admin/taxonomy/preview/vocabulary/$vocabulary->vid"));
$tree = taxonomy_get_tree($vocabulary->vid);
if ($tree) {
@ -716,13 +716,11 @@ function taxonomy_admin() {
}
switch ($op) {
case "add":
if (arg(3) == "vocabulary") {
print taxonomy_form_vocabulary();
}
else {
print taxonomy_form_term();
}
case "create vocabulary":
print taxonomy_form_vocabulary();
break;
case "add term":
print taxonomy_form_term();
break;
case "edit":
if (arg(3) == "vocabulary") {

View File

@ -31,9 +31,9 @@ function taxonomy_link($type, $node = NULL) {
$help["taxonomy"] = "The taxonomy module allows you to classify post into categories and subcategories; it allows multiple lists of categories for classification (controlled vocabularies) and offers the possibility of creating thesauri (controlled vocabularies that indicate the relationship of terms) and taxonomies (controlled vocabularies where relationships are indicated hierarchically).";
$help["vocabulary"] = "When you create a controlled vocabulary you are creating a set of terms to use for describing content (known as descriptors in indexing lingo). Drupal allows you to describe each node of content (blog, story, etc.) using one or many of these terms. For simple implementations, you might create a set of categories without subcategories, similar to Slashdot.org's or Kuro5hin.org's sections. For more complex implementations, you might create a hierarchical list of categories.";
menu_add("taxonomy", url("admin/taxonomy"), "Administer taxonomies.", $help["taxonomy"], "content management", 1);
menu_add("add new vocabulary", url("admin/taxonomy/add/vocabulary"), "Add a new vocabulary.", $help["vocabulary"], "taxonomy");
menu_add("help", url("admin/taxonomy/help"), "More information about taxonomies.", NULL, "taxonomy", 9);
menu("admin/taxonomy", "taxonomy", "taxonomy_admin", $help["taxonomy"], 3);
menu("admin/taxonomy/create vocabulary", "create new vocabulary", "taxonomy_admin", $help["vocabulary"]);
menu("admin/taxonomy/help", "help", "taxonomy_admin", NULL, 9);
}
else if ($type == "taxonomy terms" && $node != NULL) {
/*
@ -274,7 +274,7 @@ function taxonomy_overview() {
foreach ($vocabularies as $vocabulary) {
$links = array();
$rows[] = array($vocabulary->name, array("data" => $vocabulary->types, "align" => "center"), l(t("edit vocabulary"), "admin/taxonomy/edit/vocabulary/$vocabulary->vid"), l(t("add term"), "admin/taxonomy/add/term/$vocabulary->vid"), l(t("preview form"), "admin/taxonomy/preview/vocabulary/$vocabulary->vid"));
$rows[] = array($vocabulary->name, array("data" => $vocabulary->types, "align" => "center"), l(t("edit vocabulary"), "admin/taxonomy/edit/vocabulary/$vocabulary->vid"), l(t("add term"), "admin/taxonomy/add term/$vocabulary->vid"), l(t("preview form"), "admin/taxonomy/preview/vocabulary/$vocabulary->vid"));
$tree = taxonomy_get_tree($vocabulary->vid);
if ($tree) {
@ -716,13 +716,11 @@ function taxonomy_admin() {
}
switch ($op) {
case "add":
if (arg(3) == "vocabulary") {
print taxonomy_form_vocabulary();
}
else {
print taxonomy_form_term();
}
case "create vocabulary":
print taxonomy_form_vocabulary();
break;
case "add term":
print taxonomy_form_term();
break;
case "edit":
if (arg(3) == "vocabulary") {

View File

@ -416,25 +416,25 @@ function user_link($type) {
$help["search"] = "On this page you can query any username. For example, one may search for 'br' and Drupal might return 'brian', 'brad', and 'brenda'.";
$help["setting"] = "Administrators may choose to restrict registration to their site. That restriction may be accomplished on this page. Also, the list of words which may be included in a system generated password is also listed on this page. Drupal generates passwords by joining small words from the password list until the new password is greater than 6 characters.";
menu_add("user management", url("admin/user"), "User management", $help["user"]);
menu_add("create new account", url("admin/user/create"), "Create a new user account.", $help["create"], "user management", 1);
menu_add("view user accounts", url("admin/user/account"), "Display user account listings.", $help["view"], "user management", 2);
menu_add("access rules", url("admin/user/access"), "Configure access rules.", $help["access"], "user management", 3);
menu_add("e-mail rules", url("admin/user/access/mail"), "Allow or deny certain e-mail addresses.", $help["access"], "access rules");
menu_add("username rules", url("admin/user/access/user"), "Allow or deny certain usernames.", $help["access"], "access rules");
menu_add("user roles", url("admin/user/role"), "Configure user roles.", $help["role"], "user management", 4);
menu_add("user permissions", url("admin/user/permission"), "Configure user permissions.", $help["permission"], "user management", 5);
menu_add("search account", url("admin/user/search"), "Search a user account.", $help["search"], "user management", 5);
menu_add("help", url("admin/user/help"), "More information about user management.", NULL, "user management", 7);
menu("admin/user", "user management", "user_admin", $help["user"], 2);
menu("admin/user/create", "create new account", "user_admin", $help["create"], 1);
menu("admin/user/account", "view user accounts", "user_admin", $help["view"], 2);
menu("admin/user/access", "access rules", NULL, $help["access"], 3);
menu("admin/user/access/mail", "e-mail rules", "user_admin", $help["access"]);
menu("admin/user/access/user", "username rules", "user_admin", $help["access"]);
menu("admin/user/role", "user roles", "user_admin", $help["role"], 4);
menu("admin/user/permission", "user permissions", "user_admin", $help["permission"], 5);
menu("admin/user/search", "search account", "user_admin", $help["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/0", "active users", "user_admin", $help["view"], 1);
menu("admin/user/account/1", "new users", "user_admin", $help["view"], 2);
menu("admin/user/account/2", "blocked users", "user_admin", $help["view"], 3);
menu_add("active users", url("admin/user/account/0"), t("Active users."), $help["view"], "view user accounts", 1);
menu_add("new users", url("admin/user/account/1"), t("New users."), $help["view"], "view user accounts", 2);
menu_add("blocked users", url("admin/user/account/2"), t("Blocked users."), $help["view"], "view user accounts", 3);
$i = 3;
foreach (user_roles(1) as $key => $value) {
menu_add("users with role '$value'", url("admin/user/account/". $i++), NULL, $help["view"], "view user accounts", 4);
}
$i = 3;
foreach (user_roles(1) as $key => $value) {
menu("admin/user/account/". $i++, "users with role '$value'", "user_admin", $help["view"], 4);
}
}
return $links ? $links : array();
@ -1527,9 +1527,6 @@ function user_admin() {
}
switch ($op) {
case "help":
print user_help();
break;
case "search":
print search_type("user", url("admin/user/search"));
break;
@ -1823,9 +1820,9 @@ function user_help_devel_da() {
</p>
<pre>function blogger_page() {
$theme(&quot;header&quot;);
$theme(&quot;box&quot;, &quot;Blogger&quot;, blogger_auth_help());
$theme(&quot;footer&quot;);
theme(&quot;header&quot;);
theme(&quot;box&quot;, &quot;Blogger&quot;, blogger_auth_help());
theme(&quot;footer&quot;);
}</pre>
<p>The _page function is not currently used, but it might be in the future. For
now, just copy what you see here, substituting your module name for <i>blogger</i>.</p>

View File

@ -416,25 +416,25 @@ function user_link($type) {
$help["search"] = "On this page you can query any username. For example, one may search for 'br' and Drupal might return 'brian', 'brad', and 'brenda'.";
$help["setting"] = "Administrators may choose to restrict registration to their site. That restriction may be accomplished on this page. Also, the list of words which may be included in a system generated password is also listed on this page. Drupal generates passwords by joining small words from the password list until the new password is greater than 6 characters.";
menu_add("user management", url("admin/user"), "User management", $help["user"]);
menu_add("create new account", url("admin/user/create"), "Create a new user account.", $help["create"], "user management", 1);
menu_add("view user accounts", url("admin/user/account"), "Display user account listings.", $help["view"], "user management", 2);
menu_add("access rules", url("admin/user/access"), "Configure access rules.", $help["access"], "user management", 3);
menu_add("e-mail rules", url("admin/user/access/mail"), "Allow or deny certain e-mail addresses.", $help["access"], "access rules");
menu_add("username rules", url("admin/user/access/user"), "Allow or deny certain usernames.", $help["access"], "access rules");
menu_add("user roles", url("admin/user/role"), "Configure user roles.", $help["role"], "user management", 4);
menu_add("user permissions", url("admin/user/permission"), "Configure user permissions.", $help["permission"], "user management", 5);
menu_add("search account", url("admin/user/search"), "Search a user account.", $help["search"], "user management", 5);
menu_add("help", url("admin/user/help"), "More information about user management.", NULL, "user management", 7);
menu("admin/user", "user management", "user_admin", $help["user"], 2);
menu("admin/user/create", "create new account", "user_admin", $help["create"], 1);
menu("admin/user/account", "view user accounts", "user_admin", $help["view"], 2);
menu("admin/user/access", "access rules", NULL, $help["access"], 3);
menu("admin/user/access/mail", "e-mail rules", "user_admin", $help["access"]);
menu("admin/user/access/user", "username rules", "user_admin", $help["access"]);
menu("admin/user/role", "user roles", "user_admin", $help["role"], 4);
menu("admin/user/permission", "user permissions", "user_admin", $help["permission"], 5);
menu("admin/user/search", "search account", "user_admin", $help["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/0", "active users", "user_admin", $help["view"], 1);
menu("admin/user/account/1", "new users", "user_admin", $help["view"], 2);
menu("admin/user/account/2", "blocked users", "user_admin", $help["view"], 3);
menu_add("active users", url("admin/user/account/0"), t("Active users."), $help["view"], "view user accounts", 1);
menu_add("new users", url("admin/user/account/1"), t("New users."), $help["view"], "view user accounts", 2);
menu_add("blocked users", url("admin/user/account/2"), t("Blocked users."), $help["view"], "view user accounts", 3);
$i = 3;
foreach (user_roles(1) as $key => $value) {
menu_add("users with role '$value'", url("admin/user/account/". $i++), NULL, $help["view"], "view user accounts", 4);
}
$i = 3;
foreach (user_roles(1) as $key => $value) {
menu("admin/user/account/". $i++, "users with role '$value'", "user_admin", $help["view"], 4);
}
}
return $links ? $links : array();
@ -1527,9 +1527,6 @@ function user_admin() {
}
switch ($op) {
case "help":
print user_help();
break;
case "search":
print search_type("user", url("admin/user/search"));
break;
@ -1823,9 +1820,9 @@ function user_help_devel_da() {
</p>
<pre>function blogger_page() {
$theme(&quot;header&quot;);
$theme(&quot;box&quot;, &quot;Blogger&quot;, blogger_auth_help());
$theme(&quot;footer&quot;);
theme(&quot;header&quot;);
theme(&quot;box&quot;, &quot;Blogger&quot;, blogger_auth_help());
theme(&quot;footer&quot;);
}</pre>
<p>The _page function is not currently used, but it might be in the future. For
now, just copy what you see here, substituting your module name for <i>blogger</i>.</p>

View File

@ -21,14 +21,14 @@ function watchdog_link($type) {
if ($type == "admin" && user_access("administer watchdog")) {
$help = "The watchdog module monitors your website, captures system events in a log and records them to be reviewed by an authorized individual at a later time. The watchdog log is simply a list of events recorded during operation and contains usage data, performance data, errors, warnings and operational information. It is vital to check the watchdog report on a regular basis as it is often the only way to tell what is going on.";
menu_add("site monitoring", url("admin/watchdog"), "Monitor your site.", NULL, NULL, 2);
menu_add("watchdog", url("admin/watchdog/list/all"), "Display system events.", $help, "site monitoring", 1);
menu_add("user messages", url("admin/watchdog/list/user"), "Display system events", $help, "watchdog");
menu_add("regular messages", url("admin/watchdog/list/regular"), "Display system events", $help, "watchdog");
menu_add("special messages", url("admin/watchdog/list/special"), "Display system events", $help, "watchdog");
menu_add("warning messages", url("admin/watchdog/list/warning"), "Display system events", $help, "watchdog");
menu_add("error messages", url("admin/watchdog/list/error"), "Display system events", $help, "watchdog");
menu_add("httpd messages", url("admin/watchdog/list/httpd"), "Display system events", $help, "watchdog");
menu("admin/watchdog", "site monitoring", "watchdog_admin", $help, 6);
menu("admin/watchdog/user", "user messages", "watchdog_admin", $help);
menu("admin/watchdog/regular", "regular messages", "watchdog_admin", $help);
menu("admin/watchdog/special", "special messages", "watchdog_admin", $help);
menu("admin/watchdog/warning", "warning messagess", "watchdog_admin", $help);
menu("admin/watchdog/error", "error messages", "watchdog_admin", $help);
menu("admin/watchdog/httpd", "httpd messages", "watchdog_admin", $help);
menu("admin/watchdog/view", "view details", "watchdog_admin", $help, 0, 1); // hidden menu
}
}
@ -46,7 +46,7 @@ function watchdog_overview($type) {
$color = array("user" => "#FFEEAA", "message" => "#FFFFFF", "special" => "#A49FFF", "warning" => "#FFAA22", "httpd" => "#99DD99", "error" => "#EE4C4C");
$query = array("user" => "WHERE type = 'user'", "regular" => "WHERE type = 'message'", "special" => "WHERE type = 'special'", "warning" => "WHERE type = 'warning'", "error" => "WHERE type = 'error'", "httpd" => "WHERE type = 'httpd'", "actions" => "WHERE link != ''");
$result = pager_query("SELECT w.*, u.name, u.uid FROM watchdog w LEFT JOIN users u ON w.uid = u.uid ". ($type ? $query[$type] : "") ." ORDER BY w.timestamp DESC", 100);
$result = pager_query("SELECT w.*, u.name, u.uid FROM watchdog w LEFT JOIN users u ON w.uid = u.uid ". ($type ? $query[$type] : "") ." ORDER BY w.timestamp DESC", 75);
while ($watchdog = db_fetch_object($result)) {
if ($background = $color[$watchdog->type]) {
@ -92,7 +92,7 @@ function watchdog_admin() {
print watchdog_view(check_input(arg(3)));
break;
default:
print watchdog_overview(arg(3));
print watchdog_overview(arg(2));
}
}
else {

View File

@ -21,14 +21,14 @@ function watchdog_link($type) {
if ($type == "admin" && user_access("administer watchdog")) {
$help = "The watchdog module monitors your website, captures system events in a log and records them to be reviewed by an authorized individual at a later time. The watchdog log is simply a list of events recorded during operation and contains usage data, performance data, errors, warnings and operational information. It is vital to check the watchdog report on a regular basis as it is often the only way to tell what is going on.";
menu_add("site monitoring", url("admin/watchdog"), "Monitor your site.", NULL, NULL, 2);
menu_add("watchdog", url("admin/watchdog/list/all"), "Display system events.", $help, "site monitoring", 1);
menu_add("user messages", url("admin/watchdog/list/user"), "Display system events", $help, "watchdog");
menu_add("regular messages", url("admin/watchdog/list/regular"), "Display system events", $help, "watchdog");
menu_add("special messages", url("admin/watchdog/list/special"), "Display system events", $help, "watchdog");
menu_add("warning messages", url("admin/watchdog/list/warning"), "Display system events", $help, "watchdog");
menu_add("error messages", url("admin/watchdog/list/error"), "Display system events", $help, "watchdog");
menu_add("httpd messages", url("admin/watchdog/list/httpd"), "Display system events", $help, "watchdog");
menu("admin/watchdog", "site monitoring", "watchdog_admin", $help, 6);
menu("admin/watchdog/user", "user messages", "watchdog_admin", $help);
menu("admin/watchdog/regular", "regular messages", "watchdog_admin", $help);
menu("admin/watchdog/special", "special messages", "watchdog_admin", $help);
menu("admin/watchdog/warning", "warning messagess", "watchdog_admin", $help);
menu("admin/watchdog/error", "error messages", "watchdog_admin", $help);
menu("admin/watchdog/httpd", "httpd messages", "watchdog_admin", $help);
menu("admin/watchdog/view", "view details", "watchdog_admin", $help, 0, 1); // hidden menu
}
}
@ -46,7 +46,7 @@ function watchdog_overview($type) {
$color = array("user" => "#FFEEAA", "message" => "#FFFFFF", "special" => "#A49FFF", "warning" => "#FFAA22", "httpd" => "#99DD99", "error" => "#EE4C4C");
$query = array("user" => "WHERE type = 'user'", "regular" => "WHERE type = 'message'", "special" => "WHERE type = 'special'", "warning" => "WHERE type = 'warning'", "error" => "WHERE type = 'error'", "httpd" => "WHERE type = 'httpd'", "actions" => "WHERE link != ''");
$result = pager_query("SELECT w.*, u.name, u.uid FROM watchdog w LEFT JOIN users u ON w.uid = u.uid ". ($type ? $query[$type] : "") ." ORDER BY w.timestamp DESC", 100);
$result = pager_query("SELECT w.*, u.name, u.uid FROM watchdog w LEFT JOIN users u ON w.uid = u.uid ". ($type ? $query[$type] : "") ." ORDER BY w.timestamp DESC", 75);
while ($watchdog = db_fetch_object($result)) {
if ($background = $color[$watchdog->type]) {
@ -92,7 +92,7 @@ function watchdog_admin() {
print watchdog_view(check_input(arg(3)));
break;
default:
print watchdog_overview(arg(3));
print watchdog_overview(arg(2));
}
}
else {