Commit 96493500 authored by Kjartan's avatar Kjartan

- Fixed log views so that the menu doesn't dissapear. (Note: don't use exit()

  in Drupal unless you really need to!)
parent 2555ddc8
......@@ -266,15 +266,11 @@ function statistics_admin() {
/* non-configuration admin pages */
switch ($op) {
case "statistics":
print statistics_admin_displaycounts();
exit;
return statistics_admin_displaycounts();
case "referrers":
print statistics_recent_refer(arg(3));
print statistics_top_refer(arg(3));
exit;
return statistics_recent_refer(arg(3)) . statistics_top_refer(arg(3));
case "log":
print statistics_admin_displaylog();
exit;
return statistics_admin_displaylog();
}
/* configuration admin pages */
......@@ -282,9 +278,9 @@ function statistics_admin() {
switch (stripslashes($op)) {
case "Submit \"top nodes\" block changes":
statistics_save_topnodes_block($edit);
print status(t("saved 'top nodes' block changes."));
return status(t("saved 'top nodes' block changes."));
case "top nodes block":
print statistics_config_topnodes_block(array(
return statistics_config_topnodes_block(array(
"statistics_block_top_title" => variable_get("statistics_block_top_title", "Top nodes"),
"statistics_block_top_day_head" => variable_get("statistics_block_top_day_head", "<b>Todays top:</b>"),
"statistics_block_top_day_num" => variable_get("statistics_block_top_day_num", 0),
......@@ -292,25 +288,23 @@ function statistics_admin() {
"statistics_block_top_all_num" => variable_get("statistics_block_top_all_num", 0),
"statistics_block_top_last_head" => variable_get("statistics_block_top_last_head" ,"<b>Last:</b>"),
"statistics_block_top_last_num" => variable_get("statistics_block_top_last_num", 0)
));
break;
));
case "Submit \"who's online\" block changes":
statistics_save_online_block($edit);
print status(t("saved 'who's online' block changes."));
return status(t("saved 'who's online' block changes."));
case "whos online block":
print statistics_config_online_block(array(
return statistics_config_online_block(array(
"statistics_block_online_title" => variable_get("statistics_block_online_title", "Whos online"),
"statistics_block_online_subtitle" => variable_get("statistics_block_online_subtitle", "Online users:"),
"statistics_block_online_time" => variable_get("statistics_block_online_time", 2700),
"statistics_block_online_max_len" => variable_get("statistics_block_online_max_len", 15),
"statistics_block_online_max_cnt" => variable_get("statistics_block_online_max_cnt", 10)
));
break;
));
case "Submit \"top nodes\" page changes":
statistics_save_userconfig($edit);
print status(t("saved 'top nodes' page changes."));
return status(t("saved 'top nodes' page changes."));
case "top nodes page":
print statistics_admin_userpage_config(array(
return statistics_admin_userpage_config(array(
"statistics_userpage_link" => variable_get("statistics_userpage_link", ""),
"statistics_userpage_day_head" => variable_get("statistics_userpage_day_head", "Todays top"),
"statistics_userpage_day_cnt" => variable_get("statistics_userpage_day_cnt", 0),
......@@ -318,11 +312,9 @@ function statistics_admin() {
"statistics_userpage_all_cnt" => variable_get("statistics_userpage_all_cnt", 0),
"statistics_userpage_last_head" => variable_get("statistics_userpage_last_head", "Last read"),
"statistics_userpage_last_cnt" => variable_get("statistics_userpage_last_cnt", 0)
));
break;
));
default:
print statistics_admin_displaycounts();
break;
return statistics_admin_displaycounts();
}
}
}
......
......@@ -266,15 +266,11 @@ function statistics_admin() {
/* non-configuration admin pages */
switch ($op) {
case "statistics":
print statistics_admin_displaycounts();
exit;
return statistics_admin_displaycounts();
case "referrers":
print statistics_recent_refer(arg(3));
print statistics_top_refer(arg(3));
exit;
return statistics_recent_refer(arg(3)) . statistics_top_refer(arg(3));
case "log":
print statistics_admin_displaylog();
exit;
return statistics_admin_displaylog();
}
/* configuration admin pages */
......@@ -282,9 +278,9 @@ function statistics_admin() {
switch (stripslashes($op)) {
case "Submit \"top nodes\" block changes":
statistics_save_topnodes_block($edit);
print status(t("saved 'top nodes' block changes."));
return status(t("saved 'top nodes' block changes."));
case "top nodes block":
print statistics_config_topnodes_block(array(
return statistics_config_topnodes_block(array(
"statistics_block_top_title" => variable_get("statistics_block_top_title", "Top nodes"),
"statistics_block_top_day_head" => variable_get("statistics_block_top_day_head", "<b>Todays top:</b>"),
"statistics_block_top_day_num" => variable_get("statistics_block_top_day_num", 0),
......@@ -292,25 +288,23 @@ function statistics_admin() {
"statistics_block_top_all_num" => variable_get("statistics_block_top_all_num", 0),
"statistics_block_top_last_head" => variable_get("statistics_block_top_last_head" ,"<b>Last:</b>"),
"statistics_block_top_last_num" => variable_get("statistics_block_top_last_num", 0)
));
break;
));
case "Submit \"who's online\" block changes":
statistics_save_online_block($edit);
print status(t("saved 'who's online' block changes."));
return status(t("saved 'who's online' block changes."));
case "whos online block":
print statistics_config_online_block(array(
return statistics_config_online_block(array(
"statistics_block_online_title" => variable_get("statistics_block_online_title", "Whos online"),
"statistics_block_online_subtitle" => variable_get("statistics_block_online_subtitle", "Online users:"),
"statistics_block_online_time" => variable_get("statistics_block_online_time", 2700),
"statistics_block_online_max_len" => variable_get("statistics_block_online_max_len", 15),
"statistics_block_online_max_cnt" => variable_get("statistics_block_online_max_cnt", 10)
));
break;
));
case "Submit \"top nodes\" page changes":
statistics_save_userconfig($edit);
print status(t("saved 'top nodes' page changes."));
return status(t("saved 'top nodes' page changes."));
case "top nodes page":
print statistics_admin_userpage_config(array(
return statistics_admin_userpage_config(array(
"statistics_userpage_link" => variable_get("statistics_userpage_link", ""),
"statistics_userpage_day_head" => variable_get("statistics_userpage_day_head", "Todays top"),
"statistics_userpage_day_cnt" => variable_get("statistics_userpage_day_cnt", 0),
......@@ -318,11 +312,9 @@ function statistics_admin() {
"statistics_userpage_all_cnt" => variable_get("statistics_userpage_all_cnt", 0),
"statistics_userpage_last_head" => variable_get("statistics_userpage_last_head", "Last read"),
"statistics_userpage_last_cnt" => variable_get("statistics_userpage_last_cnt", 0)
));
break;
));
default:
print statistics_admin_displaycounts();
break;
return statistics_admin_displaycounts();
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment