diff --git a/inc/example.class.php b/inc/example.class.php index da686be..25b6334 100644 --- a/inc/example.class.php +++ b/inc/example.class.php @@ -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; + } } ?> diff --git a/setup.php b/setup.php index 5d17f59..460c053 100755 --- a/setup.php +++ b/setup.php @@ -47,7 +47,8 @@ function plugin_init_example() { Plugin::registerClass('PluginExampleDropdown'); Plugin::registerClass('PluginExampleExample', - array('notificationtemplates_types' => true)); + array('notificationtemplates_types' => true, + 'addtabon' => array('Phone'))); Plugin::registerClass('PluginExampleRuleTestCollection', array('rulecollections_types' => true));