<%
  import org.exoplatform.wcm.webui.Utils;
  
  def rcontext = _ctx.getRequestContext();
  String portletId = Utils.getRealPortletId(rcontext);
%>

<div class="UIForm $uicomponent.id" >
   <%
    uiform.begin()
      %>
          <div class="FormContainer">
            <fieldset class="fieldsetPreferences" >
              <legend class="StyleLegend"><%= _ctx.appRes("UISCVPreferences.label.ContentPathBlock") %></legend>
              <table class="UIFormGrid" >    
                <tr>                  
                  <td class="FieldLabel" ><%=uicomponent.getLabel(uicomponent.ITEM_PATH_FORM_INPUT_SET) %></td>
                  <td class="FieldComponent" <% if (uicomponent.getSelectedNodePath() != null) { %> title="<%=uicomponent.getSelectedNodePath()%>" <% }%> ><% uiform.renderField(uicomponent.ITEM_PATH_FORM_INPUT_SET) %></td>
                  <td class ="tdShowHelp">
                    <div class="IconInContextHelp ShowHelpIcon" id="ContentPathHelp" onmouseover="eXo.ecm.WCMUtils.showInContextHelp('ContentPathHelp', 'true')" onmouseout="eXo.ecm.WCMUtils.showInContextHelp('ContentPathHelp', 'false')">
                        <div class="InContextHelpContent" >                    
                          <div class="InContextHelpPopup">
                            <div id="ContentPathHelpID" class="LeftInContextHelpPopup"><%= _ctx.appRes("UISCVPreferences.help.ContentPathBlock") %>
                            </div>
                          </div>                      
                        </div>
                    </div>
                  </td>
                </tr>
              </table>
            </fieldset>  
          </div>
          
          <div class="FormContainer">
          <fieldset class="fieldsetPreferences" >
              <legend class="StyleLegend"><%= _ctx.appRes("UISCVPreferences.label.DisplaySettingBlock") %></legend>
              <table class="UIFormGrid">
                <tr>                  
                  <td class="FieldComponent AlignRight" ><% uiform.renderField(uicomponent.SHOW_TITLE_CHECK_BOX) %></td>
                  <td><%=uicomponent.getLabel(uicomponent.SHOW_TITLE_CHECK_BOX) %></td>                  
                  
                  <td class="FieldComponent AlignRight" ><% uiform.renderField(uicomponent.SHOW_DATE_CHECK_BOX) %></td>
                  <td><%=uicomponent.getLabel(uicomponent.SHOW_DATE_CHECK_BOX) %></td>                  
                  
                  <td  class="FieldComponent AlignRight" ><% uiform.renderField(uicomponent.SHOW_OPION_BAR_CHECK_BOX) %></td>
                  <td><%=uicomponent.getLabel(uicomponent.SHOW_OPION_BAR_CHECK_BOX) %></td>
                  <td class ="tdShowHelp">
                    <div class="IconInContextHelp ShowHelpIcon" id="ShowOptionHelp" onmouseover="eXo.ecm.WCMUtils.showInContextHelp('ShowOptionHelp', 'true')" onmouseout="eXo.ecm.WCMUtils.showInContextHelp('ShowOptionHelp', 'false')">
                        <div class="InContextHelpContent" >                    
                          <div class="InContextHelpPopup">
                            <div id="ShowOptionHelpID" class="LeftInContextHelpPopup"><%= _ctx.appRes("UISCVPreferences.help.DisplaySettingBlock") %> 
                            </div>
                          </div>                      
                        </div>
                     </div>
                  </td>
                </tr>                
              </table>
            </fieldset>             
          </div>
          
          <div class="FormContainer">
          <fieldset class="fieldsetPreferences" >
              <legend class="StyleLegend"><%= _ctx.appRes("UISCVPreferences.label.PrintSettingBlock") %></legend>
              <table class="UIFormGrid">
                <tr>                  
                  <td class="FieldLabel" ><%=uicomponent.getLabel(uicomponent.PRINT_PAGE_FORM_INPUT_SET) %></td>
                  <td class="FieldComponent" ><% uiform.renderField(uicomponent.PRINT_PAGE_FORM_INPUT_SET) %></td>          
                </tr>
                <tr>                  
                <td class="FieldLabel" ><%=uicomponent.getLabel(uicomponent.PRINT_PAGE_PARAMETER_INPUT) %></td>
                <td class="FieldComponent"><% uiform.renderField(uicomponent.PRINT_PAGE_PARAMETER_INPUT) %></td>              
              </tr>
              </table>
            </fieldset>             
          </div>
          
          <a href="#" id="UISCVShowAdvanceOption" class="AdvancePreferences"  onClick="document.getElementById('UISCVShowAdvanceOption').style.display='none';document.getElementById('UISCVContextualSelectionAdvance').style.display='block';">
             <%= _ctx.appRes("UISCVPreferences.label.Advance") %></a>
             
          <div class="FormContainer" id="UISCVContextualSelectionAdvance">
          <fieldset class="fieldsetPreferences" >
            <legend class="StyleLegend">
              <a href="#" class="AdvancePreferences" onClick="document.getElementById('UISCVContextualSelectionAdvance').style.display='none';document.getElementById('UISCVShowAdvanceOption').style.display='block';"><%=_ctx.appRes("UISCVPreferences.label.Advance")%></a>
             </legend>
              <div><%=_ctx.appRes("UISCVPreferences.label.ContextCaption") %></div>
              <table class="UIFormGrid" >
                <tr>
                  <td class="FieldComponent AlignRight" ><%=uicomponent.getLabel(uicomponent.CONTEXTUAL_SELECT_RADIO_BOX) %></td>
                  <td>
                    <div onclick="if (document.getElementById('<%=uicomponent.id%>').<%=uicomponent.CONTEXTUAL_SELECT_RADIO_BOX%>[0].checked) document.getElementById('<%=uicomponent.id%>').<%=uicomponent.PARAMETER_INPUT_BOX%>.removeAttribute('readonly',0); else document.getElementById('<%=uicomponent.PARAMETER_INPUT_BOX%>').setAttribute('readonly',true);">
                      <%uiform.renderField(uicomponent.CONTEXTUAL_SELECT_RADIO_BOX) %>                      
                    </div>
                  </td>
                  <td class ="tdShowHelp">
                  <div class="IconInContextHelp ShowHelpIcon" id="ContextualHelp" onmouseover="eXo.ecm.WCMUtils.showInContextHelp('ContextualHelp', 'true')" onmouseout="eXo.ecm.WCMUtils.showInContextHelp('ContextualHelp', 'false')">
                      <div class="InContextHelpContent" >                    
                        <div class="InContextHelpPopup">
                          <div id="ContextualHelpID" class="LeftInContextHelpPopup"><%= _ctx.appRes("UISCVPreferences.help.ContextualHelp") %>
                          </div>
                        </div>                      
                      </div>
                  </div>
                </td>
                </tr>
                <tr>                  
                  <td class="FieldLabel" ><%=uicomponent.getLabel(uicomponent.PARAMETER_INPUT_BOX) %></td>
                  <td class="FieldComponent" ><%uiform.renderField(uicomponent.PARAMETER_INPUT_BOX) %></td>
                  <td class ="tdShowHelp">
                  <div class="IconInContextHelp ShowHelpIcon" id="ParameterHelp" onmouseover="eXo.ecm.WCMUtils.showInContextHelp('ParameterHelp', 'true')" onmouseout="eXo.ecm.WCMUtils.showInContextHelp('ParameterHelp', 'false')">
                      <div class="InContextHelpContent" >                    
                        <div class="InContextHelpPopup">
                          <div id="ParameterHelpID" class="LeftInContextHelpPopup"><%= _ctx.appRes("UISCVPreferences.help.ParameterHelp") %>
                          </div>
                        </div>                      
                      </div>
                   </div>
                </td>
                </tr>                
              </table>
              <div><%=_ctx.appRes("UISCVPreferences.label.CacheManagement") %></div>
              <table class="UIFormGrid" width="100%">
                <tr>                  
                  <td class="FieldLabel" style="text-align:left;vertical-align:middle;">
                    <%uiform.renderField(uicomponent.CACHE_ENABLE_SELECT_RADIO_BOX) %>                      
                  </td>
                </tr>
              </table>
            </fieldset>  
          </div>
          <script type="text/javascript">
            if (document.getElementById('<%=uicomponent.id%>').<%=uicomponent.CONTEXTUAL_SELECT_RADIO_BOX%>[0].checked) {
              document.getElementById('<%=uicomponent.id%>').<%=uicomponent.PARAMETER_INPUT_BOX%>.removeAttribute('readonly',0);
              document.getElementById('UISCVShowAdvanceOption').style.display='none';
            }else {
              document.getElementById('<%=uicomponent.PARAMETER_INPUT_BOX%>').setAttribute('readonly',true);
              document.getElementById('UISCVContextualSelectionAdvance').style.display='none';
            }            
          </script>
        <div class="UIAction"> 
				  <% for(action in uicomponent.getActions()) { 
					   String actionLabel = _ctx.appRes(uicomponent.getName() + ".action." + action) ;
					   String link = uicomponent.event(action) ;
				  %>
						  <a  onclick="$link" class="ActionButton LightBlueStyle" href="javascript:void(0);">$actionLabel</a>
				 <%}%>        
				</div>
      <%
    uiform.end()
  %>
</div>