feature 2693 added: automatically show link to caddie if caddie not empty

git-svn-id: http://piwigo.org/svn/branches/2.4@17008 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
plegall 2012-07-25 11:43:35 +00:00
parent b9c3d840c5
commit d60339d4b5
3 changed files with 33 additions and 1 deletions

View file

@ -219,6 +219,24 @@ if ($conf['activate_comments'])
$template->assign('U_PENDING_COMMENTS', $link_start.'comments');
}
// any photo in the caddie?
$query = '
SELECT COUNT(*)
FROM '.CADDIE_TABLE.'
WHERE user_id = '.$user['id'].'
;';
list($nb_photos_in_caddie) = pwg_db_fetch_row(pwg_query($query));
if ($nb_photos_in_caddie > 0)
{
$template->assign(
array(
'NB_PHOTOS_IN_CADDIE' => $nb_photos_in_caddie,
'U_CADDIE' => $link_start.'batch_manager&cat=caddie',
)
);
}
// +-----------------------------------------------------------------------+
// | Plugin menu |
// +-----------------------------------------------------------------------+

View file

@ -41,6 +41,9 @@ Raphael("menubarUsers", 20, 16).path("").scale(0.6, 0.6, 0, 0).attr({fill: "#464
<li><a href="{$U_TAGS}">{'Tags'|@translate}</a></li>
<li><a href="{$U_RECENT_SET}">{'Recent photos'|@translate}</a></li>
<li><a href="{$U_BATCH}">{'Batch Manager'|@translate}</a></li>
{if $NB_PHOTOS_IN_CADDIE > 0}
<li><a href="{$U_CADDIE}">{'Caddie'|@translate}<span class="adminMenubarCounter">{$NB_PHOTOS_IN_CADDIE}</span></a></li>
{/if}
</ul>
</dd>
</dl>

View file

@ -1113,4 +1113,15 @@ input[type="text"].dError {border-color:#ff7070; background-color:#FFe5e5;}
.dErrorDesc {background-color:red; color:white; padding:0 5px;border-radius:10px; font-weight:bold;cursor:help;}
#wImg {max-height:100px;border:2px solid #ccc;margin-top:5px;}
#addWatermark {display:none;}
#addWatermark {display:none;}
.adminMenubarCounter {
background-color:#666;
color:white;
padding:1px 5px;
border-radius:10px;
-moz-border-radius:10px;
-webkit-border-radius:10px;
-border-radius:10px;
margin-left:5px;
}