Index: extensions/gally/gally-black-graphite/template/picture.tpl
===================================================================
--- extensions/gally/gally-black-graphite/template/picture.tpl	(revision 11031)
+++ extensions/gally/gally-black-graphite/template/picture.tpl	(revision 12602)
@@ -1,7 +1,12 @@
 <!-- **GBL** >PICTURE> -->
 
+
+
+
+
+
 {include file='dialogs.tpl'}
 
-<div id="content">
+<div id="content" {if isset($MENUBAR)}class="pictureContent"{/if}>
 
   <div id="theImageHigh" style="display:none;">
@@ -11,10 +16,32 @@
       <div id="theImgHighZoomButton" class="fit" onclick="gallyPP.switchZoomHigh();"></div>
       <div id="theImgHighContainer2">
-        <img id="theImgHigh" src="" style="display:none;" alt="{$ALT_IMG}">
+        <img id="theImgHigh" src="" style="display:none;" alt="{$ALT_IMG}"
+          {if isset($COMMENT_IMG)}
+            title="{$COMMENT_IMG|@strip_tags:false|@replace:'"':' '}" {else} title="{$current.TITLE|@replace:'"':' '} - {$ALT_IMG}"
+          {/if}>
       </div>
     </div>
   </div>
 
+
+  {if isset($MENUBAR)}
+  <div id="imageHeaderBar" class="borderMenu">
+    <div class="titrePage" id='titrePageID'>
+      {if #menuAnimated# == "noswitch"}
+          {$MENUBAR}
+      {else}
+        <div class="titrePage" id='titrePageID'>
+          <div id="menuswitcher">
+            <a id="icon_menu" class="button" onclick="gallyCP.switchmenu('', '{$ROOT_URL}{$themeconf.icon_dir}/');">&nbsp;
+            </a>
+          </div>
+        </div>
+        {$MENUBAR}
+      {/if}
+    </div>
+  {else}
   <div id="imageHeaderBar">
+  {/if}
+
     <div class="imageNumber">{$PHOTO}</div>
     <div class="browsePath">
@@ -25,5 +52,4 @@
   </div> <!-- imageHeaderBar -->
 
-
   {if !empty($PLUGIN_PICTURE_BEFORE)}{$PLUGIN_PICTURE_BEFORE}{/if}
 
@@ -38,5 +64,5 @@
 
     {if isset($COMMENT_IMG)}
-    <p>{$COMMENT_IMG}</p>
+    <p class="imageComment">{$COMMENT_IMG}</p>
     {else}
     <p>&nbsp;</p>
@@ -261,14 +287,14 @@
             {/if}
 
-            {if (isset($rate_summary) or isset($rating)) and  $display_info.average_rate}
-              <tr>
+            {if (isset($rate_summary) or isset($rating)) and  $display_info.rating_score}
+              <tr id="rating">
                 {if isset($rate_summary)}
-                  <td class="label">{'Average rate'|@translate}</td>
-                  <td class="value" id="ratingSummary">
+                  <td class="label">{'Rating score'|@translate}</td>
+                  <td class="value">
                   {if $rate_summary.count}
-                    {assign var='rate_text' value='%.2f (rated %d times)'|@translate }
-                    {$pwg->sprintf($rate_text, $rate_summary.average, $rate_summary.count) }
+                    <span id="ratingScore">{$rate_summary.score}</span>
+                    <span id="ratingCount">({assign var='rate_text' value='%d rates'|@translate}{$pwg->sprintf($rate_text, $rate_summary.count)})</span>
                   {else}
-                    {'no rate'|@translate}
+                    <span id="ratingScore">{'no rate'|@translate}</span> <span id="ratingCount"></span>
                   {/if}
                   </td>
@@ -283,20 +309,34 @@
 
                     <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;">
-                    <div>&nbsp;
-                    {foreach from=$rating.marks item=mark name=rate_loop}
-                    {if !$smarty.foreach.rate_loop.first} | {/if}
-                    {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE}
-                      <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}" />
-                    {else}
-                      <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}" />
-                    {/if}
-                    {/foreach}
-                    <script type="text/javascript" src="{$ROOT_URL}themes/default/js/rating.js"></script>
-                    <script type="text/javascript">
-                    makeNiceRatingForm( {ldelim}rootUrl: '{$ROOT_URL|@escape:"javascript"}', image_id: {$current.id},
-                    updateRateText: "{'Update your rating'|@translate|@escape:'javascript'}", updateRateElement: document.getElementById("updateRate"),
-                    ratingSummaryText: "{'%.2f (rated %d times)'|@translate|@escape:'javascript'}", ratingSummaryElement: document.getElementById("ratingSummary") {rdelim} );
-                    </script>
-                    </div>
+                      <div>&nbsp;
+                      {foreach from=$rating.marks item=mark name=rate_loop}
+                        {if !$smarty.foreach.rate_loop.first} | {/if}
+
+                        {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE}
+                          <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}" />
+                        {else}
+                          <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}" />
+                        {/if}
+
+                      {/foreach}
+
+                      {combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
+                      {combine_script id='rating' load='async' require='core.scripts' path='themes/default/js/rating.js'}
+
+
+                      {footer_script}
+                        var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[];
+                        _pwgRatingAutoQueue.push( {ldelim}rootUrl: '{$ROOT_URL}', image_id: {$current.id},
+                          onSuccess : function(rating) {ldelim}
+                            var e = document.getElementById("updateRate");
+                            if (e) e.innerHTML = "{'Update your rating'|@translate|@escape:'javascript'}";
+                            e = document.getElementById("ratingScore");
+                            if (e) e.innerHTML = rating.score;
+                            e = document.getElementById("ratingCount");
+                            if (e) e.innerHTML = "({'%d rates'|@translate|@escape:'javascript'})".replace( "%d", rating.count);
+                          {rdelim}{rdelim} );
+                      {/footer_script}
+
+                      </div>
                     </form>
                   </td>
