Customizing Tips¶
The entire FOSSology user interface is controlled by a collection of plug-ins. A beautiful thing about open source is that you are free to
customize and add plugins to suite your needs. Modifying just a few plug-ins will really help you to integrate FOSSology into your work environment. To do so, go to the plug-in directory at your installation. This might be in /usr/share/fossology/www/plugins and get ready to modify some code. BTW, PHP or HTML experience is a plus for this.
Page Titles¶
When you first log-in with your browser to a new FOSSology installation, you will see something like
This page is displayed by a plug-in called ui-default.php. Let's say you want to change the title, "Welcome to FOSSology" to "The Cat's Meow - License Scanner". Simply change $Title in ui-default.php from:
class ui_default extends FO_Plugin
{
var $Name = "Default";
var $Title = "Welcome to FOSSology";
var $Version = "2.0";
var $MenuList = "";
to
class ui_default extends FO_Plugin
{
var $Name = "Default";
var $Title = "The Cat's Meow - License Scanner";
var $Version = "2.0";
var $MenuList = "";
Save it, reload the page in your browser, and you should see:
This is how you change any plug-in page title. Pretty easy, huh?
Look at the rest of ui_default.php and you will see the rest of the text on this page. That's how you customize the rest of page.
System Configuration Variables¶
Some System configuration variables are now available from the Admin user interface. These include: * Logo * Support email * Banner message
Help¶
If you want to get fancier than the configuration user interface you can create your own Help > Support link in the top menu.
In this example, let's just create a new plug-in called "Who to call", that will appear inside your Help menu. Here is the default menu with our new logo:
To create a new simple quick and easy plug-in, let's start with a generic plug-in template. I ususally do this by copying one plug-in and removing the stuff I don't want. In this case I copied ui-about.php to ui-whotocall.php since ui-about.php is already in the help menu. Here is my new plug-in:
global $GlobalReady;
if (!isset($GlobalReady)) { exit; }
class ui_whotocall extends FO_Plugin
{
var $Name = "Who_to_Call"; // this is used for the URL
var $Title = "Who to Call"; // Title displayed on the page
var $Version = "1.0";
var $MenuList = "Help::Who to Call"; // put Who to Call in the Help menu
var $DBaccess = PLUGIN_DB_NONE;
var $LoginFlag = 0;
var $MyText = "Call Jack or Jill at extension 5678 if you need help with this applic
ation";
function Output()
{
if ($this->State != PLUGIN_STATE_READY) { return; }
$V="";
switch($this->OutputType)
{
case "XML":
$V .= "<text>$this->MyText</text>\n";
break;
case "HTML":
$V .="<h3>Need help?</h3>";
$V .= "$this->MyText";
break;
case "Text":
default:
$V .= $this->MyText;
}
if (!$this->OutputToStdout) { return($V); }
print($V);
return;
}
};
$NewPlugin = new ui_whotocall;
$NewPlugin->Initialize();
?>
Here is the new Help menu with our new //Who to Call// menu choice:
And when you click on //Who to Call// you will see your our new screen:
More about plugins¶
You can learn more about creating plug-ins at our page on
how to write agents and plugins.