Index: trunk/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme_class.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme_class.php	(revision 572)
+++ trunk/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme_class.php	(revision 578)
@@ -37,4 +37,5 @@
 	var $theme_select;
 	var $is_block_error_display;
+	var $admin_set_all_blog_admin;
 	//constructor
 	function XPressME_Class()
@@ -85,4 +86,5 @@
 		$this->theme_select = 'use_wordpress_select';
 		$this->is_block_error_display = true;
+		$this->admin_set_all_blog_admin = false;
 	}
 	
@@ -107,5 +109,4 @@
 	{
 		global $xoops_config;
-		if($xoops_config->is_wpmu) $this->is_use_xoops_upload_path = false;
 
 		$write_options = array (
@@ -143,5 +144,6 @@
 			'is_dashboard_forum_disp' => $this->is_dashboard_forum_disp,
 			'theme_select' => $this->theme_select,
-			'is_block_error_display' => $this->is_block_error_display
+			'is_block_error_display' => $this->is_block_error_display,
+			'admin_set_all_blog_admin' => $this->admin_set_all_blog_admin
 		);
 		if ($mode == 'add_new') {
@@ -152,4 +154,28 @@
 	}
 	
+	function get_current_setting_option($option_name)
+	{
+		if (empty($option_name)) return null;
+		if (defined('BLOG_ID_CURRENT_SITE')){
+				$id = BLOG_ID_CURRENT_SITE;
+		} else {
+				$id = 1;
+		}
+		if (xpress_is_multiblog() && !xpress_is_multiblog_root()){
+			switch_to_blog($id);
+			$options = get_option('xpressme_option');
+			restore_current_blog();
+		} else {
+			$options = get_option('xpressme_option');
+		}
+		$ret = $options[$option_name];
+		return $ret;
+	}
+	
+	function admin_select_groupe_role() {
+		if (xpress_is_multiblog_root()) return false;
+		return !$this->get_current_setting_option('admin_set_all_blog_admin');
+	}
+	
 	function GroupeRoleRead() {
  		global $xoops_db, $blog_id;
@@ -172,5 +198,5 @@
 		
 		if (empty($blog_id)) {
-			if (defined(BLOG_ID_CURRENT_SITE)){
+			if (defined('BLOG_ID_CURRENT_SITE')){
 				$blog_id = BLOG_ID_CURRENT_SITE;
 			} else {
@@ -179,4 +205,10 @@
 		}
 		
+		if ( xpress_is_multiblog() && $blog_id == BLOG_ID_CURRENT_SITE){
+			$set_blog_admin = true;
+		} else {
+			$set_blog_admin = !$this->admin_select_groupe_role();
+		}
+
 		$module_id = get_xpress_modid();
 		
@@ -222,5 +254,5 @@
 				if ($groupe_role->groupid == $groupe->groupid){
 					$role = $groupe_role->role;
-					if ($group_type == 'module_admin') $role = 'administrator';
+					if ($group_type == 'module_admin' && $set_blog_admin) $role = 'administrator';
 					if ($group_type == 'module_inhibit') $role = '';
 					$edit_sql = "UPDATE $group_role_table SET group_type='$group_type',role='$role' WHERE groupid = $groupe->groupid AND blog_id = $blog_id";
@@ -515,5 +547,5 @@
 	    return $form;
 	}
-
+	
 	function groupe_role_option($disible=false){
 		global $wp_roles , $xoops_db;
@@ -524,4 +556,16 @@
 		$form .= '<td>';
 		$form .= "<table>\n";
+		$form .= "<tr>\n";
+		
+		if (xpress_is_multiblog_root()){
+			$form .= "<td>" . __('XOOPS administrators role is set as all blog administrators.','xpressme') . "</td>\n";		
+			$form .= "<td>\n";
+			$form .=  $this->yes_no_radio_option_sub('admin_set_all_blog_admin',
+													__('YES','xpressme'),
+													__('NO','xpressme')
+													);
+			$form .= "</td>\n";
+			$form .= "</tr>\n";
+		}
 		$form .= '<tr><td>' . __('XOOPS Groupe', 'xpressme') . '</td><td>' . __('WordPress Role', 'xpressme') . '</td><td>' . __('Role is set at each login', 'xpressme') . "</td></tr>\n";
 		foreach ($this->groupe_role as $groupe) {
@@ -555,9 +599,18 @@
 					$selected = '';
 				}
-				if ($groupe->group_type != 'module_admin'|| !empty($selected)) {
+				
+				$admin_select_role = $this->admin_select_groupe_role();
+				
+				if ($admin_select_role || $groupe->group_type != 'module_admin'|| !empty($selected)) {
 					$role_list .= "<option value=\"{$role}\"{$selected}>{$name}</option>\n";
 				}
-			}
-			if ($groupe->group_type != 'module_admin') {
+				if (!$admin_select_role && $groupe->group_type == 'module_admin'){
+					if ($role == 'administrator'){
+						$role_list .= "<option value=\"{$role}\" selected=\"selected\">{$name}</option>\n";
+					}
+				}
+			}
+			
+			if ($this->admin_select_groupe_role() ||$groupe->group_type != 'module_admin') {
 				if ( $group_has_role ) {
 					$role_list .= '<option value="default">' . __('Default Role of WordPress', 'xpressme') . "</option>\n";
