Index: restricted_text.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/restricted_text/restricted_text.module,v
retrieving revision 1.3
diff -u -p -r1.3 restricted_text.module
--- restricted_text.module	14 Jan 2011 13:54:36 -0000	1.3
+++ restricted_text.module	19 Jan 2011 23:32:48 -0000
@@ -14,10 +14,10 @@
  */
 function restricted_text_filter_tips($delta, $format, $long = false) {
   if ($long) {
-    return "Restrict text from users by wrapping in [restrict] and [/restrict] tags. This will only allow authenticated users to see the text inside. If you wish to restrict by specific roles, you may user [restrict:roles=(some comma separated list of roles)]. Some modules may allow other restriction possibilities.";
+    return t("Restrict text from users by wrapping in [restrict] and [/restrict] tags. This will only allow authenticated users to see the text inside. If you wish to restrict by specific roles, you may user [restrict:roles=(some comma separated list of roles)]. Some modules may allow other restriction possibilities.");
   }
   else {
-    return "Restrict text from users by wrapping in [restrict] and [/restrict] tags.";
+    return t("Restrict text from users by wrapping in [restrict] and [/restrict] tags.");
   }
 }
 
@@ -122,13 +122,8 @@ function _restricted_text_replace_callba
   // the array down to a single boolean value: is the user allowed to see
   // the text or not. The default is TRUE, so we seed our reduce with TRUE.
   $reduced = array_reduce($allowed, '_restricted_text_reduce_callback', TRUE);
-  
-  if ($reduced) {
-    return $m['interior'];
-  }
-  else {
-    return '';
-  }
+
+  return theme('restricted_text_format', $reduced, $m['key'], $m['params'], $m['interior']);
 }
 
 function _restricted_text_reduce_callback($accum, $new) {
@@ -181,3 +176,44 @@ function restricted_text_restricted_text
     return TRUE;
   }
 }
+
+/**
+* Implementation of hook_theme().
+*/
+function restricted_text_theme() {
+  return array(
+    'restricted_text_format' => array(
+      'arguments' => array('allowed' => true, 'key' => NULL, 'params' => NULL, 'interior' => NULL),
+    ),
+  );
+}
+
+/*
+* Override this in your theme file
+* Example function
+*function phptemplate_restricted_text_format($allowed, $key, $params, $interior) {
+*  if($allowed)
+*  {
+*    $param_exist = (count($params)>1?true:false);
+*    if(count($params) == 1)
+*      $param_exist = ($params[0]==''?false:true);
+*
+*    if($param_exist)
+*      $param_display = implode(',',$params);
+*    else
+*      $param_display = $key;
+*
+*    $restricted = t('Restricted');   
+*    return '<div style=background-color:#FFF4C8;><u>'.$restricted.': '.$param_display.'</u><br><i>'.$interior.'</i></div>';
+*  }
+*  else
+*    return '';
+*}
+*/
+function theme_restricted_text_format($allowed, $key, $params, $interior) {
+  if($allowed)
+    return $interior;
+  else
+    return '';
+}
+
