summaryrefslogtreecommitdiff
path: root/modules/node/node.admin.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-07-19 19:04:24 +0000
committerDries Buytaert <dries@buytaert.net>2008-07-19 19:04:24 +0000
commit892d001d7ad66dc51ce72f29fb20205f5b9d4327 (patch)
tree58df192fe0c95b155cdad90c349d82446a380ffc /modules/node/node.admin.inc
parent0c6014a0cc2d9aba602ab9ad963e5fcd5958f358 (diff)
downloadbrdo-892d001d7ad66dc51ce72f29fb20205f5b9d4327.tar.gz
brdo-892d001d7ad66dc51ce72f29fb20205f5b9d4327.tar.bz2
- Patch #279620 by zeta ζ: made it easier to translate the teaser settings.
Diffstat (limited to 'modules/node/node.admin.inc')
-rw-r--r--modules/node/node.admin.inc21
1 files changed, 8 insertions, 13 deletions
diff --git a/modules/node/node.admin.inc b/modules/node/node.admin.inc
index 201e6b4ca..6100a9193 100644
--- a/modules/node/node.admin.inc
+++ b/modules/node/node.admin.inc
@@ -35,19 +35,7 @@ function node_configure() {
);
$form['teaser_length'] = array(
'#type' => 'select', '#title' => t('Length of trimmed posts'), '#default_value' => variable_get('teaser_length', 600),
- '#options' => array(
- 0 => t('Unlimited'),
- 200 => t('200 characters'),
- 400 => t('400 characters'),
- 600 => t('600 characters'),
- 800 => t('800 characters'),
- 1000 => t('1000 characters'),
- 1200 => t('1200 characters'),
- 1400 => t('1400 characters'),
- 1600 => t('1600 characters'),
- 1800 => t('1800 characters'),
- 2000 => t('2000 characters'),
- ),
+ '#options' => drupal_map_assoc(array(0, 200, 400, 600, 800, 1000, 1200, 1400, 1600, 1800, 2000), '_node_characters'),
'#description' => t("The maximum number of characters used in the trimmed version of a post. Drupal will use this setting to determine at which offset long posts should be trimmed. The trimmed version of a post is typically used as a teaser when displaying the post on the main page, in XML feeds, etc. To disable teasers, set to 'Unlimited' . Note that this setting will only affect new or updated content and will not affect existing teasers.")
);
@@ -65,6 +53,13 @@ function node_configure() {
}
/**
+ * Helper function for teaser length choices.
+ */
+function _node_characters($length) {
+ return ($length == 0) ? t('Unlimited') : format_plural($length, '1 character', '@count characters');
+}
+
+/**
* Form validate callback.
*/
function node_configure_validate($form, &$form_state) {