Index: /trunk/admin/themes/default/template/themes_installed.tpl
===================================================================
--- /trunk/admin/themes/default/template/themes_installed.tpl	(revision 23258)
+++ /trunk/admin/themes/default/template/themes_installed.tpl	(revision 23259)
@@ -1,7 +1,17 @@
 {include file='include/colorbox.inc.tpl'} 
+
 {footer_script}{literal}
 jQuery(document).ready(function() {
-  $("a.preview-box").colorbox(); 
-}); 
+  $("a.preview-box").colorbox();
+  
+  jQuery('.showInfo').tipTip({
+    'delay' : 0,
+    'fadeIn' : 200,
+    'fadeOut' : 200,
+    'maxWidth':'300px',
+    'keepAlive':true,
+    'activation':'click'
+  });
+});
 {/literal}{/footer_script}
 
@@ -12,65 +22,79 @@
 <div id="themesContent">
 
-<fieldset>
-<legend>{'Active Themes'|@translate}</legend>
-{if isset($active_themes)}
-<div class="themeBoxes">
-{foreach from=$active_themes item=theme}
-  <div class="themeBox{if $theme.is_default} themeDefault{/if}">
-    <div class="themeName">{$theme.name}{if $theme.is_default} <em>({'default'|@translate})</em>{/if} {if $theme.mobile} <em>({'Mobile'|@translate})</em>{/if}</div>
-    <div class="themeShot"><a href="{$theme.screenshot}" class="preview-box" title="{$theme.name}"><img src="{$theme.screenshot}" alt=""></a></div>
+{assign var='field_name' value='null'} {* <!-- 'counter' for fieldset management --> *}
+{foreach from=$tpl_themes item=theme}
+    
+{if $field_name != $theme.STATE}
+  {if $field_name != 'null'}
+    </div>
+  </fieldset>
+  {/if}
+  
+  <fieldset>
+    <legend>
+    {if $theme.STATE == 'active'}
+      {'Active Themes'|@translate}
+    {else}
+      {'Inactive Themes'|@translate}
+    {/if}
+    </legend>
+    <div class="themeBoxes">
+  {assign var='field_name' value=$theme.STATE}
+{/if}
+
+  {if not empty($theme.AUTHOR)}
+    {if not empty($theme.AUTHOR_URL)}
+      {assign var='author' value="<a href='%s'>%s</a>"|@sprintf:$theme.AUTHOR_URL:$theme.AUTHOR}
+    {else}
+      {assign var='author' value='<u>'|cat:$theme.AUTHOR|cat:'</u>'}
+    {/if}
+  {/if}
+  {if not empty($theme.VISIT_URL)}
+    {assign var='version' value="<a class='externalLink' href='"|cat:$theme.VISIT_URL|cat:"'>"|cat:$theme.VERSION|cat:"</a>"}
+  {else}
+    {assign var='version' value=$theme.VERSION}
+  {/if}
+  
+  <div class="themeBox{if $theme.IS_DEFAULT} themeDefault{/if}">
+    <div class="themeName">
+      {$theme.NAME} {if $theme.IS_DEFAULT}<em>({'default'|@translate})</em>{/if} {if $theme.IS_MOBILE}<em>({'Mobile'|@translate})</em>{/if}
+      <a class="showInfo" title="{if !empty($author)}{'By %s'|@translate|@sprintf:$author} | {/if}{'Version'|@translate} {$version}<br/>{$theme.DESC|@escape:'html'}">i</a>
+    </div>
+    <div class="themeShot"><a href="{$theme.SCREENSHOT}" class="preview-box" title="{$theme.NAME}"><img src="{$theme.SCREENSHOT}" alt=""></a></div>
     <div class="themeActions">
       <div>
-{if $theme.deactivable}
-      <a href="{$deactivate_baseurl}{$theme.id}" class="tiptip" title="{'Forbid this theme to users'|@translate}">{'Deactivate'|@translate}</a>
+{if $theme.STATE == 'active'}
+  {if $theme.DEACTIVABLE}
+      <a href="{$deactivate_baseurl}{$theme.ID}" class="tiptip" title="{'Forbid this theme to users'|@translate}">{'Deactivate'|@translate}</a>
+  {else}
+      <span title="{$theme.DEACTIVATE_TOOLTIP}" class="tiptip">{'Deactivate'|@translate}</span>
+  {/if}
+
+  {if not $theme.IS_DEFAULT}
+      | <a href="{$set_default_baseurl}{$theme.ID}" class="tiptip" title="{'Set as default theme for unregistered and new users'|@translate}">{'Default'|@translate}</a>
+  {/if}
+  {if $theme.ADMIN_URI}
+      <br><a href="{$theme.ADMIN_URI}" class="tiptip" title="{'Configuration'|@translate}">{'Configuration'|@translate}</a>
+  {/if}
 {else}
-      <span title="{$theme.deactivate_tooltip}" class="tiptip">{'Deactivate'|@translate}</span>
-{/if}
-      
-{if not $theme.is_default}
-      | <a href="{$set_default_baseurl}{$theme.id}" class="tiptip" title="{'Set as default theme for unregistered and new users'|@translate}">{'Default'|@translate}</a>
-{/if}
-{if isset($theme.admin_uri)}
-      <br><a href="{$theme.admin_uri}" class="tiptip" title="{'Configuration'|@translate}">{'Configuration'|@translate}</a>
+  {if $theme.ACTIVABLE}
+      <a href="{$activate_baseurl}{$theme.ID}" title="{'Make this theme available to users'|@translate}" class="tiptip">{'Activate'|@translate}</a>
+  {else}
+      <span title="{$theme.ACTIVATE_TOOLTIP}" class="tiptip">{'Activate'|@translate}</span>
+  {/if}
+      |
+  {if $theme.DELETABLE}
+      <a href="{$delete_baseurl}{$theme.ID}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');" title="{'Delete this theme'|@translate}">{'Delete'|@translate}</a>
+  {else}
+      <span title="{$theme.DELETE_TOOLTIP}" class="tiptip">{'Delete'|@translate}</span>
+  {/if}
 {/if}
       </div>
     </div> <!-- themeActions -->
   </div>
-{/foreach}
-</div> <!-- themeBoxes -->
-{/if}
-</fieldset>
-
-{if isset($inactive_themes)}
-<fieldset>
-<legend>{'Inactive Themes'|@translate}</legend>
-<div class="themeBoxes">
-{foreach from=$inactive_themes item=theme}
-  <div class="themeBox">
-    <div class="themeName">{$theme.name}{if $theme.mobile} <em>({'Mobile'|@translate})</em>{/if}</div>
-    <div class="themeShot"><a href="{$theme.screenshot}" class="preview-box" title="{$theme.name}"><img src="{$theme.screenshot}" alt=""></a></div>
-    <div class="themeActions">
-      <div>
-  {if $theme.activable}
-      <a href="{$activate_baseurl}{$theme.id}" title="{'Make this theme available to users'|@translate}" class="tiptip">{'Activate'|@translate}</a>
-  {else}
-      <span title="{$theme.activate_tooltip}" class="tiptip">{'Activate'|@translate}</span>
-  {/if}
-
-      |
-
-  {if $theme.deletable}
-      <a href="{$delete_baseurl}{$theme.id}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');" title="{'Delete this theme'|@translate}">{'Delete'|@translate}</a>
-  {else}
-      <span title="{$theme.delete_tooltip}" class="tiptip">{'Delete'|@translate}</span>
-  {/if}
-      </div>
-    </div>
-    
-  </div>
+  
 {/foreach}
 </div> <!-- themeBoxes -->
 </fieldset>
-{/if}
 
 </div> <!-- themesContent -->
Index: /trunk/admin/themes/default/theme.css
===================================================================
--- /trunk/admin/themes/default/theme.css	(revision 23258)
+++ /trunk/admin/themes/default/theme.css	(revision 23259)
@@ -759,8 +759,8 @@
 #thePopuphelpPage #footer  {display:none}
 
-.themeBox {display:inline-table; text-align:center; height:192px; background-color:#eee; margin:5px; -moz-border-radius:5px; overflow:hidden; }
+.themeBox {display:inline-table; text-align:center; height:192px; background-color:#eee; margin:5px; border-radius:5px; overflow:hidden; }
 
 .themeBox IMG {border:1px solid white; margin:0 15px;}
-.themeName {font-size:1.1em; margin:5px 0;}
+.themeName {font-size:1em; margin:5px 0; position:relative; }
 .themeActions {display: table-row; font-size:12px; height: 43px; }
 .themeActions DIV {display: table-cell; vertical-align: middle; line-height:18px; }
@@ -865,5 +865,5 @@
 .languageActions DIV {display: table-cell; vertical-align: middle; line-height:18px; }
 
-#ui-datepicker-div {-moz-border-radius:5px;}
+#ui-datepicker-div {-moz-border-radius:5px; border-radius:5px;}
 #ui-datepicker-div .ui-icon-circle-triangle-w, #ui-datepicker-div .ui-icon-circle-triangle-e {color:transparent;}
 #ui-datepicker-div A.ui-datepicker-prev, #ui-datepicker-div A.ui-datepicker-next {background-color:transparent;}
@@ -1101,5 +1101,4 @@
   -moz-border-radius:10px;
   -webkit-border-radius:10px;
-  -border-radius:10px;
   margin-left:5px;
 }
Index: /trunk/admin/themes_installed.php
===================================================================
--- /trunk/admin/themes_installed.php	(revision 23258)
+++ /trunk/admin/themes_installed.php	(revision 23259)
@@ -66,6 +66,5 @@
 }
 
-$active_themes = array();
-$inactive_themes = array();
+$tpl_themes = array();
 
 foreach ($themes->fs_themes as $theme_id => $fs_theme)
@@ -75,36 +74,45 @@
     continue;
   }
+  
+  $tpl_theme = array(
+    'ID' => $theme_id,
+    'NAME' => $fs_theme['name'],
+    'VISIT_URL' => $fs_theme['uri'],
+    'VERSION' => $fs_theme['version'],
+    'DESC' => $fs_theme['description'],
+    'AUTHOR' => $fs_theme['author'],
+    'AUTHOR_URL' => @$fs_theme['author uri'],
+    'PARENT' => @$fs_theme['parent'],
+    'SCREENSHOT' => $fs_theme['screenshot'],
+    'IS_MOBILE' => $fs_theme['mobile'],
+    'ADMIN_URI' => @$fs_theme['admin_uri'],
+    );
 
   if (in_array($theme_id, $db_theme_ids))
   {
-    $fs_theme['deactivable'] = true;
+    $tpl_theme['STATE'] = 'active';
+    $tpl_theme['DEACTIVABLE'] = true;
 
     if (count($db_theme_ids) <= 1)
     {
-      $fs_theme['deactivable'] = false;
-      $fs_theme['deactivate_tooltip'] = l10n('Impossible to deactivate this theme, you need at least one theme.');
+      $tpl_theme['DEACTIVABLE'] = false;
+      $tpl_theme['DEACTIVATE_TOOLTIP'] = l10n('Impossible to deactivate this theme, you need at least one theme.');
     }
-
-    if ($theme_id == $default_theme)
+    
+    $tpl_theme['IS_DEFAULT'] = ($theme_id == $default_theme);
+  }
+  else
+  {
+    $tpl_theme['STATE'] = 'inactive';
+    
+    // is the theme "activable" ?
+    if (isset($fs_theme['activable']) and !$fs_theme['activable'])
     {
-      $fs_theme['is_default'] = true;
-      array_unshift($active_themes, $fs_theme);
+      $tpl_theme['ACTIVABLE'] = false;
+      $tpl_theme['ACTIVABLE_TOOLTIP'] = l10n('This theme was not designed to be directly activated');
     }
     else
     {
-      $fs_theme['is_default'] = false;
-      array_push($active_themes, $fs_theme);
-    }
-  }
-  else
-  {
-    // is the theme "activable" ?
-    if (isset($fs_theme['activable']) and !$fs_theme['activable'])
-    {
-      $fs_theme['activate_tooltip'] = l10n('This theme was not designed to be directly activated');
-    }
-    else
-    {
-      $fs_theme['activable'] = true;
+      $tpl_theme['ACTIVABLE'] = true;
     }
 
@@ -112,7 +120,7 @@
     if (isset($missing_parent))
     {
-      $fs_theme['activable'] = false;
+      $tpl_theme['ACTIVABLE'] = false;
 
-      $fs_theme['activate_tooltip'] = sprintf(
+      $tpl_theme['ACTIVABLE_TOOLTIP'] = sprintf(
         l10n('Impossible to activate this theme, the parent theme is missing: %s'),
         $missing_parent
@@ -123,19 +131,34 @@
     $children = $themes->get_children_themes($theme_id);
 
-    $fs_theme['deletable'] = true;
+    $tpl_theme['DELETABLE'] = true;
 
     if (count($children) > 0)
     {
-      $fs_theme['deletable'] = false;
+      $tpl_theme['DELETABLE'] = false;
 
-      $fs_theme['delete_tooltip'] = sprintf(
+      $tpl_theme['DELETE_TOOLTIP'] = sprintf(
         l10n('Impossible to delete this theme. Other themes depends on it: %s'),
         implode(', ', $children)
         );
     }
+  }
+  
+  array_push($tpl_themes, $tpl_theme);
+}
 
-    array_push($inactive_themes, $fs_theme);
-  }
+// sort themes by state then by name
+function cmp($a, $b)
+{ 
+  $s = array('active' => 0, 'inactive' => 1);
+  
+  if (@$a['IS_DEFAULT']) return -1;
+  if (@$b['IS_DEFAULT']) return 1;
+  
+  if($a['STATE'] == $b['STATE'])
+    return strcasecmp($a['NAME'], $b['NAME']); 
+  else
+    return $s[$a['STATE']] >= $s[$b['STATE']]; 
 }
+usort($tpl_themes, 'cmp');
 
 $template->assign(
@@ -146,6 +169,5 @@
       'delete_baseurl' => $base_url.'&amp;action=delete&amp;theme=',
 
-      'active_themes' => $active_themes,
-      'inactive_themes' => $inactive_themes,
+      'tpl_themes' => $tpl_themes,
     )
   );
