{*<!--

+---------------------------------------------------------------------------+
| OpenX v2.8                                             |
| =========                             |
|                                                                           |
| Copyright (c) 2003-2009 OpenX Limited                                     |
| For contact details, see: http://www.openx.org/                           |
|                                                                           |
| This program is free software; you can redistribute it and/or modify      |
| it under the terms of the GNU General Public License as published by      |
| the Free Software Foundation; either version 2 of the License, or         |
| (at your option) any later version.                                       |
|                                                                           |
| This program is distributed in the hope that it will be useful,           |
| but WITHOUT ANY WARRANTY; without even the implied warranty of            |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             |
| GNU General Public License for more details.                              |
|                                                                           |
| You should have received a copy of the GNU General Public License         |
| along with this program; if not, write to the Free Software               |
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA |
+---------------------------------------------------------------------------+
$Id:captcha-dialog.html 11612 2007-10-26 11:00:05Z matteo.beccati@openads.org $

-->*}

{if $headerModel && $headerModel->getTitle() != ''}
    {assign var=breadcrumbs value=$headerModel->getEntityBreadcrumbs()}
    {assign var=breadcrumbCount value=$breadcrumbs|@count}

    <div class="breadcrumb {if $headerModel->getIconClass()}hasIcon {$headerModel->getIconClass()}{/if}">
        <h3 {if $breadcrumbCount == 0}class="noBreadcrumb"{/if}>
            <span class='label'>{$headerModel->getTitle()}</span>{if $headerModel->getPageType() == "edit"}:{/if}
            {$headerModel->getEntityName()|escape}
            {if $headerModel->getNewTargetName()}
                <span class='target'>
                    {$headerModel->getNewTargetTitle()}
                    {if $headerModel->getNewTargetLink()}<a href="{$headerModel->getNewTargetLink()}" title="{$headerModel->getNewTargetName()|escape}">{/if}
                    {$headerModel->getNewTargetName()|escape}
                    {if $headerModel->getNewTargetLink()}</a>{/if}
                </span>
            {/if}
        </h3>

        {if !$hideNavigator && $headerModel->hasEntityList()}
        <div class='dropDown entityList'>
            <span>
                <span>
                    <ul>
                    {section name=breadcrumbIndex loop=$breadcrumbs}
                        <li class="ent inlineIcon {$breadcrumbs[breadcrumbIndex]->getCssClass()}">{$breadcrumbs[breadcrumbIndex]->getEntityLabel()}: {$breadcrumbs[breadcrumbIndex]->getEntityName()|escape}</li>
                        {if $smarty.section.breadcrumbIndex.index lt $breadcrumbCount - 1}
                        <li class='sep'>&gt;</li>
                        {/if}
                    {/section}
                    </ul>
                </span>
            </span>
            <div class='panel'><div></div></div>
            <div class='mask'></div>
        </div>

        <script type='text/javascript'>{literal}
        <!--

          var entityList = [
            {/literal}{section name=breadcrumbIndex loop=$breadcrumbs}{literal}
              {
                'label': '{/literal}{$breadcrumbs[breadcrumbIndex]->getEntityLabel()}{literal}',
                'name': '{/literal}{$breadcrumbs[breadcrumbIndex]->getHtmlName()}{literal}',
                'className': '{/literal}{$breadcrumbs[breadcrumbIndex]->getCssClass()}{literal}',
                'id': '{/literal}{$breadcrumbs[breadcrumbIndex]->getEntityId()}{literal}'
              }{/literal}{if $smarty.section.breadcrumbIndex.index lt $breadcrumbCount - 1},{/if}{literal}
            {/literal}{/section}{literal}
          ];


          var itemTree = {};

          {/literal}
              {section name=breadcrumbIndex loop=$breadcrumbs}
          {literal}

          itemTree{/literal}{$smarty.capture.ids}{literal} = {
                  {/literal}{foreach name=items from=$breadcrumbs[breadcrumbIndex]->getEntityMap() key=itemId item=aEntity}{literal}
              			{/literal}{$itemId}{literal}:     {
                      'name': '{/literal}{$aEntity.name|escape}{literal}'
                    }{/literal}{if $smarty.foreach.items.last eq false},{/if}{literal}
                  {/literal}{/foreach}{literal}
          };

          {/literal}
              {capture name=ids}{if $smarty.capture.ids}{$smarty.capture.ids}{/if}[{$breadcrumbs[breadcrumbIndex]->getEntityId()}]['items']{/capture}
              {/section}
          {literal}


          $('.entityList').activateNavigator(entityList, itemTree);


        //-->
        {/literal}</script>
        {else}
            <span class="entityLinks">
            {section name=breadcrumbIndex loop=$breadcrumbs}
                {if $breadcrumbs[breadcrumbIndex]->getUrl()}
                    <a href="{$breadcrumbs[breadcrumbIndex]->getUrl()}" class="ent inlineIcon {$breadcrumbs[breadcrumbIndex]->getCssClass()}">{$breadcrumbs[breadcrumbIndex]->getEntityLabel()}: {$breadcrumbs[breadcrumbIndex]->getEntityName()|escape}</a>
                {else}
                    <span class="ent inlineIcon {$breadcrumbs[breadcrumbIndex]->getCssClass()}">{$breadcrumbs[breadcrumbIndex]->getEntityLabel()}: {$breadcrumbs[breadcrumbIndex]->getEntityName()|escape}</span>
                {/if}

                {if $smarty.section.breadcrumbIndex.index lt $breadcrumbCount - 1}
                    <span class='sep'>&gt;</span>
                {/if}
            {/section}
            </span>
        {/if}
    </div>
{/if}

