|
Awesome!
Reviewed by sadek (06/08/2007)
I love the fact that it's upgrade safe, and really simple.
The suggested change to the ./modules/Employees/Utilities.php will allow individuals to turn off the feature by passing &disableSmartTitleBar=false to the end of the url
<?php
class Utilities {
function ChangeTitleBar(&$bean, $event, $arguments) {
global $current_user;
if(isset($_REQUEST['disableSmartTitleBar']) && $_REQUEST['disableSmartTitleBar'] == 'false'){
$current_user->setPreference('disableSmartTitleBar', true);
}
if($current_user->getPreference('disableSmartTitleBar') == true){
return;
}
global $mod_strings;
global $app_strings;
global $sugar_config;
//if there is nothing in the buffer then don't do anything
//for some reason the program runs this hook twice, once before anything is rendered
//and once after the page rendering has begun.
if(ob_get_length()>0 && $_REQUEST['module']==$bean->module_dir) {
//Ok if this is the second go around then insert this javascript code
echo "\n\n<SCRIPT LANGUAGE=\"JavaScript\">\n";
echo "<!-- Hide this from older browsers\n";
echo "document.title = '(".$mod_strings['LBL_MODULE_NAME']." - ".$bean->name.") - ".$app_strings['LBL_BROWSER_TITLE']."';\n";
echo "// end hide -->\n";
echo "</SCRIPT>\n\n";
}
}
}
?>
|