In function _restricted_text_replace_callback the following code:
if ($reduced) {
return $interior;
}
else {
return '';
}
becomes:
if ($reduced) {
$formatted_restricted_text = theme('restricted_text_format', $m['key'], $m['params'], $m['interior']);
return $formatted_restricted_text;
}
else {
return '';
}
plus the following functions:
/**
* Implementation of hook_theme().
*/
function restricted_text_theme() {
return array(
'restricted_text_format' => array(
'arguments' => array('key' => NULL, 'params' => NULL, 'interior' => NULL),
),
);
}
function theme_restricted_text_format($key, $params, $interior) {
return $interior;
}
From my own custom module (or template)
function phptemplate_restricted_text_format($key, $params, $interior) {
return '<div style=background-color:#FFF4C8;><u>'.t('Restricted').': '.$key.'</u><br><i>'.$interior.'</i></div>';
}
You need to clear the cache to see it in effect. See http://drupal.org/node/173880
To clear the theme registry, do one of the following things:
>> On the "Administer > Site configuration > Performance" page, click on the "Clear cached data" button.
>> With devel block enabled (comes with devel module), click the "Empty cache" link.
>> The API function drupal_rebuild_theme_registry.
Comments
Comment #1
udvranto commentedBetter yet. Let's put the entire formatting logic to the theming function:
In function _restricted_text_replace_callback the following code:
Becomes:
From my own custom module (or template)
You need to clear the cache to see it in effect. See http://drupal.org/node/173880
To clear the theme registry, do one of the following things:
>> On the "Administer > Site configuration > Performance" page, click on the "Clear cached data" button.
>> With devel block enabled (comes with devel module), click the "Empty cache" link.
>> The API function drupal_rebuild_theme_registry.
Comment #2
udvranto commentedPatch
Comment #3
pukku commented