--- flag_content_old.module 2008-05-03 08:46:42.000000000 -0600 +++ flag_content_new.module 2008-05-29 18:23:38.250000000 -0600 @@ -13,6 +13,21 @@ define('FLAG_CONTENT_COMMENT', 'fla define('FLAG_CONTENT_TYPE_NODE', 'node'); define('FLAG_CONTENT_TYPE_USER', 'user'); define('FLAG_CONTENT_TYPE_COMMENT', 'comment'); +define('FLAG_CONTENT_TRANS_LINK', 'flag_content_trans_link'); + +/** + * Purpose: Returns an array of common translation placeholders + */ +function flag_content_translation() { + static $trans; + + if (!isset($trans)) { + $trans = array( + '!link' => variable_get(FLAG_CONTENT_TRANS_LINK, 'Report this page'), + ); + } + return $trans; +} function flag_content_help($section) { switch ($section) { @@ -100,6 +115,15 @@ function flag_content_admin_settings() { '#default_value' => variable_get(FLAG_CONTENT_COMMENT, 0), ); + $form['link'][FLAG_CONTENT_TRANS_LINK] = array( + '#type' => 'textfield', + '#title' => t('Link text'), + '#default_value' => variable_get(FLAG_CONTENT_TRANS_LINK, 'Report this page'), + '#description' => t('Phrase used in the hyperlink that users click to report an inappropriate post.'), + '#size' => 30, + '#maxlength' => 30, + ); + $form['email'][FLAG_CONTENT_EMAIL] = array( '#type' => 'textfield', '#title' => t('Email address'), @@ -196,7 +220,7 @@ function flag_content_link($type, $entry if (!_flag_content_check($eid, $type)) { // Not already flagged, flag it for admin $links['flag_content_add'] = array( - 'title' => t('report this page'), + 'title' => t('!link', flag_content_translation()), 'href' => "flag_content/add/$eid/$type", 'attributes' => array( 'class' => 'flag_content', @@ -287,7 +311,7 @@ function flag_content_add($eid = 0, $typ return confirm_form( $form, - t('Are you sure you want to flag the @type @title', array('@type' => $type_label, '@title' => $title)), + t('Are you sure you want to flag the @type "@title"', array('@type' => $type_label, '@title' => $title)) .'?', $_GET['destination'] ? $_GET['destination'] : $path, t(''), t('Flag'),