From 81938a3cdc7b9bd13d58e355c59d9835e830fea4 Mon Sep 17 00:00:00 2001 From: Steven Wittens Date: Fri, 18 Aug 2006 12:17:00 +0000 Subject: #76802: Introduce placeholder magic into t() See: http://drupal.org/node/64279#t-placeholders --- modules/upload/upload.module | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'modules/upload') diff --git a/modules/upload/upload.module b/modules/upload/upload.module index 55f12f7f2..bf1a130eb 100644 --- a/modules/upload/upload.module +++ b/modules/upload/upload.module @@ -17,17 +17,17 @@ function upload_help($section) { $output .= '

'. t('Users with the upload files permission can upload attachments. You can choose which post types can take attachments on the content types settings page. Each user role can be customized for the file size of uploads, and the dimension of image files.') .'

'; $output .= t('

You can

-', array('%admin-access' => url('admin/user/access'), '%admin-content-types' => url('admin/settings/types'), '%admin-upload' => url('admin/settings/upload'))); - $output .= '

'. t('For more information please read the configuration and customization handbook Upload page.', array('%upload' => 'http://drupal.org/handbook/modules/upload/')) .'

'; +', array('@admin-access' => url('admin/user/access'), '@admin-content-types' => url('admin/settings/types'), '@admin-upload' => url('admin/settings/upload'))); + $output .= '

'. t('For more information please read the configuration and customization handbook Upload page.', array('@upload' => 'http://drupal.org/handbook/modules/upload/')) .'

'; return $output; case 'admin/settings/modules#description': return t('Allows users to upload and attach files to content.'); case 'admin/settings/upload': - return t('

Users with the upload files permission can upload attachments. Users with the view uploaded files permission can view uploaded attachments. You can choose which post types can take attachments on the content types settings page.

', array('%permissions' => url('admin/user/access'), '%types' => url('admin/settings/types'))); + return t('

Users with the upload files permission can upload attachments. Users with the view uploaded files permission can view uploaded attachments. You can choose which post types can take attachments on the content types settings page.

', array('@permissions' => url('admin/user/access'), '@types' => url('admin/settings/types'))); } } @@ -54,7 +54,7 @@ function upload_link($type, $node = NULL, $teaser = FALSE) { } if ($num_files) { $links['upload_attachments'] = array( - 'title' => format_plural($num_files, '1 attachment', '%count attachments'), + 'title' => format_plural($num_files, '1 attachment', '@count attachments'), 'href' => "node/$node->nid", 'attributes' => array('title' => t('Read full article to view attachments.')), 'fragment' => 'attachments' @@ -223,7 +223,7 @@ function upload_admin_settings() { foreach ($roles as $rid => $role) { $form['settings_role_'. $rid] = array( '#type' => 'fieldset', - '#title' => t('Settings for %role', array('%role' => theme('placeholder', $role))), + '#title' => t('Settings for %role', array('%role' => $role)), '#collapsible' => TRUE, '#collapsed' => TRUE, ); @@ -434,19 +434,19 @@ function _upload_validate(&$node) { $user_roles = count($user->roles); $valid = TRUE; if ($error['extension'] == $user_roles) { - form_set_error('upload', t('The selected file %name can not be attached to this post, because it is only possible to attach files with the following extensions: %files-allowed.', array('%name' => theme('placeholder', $file->filename), '%files-allowed' => theme('placeholder', $extensions)))); + form_set_error('upload', t('The selected file %name can not be attached to this post, because it is only possible to attach files with the following extensions: %files-allowed.', array('%name' => $file->filename, '%files-allowed' => $extensions))); $valid = FALSE; } elseif ($error['uploadsize'] == $user_roles) { - form_set_error('upload', t('The selected file %name can not be attached to this post, because it exceeded the maximum filesize of %maxsize.', array('%name' => theme('placeholder', $file->filename), '%maxsize' => theme('placeholder', format_size($uploadsize))))); + form_set_error('upload', t('The selected file %name can not be attached to this post, because it exceeded the maximum filesize of %maxsize.', array('%name' => $file->filename, '%maxsize' => format_size($uploadsize)))); $valid = FALSE; } elseif ($error['usersize'] == $user_roles) { - form_set_error('upload', t('The selected file %name can not be attached to this post, because the disk quota of %quota has been reached.', array('%name' => theme('placeholder', $file->filename), '%quota' => theme('placeholder', format_size($usersize))))); + form_set_error('upload', t('The selected file %name can not be attached to this post, because the disk quota of %quota has been reached.', array('%name' => $file->filename, '%quota' => format_size($usersize)))); $valid = FALSE; } elseif (strlen($file->filename) > 255) { - form_set_error('upload', t('The selected file %name can not be attached to this post, because the filename is too long.', array('%name' => theme('placeholder', $file->filename)))); + form_set_error('upload', t('The selected file %name can not be attached to this post, because the filename is too long.', array('%name' => $file->filename))); $valid = FALSE; } @@ -533,7 +533,7 @@ function upload_nodeapi(&$node, $op, $teaser) { break; case 'search result': - return is_array($node->files) ? format_plural(count($node->files), '1 attachment', '%count attachments') : NULL; + return is_array($node->files) ? format_plural(count($node->files), '1 attachment', '@count attachments') : NULL; case 'rss item': if (is_array($node->files)) { @@ -859,7 +859,7 @@ function _upload_image($file) { $result = image_scale($file->filepath, $file->filepath, $width, $height); if ($result) { $file->filesize = filesize($file->filepath); - drupal_set_message(t('The image was resized to fit within the maximum allowed resolution of %resolution pixels.', array('%resolution' => theme('placeholder', variable_get('upload_max_resolution', 0))))); + drupal_set_message(t('The image was resized to fit within the maximum allowed resolution of %resolution pixels.', array('%resolution' => variable_get('upload_max_resolution', 0)))); } } } -- cgit v1.2.3