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/forum/forum.module | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'modules/forum') diff --git a/modules/forum/forum.module b/modules/forum/forum.module index bf3801e13..ced6cffb3 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -17,13 +17,13 @@ function forum_help($section) { $output .= '

'. t('Forums module requires Taxonomy and Comments module be enabled.') .'

'; $output .= t('

You can

-', array('%admin-forum' => url('admin/content/forum'), '%admin-modules' => url('admin/settings/modules'), '%admin-help-comment' => url('admin/help/comment'), '%admin-help-taxonomy' => url('admin/help/taxonomy'))); - $output .= '

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

'; +', array('@admin-forum' => url('admin/content/forum'), '@admin-modules' => url('admin/settings/modules'), '@admin-help-comment' => url('admin/help/comment'), '@admin-help-taxonomy' => url('admin/help/taxonomy'))); + $output .= '

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

'; return $output; case 'admin/settings/modules#description': return t('Enables threaded discussions about general topics.'); @@ -373,7 +373,7 @@ function forum_validate($node) { if (db_result(db_query('SELECT COUNT(*) FROM {term_data} WHERE tid = %d AND vid = %d', $term, $vocabulary))) { if (in_array($term, $containers)) { $term = taxonomy_get_term($term); - form_set_error('taxonomy', t('The item %forum is only a container for forums. Please select one of the forums below it.', array('%forum' => theme('placeholder', $term->name)))); + form_set_error('taxonomy', t('The item %forum is only a container for forums. Please select one of the forums below it.', array('%forum' => $term->name))); } } } @@ -547,10 +547,10 @@ function forum_form_submit($form_id, $form_values) { $containers[] = $form_values['tid']; variable_set('forum_containers', $containers); } - drupal_set_message(t('Created new %type %term.', array('%term' => theme('placeholder', $form_values['name']), '%type' => $type))); + drupal_set_message(t('Created new @type %term.', array('%term' => $form_values['name'], '@type' => $type))); break; case SAVED_UPDATED: - drupal_set_message(t('The %type %term has been updated.', array('%term' => theme('placeholder', $form_values['name']), '%type' => $type))); + drupal_set_message(t('The @type %term has been updated.', array('%term' => $form_values['name'], '@type' => $type))); break; } return 'admin/content/forum'; @@ -567,7 +567,7 @@ function _forum_confirm_delete($tid) { $form['tid'] = array('#type' => 'value', '#value' => $tid); $form['name'] = array('#type' => 'value', '#value' => $term->name); - return confirm_form('forum_confirm_delete', $form, t('Are you sure you want to delete the forum %name?', array('%name' => theme('placeholder', $term->name))), 'admin/content/forums', t('Deleting a forum or container will delete all sub-forums and associated posts as well. This action cannot be undone.'), t('Delete'), t('Cancel')); + return confirm_form('forum_confirm_delete', $form, t('Are you sure you want to delete the forum %name?', array('%name' => $term->name)), 'admin/content/forums', t('Deleting a forum or container will delete all sub-forums and associated posts as well. This action cannot be undone.'), t('Delete'), t('Cancel')); } /** @@ -575,8 +575,8 @@ function _forum_confirm_delete($tid) { */ function forum_confirm_delete_submit($form_id, $form_values) { taxonomy_del_term($form_values['tid']); - drupal_set_message(t('The forum %term and all sub-forums and associated posts have been deleted.', array('%term' => theme('placeholder', $form_values['name'])))); - watchdog('content', t('forum: deleted %term and all its sub-forums and associated posts.', array('%term' => theme('placeholder', $form_values['name'])))); + drupal_set_message(t('The forum %term and all sub-forums and associated posts have been deleted.', array('%term' => $form_values['name']))); + watchdog('content', t('forum: deleted %term and all its sub-forums and associated posts.', array('%term' => $form_values['name']))); return 'admin/content/forum'; } @@ -600,7 +600,7 @@ function forum_overview() { } } else { - $rows[] = array(array('data' => '' . t('There are no existing containers or forums. You may add some on the add container or add forum pages.', array('%container' => url('admin/content/forum/add/container'), '%forum' => url('admin/content/forum/add/forum'))) . '', 'colspan' => 2)); + $rows[] = array(array('data' => '' . t('There are no existing containers or forums. You may add some on the add container or add forum pages.', array('@container' => url('admin/content/forum/add/container'), '@forum' => url('admin/content/forum/add/forum'))) . '', 'colspan' => 2)); } return theme('table', $header, $rows); } @@ -692,7 +692,7 @@ function _forum_get_vid() { */ function _forum_format($topic) { if ($topic && $topic->timestamp) { - return t('%time ago
by %author', array('%time' => format_interval(time() - $topic->timestamp), '%author' => theme('username', $topic))); + return t('@time ago
by !author', array('@time' => format_interval(time() - $topic->timestamp), '!author' => theme('username', $topic))); } else { return t('n/a'); @@ -920,7 +920,7 @@ function theme_forum_display($forums, $topics, $parents, $tid, $sortby, $forum_p $output .= '
  • '. t('You are not allowed to post a new forum topic.') .'
  • '; } else { - $output .= '
  • '. t('Login to post a new forum topic.', array('%login' => url('user/login'))) .'
  • '; + $output .= '
  • '. t('Login to post a new forum topic.', array('@login' => url('user/login'))) .'
  • '; } $output .= ''; @@ -986,7 +986,7 @@ function theme_forum_list($forums, $parents, $tid) { $rows[] = array( array('data' => $description, 'class' => 'forum'), - array('data' => $forum->num_topics . ($new_topics ? '
    '. l(format_plural($new_topics, '1 new', '%count new'), "forum/$forum->tid", NULL, NULL, 'new') : ''), 'class' => 'topics'), + array('data' => $forum->num_topics . ($new_topics ? '
    '. l(format_plural($new_topics, '1 new', '@count new'), "forum/$forum->tid", NULL, NULL, 'new') : ''), 'class' => 'topics'), array('data' => $forum->num_posts, 'class' => 'posts'), array('data' => _forum_format($forum->last_post), 'class' => 'last-reply')); } @@ -1021,7 +1021,7 @@ function theme_forum_topic_list($tid, $topics, $sortby, $forum_per_page) { $rows[] = array( array('data' => theme('forum_icon', $topic->new, $topic->num_comments, $topic->comment_mode, $topic->sticky), 'class' => 'icon'), array('data' => l($topic->title, "node/$topic->nid"), 'class' => 'topic'), - array('data' => $topic->num_comments . ($topic->new_replies ? '
    '. l(format_plural($topic->new_replies, '1 new', '%count new'), "node/$topic->nid", NULL, NULL, 'new') : ''), 'class' => 'replies'), + array('data' => $topic->num_comments . ($topic->new_replies ? '
    '. l(format_plural($topic->new_replies, '1 new', '@count new'), "node/$topic->nid", NULL, NULL, 'new') : ''), 'class' => 'replies'), array('data' => _forum_format($topic), 'class' => 'created'), array('data' => _forum_format($topic->last_reply), 'class' => 'last-reply') ); -- cgit v1.2.3