From 8e732b44506e253e4a5250d2111c9099e5e254df Mon Sep 17 00:00:00 2001
From: Emmanuel Lacour <elacour@easter-eggs.com>
Date: Tue, 21 Jun 2011 15:26:36 +0200
Subject: [PATCH] Remove obsolete "environment" plugin handling that makes this plugin disapear from plugin menu when "environment " is enabled


diff --git a/setup.php b/setup.php
index 9ceec44..98ebe31 100755
--- a/setup.php
+++ b/setup.php
@@ -60,40 +60,18 @@ function plugin_init_connections() {
    
 	if (getLoginUserID()) {
 		
-		if ((isset($_SESSION["glpi_plugin_environment_installed"]) && $_SESSION["glpi_plugin_environment_installed"]==1)) {
-			
-			$_SESSION["glpi_plugin_environment_connections"]=1;
-			
-			// Display a menu entry ?
-			if (plugin_connections_haveRight("connections","r")) {
-				$PLUGIN_HOOKS['menu_entry']['connections'] = false;
-				$PLUGIN_HOOKS['submenu_entry']['environment']['options']['connections']['title'] = $LANG['plugin_connections']['title'][1];
-				$PLUGIN_HOOKS['submenu_entry']['environment']['options']['connections']['page'] = '/plugins/connections/front/connection.php';
-				$PLUGIN_HOOKS['submenu_entry']['environment']['options']['connections']['links']['search'] = '/plugins/connections/front/connection.php';
-				$PLUGIN_HOOKS['headings']['connections'] = 'plugin_get_headings_connections';
-				$PLUGIN_HOOKS['headings_action']['connections'] = 'plugin_headings_actions_connections';
-			}
-			
-			  if (plugin_connections_haveRight("connections","w")) {
-				$PLUGIN_HOOKS['submenu_entry']['environment']['options']['connections']['links']['add'] = '/plugins/connections/front/connection.form.php';
-				$PLUGIN_HOOKS['use_massive_action']['connections']=1;
-				
-			}		
-		} else {
+		// Display a menu entry ?
+		if (plugin_connections_haveRight("connections","r")) {
+			$PLUGIN_HOOKS['menu_entry']['connections'] = 'front/connection.php';
+			$PLUGIN_HOOKS['submenu_entry']['connections']['search'] = 'front/connection.php';
+			$PLUGIN_HOOKS['headings']['connections'] = 'plugin_get_headings_connections';
+			$PLUGIN_HOOKS['headings_action']['connections'] = 'plugin_headings_actions_connections';
+		}
 		
-			// Display a menu entry ?
-			if (plugin_connections_haveRight("connections","r")) {
-				$PLUGIN_HOOKS['menu_entry']['connections'] = 'front/connection.php';
-				$PLUGIN_HOOKS['submenu_entry']['connections']['search'] = 'front/connection.php';
-				$PLUGIN_HOOKS['headings']['connections'] = 'plugin_get_headings_connections';
-				$PLUGIN_HOOKS['headings_action']['connections'] = 'plugin_headings_actions_connections';
-			}
+		if (plugin_connections_haveRight("connections","w")) {
+			$PLUGIN_HOOKS['submenu_entry']['connections']['add'] = 'front/connection.form.php?new=1';
+			$PLUGIN_HOOKS['use_massive_action']['connections']=1;
 			
-			if (plugin_connections_haveRight("connections","w")) {
-				$PLUGIN_HOOKS['submenu_entry']['connections']['add'] = 'front/connection.form.php?new=1';
-				$PLUGIN_HOOKS['use_massive_action']['connections']=1;
-				
-			}
 		}
       
 		// Add specific files to add to the header : javascript or css
@@ -153,4 +131,4 @@ function plugin_datainjection_migratetypes_connections($types) {
    return $types;
 }
 
-?>
\ No newline at end of file
+?>
-- 
1.7.2.5

