- Block module fixes. Patch by Kjartan.
parent
e2c206dafa
commit
b4ceaac375
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
// $Id$
|
||||
|
||||
function block_help($section = "admin/block/help") {
|
||||
function block_help($section = "admin/system/block/help") {
|
||||
$output = "";
|
||||
|
||||
switch ($section) {
|
||||
case 'admin/block/help':
|
||||
case 'admin/system/block/help':
|
||||
$output .= "<p>Blocks are the boxes visible in the sidebar(s) of your web site. These are usually generated automatically by modules (e.g. recent forum topics), but you can also create your own blocks using either static HTML or dynamic PHP content.</p>";
|
||||
$output .= "<p>The sidebar each block appears in depends on both which theme you're using (some are left-only, some right, some both), and on the settings in block management.</p><p>Whether a block is visible in the first place depends on three things:</p><ul><li>It must have its \"enabled\" box checked in block management.</li><li>If it has its \"custom\" box checked in block management, the user must have chosen to display it in their user preferences.</li><li>If the \"path\" field in block management is set, the visitor must be on a page that matches the path specification (more on this later).</li></ul>";
|
||||
$output .= "<p>The block management screen also lets you specify the vertical sort-order of the blocks within a sidebar. You do this by assigning a <b>weight</b> to each block. Lighter blocks (smaller weight) \"float up\" towards the top of the sidebar. Heavier ones \"sink down\" towards the bottom of it. Once you've positioned things just so, you can preview what the layout will look like in different types of themes by clicking the preview placement link in the menu to the left.</p>";
|
||||
|
@ -162,8 +162,8 @@ function block_admin_display() {
|
|||
|
||||
foreach ($blocks as $block) {
|
||||
if ($block["module"] == "block") {
|
||||
$edit = l(t("edit"), "admin/block/edit/". $block["delta"]);
|
||||
$delete = l(t("delete"), "admin/block/delete/". $block["delta"]);
|
||||
$edit = l(t("edit"), "admin/system/block/edit/". $block["delta"]);
|
||||
$delete = l(t("delete"), "admin/system/block/delete/". $block["delta"]);
|
||||
}
|
||||
else {
|
||||
$edit = "";
|
||||
|
@ -284,7 +284,7 @@ function block_admin() {
|
|||
if (user_access("administer blocks")) {
|
||||
|
||||
if (empty($op)) {
|
||||
$op = arg(2);
|
||||
$op = arg(3);
|
||||
}
|
||||
|
||||
switch ($op) {
|
||||
|
@ -295,10 +295,10 @@ function block_admin() {
|
|||
$output = block_box_form();
|
||||
break;
|
||||
case "edit":
|
||||
$output = block_box_form(block_box_get(arg(3)));
|
||||
$output = block_box_form(block_box_get(arg(4)));
|
||||
break;
|
||||
case "delete":
|
||||
$output = status(block_box_delete(arg(3)));
|
||||
$output = status(block_box_delete(arg(4)));
|
||||
cache_clear_all();
|
||||
$output .= block_admin_display();
|
||||
break;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
// $Id$
|
||||
|
||||
function block_help($section = "admin/block/help") {
|
||||
function block_help($section = "admin/system/block/help") {
|
||||
$output = "";
|
||||
|
||||
switch ($section) {
|
||||
case 'admin/block/help':
|
||||
case 'admin/system/block/help':
|
||||
$output .= "<p>Blocks are the boxes visible in the sidebar(s) of your web site. These are usually generated automatically by modules (e.g. recent forum topics), but you can also create your own blocks using either static HTML or dynamic PHP content.</p>";
|
||||
$output .= "<p>The sidebar each block appears in depends on both which theme you're using (some are left-only, some right, some both), and on the settings in block management.</p><p>Whether a block is visible in the first place depends on three things:</p><ul><li>It must have its \"enabled\" box checked in block management.</li><li>If it has its \"custom\" box checked in block management, the user must have chosen to display it in their user preferences.</li><li>If the \"path\" field in block management is set, the visitor must be on a page that matches the path specification (more on this later).</li></ul>";
|
||||
$output .= "<p>The block management screen also lets you specify the vertical sort-order of the blocks within a sidebar. You do this by assigning a <b>weight</b> to each block. Lighter blocks (smaller weight) \"float up\" towards the top of the sidebar. Heavier ones \"sink down\" towards the bottom of it. Once you've positioned things just so, you can preview what the layout will look like in different types of themes by clicking the preview placement link in the menu to the left.</p>";
|
||||
|
@ -162,8 +162,8 @@ function block_admin_display() {
|
|||
|
||||
foreach ($blocks as $block) {
|
||||
if ($block["module"] == "block") {
|
||||
$edit = l(t("edit"), "admin/block/edit/". $block["delta"]);
|
||||
$delete = l(t("delete"), "admin/block/delete/". $block["delta"]);
|
||||
$edit = l(t("edit"), "admin/system/block/edit/". $block["delta"]);
|
||||
$delete = l(t("delete"), "admin/system/block/delete/". $block["delta"]);
|
||||
}
|
||||
else {
|
||||
$edit = "";
|
||||
|
@ -284,7 +284,7 @@ function block_admin() {
|
|||
if (user_access("administer blocks")) {
|
||||
|
||||
if (empty($op)) {
|
||||
$op = arg(2);
|
||||
$op = arg(3);
|
||||
}
|
||||
|
||||
switch ($op) {
|
||||
|
@ -295,10 +295,10 @@ function block_admin() {
|
|||
$output = block_box_form();
|
||||
break;
|
||||
case "edit":
|
||||
$output = block_box_form(block_box_get(arg(3)));
|
||||
$output = block_box_form(block_box_get(arg(4)));
|
||||
break;
|
||||
case "delete":
|
||||
$output = status(block_box_delete(arg(3)));
|
||||
$output = status(block_box_delete(arg(4)));
|
||||
cache_clear_all();
|
||||
$output .= block_admin_display();
|
||||
break;
|
||||
|
|
|
@ -280,29 +280,9 @@ function statistics_admin() {
|
|||
case "Submit \"top nodes\" block changes":
|
||||
statistics_save_topnodes_block($edit);
|
||||
$output .= status(t("saved 'top nodes' block changes."));
|
||||
case "top nodes block":
|
||||
$output .= 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),
|
||||
"statistics_block_top_all_head" => variable_get("statistics_block_top_all_head", "<b>All time top:</b>"),
|
||||
"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);
|
||||
$output .= status(t("saved 'who's online' block changes."));
|
||||
case "whos online block":
|
||||
$output .= statistics_config_online_block(array(
|
||||
"statistics_block_online_title" => variable_get("statistics_block_online_title", "Who's 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);
|
||||
$output .= status(t("saved 'top nodes' page changes."));
|
||||
|
@ -317,6 +297,28 @@ function statistics_admin() {
|
|||
"statistics_userpage_last_cnt" => variable_get("statistics_userpage_last_cnt", 0)
|
||||
));
|
||||
break;
|
||||
case "block":
|
||||
if (arg(3) == "top nodes block") {
|
||||
$output .= 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),
|
||||
"statistics_block_top_all_head" => variable_get("statistics_block_top_all_head", "<b>All time top:</b>"),
|
||||
"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)
|
||||
));
|
||||
}
|
||||
elseif (arg(3) == "whos online block") {
|
||||
$output .= statistics_config_online_block(array(
|
||||
"statistics_block_online_title" => variable_get("statistics_block_online_title", "Who's 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;
|
||||
}
|
||||
default:
|
||||
$output .= statistics_admin_topnodes();
|
||||
}
|
||||
|
|
|
@ -280,29 +280,9 @@ function statistics_admin() {
|
|||
case "Submit \"top nodes\" block changes":
|
||||
statistics_save_topnodes_block($edit);
|
||||
$output .= status(t("saved 'top nodes' block changes."));
|
||||
case "top nodes block":
|
||||
$output .= 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),
|
||||
"statistics_block_top_all_head" => variable_get("statistics_block_top_all_head", "<b>All time top:</b>"),
|
||||
"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);
|
||||
$output .= status(t("saved 'who's online' block changes."));
|
||||
case "whos online block":
|
||||
$output .= statistics_config_online_block(array(
|
||||
"statistics_block_online_title" => variable_get("statistics_block_online_title", "Who's 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);
|
||||
$output .= status(t("saved 'top nodes' page changes."));
|
||||
|
@ -317,6 +297,28 @@ function statistics_admin() {
|
|||
"statistics_userpage_last_cnt" => variable_get("statistics_userpage_last_cnt", 0)
|
||||
));
|
||||
break;
|
||||
case "block":
|
||||
if (arg(3) == "top nodes block") {
|
||||
$output .= 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),
|
||||
"statistics_block_top_all_head" => variable_get("statistics_block_top_all_head", "<b>All time top:</b>"),
|
||||
"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)
|
||||
));
|
||||
}
|
||||
elseif (arg(3) == "whos online block") {
|
||||
$output .= statistics_config_online_block(array(
|
||||
"statistics_block_online_title" => variable_get("statistics_block_online_title", "Who's 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;
|
||||
}
|
||||
default:
|
||||
$output .= statistics_admin_topnodes();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue