summaryrefslogtreecommitdiff
path: root/modules/block
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-11-06 23:24:33 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-11-06 23:24:33 +0000
commit926dff9fc9739e85085890e3e4e96e8551e51ff7 (patch)
tree1e29a11751e5cdd009affe59d052c9ee8d6b3b58 /modules/block
parent27e91f114532baf921d57bd86d5ccd56059ba7aa (diff)
downloadbrdo-926dff9fc9739e85085890e3e4e96e8551e51ff7.tar.gz
brdo-926dff9fc9739e85085890e3e4e96e8551e51ff7.tar.bz2
#601932 by David_Rothstein, carlos8f, yoroy, Bojhan, et al: Allow dashboard to limit available blocks.
Diffstat (limited to 'modules/block')
-rw-r--r--modules/block/block.admin.inc12
-rw-r--r--modules/block/block.api.php6
2 files changed, 17 insertions, 1 deletions
diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc
index 181f941ed..5902c20b3 100644
--- a/modules/block/block.admin.inc
+++ b/modules/block/block.admin.inc
@@ -291,6 +291,7 @@ function block_admin_configure($form, &$form_state, $module, $delta) {
);
$theme_default = variable_get('theme_default', 'bartik');
+ $admin_theme = variable_get('admin_theme');
foreach (list_themes() as $key => $theme) {
// Only display enabled themes
if ($theme->status) {
@@ -300,9 +301,18 @@ function block_admin_configure($form, &$form_state, $module, $delta) {
':theme' => $key,
))->fetchField();
+ // Use a meaningful title for the main site theme and administrative
+ // theme.
+ $theme_title = $theme->info['name'];
+ if ($key == $theme_default) {
+ $theme_title = t('!theme (default theme)', array('!theme' => $theme_title));
+ }
+ elseif ($admin_theme && $key == $admin_theme) {
+ $theme_title = t('!theme (administration theme)', array('!theme' => $theme_title));
+ }
$form['regions'][$key] = array(
'#type' => 'select',
- '#title' => $theme->info['name'],
+ '#title' => $theme_title,
'#default_value' => !empty($region) && $region != -1 ? $region : NULL,
'#empty_value' => BLOCK_REGION_NONE,
'#options' => system_region_list($key, REGIONS_VISIBLE),
diff --git a/modules/block/block.api.php b/modules/block/block.api.php
index e8a589742..9cc2f602e 100644
--- a/modules/block/block.api.php
+++ b/modules/block/block.api.php
@@ -57,6 +57,12 @@
* - DRUPAL_CACHE_GLOBAL: The block is the same for every user on every
* page where it is visible.
* - DRUPAL_NO_CACHE: The block should not get cached.
+ * - 'properties': (optional) Array of additional metadata to add to the
+ * block. Common properties include:
+ * - 'administrative': Boolean which categorizes this block as usable in
+ * an administrative context. This might include blocks which help an
+ * administrator approve/deny comments, or view recently created
+ * user accounts.
* - 'weight': (optional) Initial value for the ordering weight of this block.
* Most modules do not provide an initial value, and any value provided can
* be modified by a user on the block configuration screen.