summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/block.module2
-rw-r--r--modules/block/block.module2
-rw-r--r--modules/system.module17
-rw-r--r--modules/system/system.module17
4 files changed, 24 insertions, 14 deletions
diff --git a/modules/block.module b/modules/block.module
index dc29b2c8b..1746a61cc 100644
--- a/modules/block.module
+++ b/modules/block.module
@@ -40,7 +40,7 @@ function block_help($section = "admin/help#block") {
$output = t("Controls the boxes that are displayed around the main content.");
break;
case 'admin/system/block':
- $output = t("Blocks are the boxes in the left- and right- side bars of the web site, depending on the choosen theme. They are created by <b>active</b> Drupal modules. In order to view a block it must be enabled. You can assign the block's placement by giving it a region and a weight. The region specifies which side of the page the block is on, and the weight sorts blocks within a region. Lighter (smaller weight value) blocks \"float up\" towards the top of the page. The path setting lets you define which pages you want a block to be shown on. The custom checkbox lets your users hide the block using their account setting. You can also create your own blocks, where you specify the content of the block rather than its being generated by a module (you can even use PHP in these). You can create one of these by clicking the %createblock link in the menu to the left. Edit and delete links will become active below for these customized blocks. Blocks can automatically be temporarily disabled to reduce server load when your site becomes extremely busy by checking throttle. The auto-throttle functionality must be enabled on the %throttle.", array("%createblock" => l(t("new block"), "admin/system/block/add"), "%throttle" => l(t("throttle configuration page"), "admin/system/modules/throttle")));
+ $output = t("Blocks are the boxes in the left- and right- side bars of the web site, depending on the choosen theme. They are created by <b>active</b> Drupal modules. In order to view a block it must be enabled. You can assign the block's placement by giving it a region and a weight. The region specifies which side of the page the block is on, and the weight sorts blocks within a region. Lighter (smaller weight value) blocks \"float up\" towards the top of the page. The path setting lets you define which pages you want a block to be shown on. The custom checkbox lets your users hide the block using their account setting. You can also create your own blocks, where you specify the content of the block rather than its being generated by a module (you can even use PHP in these). You can create one of these by clicking the %createblock link in the menu to the left. Edit and delete links will become active below for these customized blocks. Blocks can automatically be temporarily disabled to reduce server load when your site becomes extremely busy by checking throttle. The auto-throttle functionality must be enabled on the %throttle after having enabled the throttle module.", array("%createblock" => l(t("new block"), "admin/system/block/add"), "%throttle" => l(t("throttle configuration page"), "admin/system/modules/throttle")));
break;
case 'admin/system/block/add':
$output = t("Here you can create a custom content block. Once you have created this block you must make it active, and give it a place on the page using %overview. The title is used when displaying the block. The description is used in the \"block\" column on the %overview page. If you are going to place PHP code in the block, and you have <b>create php content</b> permission (see the %permission page) you <b>must</b> change the type to PHP to make your code active.", array("%overview" => l(t("blocks"), "admin/system/block"), "%permission" => l(t("permissions"), "admin/user/permission")));
diff --git a/modules/block/block.module b/modules/block/block.module
index dc29b2c8b..1746a61cc 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -40,7 +40,7 @@ function block_help($section = "admin/help#block") {
$output = t("Controls the boxes that are displayed around the main content.");
break;
case 'admin/system/block':
- $output = t("Blocks are the boxes in the left- and right- side bars of the web site, depending on the choosen theme. They are created by <b>active</b> Drupal modules. In order to view a block it must be enabled. You can assign the block's placement by giving it a region and a weight. The region specifies which side of the page the block is on, and the weight sorts blocks within a region. Lighter (smaller weight value) blocks \"float up\" towards the top of the page. The path setting lets you define which pages you want a block to be shown on. The custom checkbox lets your users hide the block using their account setting. You can also create your own blocks, where you specify the content of the block rather than its being generated by a module (you can even use PHP in these). You can create one of these by clicking the %createblock link in the menu to the left. Edit and delete links will become active below for these customized blocks. Blocks can automatically be temporarily disabled to reduce server load when your site becomes extremely busy by checking throttle. The auto-throttle functionality must be enabled on the %throttle.", array("%createblock" => l(t("new block"), "admin/system/block/add"), "%throttle" => l(t("throttle configuration page"), "admin/system/modules/throttle")));
+ $output = t("Blocks are the boxes in the left- and right- side bars of the web site, depending on the choosen theme. They are created by <b>active</b> Drupal modules. In order to view a block it must be enabled. You can assign the block's placement by giving it a region and a weight. The region specifies which side of the page the block is on, and the weight sorts blocks within a region. Lighter (smaller weight value) blocks \"float up\" towards the top of the page. The path setting lets you define which pages you want a block to be shown on. The custom checkbox lets your users hide the block using their account setting. You can also create your own blocks, where you specify the content of the block rather than its being generated by a module (you can even use PHP in these). You can create one of these by clicking the %createblock link in the menu to the left. Edit and delete links will become active below for these customized blocks. Blocks can automatically be temporarily disabled to reduce server load when your site becomes extremely busy by checking throttle. The auto-throttle functionality must be enabled on the %throttle after having enabled the throttle module.", array("%createblock" => l(t("new block"), "admin/system/block/add"), "%throttle" => l(t("throttle configuration page"), "admin/system/modules/throttle")));
break;
case 'admin/system/block/add':
$output = t("Here you can create a custom content block. Once you have created this block you must make it active, and give it a place on the page using %overview. The title is used when displaying the block. The description is used in the \"block\" column on the %overview page. If you are going to place PHP code in the block, and you have <b>create php content</b> permission (see the %permission page) you <b>must</b> change the type to PHP to make your code active.", array("%overview" => l(t("blocks"), "admin/system/block"), "%permission" => l(t("permissions"), "admin/user/permission")));
diff --git a/modules/system.module b/modules/system.module
index 4ed775197..d821ec530 100644
--- a/modules/system.module
+++ b/modules/system.module
@@ -13,7 +13,7 @@ function system_help($section = "admin/help#system") {
$output = t("Select which themes are available to your users and specify the default theme.");
break;
case 'admin/system/modules':
- $output = t("Modules are plugins for Drupal that extend its core functionality. Here you can select which modules are enabled. On the left hand side click on the name of the module for their individual configurations. Once a module is enabled, you will need to grant %permissions to users.", array("%permissions" => l(t("permissions"), "admin/user/permission")));
+ $output = t("Modules are plugins for Drupal that extend its core functionality. Here you can select which modules are enabled. Click on the name of the module in the navigation menu for their individual configuration pages. Once a module is enabled, new %permissions might be made available. Modules can automatically be temporarily disabled to reduce server load when your site becomes extremely busy by checking throttle. The auto-throttle functionality must be enabled on the %throttle after having enabled the throttle module.", array("%permissions" => l(t("permissions"), "admin/user/permission"), "%throttle" => l(t("throttle configuration page"), "admin/system/modules/throttle")));
break;
case 'admin/system/filters':
$output = t("Filters fit between the raw text in a node and the HTML output. They allow you to replace text selectively. Uses include automatic conversion of emoticons into graphics and filtering HTML content from users' submissions.");
@@ -193,7 +193,7 @@ function system_save_settings($edit = array()) {
if ($edit["type"]) {
db_query("UPDATE {system} SET status = '0' WHERE type = '%s'", $edit["type"]);
foreach ($edit["status"] as $filename => $status) {
- db_query("UPDATE {system} SET status = %d WHERE filename = '$filename'", $status);
+ db_query("UPDATE {system} SET status = %d, throttle = %d WHERE filename = '$filename'", $status, $edit["throttle"]["$filename"]);
}
if ($edit["type"] == "theme") {
variable_set("theme_default", $edit["theme_default"]);
@@ -281,7 +281,7 @@ function system_listing($type, $directory, $required = array()) {
$files = system_dirscan($directory, "\.$type$");
// Extract current files from database.
- $result = db_query("SELECT filename, type, status FROM {system} WHERE type = '%s'", $type);
+ $result = db_query("SELECT filename, type, status, throttle FROM {system} WHERE type = '%s'", $type);
while ($file = db_fetch_object($result)) {
if (is_object($files[$file->filename])) {
foreach ($file as $key => $value) {
@@ -293,7 +293,9 @@ function system_listing($type, $directory, $required = array()) {
ksort($files);
if ($type == "module") {
- $header = array(t("name"), t("description"), t("status"));
+ $header = array(t("name"), t("description"), t("status"), t("throttle"));
+ // the throttle mechanism requires additional modules always be enabled
+ $throttle_required = array_merge($required, array("modules/statistics.module", "modules/throttle.module"));
}
else {
$header = array(t("name"), t("description"), t("enable"), t("default"));
@@ -326,10 +328,13 @@ function system_listing($type, $directory, $required = array()) {
// Update the contents of the system table:
db_query("DELETE FROM {system} WHERE filename = '%s' AND type = '%s'", $filename, $type);
- db_query("INSERT INTO {system} (name, description, type, filename, status, bootstrap) VALUES ('%s', '%s', '%s', '%s', %d, %d)", $info->name, $info->description, $type, $filename, $file->status, $bootstrap);
+ db_query("INSERT INTO {system} (name, description, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', %d, %d, %d)", $info->name, $info->description, $type, $filename, $file->status, $file->throttle, $bootstrap);
$row = array($info->name, $info->description, array("data" => (in_array($filename, $required) ? form_hidden("status][$filename", 1) . t("required") : form_checkbox("", "status][$filename", 1, $file->status)), "align" => "center"));
- if ($type == "theme") {
+ if ($type == "module") {
+ $row[] = array("data" => (in_array($filename, $throttle_required) ? form_hidden("throttle][$filename", 0) . t("required") : form_checkbox(NULL, "throttle][$filename", 1, $file->throttle, NULL, variable_get("throttle_enable", 0) ? NULL : array("disabled" => "disabled"))), "align" => "center");
+ }
+ else if ($type == "theme") {
$row[] = array("data" => form_radio("","theme_default",$info->name,(variable_get("theme_default",0) == $info->name) ? 1 : 0), "align" => "center");
}
$rows[] = $row;
diff --git a/modules/system/system.module b/modules/system/system.module
index 4ed775197..d821ec530 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -13,7 +13,7 @@ function system_help($section = "admin/help#system") {
$output = t("Select which themes are available to your users and specify the default theme.");
break;
case 'admin/system/modules':
- $output = t("Modules are plugins for Drupal that extend its core functionality. Here you can select which modules are enabled. On the left hand side click on the name of the module for their individual configurations. Once a module is enabled, you will need to grant %permissions to users.", array("%permissions" => l(t("permissions"), "admin/user/permission")));
+ $output = t("Modules are plugins for Drupal that extend its core functionality. Here you can select which modules are enabled. Click on the name of the module in the navigation menu for their individual configuration pages. Once a module is enabled, new %permissions might be made available. Modules can automatically be temporarily disabled to reduce server load when your site becomes extremely busy by checking throttle. The auto-throttle functionality must be enabled on the %throttle after having enabled the throttle module.", array("%permissions" => l(t("permissions"), "admin/user/permission"), "%throttle" => l(t("throttle configuration page"), "admin/system/modules/throttle")));
break;
case 'admin/system/filters':
$output = t("Filters fit between the raw text in a node and the HTML output. They allow you to replace text selectively. Uses include automatic conversion of emoticons into graphics and filtering HTML content from users' submissions.");
@@ -193,7 +193,7 @@ function system_save_settings($edit = array()) {
if ($edit["type"]) {
db_query("UPDATE {system} SET status = '0' WHERE type = '%s'", $edit["type"]);
foreach ($edit["status"] as $filename => $status) {
- db_query("UPDATE {system} SET status = %d WHERE filename = '$filename'", $status);
+ db_query("UPDATE {system} SET status = %d, throttle = %d WHERE filename = '$filename'", $status, $edit["throttle"]["$filename"]);
}
if ($edit["type"] == "theme") {
variable_set("theme_default", $edit["theme_default"]);
@@ -281,7 +281,7 @@ function system_listing($type, $directory, $required = array()) {
$files = system_dirscan($directory, "\.$type$");
// Extract current files from database.
- $result = db_query("SELECT filename, type, status FROM {system} WHERE type = '%s'", $type);
+ $result = db_query("SELECT filename, type, status, throttle FROM {system} WHERE type = '%s'", $type);
while ($file = db_fetch_object($result)) {
if (is_object($files[$file->filename])) {
foreach ($file as $key => $value) {
@@ -293,7 +293,9 @@ function system_listing($type, $directory, $required = array()) {
ksort($files);
if ($type == "module") {
- $header = array(t("name"), t("description"), t("status"));
+ $header = array(t("name"), t("description"), t("status"), t("throttle"));
+ // the throttle mechanism requires additional modules always be enabled
+ $throttle_required = array_merge($required, array("modules/statistics.module", "modules/throttle.module"));
}
else {
$header = array(t("name"), t("description"), t("enable"), t("default"));
@@ -326,10 +328,13 @@ function system_listing($type, $directory, $required = array()) {
// Update the contents of the system table:
db_query("DELETE FROM {system} WHERE filename = '%s' AND type = '%s'", $filename, $type);
- db_query("INSERT INTO {system} (name, description, type, filename, status, bootstrap) VALUES ('%s', '%s', '%s', '%s', %d, %d)", $info->name, $info->description, $type, $filename, $file->status, $bootstrap);
+ db_query("INSERT INTO {system} (name, description, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', %d, %d, %d)", $info->name, $info->description, $type, $filename, $file->status, $file->throttle, $bootstrap);
$row = array($info->name, $info->description, array("data" => (in_array($filename, $required) ? form_hidden("status][$filename", 1) . t("required") : form_checkbox("", "status][$filename", 1, $file->status)), "align" => "center"));
- if ($type == "theme") {
+ if ($type == "module") {
+ $row[] = array("data" => (in_array($filename, $throttle_required) ? form_hidden("throttle][$filename", 0) . t("required") : form_checkbox(NULL, "throttle][$filename", 1, $file->throttle, NULL, variable_get("throttle_enable", 0) ? NULL : array("disabled" => "disabled"))), "align" => "center");
+ }
+ else if ($type == "theme") {
$row[] = array("data" => form_radio("","theme_default",$info->name,(variable_get("theme_default",0) == $info->name) ? 1 : 0), "align" => "center");
}
$rows[] = $row;