<%@ page language="java" buffer="100kb" errorPage="/common/error.jsp"%>

<%@ page import="org.apache.struts.Globals" %>

<%@ taglib uri="struts-bean"  prefix="bean" %>
<%@ taglib uri="struts-html"  prefix="html" %>
<%@ taglib uri="struts-logic" prefix="logic" %>
<%@ taglib uri="vkc-taglib"   prefix="vkc" %>

<% String ctxPath = request.getContextPath();%>

<bean:define id="form" name="showRecentNewsForm" scope="request" type="vkc.news.form.ShowRecentNewsForm"/>

<html:html locale="true">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta http-equiv="cache"        content="no-cache">
    <meta http-equiv="expires"      content="0">

	<vkc:cssinclude />

    <title><vkc:message key="vkc.news.showNews"/></title>
    <script type="text/javascript" src="<vkc:rewrite page='/common/utils.js'/>"></script>

    <script type="text/javascript">
    window.name = "MAINVIEW";
    </script>

</head>

<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" marginwidth="0" marginheight="0">

<table width="100%" cellspacing="0" cellpadding="0" border="0">
  <html:form action="/showRecentNews" method="post">
  
  <logic:notEmpty name="form" property="linkType">
  <html:hidden property="linkType"/>
  </logic:notEmpty>
  <logic:notEmpty name="form" property="objectId">
  <html:hidden property="objectId"/>
  </logic:notEmpty>
  <logic:notEmpty name="form" property="loginType">
  <html:hidden property="loginType"/>
  </logic:notEmpty>

  <logic:present name="<%=Globals.ERROR_KEY%>">
  <tr><td colspan="2" align="left"><vkc:errors /></td></tr>
  <tr><td colspan="2" height="1"><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" width="1" height="5" border="0"/></td></tr>
  </logic:present>
  
  <logic:notEmpty name="form" property="recentNews">
  <logic:iterate id="news" name="form" property="recentNews" type="vkc.db.entities.VKCNews">
  <tr><td><vkc:img page="/templates/${template.name}/gfx/trans.gif" width="20" height="20" border="0" alt=""/></td></tr>
  <tr> 
	<td>  
      <table cellspacing="3" cellpadding="0" border="0" width="100%">
        <tr>
          <td colspan="2">
            <table cellspacing="0" cellpadding="0" border="0" width="100%">
              <tr class="color_doctitle">
                <td width="99%"><b><vkc:write name="news" property="headline"/></b></td>
                <td align="right" width="1%"><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="24" width="1"/></td>
                <td align="right" nowrap><b>[<vkc:message key="vkc.news.creator"/></b>&nbsp;<vkc:write name="news" property="creatorName"/>&nbsp;(<vkc:write name="news" property="creatorFirstname"/>&nbsp;<vkc:write name="news" property="creatorLastname"/>)&nbsp;<b><vkc:message key="vkc.news.at"/></b>&nbsp;<vkc:write name="news" property="created" formatKey="date.medium.format"/><b>]</b></td>
              </tr>
            </table>
          </td>
        </tr>
        <tr>
          <td width="1%" nowrap="nowrap" valign="top"><b><vkc:message key="vkc.news.newstext"/>:</b>&nbsp;</td>
          <td width="99%">
          <logic:equal name="form" property="tinyMCECompatible" value="true">
          <vkc:write name="news" property="newsText" displayAsHTML="true" renderNewLine="true"/>
          </logic:equal>
          <logic:equal name="form" property="tinyMCECompatible" value="false">
          <vkc:write name="news" property="newsText" stripHTML="true" renderNewLine="true"/>
          </logic:equal>
          </td>
        </tr>
        <tr>
          <td width="1%" nowrap="nowrap"><b><vkc:message key="vkc.news.infourl"/>:</b>&nbsp;</td>
          <td width="99%"><a href="<vkc:write name='news' property='infoUrl'/>" target="_blank"><vkc:write name="news" property="infoUrl"/></a></td>
        </tr>
        <logic:notEmpty name="news" property="validFrom">
        <tr>
          <td width="1%" nowrap="nowrap"><b><vkc:message key="vkc.news.validFrom"/>:</b>&nbsp;</td>
          <td width="99%"><vkc:write name="news" property="validFrom" formatKey="date.medium.format"/></td>
        </tr>
        </logic:notEmpty>
        <logic:notEmpty name="news" property="validUntil">
        <tr>
          <td width="1%" nowrap="nowrap"><b><vkc:message key="vkc.news.validUntil"/>:</b>&nbsp;</td>
          <td width="99%"><vkc:write name="news" property="validUntil" formatKey="date.medium.format"/></td>
        </tr>
        </logic:notEmpty>
      </table>
	</td>
  </tr>
  </logic:iterate>
  </logic:notEmpty>

  <logic:empty name="form" property="recentNews">
  <tr><td>&nbsp;</td></tr>
  <tr><td width="100%" align="center"><b><vkc:message key="vkc.news.nonews"/></b></td></tr>
  </logic:empty>
  
  <vkc:hline colspan="5" lineClass="hline" lineHeight="1" topSpace="5" bottomSpace="5"/>
  
  <tr><td align="center"><vkc:button property="action.redirect" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="vkc.news.button.continue"/></vkc:button></td></tr>
  <tr><td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" width="5" height="5" border="0"/></td></tr>
  </html:form>
</table>
</body>
</html:html>
