Indentation automatique

git-svn-id: https://forge.glpi-project.org/svn/example/trunk@6 349b9182-4a13-0410-896f-e5e9767dd1b3
This commit is contained in:
moyooo 2006-08-25 23:59:21 +00:00
parent 8b7d077d86
commit fda0ebe2d3
6 changed files with 169 additions and 169 deletions

View File

@ -1,31 +1,31 @@
<?php <?php
/* /*
---------------------------------------------------------------------- ----------------------------------------------------------------------
GLPI - Gestionnaire Libre de Parc Informatique GLPI - Gestionnaire Libre de Parc Informatique
Copyright (C) 2003-2006 by the INDEPNET Development Team. Copyright (C) 2003-2006 by the INDEPNET Development Team.
http://indepnet.net/ http://glpi-project.org
----------------------------------------------------------------------
LICENSE http://indepnet.net/ http://glpi-project.org
----------------------------------------------------------------------
This file is part of GLPI. LICENSE
GLPI is free software; you can redistribute it and/or modify This file is part of GLPI.
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GLPI is distributed in the hope that it will be useful, GLPI is free software; you can redistribute it and/or modify
but WITHOUT ANY WARRANTY; without even the implied warranty of it under the terms of the GNU General Public License as published by
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the the Free Software Foundation; either version 2 of the License, or
GNU General Public License for more details. (at your option) any later version.
You should have received a copy of the GNU General Public License GLPI is distributed in the hope that it will be useful,
along with GLPI; if not, write to the Free Software but WITHOUT ANY WARRANTY; without even the implied warranty of
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
------------------------------------------------------------------------ GNU General Public License for more details.
*/
You should have received a copy of the GNU General Public License
along with GLPI; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
------------------------------------------------------------------------
*/
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Original Author of file: // Original Author of file:
@ -40,13 +40,13 @@ $Dir = explode('/', $Dir);
$NDir = count($Dir); $NDir = count($Dir);
for($i=count($Dir); $i>0;$i--) for($i=count($Dir); $i>0;$i--)
{ {
if(file_exists(implode('/', $Dir) . '/siteroot.php')) if(file_exists(implode('/', $Dir) . '/siteroot.php'))
{ {
$phproot = implode('/', $Dir); $phproot = implode('/', $Dir);
$HTMLRel = str_repeat("../", $NDir - count($Dir)); $HTMLRel = str_repeat("../", $NDir - count($Dir));
$i = 0; $i = 0;
} }
unset($Dir[$i]); unset($Dir[$i]);
} }

View File

@ -1,31 +1,31 @@
<?php <?php
/* /*
---------------------------------------------------------------------- ----------------------------------------------------------------------
GLPI - Gestionnaire Libre de Parc Informatique GLPI - Gestionnaire Libre de Parc Informatique
Copyright (C) 2003-2006 by the INDEPNET Development Team. Copyright (C) 2003-2006 by the INDEPNET Development Team.
http://indepnet.net/ http://glpi-project.org
----------------------------------------------------------------------
LICENSE http://indepnet.net/ http://glpi-project.org
----------------------------------------------------------------------
This file is part of GLPI. LICENSE
GLPI is free software; you can redistribute it and/or modify This file is part of GLPI.
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GLPI is distributed in the hope that it will be useful, GLPI is free software; you can redistribute it and/or modify
but WITHOUT ANY WARRANTY; without even the implied warranty of it under the terms of the GNU General Public License as published by
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the the Free Software Foundation; either version 2 of the License, or
GNU General Public License for more details. (at your option) any later version.
You should have received a copy of the GNU General Public License GLPI is distributed in the hope that it will be useful,
along with GLPI; if not, write to the Free Software but WITHOUT ANY WARRANTY; without even the implied warranty of
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
------------------------------------------------------------------------ GNU General Public License for more details.
*/
You should have received a copy of the GNU General Public License
along with GLPI; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
------------------------------------------------------------------------
*/
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Original Author of file: // Original Author of file:

View File

@ -1,31 +1,31 @@
<?php <?php
/* /*
---------------------------------------------------------------------- ----------------------------------------------------------------------
GLPI - Gestionnaire Libre de Parc Informatique GLPI - Gestionnaire Libre de Parc Informatique
Copyright (C) 2003-2006 by the INDEPNET Development Team. Copyright (C) 2003-2006 by the INDEPNET Development Team.
http://indepnet.net/ http://glpi-project.org
----------------------------------------------------------------------
LICENSE http://indepnet.net/ http://glpi-project.org
----------------------------------------------------------------------
This file is part of GLPI. LICENSE
GLPI is free software; you can redistribute it and/or modify This file is part of GLPI.
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GLPI is distributed in the hope that it will be useful, GLPI is free software; you can redistribute it and/or modify
but WITHOUT ANY WARRANTY; without even the implied warranty of it under the terms of the GNU General Public License as published by
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the the Free Software Foundation; either version 2 of the License, or
GNU General Public License for more details. (at your option) any later version.
You should have received a copy of the GNU General Public License GLPI is distributed in the hope that it will be useful,
along with GLPI; if not, write to the Free Software but WITHOUT ANY WARRANTY; without even the implied warranty of
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
------------------------------------------------------------------------ GNU General Public License for more details.
*/
You should have received a copy of the GNU General Public License
along with GLPI; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
------------------------------------------------------------------------
*/
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Original Author of file: // Original Author of file:

View File

@ -4,29 +4,29 @@
---------------------------------------------------------------------- ----------------------------------------------------------------------
GLPI - Gestionnaire Libre de Parc Informatique GLPI - Gestionnaire Libre de Parc Informatique
Copyright (C) 2003-2006 by the INDEPNET Development Team. Copyright (C) 2003-2006 by the INDEPNET Development Team.
http://indepnet.net/ http://glpi.indepnet.org http://indepnet.net/ http://glpi.indepnet.org
---------------------------------------------------------------------- ----------------------------------------------------------------------
LICENSE LICENSE
This file is part of GLPI. This file is part of GLPI.
GLPI is free software; you can redistribute it and/or modify GLPI is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
GLPI is distributed in the hope that it will be useful, GLPI is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GLPI; if not, write to the Free Software along with GLPI; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
------------------------------------------------------------------------ ------------------------------------------------------------------------
*/ */
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Original Author of file: // Original Author of file:
@ -34,4 +34,4 @@
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
$langexample["test"]="test english"; $langexample["test"]="test english";
?> ?>

View File

@ -4,29 +4,29 @@
---------------------------------------------------------------------- ----------------------------------------------------------------------
GLPI - Gestionnaire Libre de Parc Informatique GLPI - Gestionnaire Libre de Parc Informatique
Copyright (C) 2003-2006 by the INDEPNET Development Team. Copyright (C) 2003-2006 by the INDEPNET Development Team.
http://indepnet.net/ http://glpi.indepnet.org http://indepnet.net/ http://glpi.indepnet.org
---------------------------------------------------------------------- ----------------------------------------------------------------------
LICENSE LICENSE
This file is part of GLPI. This file is part of GLPI.
GLPI is free software; you can redistribute it and/or modify GLPI is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
GLPI is distributed in the hope that it will be useful, GLPI is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with GLPI; if not, write to the Free Software along with GLPI; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
------------------------------------------------------------------------ ------------------------------------------------------------------------
*/ */
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Original Author of file: // Original Author of file:
@ -35,4 +35,4 @@
$langexample["test"]="test french"; $langexample["test"]="test french";
?> ?>

138
setup.php
View File

@ -1,31 +1,31 @@
<?php <?php
/* /*
---------------------------------------------------------------------- ----------------------------------------------------------------------
GLPI - Gestionnaire Libre de Parc Informatique GLPI - Gestionnaire Libre de Parc Informatique
Copyright (C) 2003-2006 by the INDEPNET Development Team. Copyright (C) 2003-2006 by the INDEPNET Development Team.
http://indepnet.net/ http://glpi-project.org
----------------------------------------------------------------------
LICENSE http://indepnet.net/ http://glpi-project.org
----------------------------------------------------------------------
This file is part of GLPI. LICENSE
GLPI is free software; you can redistribute it and/or modify This file is part of GLPI.
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GLPI is distributed in the hope that it will be useful, GLPI is free software; you can redistribute it and/or modify
but WITHOUT ANY WARRANTY; without even the implied warranty of it under the terms of the GNU General Public License as published by
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the the Free Software Foundation; either version 2 of the License, or
GNU General Public License for more details. (at your option) any later version.
You should have received a copy of the GNU General Public License GLPI is distributed in the hope that it will be useful,
along with GLPI; if not, write to the Free Software but WITHOUT ANY WARRANTY; without even the implied warranty of
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
------------------------------------------------------------------------ GNU General Public License for more details.
*/
You should have received a copy of the GNU General Public License
along with GLPI; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
------------------------------------------------------------------------
*/
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Original Author of file: // Original Author of file:
@ -37,14 +37,14 @@
// Init the hooks of the plugins -Needed // Init the hooks of the plugins -Needed
function plugin_init_example() { function plugin_init_example() {
global $plugin_hooks; global $plugin_hooks;
// Display a menu entry ? // Display a menu entry ?
$plugin_hooks['menu_entry']['example'] = true; $plugin_hooks['menu_entry']['example'] = true;
// Setup/Update functions // Setup/Update functions
$plugin_hooks['setup']['example'] = "plugin_setup_example"; $plugin_hooks['setup']['example'] = "plugin_setup_example";
// Config function // Config function
$plugin_hooks['config']['example'] = 'plugin_config_example'; $plugin_hooks['config']['example'] = 'plugin_config_example';
// Config page // Config page
$plugin_hooks['config_page']['example'] = 'config.php'; $plugin_hooks['config_page']['example'] = 'config.php';
// Item action event // See config.php for defined ITEM_TYPE // Item action event // See config.php for defined ITEM_TYPE
@ -65,7 +65,7 @@ function plugin_init_example() {
// Get the name and the version of the plugin - Needed // Get the name and the version of the plugin - Needed
function plugin_version_example(){ function plugin_version_example(){
return array( 'name' => 'Plugin Example', return array( 'name' => 'Plugin Example',
'version' => '0.0.1'); 'version' => '0.0.1');
} }
// Get config of the plugin // Get config of the plugin
@ -86,13 +86,13 @@ function plugin_config_form_example(){
function plugin_item_update_example($parm){ function plugin_item_update_example($parm){
if (isset($parm["type"])) if (isset($parm["type"]))
switch ($parm["type"]){ switch ($parm["type"]){
case COMPUTER_TYPE : case COMPUTER_TYPE :
if (!empty($_SESSION["MESSAGE_AFTER_REDIRECT"])) $_SESSION["MESSAGE_AFTER_REDIRECT"].="<br>"; if (!empty($_SESSION["MESSAGE_AFTER_REDIRECT"])) $_SESSION["MESSAGE_AFTER_REDIRECT"].="<br>";
$_SESSION["MESSAGE_AFTER_REDIRECT"].="Update Computer Hook"; $_SESSION["MESSAGE_AFTER_REDIRECT"].="Update Computer Hook";
return true; return true;
break; break;
} }
return false; return false;
} }
@ -100,13 +100,13 @@ function plugin_item_update_example($parm){
function plugin_item_add_example($parm){ function plugin_item_add_example($parm){
if (isset($parm["type"])) if (isset($parm["type"]))
switch ($parm["type"]){ switch ($parm["type"]){
case COMPUTER_TYPE : case COMPUTER_TYPE :
if (!empty($_SESSION["MESSAGE_AFTER_REDIRECT"])) $_SESSION["MESSAGE_AFTER_REDIRECT"].="<br>"; if (!empty($_SESSION["MESSAGE_AFTER_REDIRECT"])) $_SESSION["MESSAGE_AFTER_REDIRECT"].="<br>";
$_SESSION["MESSAGE_AFTER_REDIRECT"].="Add Computer Hook"; $_SESSION["MESSAGE_AFTER_REDIRECT"].="Add Computer Hook";
return true; return true;
break; break;
} }
return false; return false;
} }
@ -114,13 +114,13 @@ function plugin_item_add_example($parm){
function plugin_item_delete_example($parm){ function plugin_item_delete_example($parm){
if (isset($parm["type"])) if (isset($parm["type"]))
switch ($parm["type"]){ switch ($parm["type"]){
case COMPUTER_TYPE : case COMPUTER_TYPE :
if (!empty($_SESSION["MESSAGE_AFTER_REDIRECT"])) $_SESSION["MESSAGE_AFTER_REDIRECT"].="<br>"; if (!empty($_SESSION["MESSAGE_AFTER_REDIRECT"])) $_SESSION["MESSAGE_AFTER_REDIRECT"].="<br>";
$_SESSION["MESSAGE_AFTER_REDIRECT"].="Delete Computer Hook"; $_SESSION["MESSAGE_AFTER_REDIRECT"].="Delete Computer Hook";
return true; return true;
break; break;
} }
return false; return false;
} }
@ -128,13 +128,13 @@ function plugin_item_delete_example($parm){
function plugin_item_purge_example($parm){ function plugin_item_purge_example($parm){
if (isset($parm["type"])) if (isset($parm["type"]))
switch ($parm["type"]){ switch ($parm["type"]){
case COMPUTER_TYPE : case COMPUTER_TYPE :
if (!empty($_SESSION["MESSAGE_AFTER_REDIRECT"])) $_SESSION["MESSAGE_AFTER_REDIRECT"].="<br>"; if (!empty($_SESSION["MESSAGE_AFTER_REDIRECT"])) $_SESSION["MESSAGE_AFTER_REDIRECT"].="<br>";
$_SESSION["MESSAGE_AFTER_REDIRECT"].="Purge Computer Hook"; $_SESSION["MESSAGE_AFTER_REDIRECT"].="Purge Computer Hook";
return true; return true;
break; break;
} }
return false; return false;
} }
@ -142,13 +142,13 @@ function plugin_item_purge_example($parm){
function plugin_item_restore_example($parm){ function plugin_item_restore_example($parm){
if (isset($parm["type"])) if (isset($parm["type"]))
switch ($parm["type"]){ switch ($parm["type"]){
case COMPUTER_TYPE : case COMPUTER_TYPE :
if (!empty($_SESSION["MESSAGE_AFTER_REDIRECT"])) $_SESSION["MESSAGE_AFTER_REDIRECT"].="<br>"; if (!empty($_SESSION["MESSAGE_AFTER_REDIRECT"])) $_SESSION["MESSAGE_AFTER_REDIRECT"].="<br>";
$_SESSION["MESSAGE_AFTER_REDIRECT"].="Restore Computer Hook"; $_SESSION["MESSAGE_AFTER_REDIRECT"].="Restore Computer Hook";
return true; return true;
break; break;
} }
return false; return false;
} }
@ -163,13 +163,13 @@ function plugin_get_headings_example($type,$withtemplate){
else else
return array( return array(
1 => "Test PLugin", 1 => "Test PLugin",
); );
break; break;
case ENTERPRISE_TYPE : case ENTERPRISE_TYPE :
return array( return array(
1 => "Test PLugin", 1 => "Test PLugin",
2 => "Test PLugin 2", 2 => "Test PLugin 2",
); );
break; break;
} }
@ -178,20 +178,20 @@ function plugin_get_headings_example($type,$withtemplate){
// Define headings actions added by the plugin // Define headings actions added by the plugin
function plugin_headings_actions_example($type){ function plugin_headings_actions_example($type){
switch ($type){ switch ($type){
case COMPUTER_TYPE : case COMPUTER_TYPE :
return array( return array(
1 => "plugin_headings_example", 1 => "plugin_headings_example",
); );
break; break;
case ENTERPRISE_TYPE : case ENTERPRISE_TYPE :
return array( return array(
1 => "plugin_headings_example", 1 => "plugin_headings_example",
2 => "plugin_headings_example", 2 => "plugin_headings_example",
); );
break; break;
} }
@ -210,10 +210,10 @@ function plugin_headings_example($type,$ID,$withtemplate=0){
// Hook to be launch on central // Hook to be launch on central
function plugin_central_action_example(){ function plugin_central_action_example(){
global $langexample; global $langexample;
echo "<div align='center'>"; echo "<div align='center'>";
echo "Plugin central action ".$langexample["test"]; echo "Plugin central action ".$langexample["test"];
echo "</div>"; echo "</div>";
} }
?> ?>