mirror of
https://github.com/pluginsGLPI/example.git
synced 2025-05-04 18:08:42 +02:00
call functions (by Yllen)
git-svn-id: https://forge.glpi-project.org/svn/example/trunk@168 349b9182-4a13-0410-896f-e5e9767dd1b3
This commit is contained in:
parent
f5992289ab
commit
55992d0d94
@ -45,8 +45,8 @@ Session::checkRight("config", "w");
|
|||||||
// To be available when plugin in not activated
|
// To be available when plugin in not activated
|
||||||
Plugin::load('example');
|
Plugin::load('example');
|
||||||
|
|
||||||
commonHeader("TITRE",$_SERVER['PHP_SELF'],"config","plugins");
|
Html::header("TITRE",$_SERVER['PHP_SELF'],"config","plugins");
|
||||||
echo "This is the plugin config page<br>";
|
echo "This is the plugin config page<br>";
|
||||||
echo $LANG['plugin_example']["test"];
|
echo $LANG['plugin_example']["test"];
|
||||||
commonFooter();
|
Html::footer();
|
||||||
?>
|
?>
|
@ -37,9 +37,9 @@ define('GLPI_ROOT', '../../..');
|
|||||||
include (GLPI_ROOT . "/inc/includes.php");
|
include (GLPI_ROOT . "/inc/includes.php");
|
||||||
|
|
||||||
if ($_SESSION["glpiactiveprofile"]["interface"] == "central") {
|
if ($_SESSION["glpiactiveprofile"]["interface"] == "central") {
|
||||||
commonHeader("TITRE", $_SERVER['PHP_SELF'],"plugins","example","optionname");
|
Html::header("TITRE", $_SERVER['PHP_SELF'],"plugins","example","optionname");
|
||||||
} else {
|
} else {
|
||||||
helpHeader("TITRE", $_SERVER['PHP_SELF']);
|
Html::helpHeader("TITRE", $_SERVER['PHP_SELF']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -47,5 +47,5 @@ if ($_SESSION["glpiactiveprofile"]["interface"] == "central") {
|
|||||||
|
|
||||||
Search::show('PluginExampleExample');
|
Search::show('PluginExampleExample');
|
||||||
|
|
||||||
commonFooter();
|
Html::footer();
|
||||||
?>
|
?>
|
@ -40,23 +40,22 @@ if (isset($_GET["popup"])) {
|
|||||||
if (isset($_SESSION["glpipopup"]["name"])) {
|
if (isset($_SESSION["glpipopup"]["name"])) {
|
||||||
switch ($_SESSION["glpipopup"]["name"]) {
|
switch ($_SESSION["glpipopup"]["name"]) {
|
||||||
case "test_rule" :
|
case "test_rule" :
|
||||||
popHeader($LANG['buttons'][50],$_SERVER['PHP_SELF']);
|
Html::popHeader($LANG['buttons'][50],$_SERVER['PHP_SELF']);
|
||||||
include "../../../front/rule.test.php";
|
include "../../../front/rule.test.php";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "test_all_rules" :
|
case "test_all_rules" :
|
||||||
popHeader($LANG['rulesengine'][84],$_SERVER['PHP_SELF']);
|
Html::popHeader($LANG['rulesengine'][84],$_SERVER['PHP_SELF']);
|
||||||
include "../../../front/rulesengine.test.php";
|
include "../../../front/rulesengine.test.php";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "show_cache" :
|
case "show_cache" :
|
||||||
popHeader($LANG['rulesengine'][100],$_SERVER['PHP_SELF']);
|
Html::popHeader($LANG['rulesengine'][100],$_SERVER['PHP_SELF']);
|
||||||
include "../../../front/rule.cache.php";
|
include "../../../front/rule.cache.php";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
echo "<div class='center'><br><a href='javascript:window.close()'>".$LANG['buttons'][13]."</a>";
|
echo "<div class='center'><br><a href='javascript:window.close()'>".$LANG['buttons'][13]."</a>";
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
popFooter();
|
Html::popFooter();
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
4
hook.php
4
hook.php
@ -39,10 +39,10 @@
|
|||||||
function plugin_change_profile_example() {
|
function plugin_change_profile_example() {
|
||||||
|
|
||||||
// For example : same right of computer
|
// For example : same right of computer
|
||||||
if (haveRight('computer','w')) {
|
if (Session::haveRight('computer','w')) {
|
||||||
$_SESSION["glpi_plugin_example_profile"] = array('example' => 'w');
|
$_SESSION["glpi_plugin_example_profile"] = array('example' => 'w');
|
||||||
|
|
||||||
} else if (haveRight('computer','r')) {
|
} else if (Session::haveRight('computer','r')) {
|
||||||
$_SESSION["glpi_plugin_example_profile"] = array('example' => 'r');
|
$_SESSION["glpi_plugin_example_profile"] = array('example' => 'r');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -42,9 +42,9 @@ include (GLPI_ROOT . "/inc/includes.php");
|
|||||||
|
|
||||||
Session::checkRight("config", "w");
|
Session::checkRight("config", "w");
|
||||||
|
|
||||||
commonHeader("TITRE",$_SERVER['PHP_SELF'],"plugins");
|
Html::header("TITRE",$_SERVER['PHP_SELF'],"plugins");
|
||||||
|
|
||||||
echo "This is the plugin report page";
|
echo "This is the plugin report page";
|
||||||
|
|
||||||
commonFooter();
|
Html::footer();
|
||||||
?>
|
?>
|
@ -69,7 +69,7 @@ function plugin_init_example() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Config page
|
// Config page
|
||||||
if (haveRight('config','w')) {
|
if (Session::haveRight('config','w')) {
|
||||||
$PLUGIN_HOOKS['config_page']['example'] = 'config.php';
|
$PLUGIN_HOOKS['config_page']['example'] = 'config.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
stat.php
4
stat.php
@ -42,9 +42,9 @@ include (GLPI_ROOT . "/inc/includes.php");
|
|||||||
|
|
||||||
Session::checkRight("config", "w");
|
Session::checkRight("config", "w");
|
||||||
|
|
||||||
commonHeader("TITLE",$_SERVER['PHP_SELF'],"plugins");
|
Html::header("TITLE",$_SERVER['PHP_SELF'],"plugins");
|
||||||
|
|
||||||
echo "This is the plugin stat page";
|
echo "This is the plugin stat page";
|
||||||
|
|
||||||
commonFooter();
|
Html::footer();
|
||||||
?>
|
?>
|
Loading…
x
Reference in New Issue
Block a user