mirror of
https://github.com/pluginsGLPI/example.git
synced 2025-05-04 18:08:42 +02:00
[examples] add to plugin_get_headings
git-svn-id: https://forge.glpi-project.org/svn/example/trunk@72 349b9182-4a13-0410-896f-e5e9767dd1b3
This commit is contained in:
parent
7e2c61a7b4
commit
dc2dc419a2
24
hook.php
24
hook.php
@ -516,17 +516,28 @@ function plugin_display_planning_example($parm){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Define headings added by the plugin
|
// Define headings added by the plugin
|
||||||
function plugin_get_headings_example($type,$withtemplate){
|
function plugin_get_headings_example($type,$ID,$withtemplate){
|
||||||
switch ($type){
|
switch ($type){
|
||||||
case COMPUTER_TYPE :
|
case PROFILE_TYPE:
|
||||||
// template case
|
$prof = new Profile();
|
||||||
if ($withtemplate)
|
if ($ID>0 && $prof->getFromDB($ID) && $prof->fields['interface']=='central') {
|
||||||
|
return array(
|
||||||
|
1 => "Test PLugin",
|
||||||
|
);
|
||||||
|
} else {
|
||||||
return array();
|
return array();
|
||||||
// Non template case
|
}
|
||||||
else
|
break;
|
||||||
|
case COMPUTER_TYPE :
|
||||||
|
// new object / template case
|
||||||
|
if ($withtemplate) {
|
||||||
|
return array();
|
||||||
|
// Non template case / editing an existing object
|
||||||
|
} else {
|
||||||
return array(
|
return array(
|
||||||
1 => "Test PLugin",
|
1 => "Test PLugin",
|
||||||
);
|
);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ENTERPRISE_TYPE :
|
case ENTERPRISE_TYPE :
|
||||||
return array(
|
return array(
|
||||||
@ -553,6 +564,7 @@ function plugin_get_headings_example($type,$withtemplate){
|
|||||||
function plugin_headings_actions_example($type){
|
function plugin_headings_actions_example($type){
|
||||||
|
|
||||||
switch ($type){
|
switch ($type){
|
||||||
|
case PROFILE_TYPE :
|
||||||
case COMPUTER_TYPE :
|
case COMPUTER_TYPE :
|
||||||
return array(
|
return array(
|
||||||
1 => "plugin_headings_example",
|
1 => "plugin_headings_example",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user