Index: /extensions/PWG_Stuffs/admin/add_module.php
===================================================================
--- /extensions/PWG_Stuffs/admin/add_module.php	(revision 7854)
+++ /extensions/PWG_Stuffs/admin/add_module.php	(revision 7855)
@@ -9,5 +9,5 @@
 load_language('plugin.lang', STUFFS_PATH);
 
-if (!isset($_GET['type']) or ($_GET['type'] != 'MainBlock' and !is_dir(STUFFS_PATH . 'modules/' . $_GET['type'])))
+if (!isset($_GET['type']) or !is_dir(STUFFS_PATH . 'modules/' . $_GET['type']))
 {
   die('Wrong parameters...');
@@ -24,15 +24,7 @@
 if (isset($_POST['submit']) and !is_adviser())
 {
-  @include(STUFFS_PATH . 'modules/' . $type . '/config.inc.php');
+  include(STUFFS_PATH . 'modules/' . $type . '/config.inc.php');
   if (empty($page['errors']))
   {
-    if ($type == 'MainBlock')
-    {
-      $_POST['module_name'] = 'MainBlock';
-      $_POST['show_title'] = true;
-      $_POST['on_home'] = true;
-      $_POST['on_cats'] = true;
-      $_POST['on_picture'] = true;
-    }
     if (empty($_POST['module_name']))
     {
@@ -113,5 +105,4 @@
   $template->assign(array(
     'STUFFS_TITLE' => l10n('stuffs_edit_mod') . ' <i>' . trigger_event('render_stuffs_name', $module['name']) . '</i>',
-    'MODULE_ID' => $_GET['edit'],
     'MODULE_NAME' => $module['name'],
     'DESC_VALUE' => (isset($module['descr']) ? $module['descr'] : ''),
@@ -148,5 +139,5 @@
 
 // Configuration du module
-@include_once(STUFFS_PATH . 'modules/' . $type . '/config.inc.php');
+include_once(STUFFS_PATH . 'modules/' . $type . '/config.inc.php');
 
 $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/template/add_module.tpl'));
Index: /extensions/PWG_Stuffs/admin/manage.php
===================================================================
--- /extensions/PWG_Stuffs/admin/manage.php	(revision 7854)
+++ /extensions/PWG_Stuffs/admin/manage.php	(revision 7855)
@@ -19,9 +19,14 @@
   }
 
+    pwg_query('
+UPDATE ' . STUFFS_TABLE . '
+SET datas = "'.addslashes(serialize(array('hide' => isset($_POST['hidemb'])))).'"
+WHERE id=0;');
+
   array_push($page['infos'], l10n('stuffs_order_saved'));
 }
 
 // Affichage des modules et de leur position
-$q = 'SELECT id, name, descr, type, id_line, width
+$q = 'SELECT id, name, descr, type, id_line, width, datas
 FROM ' . STUFFS_TABLE . '
 ORDER BY pos ASC;';
@@ -59,6 +64,12 @@
 		'ID' => $module['id'],
     'U_EDIT' => PHPWG_ROOT_PATH . 'admin.php?page=plugin&amp;section=' . STUFFS_DIR . '%2Fadmin%2Fadd_module.php&amp;type=' . $module['type'] . '&amp;edit=' . $module['id'],
-    'U_DELETE' => !is_adviser() and $module['id'] != 0 ? PHPWG_ROOT_PATH . 'admin.php?page=plugin&amp;section=' . STUFFS_DIR . '%2Fadmin%2Fadmin.php&amp;del=' . $module['id'] : '',
+    'U_DELETE' => !is_adviser() ? PHPWG_ROOT_PATH . 'admin.php?page=plugin&amp;section=' . STUFFS_DIR . '%2Fadmin%2Fadmin.php&amp;del=' . $module['id'] : '',
   ));
+
+  if ($module['type'] == 'MainBlock' and !empty($module['datas']))
+  {
+    $datas = unserialize($module['datas']);
+    $template->assign('HIDEMB', $datas['hide']); 
+  }
 }
 
Index: /extensions/PWG_Stuffs/admin/template/add_module.tpl
===================================================================
--- /extensions/PWG_Stuffs/admin/template/add_module.tpl	(revision 7854)
+++ /extensions/PWG_Stuffs/admin/template/add_module.tpl	(revision 7855)
@@ -11,10 +11,8 @@
 <fieldset>
 	<legend>{'stuffs_module_config'|@translate}</legend>
-  {if $MODULE_ID == 0}<p>{'This module can be hidden only on homepage'|@translate}</p>{/if}
 	<table>
 
 		<tr><td colspan="3"><br></td></tr>
 
-    {if $MODULE_ID != 0}
 		<tr>
 			<td><b>{'stuffs_module_title'|@translate}&nbsp;&nbsp;</b></td>
@@ -32,5 +30,4 @@
 			<td colspan="2">{'stuffs_only_for_admin'|@translate}</td>
 		</tr>
-    {/if}
 
 		<tr><td colspan="3"><br></td></tr>
@@ -64,5 +61,4 @@
 </fieldset>
 
-{if $MODULE_ID != 0}
 <fieldset>
 	<legend>{'stuffs_visual_config'|@translate}</legend>
@@ -85,4 +81,6 @@
 		<tr><td colspan="2"><br></td></tr>
 	</table>
+
+
 </fieldset>
 
@@ -91,5 +89,4 @@
 	{$MODULE_OPTIONS}
 </fieldset>
-{/if}
 <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED}/></p>
 </form>
Index: /extensions/PWG_Stuffs/admin/template/manage.tpl
===================================================================
--- /extensions/PWG_Stuffs/admin/template/manage.tpl	(revision 7854)
+++ /extensions/PWG_Stuffs/admin/template/manage.tpl	(revision 7855)
@@ -51,6 +51,6 @@
 
     <li class="categoryLi virtual_cat" id="module_{$module.ID}">
+      {if $module.TYPE != 'MainBlock'}
       <ul class="categoryActions">
-        {if $module.TYPE != 'MainBlock'}
         <li class="stuffs_line">
           {'stuffs_id_ligne'|@translate}&nbsp;
@@ -63,5 +63,4 @@
           <input type="text" size="2" maxlength="2" value="{$module.WIDTH}" name="width[{$module.ID}]" > %
         </li>
-        {/if}
         <li><a href="{$module.U_EDIT}" title="{'stuffs_edit'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'stuffs_edit'|@translate}"/></a></li>
         {if !empty($module.U_DELETE) }
@@ -69,4 +68,5 @@
         {/if}
       </ul>
+      {/if}
 
       <p>
@@ -78,4 +78,6 @@
       {if !empty($module.DESC)}
         <p style="margin-left: 30px;"><i>{$module.DESC}</i></p>
+      {elseif $module.TYPE == 'MainBlock'}
+        <p style="margin-left: 30px;"><input name="hidemb" type="checkbox" {if $HIDEMB}checked="checked"{/if}> &nbsp;{'Hide on home page'|@translate}</p>
       {/if}
 
Index: /extensions/PWG_Stuffs/include/class.inc.php
===================================================================
--- /extensions/PWG_Stuffs/include/class.inc.php	(revision 7854)
+++ /extensions/PWG_Stuffs/include/class.inc.php	(revision 7855)
@@ -36,8 +36,7 @@
 
     $query = '
-SELECT id, name, type, datas, users, groups, show_title, id_line, width
+SELECT id, name, type, datas, groups, show_title, id_line, width
 FROM ' . STUFFS_TABLE . '
-WHERE id = 0 OR (
-  users LIKE "%' . $user['status'] . '%"
+WHERE users LIKE "%' . $user['status'] . '%"
 ';
 
@@ -55,5 +54,5 @@
     else return;
 
-    $query .= ')
+    $query .= '
 ORDER BY pos ASC;';
 
@@ -71,19 +70,19 @@
     foreach ($this->modules as $module)
     {
-    	if (!empty($module['groups']))
-      {
-    		$authorized_groups = explode(',', $module['groups']);
-    		if (array_intersect($this->user_groups, $authorized_groups) == array()) continue;
-    	}
-
       if ($module['type'] == 'MainBlock')
       {
-        global $user;
-        if (strpos($module['users'], $user['status']) === false)
+    		$this->pos = 'end';
+        if (!empty($module['datas'])
+          and $datas = unserialize($module['datas'])
+          and $datas['hide'])
         {
           add_event_handler('loc_end_index', 'hide_main_block');
         }
-        $this->pos = 'end';
     		continue;
+    	}
+    	if (!empty($module['groups']))
+      {
+    		$authorized_groups = explode(',', $module['groups']);
+    		if (array_intersect($this->user_groups, $authorized_groups) == array()) continue;
     	}
 
