mirror of
https://github.com/pluginsGLPI/example.git
synced 2025-05-04 18:08:42 +02:00
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:
parent
aa2a81f1b5
commit
2c9d41dda2
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -47,7 +47,8 @@ function plugin_init_example() {
|
|||||||
Plugin::registerClass('PluginExampleDropdown');
|
Plugin::registerClass('PluginExampleDropdown');
|
||||||
|
|
||||||
Plugin::registerClass('PluginExampleExample',
|
Plugin::registerClass('PluginExampleExample',
|
||||||
array('notificationtemplates_types' => true));
|
array('notificationtemplates_types' => true,
|
||||||
|
'addtabon' => array('Phone')));
|
||||||
|
|
||||||
Plugin::registerClass('PluginExampleRuleTestCollection',
|
Plugin::registerClass('PluginExampleRuleTestCollection',
|
||||||
array('rulecollections_types' => true));
|
array('rulecollections_types' => true));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user