summaryrefslogtreecommitdiff
path: root/modules/system
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system')
-rw-r--r--modules/system/system.module17
1 files changed, 11 insertions, 6 deletions
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;