standard tab added from plugin, "Proof Of Concept", to be discussed (see glpi r15253)

git-svn-id: https://forge.glpi-project.org/svn/example/trunk@162 349b9182-4a13-0410-896f-e5e9767dd1b3
This commit is contained in:
remicollet
2011-08-08 09:16:59 +00:00
parent aa2a81f1b5
commit 2c9d41dda2
2 changed files with 27 additions and 1 deletions

View File

@ -137,6 +137,31 @@ class PluginExampleExample extends CommonDBTM {
}
function getTabNameForItem(CommonGLPI $item) {
global $LANG;
Toolbox::logDebug('getTabNameForItem', $item);
if ($item->getID()) {
switch ($item->getType()) {
case 'Phone' :
if ($_SESSION['glpishow_count_on_tabs']) {
return self::createTabEntry('Example',
countElementsInTable($this->getTable()));
}
return 'Example';
}
}
return '';
}
static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) {
if ($item->getType()=='Phone') {
echo "Plugin Example on Phone";
}
return true;
}
}
?>