summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-10-23 00:45:51 +0000
committerDries Buytaert <dries@buytaert.net>2009-10-23 00:45:51 +0000
commit566586a698c6712cdf95ee42983df77420fcc622 (patch)
tree0be32fa89d01f1fbff44620b46711eac43fd55e6
parent891512c22912527d54f29fe30ef9f3be110746a3 (diff)
downloadbrdo-566586a698c6712cdf95ee42983df77420fcc622.tar.gz
brdo-566586a698c6712cdf95ee42983df77420fcc622.tar.bz2
- Patch #608478 by seutje, Bojhan: replace 'Powered by' icon with text.
-rw-r--r--modules/system/system.module48
-rw-r--r--modules/system/system.test4
2 files changed, 5 insertions, 47 deletions
diff --git a/modules/system/system.module b/modules/system/system.module
index 5fb04db43..f67500a3d 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -199,7 +199,7 @@ function system_theme() {
'file' => 'system.admin.inc',
),
'system_powered_by' => array(
- 'arguments' => array('image_path' => NULL),
+ 'arguments' => NULL,
),
'meta_generator_html' => array(
'arguments' => array('version' => NULL),
@@ -1753,46 +1753,6 @@ function system_block_info() {
}
/**
- * Implement hook_block_configure().
- */
-function system_block_configure($delta = '') {
- if ($delta == 'powered-by') {
- $image_path = 'misc/' . variable_get('drupal_badge_color', 'powered-blue') . '-' . variable_get('drupal_badge_size', '80x15') . '.png';
- drupal_add_js(drupal_get_path('module', 'system') . '/system.js');
- // Compile a list of fields to show
- $form['wrapper']['color'] = array(
- '#type' => 'select',
- '#title' => t('Badge color'),
- '#default_value' => variable_get('drupal_badge_color', 'powered-blue'),
- '#options' => array('powered-black' => t('Black'), 'powered-blue' => t('Blue'), 'powered-gray' => t('Gray')),
- );
- $form['wrapper']['size'] = array(
- '#type' => 'select',
- '#title' => t('Badge size'),
- '#default_value' => variable_get('drupal_badge_size', '80x15'),
- '#options' => array('80x15' => t('Small'), '88x31' => t('Medium'), '135x42' => t('Large')),
- );
- $form['wrapper']['preview'] = array(
- '#type' => 'item',
- '#title' => 'Preview',
- '#markup' => theme('image', array('path' => $image_path, 'alt' => t('Powered by Drupal, an open source content management system'), 'title' => t('Powered by Drupal, an open source content management system'), 'attributes' => array('class' => array('powered-by-preview')), 'getsize' => FALSE)),
- );
- return $form;
- }
-}
-
-/**
- * Implement hook_block_save().
- */
-function system_block_save($delta = '', $edit = NULL) {
- if ($delta == 'powered-by') {
- $image_path = 'misc/' . variable_get('drupal_badge_color', 'powered-blue') . '-' . variable_get('drupal_badge_size', '80x15') . '.png';
- variable_set('drupal_badge_color', $edit['color']);
- variable_set('drupal_badge_size', $edit['size']);
- }
-}
-
-/**
* Implement hook_block_view().
*
* Generate a block with a promotional link to Drupal.org and
@@ -1806,9 +1766,8 @@ function system_block_view($delta = '') {
$block['content'] = drupal_set_page_content();
return $block;
case 'powered-by':
- $image_path = 'misc/' . variable_get('drupal_badge_color', 'powered-blue') . '-' . variable_get('drupal_badge_size', '80x15') . '.png';
$block['subject'] = NULL;
- $block['content'] = theme('system_powered_by', array('image_path' => $image_path));
+ $block['content'] = theme('system_powered_by');
return $block;
case 'help':
$block['subject'] = NULL;
@@ -2910,8 +2869,7 @@ function system_timezone($abbreviation = '', $offset = -1, $is_daylight_saving_t
* @ingroup themeable
*/
function theme_system_powered_by($variables) {
- $image = theme('image', array('path' => $variables['image_path'], 'alt' => t('Powered by Drupal, an open source content management system'), 'title' => t('Powered by Drupal, an open source content management system')));
- return l($image, 'http://drupal.org', array('html' => TRUE, 'absolute' => TRUE, 'external' => TRUE));
+ return '<span>' . t('Powered by <a href="@poweredby">Drupal</a>', array('@poweredby' => 'http://drupal.org')) . '</span>';
}
/**
diff --git a/modules/system/system.test b/modules/system/system.test
index 3f66d677b..f8fcaa043 100644
--- a/modules/system/system.test
+++ b/modules/system/system.test
@@ -972,7 +972,7 @@ class SystemBlockTestCase extends DrupalWebTestCase {
*/
function testPoweredByBlock() {
// Set block title and some settings to confirm that the interface is availble.
- $this->drupalPost('admin/structure/block/manage/system/powered-by/configure', array('title' => $this->randomName(8), 'color' => 'powered-black', 'size' => '135x42'), t('Save block'));
+ $this->drupalPost('admin/structure/block/manage/system/powered-by/configure', array('title' => $this->randomName(8)), t('Save block'));
$this->assertText(t('The block configuration has been saved.'), t('Block configuration set.'));
// Set the powered-by block to the footer region.
@@ -997,7 +997,7 @@ class SystemBlockTestCase extends DrupalWebTestCase {
$edit = array();
$edit['system_powered-by[region]'] = 'footer';
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
- $this->drupalPost('admin/structure/block/manage/system/powered-by/configure', array('title' => '', 'color' => 'powered-blue', 'size' => '80x15'), t('Save block'));
+ $this->drupalPost('admin/structure/block/manage/system/powered-by/configure', array('title' => ''), t('Save block'));
}
}