{include file="$admintemplatepath/header.template"}
{include file="$admintemplatepath/navigation.template" showOpt=showBlogUsers title=$locale->tr("showBlogUsers")}
<script type="text/javascript">
{literal}
YAHOO.util.Event.addListener( window, "load", function() {
		var t = new Lifetype.UI.TableEffects( "list" );
		t.stripe();
		t.highlightRows();
	});
{/literal}
</script>
        <form id="blogUsers" action="admin.php" method="post">
        <div id="list">
  {include file="$admintemplatepath/successmessage.template"}
  {include file="$admintemplatepath/errormessage.template"}
            <table id="list" class="info" summary="{$locale->tr("showBlogUsers")}">
                <thead>
                    <tr>
                        <th><input class="checkbox" type="checkbox" name="all" id="all" value="1" onclick="toggleAllChecks('blogUsers');" /></th>
                        <th style="width:20%;">{$locale->tr("username")}</th>
                        <th style="width:40%;">{$locale->tr("full_name")}</th>                        
                        <th style="width:30%;">{$locale->tr("email")}</th>
                        <th style="width:10%;">{$locale->tr("actions")}</th>
                    </tr>
                </thead>
                {if $blogusers}
                <tbody>
                   {foreach from=$blogusers item=bloguser}
                    <tr>
                        <td>
                            <input class="checkbox" type="checkbox" name="userIds[{$bloguser->getId()}]" id="checks_1" value="{$bloguser->getId()}" />
                        </td>
                        <td class="col_highlighted">
                            <a id="user_{$bloguser->getId()}" href="?op=editBlogUser&amp;userId={$bloguser->getId()}">{$bloguser->getUsername()}</a>
							{assign var=blogId value=$blog->getId()}
							{assign var=userPerms value=$bloguser->getPermissions($blogId)}
							<script type="text/javascript">
							  myTooltip = new YAHOO.widget.Tooltip("myTooltip", {literal}{{/literal}  
							    context:"user_{$bloguser->getId()}",  
								text:"{$locale->tr("permissions")}:<br/>{foreach from=$userPerms item=perm}{$locale->tr($perm->getPermissionDescription())}<br/>{/foreach}"
								{literal}}{/literal} );
							</script>
                        </td>
                        <td>
                            {$bloguser->getFullName()}
                        </td>                        
                        <td>
                            <a href="mailto:{$bloguser->getEmail()}">
                            {$bloguser->getEmail()}
                            </a>
                        </td>
                        <td>
                            <div class="list_action_button">
							{check_perms perm=update_blog_users}
                            <a href="?op=editBlogUser&amp;userId={$bloguser->getId()}" title="{$locale->tr("edit")}">
	                           <img src="imgs/admin/icon_edit-16.png" alt="{$locale->tr("edit")}" />
	                        </a>
                            <a href="?op=deleteBlogUserPermissions&amp;userId={$bloguser->getId()}" title="{$locale->tr("revoke_permissions")}">
	                           <img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("revoke_permissions")}" />
	                        </a>
							{/check_perms}
                            </div>
                        </td>
                    </tr>
                    {/foreach}
                </tbody>
                {/if}
            </table>
        </div>
        <div id="list_action_bar">
			{check_perms perm=update_blog_users}
            <input type="submit" name="delete" value="{$locale->tr("revoke_permissions")}" class="submit" />
            <input type="hidden" name="op" value="deleteBlogUsersPermissions" />
			{/check_perms}
        </div>
	</form>
{include file="$admintemplatepath/footernavigation.template"}
{include file="$admintemplatepath/footer.template"}
