From 76151a8bc900ebb38c76170283a05df791311f76 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 16 Apr 2008 11:35:52 +0000 Subject: - Patch #245504 by catch, David_Rothstein, Freso, et al: removed the throttle module from Drupal core. --- modules/block/block-admin-display-form.tpl.php | 12 ++------ modules/block/block.admin.inc | 9 +----- modules/block/block.install | 7 ----- modules/block/block.module | 39 ++++++++++---------------- modules/statistics/statistics.module | 2 +- modules/system/system.admin.inc | 33 ---------------------- modules/system/system.install | 22 ++++++++++----- modules/system/system.module | 14 ++++----- 8 files changed, 39 insertions(+), 99 deletions(-) (limited to 'modules') diff --git a/modules/block/block-admin-display-form.tpl.php b/modules/block/block-admin-display-form.tpl.php index 369d09346..5e45ca3f3 100644 --- a/modules/block/block-admin-display-form.tpl.php +++ b/modules/block/block-admin-display-form.tpl.php @@ -9,7 +9,6 @@ * - $block_regions: An array of regions. Keyed by name with the title as value. * - $block_listing: An array of blocks keyed by region and then delta. * - $form_submit: Form submit button. - * - $throttle: TRUE or FALSE depending on throttle module being enabled. * * Each $block_listing[$region] contains an array of blocks for that region. * @@ -18,7 +17,6 @@ * - $data->block_title: Block title. * - $data->region_select: Drop-down menu for assigning a region. * - $data->weight_select: Drop-down menu for setting weights. - * - $data->throttle_check: Checkbox to enable throttling. * - $data->configure_link: Block configuration link. * - $data->delete_link: For deleting user added blocks. * @@ -41,9 +39,6 @@ - - - @@ -51,19 +46,16 @@ $title): ?> - + - + $data): ?> block_title; ?> region_select; ?> weight_select; ?> - - throttle_check; ?> - configure_link; ?> delete_link; ?> diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc index ab125d792..2c53c998c 100644 --- a/modules/block/block.admin.inc +++ b/modules/block/block.admin.inc @@ -35,7 +35,6 @@ function block_admin_display_form(&$form_state, $blocks, $theme = NULL) { $custom_theme = isset($theme) ? $theme : variable_get('theme_default', 'garland'); init_theme(); - $throttle = module_exists('throttle'); $block_regions = system_region_list($theme_key) + array(BLOCK_REGION_NONE => '<' . t('none') . '>'); // Build form tree @@ -70,10 +69,6 @@ function block_admin_display_form(&$form_state, $blocks, $theme = NULL) { '#default_value' => $block['region'], '#options' => $block_regions, ); - - if ($throttle) { - $form[$key]['throttle'] = array('#type' => 'checkbox', '#default_value' => isset($block['throttle']) ? $block['throttle'] : FALSE); - } $form[$key]['configure'] = array('#value' => l(t('configure'), 'admin/build/block/configure/' . $block['module'] . '/' . $block['delta'])); if ($block['module'] == 'block') { $form[$key]['delete'] = array('#value' => l(t('delete'), 'admin/build/block/delete/' . $block['delta'])); @@ -95,7 +90,7 @@ function block_admin_display_form_submit($form, &$form_state) { foreach ($form_state['values'] as $block) { $block['status'] = $block['region'] != BLOCK_REGION_NONE; $block['region'] = $block['status'] ? $block['region'] : ''; - db_query("UPDATE {blocks} SET status = %d, weight = %d, region = '%s', throttle = %d WHERE module = '%s' AND delta = '%s' AND theme = '%s'", $block['status'], $block['weight'], $block['region'], isset($block['throttle']) ? $block['throttle'] : 0, $block['module'], $block['delta'], $block['theme']); + db_query("UPDATE {blocks} SET status = %d, weight = %d, region = '%s' WHERE module = '%s' AND delta = '%s' AND theme = '%s'", $block['status'], $block['weight'], $block['region'], $block['module'], $block['delta'], $block['theme']); } drupal_set_message(t('The block settings have been updated.')); cache_clear_all(); @@ -354,7 +349,6 @@ function template_preprocess_block_admin_display_form(&$variables) { global $theme_key; $block_regions = system_region_list($theme_key); - $variables['throttle'] = module_exists('throttle'); $variables['block_regions'] = $block_regions + array(BLOCK_REGION_NONE => t('Disabled')); foreach ($block_regions as $key => $value) { @@ -386,7 +380,6 @@ function template_preprocess_block_admin_display_form(&$variables) { $variables['block_listing'][$region][$i]->block_title = drupal_render($block['info']); $variables['block_listing'][$region][$i]->region_select = drupal_render($block['region']) . drupal_render($block['theme']); $variables['block_listing'][$region][$i]->weight_select = drupal_render($block['weight']); - $variables['block_listing'][$region][$i]->throttle_check = $variables['throttle'] ? drupal_render($block['throttle']) : ''; $variables['block_listing'][$region][$i]->configure_link = drupal_render($block['configure']); $variables['block_listing'][$region][$i]->delete_link = !empty($block['delete']) ? drupal_render($block['delete']) : ''; $variables['block_listing'][$region][$i]->printed = FALSE; diff --git a/modules/block/block.install b/modules/block/block.install index 83bc7b8d1..23cb8f30e 100644 --- a/modules/block/block.install +++ b/modules/block/block.install @@ -62,13 +62,6 @@ function block_schema() { 'size' => 'tiny', 'description' => t('Flag to indicate how users may control visibility of the block. (0 = Users cannot control, 1 = On by default, but can be hidden, 2 = Hidden by default, but can be shown)'), ), - 'throttle' => array( - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - 'size' => 'tiny', - 'description' => t('Flag to indicate whether or not to remove block when website traffic is high. (1 = throttle, 0 = do not throttle)'), - ), 'visibility' => array( 'type' => 'int', 'not null' => TRUE, diff --git a/modules/block/block.module b/modules/block/block.module index c6e9ebd0b..3d4a94450 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -72,7 +72,6 @@ function block_help($path, $arg) { $output .= '

' . t('When working with blocks, remember that:') . '

'; $output .= '