Index: extensions/FacebookPlug/Plugin/admin.config.php
===================================================================
--- extensions/FacebookPlug/Plugin/admin.config.php	(revision 8316)
+++ extensions/FacebookPlug/Plugin/admin.config.php	(revision 8331)
@@ -47,4 +47,5 @@
 $colorscheme_l10n = array_map('l10n', $colorscheme);
 
+
 // Tabsheet
 $tabsheet = new tabsheet();
@@ -61,4 +62,6 @@
 if (isset($_POST['submit']))
 {
+  $save_conf['fbp'] = $conf['fbp'];
+
   switch ($page['tab'])
   {
@@ -88,4 +91,12 @@
       $conf['fbp']['social_plugin_like_box']['stream'] = empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BOX_STREAM']) ? false : true;
       $conf['fbp']['social_plugin_like_box']['header'] = empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BOX_HEADER']) ? false : true;
+      
+      // Check
+      if ($conf['fbp']['social_plugin_like_button']['enabled'] and $conf['fbp']['social_plugin_comments']['enabled'])
+      {
+        $conf['fbp']['social_plugin_like_button']['enabled'] = $save_conf['fbp']['social_plugin_like_button']['enabled'];
+        $conf['fbp']['social_plugin_comments']['enabled'] = $save_conf['fbp']['social_plugin_comments']['enabled'];
+        array_push($page['infos'], l10n('Like button and comments cannot be enabled together').', '.l10n('enabled values are restored'));
+      }
       break;
     }
@@ -183,10 +194,10 @@
 }
 
-/*$template->assign(
-  array(
-    'FBP_ALLOW_FB_ACCESS_PRIVATE_PAGE'=> ($conf['fbp']['allow_fb_access_private_page'] ? 'checked="checked"' : ''),
-    //~ 'FBP_DAY_NUMBER'=> $conf['fbp']['day_number'],
-    ));*/
-
+// Global value
+//~ $template->assign('FBP_PATH', FBP_PATH);
+$template->assign('FBP_ACTION', add_url_params($base_url, array('tab' => $page['tab'])));
+$template->block_html_head('', '<link rel="stylesheet" type="text/css" href="'.FBP_PATH.'/css/admin.config.css">', $smarty, $repeat);
+
+//Apply tpl
 $template->set_filename('plugin_admin_content', FBP_DIR.'/tpl/admin.config.tpl');
 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
Index: extensions/FacebookPlug/Plugin/css/admin.config.css
===================================================================
--- extensions/FacebookPlug/Plugin/css/admin.config.css	(revision 8331)
+++ extensions/FacebookPlug/Plugin/css/admin.config.css	(revision 8331)
@@ -0,0 +1,67 @@
+/* Adaptation of jquery-ui-1.7.3.custom.css generated by jQuery UI CSS Framework */
+
+/* Layout helpers
+----------------------------------*/
+.admin_config .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
+.admin_config .ui-helper-clearfix { display: inline-block; }
+* html .admin_config .ui-helper-clearfix { height:1%; }
+.admin_config .ui-helper-clearfix { display:block; }
+
+/* Icons
+----------------------------------*/
+/* states and images */
+.admin_config .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
+
+/* Overlays */
+.admin_config .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
+
+/* Component containers
+----------------------------------*/
+.admin_config /*.ui-widget*/ { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
+.admin_config /*.ui-widget*/ input, .admin_config /*.ui-widget*/ select, .admin_config /*.ui-widget*/ textarea, .admin_config /*.ui-widget*/ button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
+.admin_config /*.ui-widget-content*/ { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
+.admin_config /*.ui-widget-content*/ a { color: #222222; }
+.admin_config .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
+.admin_config .ui-widget-header a { color: #222222; }
+
+
+/* Icons
+----------------------------------*/
+/* states and images */
+.admin_config .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
+.admin_config .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
+.admin_config .ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
+
+/* positioning */
+.admin_config .ui-icon-closethick { background-position: -96px -128px; }
+
+/* Misc visuals
+----------------------------------*/
+/* Corner radius */
+.admin_config .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; }
+.admin_config .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; }
+.admin_config .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; }
+.admin_config .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
+.admin_config .ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; }
+.admin_config .ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
+.admin_config .ui-corner-right {  -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
+.admin_config .ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; }
+.admin_config, .admin_config .ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; }
+
+/* Overlays */
+.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_diagonals-medium_0_aaaaaa_40x40.png) 50% 50% repeat; opacity: .30;filter:Alpha(Opacity=30); }
+.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; }/* Resizable
+
+/* dialog
+----------------------------------*/
+.admin_config /*.ui-dialog*/ { position: relative; padding: .2em; width: 300px; }
+.admin_config /*.ui-dialog*/ .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative;  }
+.admin_config /*.ui-dialog*/ .ui-dialog-title { float: left; margin: .1em 0 .2em; } 
+.admin_config /*.ui-dialog*/ .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
+.admin_config /*.ui-dialog*/ .ui-dialog-titlebar-close span { display: block; margin: 1px; }
+.admin_config /*.ui-dialog*/ .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
+.admin_config /*.ui-dialog*/ .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
+.admin_config /*.ui-dialog*/ .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
+.admin_config /*.ui-dialog*/ .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; }
+.admin_config /*.ui-dialog*/ .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
+.admin_config /*.ui-draggable*/ .ui-dialog-titlebar { cursor: move; }
Index: extensions/FacebookPlug/Plugin/language/en_UK/plugin.lang.php
===================================================================
--- extensions/FacebookPlug/Plugin/language/en_UK/plugin.lang.php	(revision 8316)
+++ extensions/FacebookPlug/Plugin/language/en_UK/plugin.lang.php	(revision 8331)
@@ -49,6 +49,4 @@
 $lang['Show header'] = 'Show header';
 $lang['Facebook Page URL'] = 'Facebook Page URL';
-$lang['on picture pages'] = 'on picture pages';
-$lang['on main pages'] = 'on main pages';
 $lang['Data updated with success'] = 'Data updated with success';
 $lang['Data updated with error'] = 'Data updated with error';
@@ -63,4 +61,17 @@
 $lang['Publish feed'] = 'Publish feed';
 $lang['Facebook application identifient'] = 'Facebook application identifient';
+$lang['On picture pages'] = 'On picture pages';
+$lang['On menu of main pages'] = 'On menu of main pages';
+$lang['Options'] = 'Options';
+$lang['Like button and comments cannot be enabled together'] = 'Like button and comments cannot be enabled together';
+$lang['enabled values are restored'] = 'enabled values are restored';
+$lang['Informations'] = 'Informations';
+$lang['Continue'] = 'Continue';
+//~ $lang[''] = '';
+//~ $lang[''] = '';
+//~ $lang[''] = '';
+//~ $lang[''] = '';
+//~ $lang[''] = '';
+//~ $lang[''] = '';
 
 ?>
Index: extensions/FacebookPlug/Plugin/language/fr_FR/plugin.lang.php
===================================================================
--- extensions/FacebookPlug/Plugin/language/fr_FR/plugin.lang.php	(revision 8316)
+++ extensions/FacebookPlug/Plugin/language/fr_FR/plugin.lang.php	(revision 8331)
@@ -49,6 +49,4 @@
 $lang['Show header'] = 'Voir l\'entête';
 $lang['Facebook Page URL'] = 'URL de la page Facebook';
-$lang['on picture pages'] = 'sur les pages d\'images';
-$lang['on main pages'] = 'sur les pages principales';
 $lang['Data updated with success'] = 'Données mises à jour avec succès';
 $lang['Data updated with error'] = 'Données mises à jour avec erreur';
@@ -63,4 +61,12 @@
 $lang['Publish feed'] = 'Publier les commentaires';
 $lang['Facebook application identifient'] = 'Identifiant de l\'application Facebook';
+$lang['On picture pages'] = 'Sur les pages d\'images';
+$lang['On menu of main pages'] = 'Dans les menus des pages principales';
+$lang['Options'] = 'Options';
+$lang['Like button and comments cannot be enabled together'] = 'Le bouton "J\'aime" et les commentaires ne peuvent être activés en même temps';
+$lang['enabled values are restored'] = 'les valeurs d\'activation ont été restaurées';
+$lang['Informations'] = 'Informations';
+$lang['Continue'] = 'Continuer';
+
 
 ?>
Index: extensions/FacebookPlug/Plugin/tpl/admin.config.tpl
===================================================================
--- extensions/FacebookPlug/Plugin/tpl/admin.config.tpl	(revision 8316)
+++ extensions/FacebookPlug/Plugin/tpl/admin.config.tpl	(revision 8331)
@@ -1,2 +1,16 @@
+{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"}
+{known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"}
+{known_script id="jquery.ui.dialog" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.dialog.packed.js"}
+
+{*
+{html_head}
+<link rel="stylesheet" type="text/css" href="{$FBP_PATH|@cat:'/css/admin.config.css'}">
+{/html_head}
+*}
+
+{*html_head}
+<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/base/jquery-ui.css">
+{/html_head*}
+
 <div class="titrePage">
   <h2>FacebookPlug</h2>
@@ -4,10 +18,10 @@
 <br>
 
-<form method="post" class="properties">
-
+<form method="post" class="properties" action="{$FBP_ACTION}">
 {if isset($social_plugin)}
-<fieldset>
-  <ul>
-    <h3><a href="{$social_plugin.like_button.FB_PAGE}" onclick="window.open(this.href); return false;">{'Like button'|@translate}</a> {'on picture pages'|@translate}</h3>
+<h3>{'On picture pages'|@translate}</h3>
+<fieldset>
+  <legend><a href="{$social_plugin.like_button.FB_PAGE}" onclick="window.open(this.href); return false;">{'Like button'|@translate}</a></legend>
+  <ul>
     <li>
       <label>
@@ -53,6 +67,6 @@
 
 <fieldset>
-  <ul>
-    <h3><a href="{$social_plugin.facepile.FB_PAGE}" onclick="window.open(this.href); return false;">{'Facepile'|@translate}</a> {'on slideshow pages'|@translate}</h3>
+  <legend><a href="{$social_plugin.facepile.FB_PAGE}" onclick="window.open(this.href); return false;">{'Facepile'|@translate}</a> {'on slideshow pages'|@translate}</legend>
+  <ul>
     <li>
       <label>
@@ -74,6 +88,6 @@
 
 <fieldset>
-  <ul>
-    <h3><a href="{$social_plugin.comments.FB_PAGE}" onclick="window.open(this.href); return false;">{'Comments'|@translate}</a> {'on picture pages'|@translate}</h3>
+  <legend><a href="{$social_plugin.comments.FB_PAGE}" onclick="window.open(this.href); return false;">{'Comments'|@translate}</a></legend>
+  <ul>
     <li>
       <label>
@@ -118,7 +132,8 @@
 </fieldset>
 
-<fieldset>
-  <ul>
-    <h3><a href="{$social_plugin.like_box.FB_PAGE}" onclick="window.open(this.href); return false;">{'Like box'|@translate}</a> {'on main pages'|@translate}</h3>
+<h3>{'On menu of main pages'|@translate}</h3>
+<fieldset>
+  <legend><a href="{$social_plugin.like_box.FB_PAGE}" onclick="window.open(this.href); return false;">{'Like box'|@translate}</a></legend>
+  <ul>
     <li>
       <label>
@@ -168,4 +183,5 @@
 {if isset($advanced)}
 <fieldset>
+  <legend>{'Options'|@translate}</legend>
   <ul>
       <li>
@@ -207,21 +223,33 @@
 </form>
 
+<div id="dialog_modal_like_button_comments" title="{'Informations'|@translate}">{'Like button and comments cannot be enabled together'|@translate}</div>
+{*<div id="dialog_modal_can_close" title="{'Informations'|@translate}">{'Data are modified but not saved! Are you sure to quit this tabsheet?'|@translate}</div>*}
+
 {literal}
 <script type="text/javascript">
   function show_hide(checkbox_name, div_name)
   {
-    if (jQuery("input[name="+checkbox_name+"]").attr('checked'))
+    if ($("input[name="+checkbox_name+"]").attr('checked'))
     {
-      jQuery("#"+div_name).show();
+      $("#"+div_name).show();
     }
     else
     {
-      jQuery("#"+div_name).hide();
+      $("#"+div_name).hide();
     }
   }
 
+  function inverse_check_value(checkbox_name_1, checkbox_name_2)
+  {
+    if ($("input[name="+checkbox_name_1+"]").attr('checked') && $("input[name="+checkbox_name_2+"]").attr('checked'))
+    {
+      $("input[name="+checkbox_name_1+"]").attr('checked', false);
+      $("#dialog_modal_like_button_comments").dialog('open');
+    }
+  }
+
   function init_checkbox(checkbox_name, div_name)
   {
-    jQuery("input[name="+checkbox_name+"]").click(
+    $("input[name="+checkbox_name+"]").click(
       function()
       {
@@ -232,12 +260,59 @@
   }
 
-  jQuery(document).ready(
+  function init_checkbox_with_inverse_value(checkbox_name_1, checkbox_name_2)
+  {
+    $("input[name="+checkbox_name_1+"]").click(
+      function()
+      {
+        inverse_check_value(checkbox_name_1, checkbox_name_2);
+      }
+    );
+    $("input[name="+checkbox_name_2+"]").click(
+      function()
+      {
+        inverse_check_value(checkbox_name_2, checkbox_name_1);
+      }
+    );
+  }
+
+  $(document).ready(
     function()
     {
       //Init all main checkbox
+      init_checkbox_with_inverse_value("FBP_SOCIAL_PLUGIN_LIKE_BUTTON_ENABLED", "FBP_SOCIAL_PLUGIN_COMMENTS_ENABLED");
       init_checkbox("FBP_SOCIAL_PLUGIN_LIKE_BUTTON_ENABLED", "like_button");
       init_checkbox("FBP_SOCIAL_PLUGIN_FACEPILE_ENABLED", "facepile");
       init_checkbox("FBP_SOCIAL_PLUGIN_COMMENTS_ENABLED", "comments");
       init_checkbox("FBP_SOCIAL_PLUGIN_LIKE_BOX_ENABLED", "like_box");
+      // Init message box
+      $("#dialog_modal_like_button_comments").dialog({
+        autoOpen: false, modal: true, dialogClass: 'admin_config', // necessary to have a specific class because there are conflic with main menu accordeon
+        buttons: { "{/literal}{'Continue'|@translate}{literal}": function() { $(this).dialog("close"); } },
+      });
+      $("#dialog_modal_can_close").dialog({
+        autoOpen: false, modal: true, dialogClass: 'admin_config', // necessary to have a specific class because there are conflic with main menu accordeon
+        buttons: { "Cancel": function() { $(this).dialog("close"); }, "{/literal}{'Submit'|@translate}{literal}": function() { IsDataChanged = false; $(this).dialog("close"); } },
+      });
+      // Detect data change
+      /*IsDataChanged = false;
+      $("input, select").change(function() { IsDataChanged = true; });
+      //~ $(".tabsheet").click(function()
+      $(window).unload(function()
+        {
+          if (IsDataChanged)
+          {
+            //~ alert($(this).attr("name"));
+           //~ $("#dialog_modal_can_close").dialog( "option", "buttons", { "{/literal}{'Submit'|@translate}{literal}": function() { $(this).dialog("close"); } } );
+            $("#dialog_modal_can_close").dialog('open');
+            
+            //~ return true;
+            return false
+          }
+          else
+          {
+            return true;
+          }
+          //return ! IsDataChanged;
+        });*/
     });
 
