<%-- Licensed Materials - Property of IBM, 5724-E76, 
(C) Copyright IBM Corp. 2001, 2004 - All Rights reserved. --%>
<%@ page import="com.ibm.wps.portlets.admin.shared.*"%>
<%@ page import="com.ibm.portal.content.ContentNode" %>
<%@ page import="com.ibm.portal.content.ContentNodeType" %>

<%--


  NOTE: If you change this file,  "touch" the version of Default.jsp which includes
     it to see your changes.  You can do this by editing Default.jsp and saving it.

     Default.jsp uses the @include JSP directive which compiles this file into the
     servlet for Default.jsp.


  NOTE: By default, automatic reloading of theme and skin JSP files is turned off.
          To see the changes you make to this file without stopping and restarting
          the server, follow the instructions for enabling automatic JSP reloading
          in the InfoCenter.
          
          Do not enable automatic JSP reloading in a production environment
          because performance will decrease.

--%>

<%-- Place Bar --%>

<wps:if navigationAvailable="yes" screen="Home,LoggedIn,LoggedOut">
  <!-- one row, one cell table to span the page-->
  <table border="0" class="wpsPlaceBar" cellspacing="0" cellpadding="0" width="100%">
    <tr>
      <!-- Navigation -->
      <td align="<%=bidiAlignLeft%>" valign="bottom" nowrap>
        <table border="0" cellpadding="0" cellspacing="0" height="100%" background='<%= wpsBaseURL %>/images/dot.gif'>
          <tr>
            <td class="wpsPlaceBar3dShadow" valign="middle"><img width="30"  border="0" src='<%= wpsBaseURL %>/images/dot.gif' alt=""></td>

             <%-- render previous and next page shift anchor --%>
              <wps:navigationShift by="-5" maxPages="6">
               <wps:if pageAvailablePrevious="yes">
                <td class="wpsPlaceBar3dShadow">
                <a href='<wps:urlParent/>'><img alt="<wps:text key="link.previous" bundle="nls.engine"/>" src="<wps:urlFindInTheme file='<%="tab_prev"+bidiImageRTL+".gif"%>'/>" border="0" align="absmiddle"></a>
               </wps:if>
               <wps:if pageAvailablePrevious="no">
                <td class="wpsPlaceBar3dShadow"><img alt="<wps:text key="link.previous" bundle="nls.engine"/>" src="<wps:urlFindInTheme file='<%="tab_prev_dis"+bidiImageRTL+".gif"%>'/>" border="0" align="absmiddle">
               </wps:if>
             </wps:navigationShift>

             <wps:navigationShift by="+5" maxPages="6">
               <wps:if pageAvailableNext="yes">
                <a href='<wps:urlParent/>'><img alt="<wps:text key="link.next" bundle="nls.engine"/>" src="<wps:urlFindInTheme file='<%="tab_next"+bidiImageRTL+".gif"%>'/>" border="0" align="absmiddle"></a>
                </td>
               </wps:if>
               <wps:if pageAvailableNext="no">
                <img alt="<wps:text key="link.next" bundle="nls.engine"/>" src="<wps:urlFindInTheme file='<%="tab_next_dis"+bidiImageRTL+".gif"%>'/>" border="0" align="absmiddle">
                </td>
               </wps:if>
            </wps:navigationShift>

            <wps:navigation startLevel="2" stopLevel="2">
            <wps:navigationLoop>
              <wps:if nodeInSelectionPath="yes">
                <td class="wpsSelectedPlace" nowrap height="100%">
                  <a class="wpsSelectedPlaceLink" href='<wps:navigationUrl type="link" />' >
                    &nbsp;<%= com.ibm.wps.model.LocaleHelper.getTitle((com.ibm.portal.Localized)wpsNavNode, pageContext.getRequest())%>&nbsp;
                  </a>

                                    <%-- Show icon for closing transient pages --%>
                                    <wps:closePage>
                                        <td class="wpsSelectedPlaceIcon">
                                            <a class="wpsSelectedPlaceLink" href="<% closePageURL.write(out); %>" >
                                                <img class="wpsNavNodeIcon" 
                                                     src="<wps:urlFindInTheme file='NavigationClose.gif'/>"
                                                     border="0"
                                                     align="absmiddle">
                                            </a>
                                        </td>
                                    </wps:closePage>


                <!-- display show tools buttons -->
                <wps:if showTools="yes">

                  <%-- link to customizer if node is a page --%>
                  <wps-internal:adminlinkinfo name="<%=AdminUniqueNamesMappingService.CONTENT_LAYOUT%>">
<%
                    if (((ContentNodeType.COMPOSITION).toString()).equals(wpsContentNodeTypeString)) {
%>
                      <wps:urlGeneration contentNode="<%=wpsContentNode%>"
                                 portletWindowState="Normal"
                                 pacCheck="<%=CreateUrlCommand.PAC_EDIT_LAYOUT%>">

                        <wps:urlParam name="<%= SharedParamConstants.WPS_ADMIN_NAVIGATION_INIT %>" value="init" />
                        <wps:urlParam name="<%= SharedParamConstants.WORKING_CONTENT_NODE%>" value="<%= wpsContentNodeID %>"/>
                        <wps:urlParam name="<%= SharedParamConstants.ORIGIN_CONTENT_NODE %>" value="<%= wpsContentNodeID %>" />
                        <wps:urlParam name="<%= SharedParamConstants.WPS_ADMIN_NAVIGATION_PUSH %>" value="push" />

                        <td class="wpsSelectedPlaceIcon">
                          <a class="wpsSelectedPlaceLink"  href="<% wpsURL.write(out); %>" >
                            <img class="wpsNavNodeIcon" alt="<wps:text key="link.editlayout" bundle="nls.engine"/>"
                               src="<wps:urlFindInTheme file='show_tools_edit.gif'/>"
                               border="0" 
                               align="absmiddle">
                          </a>
                        </td>

                      </wps:urlGeneration>
<%
                    }
%>
                  </wps-internal:adminlinkinfo>
                  <%-- link to properties portlet if node is a label --%>
                  <wps-internal:adminlinkinfo name="<%=AdminUniqueNamesMappingService.PROPERTIES_PORTLET%>">
<%
                     if (((ContentNodeType.LABEL).toString()).equals(wpsContentNodeTypeString)) {
%>
                      <wps:urlGeneration contentNode="<%=wpsContentNode%>"
                                 compositionNode='<%= wpsCompositionNode %>'
                                 portletWindowState="Solo" 
                                 pacCheck="<%=CreateUrlCommand.PAC_EDIT_LAYOUT%>">

                        <wps:urlParam name="<%= SharedParamConstants.WPS_ADMIN_NAVIGATION_INIT %>" value="init" />
                        <wps:urlParam name="<%= SharedParamConstants.ORIGIN_CONTENT_NODE %>" value="<%= wpsContentNodeID %>" />
                        <wps:urlParam name="<%= SharedParamConstants.WORKING_CONTENT_NODE%>" value="<%= wpsContentNodeID %>"/>
                        <wps:urlParam name="<%= SharedParamConstants.PROPERTIES_ACTION_TYPE %>" value="<%= SharedParamConstants.PROPERTIES_ACTION_TYPE_EDIT %>" />
                        <wps:urlParam name="<%= SharedParamConstants.PROPERTIES_CONTENT_NODE_TYPE %>" value="<%= SharedParamConstants.PROPERTIES_CONTENT_NODE_TYPE_LABEL %>" />
                        <wps:urlParam name="<%= SharedParamConstants.WPS_ADMIN_NAVIGATION_PUSH %>" value="push" />

                        <td class="wpsSelectedPlaceIcon">
                          <a class="wpsSelectedPlaceLink"  href="<% wpsURL.write(out); %>" >
                            <img class="wpsNavNodeIcon" alt="<wps:text key="link.editlayout" bundle="nls.engine"/>"
                               src="<wps:urlFindInTheme file='show_tools_properties.gif'/>"
                               border="0" 
                               align="absmiddle">
                          </a>
                        </td>

                      </wps:urlGeneration>
<%
                     }
%>
                    </wps-internal:adminlinkinfo>

                <!-- end show tools -->
                </wps:if>
                </td>
              </wps:if>

              <wps:if nodeInSelectionPath="no">
<%
                 // The following check is present so that when this theme is used with a
                                 // workplace application installed on this portal, special navigation
                                 // nodes are hidden from the navigation.
                 ContentNode cNode = wpsNavNode.getContentNode();

                 boolean bShowNode = true;

                 if( cNode != null && cNode instanceof MetaData) {
                  MetaData md = (MetaData) cNode;
                  Object o = md.getValue( "hidden");
                  if ( o != null && o.toString( ).equalsIgnoreCase( "Yes") ) {
                    bShowNode = false;
                  }
                  }

                if( bShowNode) {
%>
                    <td class="wpsUnSelectedPlace" nowrap height="100%">
                      <a class="wpsUnSelectedPlaceLink" href='<wps:navigationUrl type="link" />' >
                        &nbsp;<%= com.ibm.wps.model.LocaleHelper.getTitle((com.ibm.portal.Localized)wpsNavNode, pageContext.getRequest()) %>&nbsp;
                      </a>
                    </td>
                <% 
                }  
                %>
              </wps:if>
            </wps:navigationLoop>
            </wps:navigation>
          </tr>
        </table>

      </td>
      <!-- Favorites -->
      <td align="<%=bidiAlignRight%>" valign="middle" dir="ltr" nowrap>

        <%
          boolean firstItem = true;
        %>              
        <table border="0" cellpadding="0" cellspacing="0" <%= bidiDirAttr %> >
          <tr>

            <wps:if loggedIn="yes" notScreen="SelfcareUserForm,SelfcareUserConf">

              <td valign="middle">
                <%-- Since we aren't sending more than 1024 bytes and since we aren't sending DBCS data, it is not necessary to use POST for this form.  If we use GET instead of POST, it makes life easier on proxy servers. --%>
                <form name="wpsFavoritesSelectionForm" method="GET" style="margin-bottom: 0" action='<wps:url commandParam="favoritesCommand"/>'>
                  <select name="favoritesCommand" onchange="javascript: if (this.options[this.selectedIndex].value.charAt(0) == '@') { window.open(this.options[this.selectedIndex].value.substring(1), '_blank'); this.selectedIndex=0; return  false;  }  else  {  this.form.submit();  return  false;  }">
                    <option value='#' selected><wps:text key='link.favorites.myfavorites' bundle='nls.engine'/>
                    <wps:if pageBookmarkable="true">
                      <option value='<wps:url command="AddBookmark" alias="wps.My Favorites"/>' ><wps:text key='link.favorites.add' bundle='nls.engine'/>
                    </wps:if>
                    <!-- urlSelect removed: placeName="Work with Pages" pageName="Organize My Favorites"
                      Must be replaced by UrlGeneration tag -->

                    <wps:urlGeneration contentNode="wps.Organize Favorites" portletWindowState="Normal" pacCheck="NoCheck">
                    <option value='<% wpsURL.write(out); %>' ><wps:text key='link.favorites.orgainize' bundle='nls.engine'/>
                    </wps:urlGeneration>
                    <option value='#'>------------

                    <wps:favoritesLoop>
                      <% 
                        // wpsFavoritesURL is null for folders in the list of favorites
                        if (wpsFavoritesURL != null)
                        {
                           // Check the favorite type.  If it is an external URL, add a symbol to the URL
                           // so the JavaScript on the select can detect when to open a new window
                           // wpsFavoritesType may be null.  wpsFavoritesType=1 means external URL
                           if ("EXTERNALURL".equals(wpsFavoritesType))
                            wpsFavoritesURL = "@" + wpsFavoritesURL;
                            
                           // Phone number links are only supported on WML devices... and favorites are not markup-specific.
                           // wpsFavoritesType may be null.  wpsFavoritesType=2 means Phone Number
                           if (!"2".equals(wpsFavoritesType))
                           {
                      %>
                            <option value="<%= wpsFavoritesURL %>"><% for (int favSpace=1; favSpace < wpsFavoritesLevel.intValue(); favSpace++) {%>&nbsp;&nbsp;&nbsp;<% } %><%= wpsFavoritesTitle %>
                      <%
                           }
                        }
                        else
                        {
                      %>
                        <option value="#" ><% for (int favSpace=1; favSpace < wpsFavoritesLevel.intValue(); favSpace++) {%>&nbsp;&nbsp;&nbsp;<% } %>--<%= wpsFavoritesTitle %>--
                      <%
                        }
                      %>
                    </wps:favoritesLoop>

                  </select>
                  <noscript>
                    <input type="image" border="0" align="absmiddle" src='<wps:urlFindInTheme file="go.gif"/>'/><span class="wpsPlaceBarLink" >&nbsp;<wps:text key="go" bundle="nls.button"/></span>
                  </noscript>
                </form>
              </td>
              <td>&nbsp;&nbsp;</td>

            </wps:if>

          </tr>
        </table>
      </td>
    </tr>
  </table>
</wps:if>


 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.