Location: PHPKode > scripts > eventCreator > eventCreator-2.0/eventCreator.HTML.php
<?php
/**
 * eventCreator
 * ver 2.0
 *
 * The iCal file event php-HTML form editor
 *
 * copyright (c) 2007 Kjell-Inge Gustafsson kigkonsult
 * www.kigkonsult.se/iCalcreator/eventCreator/index.php
 * hide@address.com
 * updated 20070703
 *
 * 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
 *
 * This script displays iCal event for editing (PHP + HTML)
 *
**/
if( !defined( '_VALID_KIG' )) die ('Invalid access to this file');

class EC {
            /**********************************************/
  function ecEditEvent( $v ) {
?>
<?php
    if( TRUE === @ECSTANDALONE ) {
      $lang = ( isset( $v['lang'] )) ? ' lang="'.$v['lang'].'"' : '';
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html<?php echo $lang; ?>>
<head>
<title>eventCreator 2.0<?php if( TRUE !== @ECSINGLEFILE) echo " - {$v['filename']}"; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="author"      content="kigkonsult - Kjell-Inge Gustafsson"/>
<meta name="copyright"   content="2007 Kjell-Inge Gustafsson kigkonsult"/>
<link href="eCstyle.css" rel="stylesheet" type="text/css"/>
</head>
<?php
      if( !empty( $v['closeWindow'] )) {
?>
<body onLoad=" window.close();"></body></html>
<?php
      }
      else {
?>
<body>
<?php
      }
    }
?>
<div class="eC" id="eC">
<?php
    if( defined( 'ECJAVASCRIPTDIR' )) {
?>
<script type="text/javascript" src="<?php echo ECJAVASCRIPTDIR.'/prototype.js'; ?>"></script>
<?php
    }
?>
<input type="hidden" id="startts" value="<?php echo $v['DTSTART']['timestamp']; ?>"/>
<input type="hidden" id="endts"   value="<?php if( !empty( $v['DTEND']['timestamp'] )) echo $v['DTEND']['timestamp']; ?>"/>
<?php
    if( TRUE === @ECHEADERTEXT ) {
?>
<div class="eCcenter" id="eCheader"><?php echo $v['t']['HEADERtext']; ?></div>
<?php
    }
?>
<!-- menu start -->
<?php
    if(( TRUE === @ECFILEUPLOAD ) && ( TRUE !== @ECSINGLEFILE ))
      EC::ecEditEventUpload( $v );

    EC::ecEditEventMenu( $v, 1 );
?>
<!-- menu end -->
<tbody class="eCopt">
<tr>
<td class="eCgroup"><?php echo $v['t']['Required']; ?></td>
<td class="eCgroupText" colspan="6"><?php echo $v['t']['RequiredText']; ?></td>
</tr>

<tr>
<td class="eC1col eClabel"><label for="summary"><?php echo $v['t']['SUMMARYlabel']; ?></label></td>
<td colspan="6"><input class="input" type="text" name="v[SUMMARY]" id="summary" value="<?php echo $v['SUMMARY']; ?>" size="60"/>
<a onClick=" chgdsp('SUMMARYhelp');" title="<?php echo $v['t']['helptextOnOff']; ?>"><img src="images/help.png" alt="<?php echo $v['t']['helptextOnOff']; ?>"/></a>
<div id="SUMMARYhelp" class="eChelptext"><?php echo $v['t']['SUMMARYhelptext']; ?></div>
</td>
</tr>

<tr id="DTSTARTcontainer">
<td class="eC1col eClabel"><?php echo $v['t']['DTSTARTlabel']; ?></td>
<td class="nowrap" colspan="6">
<select name="v[DTSTART][Year]">
<?php
    $Year = date('Y', $v['DTSTART']['timestamp'] );
    echo EC::_ecEditEventOption( FALSE, $Year, ($Year-40<1970)?1970:$Year-40, $Year+40 );
?>
</select>
<select name="v[DTSTART][Month]">
<?php
    $Month = date('m', $v['DTSTART']['timestamp'] );
    echo EC::_ecEditEventOption( FALSE, $Month, 1, 12 );
?>
</select>
<select name="v[DTSTART][Day]">
<?php
    $Day = date('d', $v['DTSTART']['timestamp'] );
    echo EC::_ecEditEventOption( FALSE, $Day, 1 , 31 );
?>
</select>
<span class="eClabel"><?php echo $v['t']['DTtimelabel']; ?></span>
<select name="v[DTSTART][Hour]">
<?php
    $Hour = date('H', $v['DTSTART']['timestamp'] );
    echo EC::_ecEditEventOption( FALSE, $Hour, '00' , 23 );
?>
</select>
<select name="v[DTSTART][Minute]">
<?php
    $Minute = date('i', $v['DTSTART']['timestamp'] );
    echo EC::_ecEditEventOption( FALSE, $Minute, '00' , 59 );
?>
</select>
<a onClick=" chgdsp('DTSTARThelp');" title="<?php echo $v['t']['helptextOnOff']; ?>"><img src="images/help.png" alt="<?php echo $v['t']['helptextOnOff']; ?>"/></a>
<span class="eClabel"><?php echo $v['t']['DTnoendlabel']; ?></span>
<input type="checkbox" name="v[chkb]" id="chkb" value="1" onclick=' if(this.checked) deact(); else act();'<?php if( empty( $v['DTEND']['timestamp'] ) || ( $v['DTEND']['timestamp'] == $v['DTSTART']['timestamp'] )) {?> checked="checked"<?php } ?>/>
<div id="DTSTARThelp" class="eChelptext"><?php echo $v['t']['DTSTARThelptext']; ?></div>
</td>
</tr>
<tr id="DTENDcontainer">
<td class="eC1col eClabel"><?php echo $v['t']['DTENDlabel']; ?>
</td>
<td class="nowrap" colspan="6">
<select name="v[DTEND][Year]">
<?php
    $Year = date('Y', $v['DTEND']['timestamp'] );
    echo EC::_ecEditEventOption( FALSE, $Year, ($Year-40<1970)?1970:$Year-40, $Year+40 );
?>
</select>
<select name="v[DTEND][Month]">
<?php
    $Month = date('m', $v['DTEND']['timestamp'] );
    echo EC::_ecEditEventOption( FALSE, $Month, 1, 12 );
?>
</select>
<select name="v[DTEND][Day]">
<?php
    $Day = date('d', $v['DTEND']['timestamp'] );
    echo EC::_ecEditEventOption( FALSE, $Day, 1 , 31 );
?>
</select>
<span class="eClabel"><?php echo $v['t']['DTtimelabel']; ?></span>
<select name="v[DTEND][Hour]">
<?php
    $Hour = date('H', $v['DTEND']['timestamp'] );
    echo EC::_ecEditEventOption( FALSE, $Hour, '00' , 23 );
?>
</select>
<select name="v[DTEND][Minute]">
<?php
    $Minute = date('i', $v['DTEND']['timestamp'] );
    echo EC::_ecEditEventOption( FALSE, $Minute, '00' , 59 );
?>
</select>
<a onClick=" chgdsp('DTENDhelp');" title="<?php echo $v['t']['helptextOnOff']; ?>"><img src="images/help.png" alt="<?php echo $v['t']['helptextOnOff']; ?>"/></a>
<div id="DTENDhelp" class="eChelptext"><?php echo $v['t']['DTENDhelptext']; ?></div>
<script> if (!$F('endts').present()||($F('endts')==$F('startts')) $('DTENDcontainer').style.display = 'none';</script>
</td>
</tr>

<tr>
<td class="eC1col eClabel"><label for="location"><?php echo $v['t']['LOCATIONlabel']; ?></label></td>
<td colspan="6"><input class="input" type="text" name="v[LOCATION]" id="location" value="<?php echo $v['LOCATION']; ?>" size="60"/>
<a onClick=" chgdsp('LOCATIONhelp');" title="<?php echo $v['t']['helptextOnOff']; ?>"><img src="images/help.png" alt="<?php echo $v['t']['helptextOnOff']; ?>"/></a>
<div id="LOCATIONhelp" class="eChelptext"><?php echo $v['t']['LOCATIONhelptext']; ?></div>
</td>
</tr>

<tr>
<td class="eC1col eClabel"><label for="organizer"><?php echo $v['t']['ORGANIZERlabel']; ?></label></td>
<td colspan="6"><input class="input" type="text" name="v[ORGANIZER]" id="organizer" value="<?php echo $v['ORGANIZER']; ?>" size="60" onBlur=" if(!emailcheck(this)) this.focus();"/>
<a onClick=" chgdsp('ORGANIZERhelp');" title="<?php echo $v['t']['helptextOnOff']; ?>"><img src="images/help.png" alt="<?php echo $v['t']['helptextOnOff']; ?>"/></a>
<div id="ORGANIZERhelp" class="eChelptext"><?php echo $v['t']['ORGANIZERhelptext']; ?></div>
</td>
</tr>

<tr>
<td class="eC1col eClabel"><label for="description"><?php echo $v['t']['DESCRIPTIONlabel']; ?></label></td>
<td colspan="6"><textarea name="v[DESCRIPTION]" id="description" cols="50" rows="1"><?php echo $v['DESCRIPTION']; ?></textarea>
<a onClick=" chgdsp('DESCRIPTIONhelp');" title="<?php echo $v['t']['helptextOnOff']; ?>"><img src="images/help.png" alt="<?php echo $v['t']['helptextOnOff']; ?>"/></a>
<div id="DESCRIPTIONhelp" class="eChelptext"><?php echo $v['t']['DESCRIPTIONhelptext']; ?></div>
</td>
</tr>
</tbody>

<tbody class="eCnorm">
<tr>
<td class="eCgroup"><?php echo $v['t']['Optional']; ?></td>
<td class="eCright" colspan="6">
<table><tr>
<?php
    if( TRUE === @ECALLOWTRIGGERDISPLAY ) {
?>
<td width="1*">
 <div class="eClabel nowrap"><?php echo $v['t']['TRIGGERDISPLAYlabel']; ?>&nbsp;<a onClick=" chgdsp('TRIGGERDISPLAYhelp');" title="<?php echo $v['t']['helptextOnOff']; ?>"><img src="images/help.png" alt="<?php echo $v['t']['helptextOnOff']; ?>"/></a></div>
 <div><select name=v[TRIGGERdisplay] id=TRIGGERdisplay>
    <?php echo EC::_ecEditEventOption( $v['t']['TRIGGER_options'], $v['TRIGGERdisplay'] ); ?>
    </select></div>
 <div id="TRIGGERDISPLAYhelp" class="eChelptext"><?php echo $v['t']['TRIGGERDISPLAYhelptext']; ?></div>
</td>
<?php
    }
    if( TRUE === @ECALLOWTRIGGEREMAIL ) {
?>
<td width="1*">
 <div class="eClabel nowrap"><?php echo $v['t']['TRIGGEREMAILlabel']; ?>&nbsp;<a onClick=" chgdsp('TRIGGEREMAILhelp');" title="<?php echo $v['t']['helptextOnOff']; ?>"><img src="images/help.png" alt="<?php echo $v['t']['helptextOnOff']; ?>"/></a></div>
 <div> <select name=v[TRIGGERemail] id=TRIGGERemail>
    <?php echo EC::_ecEditEventOption( $v['t']['TRIGGER_options'], $v['TRIGGERemail'] ); ?>
    </select></div>
 <div id="TRIGGEREMAILhelp" class="eChelptext"><?php echo $v['t']['TRIGGEREMAILhelptext']; ?></div>
</td>
<?php
    }
?>
<td width="1*">
 <div class="eClabel nowrap"><?php echo $v['t']['TRANSPlabel']; ?>&nbsp;<a onClick=" chgdsp('TRANSPhelp');" title="<?php echo $v['t']['helptextOnOff']; ?>"><img src="images/help.png" alt="<?php echo $v['t']['helptextOnOff']; ?>"/></a></div>
 <div><select name=v[TRANSP] id=TRANSP>
    <?php echo EC::_ecEditEventOption( $v['t']['TRANSP_options'], $v['TRANSP'] ); ?>
    </select></div>
 <div id="TRANSPhelp" class="eChelptext"><?php echo $v['t']['TRANSPhelptext']; ?></div>
</td>
<td width="1*">
 <div class="eClabel nowrap"><?php echo $v['t']['CLASSlabel']; ?>&nbsp;<a onClick=" chgdsp('CLASShelp');" title="<?php echo $v['t']['helptextOnOff']; ?>"><img src="images/help.png" alt="<?php echo $v['t']['helptextOnOff']; ?>"/></a></div>
 <div><select name=v[CLASS] id=CLASS>
    <?php echo EC::_ecEditEventOption( $v['t']['CLASS_options'], $v['CLASS'] ); ?>
    </select></div>
 <div id="CLASShelp" class="eChelptext"><?php if(( TRUE === @ECRSSCALOUTPUT ) || ( TRUE === @ECRSS2CALOUTPUT )) echo $v['t']['CLASShelptextRSS']; else echo $v['t']['CLASShelptext']; ?></div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="eC1col eClabel"><label for="url"><?php echo $v['t']['URLlabel']; ?></label></td>
<td colspan="6"><input class="input" type="text" name="v[URL]" id="url" value="<?php echo $v['URL']; ?>" size="60" onFocus="if( this.value &lt;= '') this.value = 'http://';"/>
<a onClick=" chgdsp('URLhelp');" title="<?php echo $v['t']['helptextOnOff']; ?>"><img src="images/help.png" alt="<?php echo $v['t']['helptextOnOff']; ?>"/></a>
<div id="URLhelp" class="eChelptext"><?php if(( TRUE === @ECRSSCALOUTPUT ) || ( TRUE === @ECRSS2CALOUTPUT )) echo $v['t']['URLhelptextRSS']; else echo $v['t']['URLhelptext']; ?></div>
</td>
</tr>
</tbody>

<tbody class="eCopt">
<tr>
<td class="eCgroup"><?php echo $v['t']['Extra']; ?></td>
<td colspan="2">
<div class="eClabel"><a onClick=" addField('COMMENT', 'textarea', '25', '1');" title="<?php echo $v['t']['CommentsText']; ?>"><img src="images/plus.png" alt="<?php echo $v['t']['CommentsText']; ?>"/></a>
<span class="eCgroupText" onClick=" var x=getFormIndex('COMMENTcnt'); document.eCform.elements[x-1].focus();"><?php echo $v['t']['COMMENTlabel']; ?></span>&nbsp;<a onClick=" chgdsp('COMMENThelp');" title="<?php echo $v['t']['helptextOnOff']; ?>"><img src="images/help.png" alt="<?php echo $v['t']['helptextOnOff']; ?>"/></a></div>
<div id="COMMENThelp" class="eChelptext"><?php echo $v['t']['COMMENThelptext']; ?></div>
<div id="COMMENTbody">
<?php
    foreach( $v['COMMENT' ] as $cix => $commentPart ) {
?>
<span id="COMMENT<?php echo $cix; ?>">
<textarea name="v[COMMENT][<?php echo $cix; ?>]" id="COMMENTf<?php echo $cix; ?>" cols="25" rows="1"><?php echo $commentPart; ?></textarea><a onClick=" remField('COMMENT<?php echo $cix; ?>');" title="<?php echo $v['t']['COMMENTdelText']; ?>"><img src="images/delete.png" alt="<?php echo $v['t']['COMMENTdelText']; ?>"/></a>
</span>
<?php
    }
?>
</div>
<input type="hidden" name="v[COMMENTcnt]" id="COMMENTcnt" value="<?php echo count( $v['COMMENT'] ); ?>"/>
</td>
<td colspan="4">
<div class="eClabel"><a onClick=" addField('ATTENDEE', 'input', '30', '');" title="<?php echo $v['t']['AttendeeText']; ?>"><img src="images/plus.png" alt="<?php echo $v['t']['AttendeeText']; ?>"/></a>
<span class="eCgroupText" onClick=" var x=getFormIndex('ATTENDEEcnt'); document.eCform.elements[x-1].focus();"><?php echo $v['t']['ATTENDEElabel']; ?></span>&nbsp;<a onClick=" chgdsp('ATTENDEEhelp');" title="<?php echo $v['t']['helptextOnOff']; ?>"><img src="images/help.png" alt="<?php echo $v['t']['helptextOnOff']; ?>"/></a></div>
<div id="ATTENDEEhelp" class="eChelptext"><?php echo $v['t']['ATTENDEEhelptext']; ?></div>
<div id="ATTENDEEbody">
<?php
    foreach( $v['ATTENDEE'] as $aix => $attendeePart ) {
?>
<span id="ATTENDEE<?php echo $aix; ?>">
<input type="text" name="v[ATTENDEE][<?php echo $aix; ?>]" id="ATTENDEEf<?php echo $aix; ?>" value="<?php echo $attendeePart; ?>" size="30"/><a onClick=" remField('ATTENDEE<?php echo $aix; ?>');" title="<?php echo $v['t']['ATTENDEEdelText']; ?>"><img src="images/delete.png" alt="<?php echo $v['t']['ATTENDEEdelText']; ?>"/></a>
</span>
<?php
    }
?>
</div>
<input type="hidden" name="v[ATTENDEEcnt]" id="ATTENDEEcnt" value="<?php echo count( $v['ATTENDEE'] ); ?>"/>
</td>
</tr>
</tbody>

<?php
    if( TRUE === @ECLOWERMENU ) {
      EC::ecEditEventMenu( $v, 2 );
    }
?>
<tbody class="eCnorm">
<tr height="10px">
<td class="eCmsg">
<!-- do NOT remove, see GPL licence --><a class="eClabel" onClick=" chgdsp('legalStuff');" title="copyrights">copyright/license</a></td>
<td class="eCmsg" colspan="6">
<!-- do NOT remove, see GPL licence --><a class="eClabel" href="http://www.kigkonsult.se/eventCreator" title="www.kigkonsult.se/eventCreator"><?php echo EVENTCREATOR_VERSION; ?></a>
<?php
    if( TRUE === @ECICALOUTPUT ) {
?>
<a class="eClabel" onClick=" if (fieldcheck('iCal')) submitForm('iCal');" title="<?php echo $v['t']['createiCalText']; ?>"><img src="images/iCal2.0.png" alt="<?php echo $v['t']['createiCalText']; ?>"/></a>
<?php
    }
    if( TRUE === @ECXCALOUTPUT ) {
?>
<a class="eClabel" onClick=" if (fieldcheck('xCal')) submitForm('xCal');" title="<?php echo $v['t']['createxCalText']; ?>"><img src="images/xCal2.0.png" alt="<?php echo $v['t']['createxCalText']; ?>"/></a>
<?php
    }
    if( TRUE === @ECRSSCALOUTPUT ) {
?>
<a class="eClabel" onClick=" if (fieldcheck('rssCal')) submitForm('rssCal');" title="<?php echo $v['t']['createrssCalText']; ?>"><img src="images/rsscal1.0.png" alt="<?php echo $v['t']['createrssCalText']; ?>"/></a>
<?php
    }
    if( TRUE === @ECRSS2CALOUTPUT ) {
?>
<a class="eClabel" onClick=" if (fieldcheck('rssCal')) submitForm('rss2Cal');" title="<?php echo $v['t']['createrss2CalText']; ?>"><img src="images/rsscal2.0.png" alt="<?php echo $v['t']['createrss2CalText']; ?>"/></a>
<?php
    }
?>
</td>
</tr>
<tr>
<td colspan="7">
<table id="legalStuff" class="eChelptext">
<tr>
<td colspan="4">copyright &copy; 2007 kigkonsult
<tr><td>eventCreator&nbsp;<td>&nbsp;2.0&nbsp;<td>&nbsp;<a href="http://www.kigkonsult.se/eventCreator/docs/LGPL.txt">GPL</a>&nbsp;<td>&nbsp;<a href="http://www.kigkonsult.se/eventCreator">www.kigkonsult.se/eventCreator</a></td></tr>
<tr><td>Flag icons&nbsp;<td>&nbsp;<td>&nbsp;free for any use&nbsp;<td>&nbsp;<a href="http://www.famfamfam.com">www.famfamfam.com</a></td></tr>
<tr><td>iCalCreator&nbsp;<td>&nbsp;2.0&nbsp;<td>&nbsp;<a href="http://www.kigkonsult.se/iCalcreator/docs/LGPL.txt">LGPL</a>&nbsp;<td>&nbsp;<a href="http://www.kigkonsult.se/iCalcreator">www.kigkonsult.se/iCalcreator</a></td></tr>
<tr><td>prototype.js&nbsp;<td>&nbsp;1.5.1&nbsp;<td>&nbsp;<a href="http://creativecommons.org/licenses/by-sa/3.0/">CC BY-SA 3.0</a>&nbsp;<td>&nbsp;<a href="http://www.prototypejs.org/">www.prototypejs.org</a></td></tr>
<tr><td>rsscalCreator&nbsp;<td>&nbsp;0.8.5&nbsp;<td>&nbsp;<a href="http://www.kigkonsult.se/iCalcreator/docs/LGPL.txt">LGPL</a>&nbsp;<td>&nbsp;<a href="http://www.kigkonsult.se/rsscalCreator">www.kigkonsult.se/rsscalCreator</a></td></tr>
</table>
</td>
</tr>
</tbody>
</table>
<input type="hidden"                      id="ecurl"      value="<?php echo ECURL; ?>"/>
<input type="hidden" name="v[filename]"   id="filename"   value="<?php if( isset( $v['filename'] )) echo $v['filename']; ?>"/>
<input type="hidden" name="v[directory]"  id="directory"  value="<?php if( isset( $v['directory'] )) echo $v['directory']; ?>"/>
<input type="hidden" name="v[UID]"        id="uid"        value="<?php if( isset( $v['UID'] )) echo $v['UID']; ?>"/>
<input type="hidden" name="v[ordno]"      id="ordno"      value="<?php if( isset( $v['ordno'] )) echo $v['ordno']; ?>"/>
<input type="hidden" name="v[eventordno]" id="eventordno" value="<?php if( isset( $v['eventordno'] )) echo $v['eventordno']; ?>"/>
<?php
    if( TRUE !== @ECSINGLEEVENTUPDATE ) {
?>
<input type="hidden" name="v[eventcnt]"   id="eventcnt"   value="<?php if( isset( $v['eventcnt'] )) echo $v['eventcnt']; ?>"/>
<input type="hidden" name="v[previous]"   id="previous"   value="<?php if( isset( $v['previous'] )) echo $v['previous']; ?>"/>
<input type="hidden" name="v[next]"       id="next"       value="<?php if( isset( $v['next'] )) echo $v['next']; ?>"/>
<?php
    }
?>
<input type="hidden" name="v[task]"       id="task"       value=""/>
<?php
    if( 0 < @ECEVENTDURATION ) {
?>
<input type="hidden"                      id="duration"   value="<?php echo ECEVENTDURATION; ?>"/>
<?php
    }
    if(( TRUE === @ECLANGCHANGE ) && is_array( $v['flags'] )) {
?>
<input type="hidden" name="v[lang]"       id="lang"       value="<?php echo $v['lang']; ?>"/>
<?php
    }
    if( is_array( $v['DTSTAMP'] )) {
      foreach( $v['DTSTAMP'] as  $dix => $dtstampPart ) {
?>
<input type="hidden" name="v[DTSTAMP][<?php echo $dix; ?>]" value="<?php echo $dtstampPart; ?>"/>
<?php
      }
    }
    if( is_array( $v['CREATED'] )) {
      foreach( $v['CREATED'] as $cix => $createdPart ) {
?>
<input type="hidden" name="v[CREATED][<?php echo $cix; ?>]" value="<?php echo $createdPart; ?>"/>
<?php
      }
    }
    if( is_array( $v['LASTMODIFIED'] )) {
      foreach( $v['LASTMODIFIED'] as $lix => $lastmodifiedPart ) {
?>
<input type="hidden" name="v[LASTMODIFIED][<?php echo $lix; ?>]" value="<?php echo $lastmodifiedPart; ?>"/>
<?php
      }
    }
?>
</form>
<script type="text/javascript" src="includes/js/eventCreator.js"></script>
<script type="text/javascript"> checkdate(); attendeeArrUpd();</script>
</div>
<?php
    if( TRUE === @ECSTANDALONE ) {
?>
</body>
</html>
<?php
    }
  }
             /**********************************************/
  function ecEditEventMenu( $v, $showPart=1 ) {
    if( $showPart == 1 ) {
?>
<form name="eCform" id="eCform" method="post" action="<?php echo ECURL; ?>">
<table>
<?php
    }
?>
<tbody class="eCnorm">
<tr>
<td class="eC1col eClabel">
<?php
    if( TRUE === @ECFILESELECT ) {
?>
<label for="selectFile<?php echo $showPart; ?>"><?php echo $v['t']['selectFilelabel']; ?></label>
<?php
    }
?>
</td>
<td width="135px">
<?php
    if(( TRUE === @ECFILESELECT ) && ( TRUE !== @ECSINGLEFILE )) {
?>
<select name="v[selectFile<?php echo $showPart; ?>]" id="selectFile<?php echo $showPart; ?>" onChange=" submitForm('selectFile<?php echo $showPart; ?>');">
<?php
        $selected = ( isset( $v['filename'] )) ? $v['filename'] : null;
        echo EC::_ecEditEventOption( $v['filelist'], $selected );
?>
</select>
<?php
    }
    elseif( TRUE !== @ECSINGLEFILE )
      echo $v['t']['filename'];
?>
</td>
<td colspan="2" width="160px" class="eCmsg">
<?php
    if( 0 < count( $v['ecmsg'] )) {
      foreach( $v['ecmsg'] as $mix => $messagePart ) {
        if( 0 < $mix )
          echo "<br/>\n";
       echo $messagePart;
      }
    }
?>
</td>
<td colspan="3" width="190px">
<table>
<tr>
<td width="2px"><img src="images/2px.png"/></td>
<td width="14px">
<?php
    if(( TRUE !== @ECSINGLEEVENT ) && !empty( $v['previous'] )) {
?>
<a onClick=" submitForm('loadEvent',<?php echo $v['previous']; ?>);" title="<?php echo $v['t']['backwardlabel']; ?>"><img src="images/previous.png" width="10px" height="10px" hspace="1px" alt="<?php echo $v['t']['backwardlabel']; ?>"/></a>
<br /><a onClick=" submitForm('loadEvent','1');" title="<?php echo $v['t']['firstlabel']; ?>"><img src="images/first.png" width="10px" height="10px" hspace="1px" alt="<?php echo $v['t']['firstlabel']; ?>"/></a>
<?php
    }
    else {
?>
<img src="images/2px.png"/><img src="images/10px.png"/><img src="images/2px.png"/>
<?php
    }
?>
</td>
<td width="40px">
<?php
    if(( TRUE !== @ECSINGLEEVENT ) && isset( $v['eventcnt'] ) && (1 < $v['eventcnt'] )) {
?>
<select id="eventSelect" onChange=" submitForm('loadEvent',$F(this));">
<?php
      $selected = ( isset( $v['eventordno'] )) ? $v['eventordno'] : null;
      echo EC::_ecEditEventOption( $v['eventSelect'], $selected );
?>
</select>
<?php
    }
    else {
?>
<img src="images/10px.png"/><img src="images/10px.png"/><img src="images/10px.png"/><img src="images/10px.png"/>
<?php
    }
?>
</td>
<td width="14px">
<?php
    if(( TRUE !== @ECSINGLEEVENT ) && !empty( $v['next'] )) {
?>
<a onClick=" submitForm('loadEvent',<?php echo $v['next']; ?>);" title="<?php echo $v['t']['forwardlabel']; ?>"><img src="images/next.png" width="10px" height="10px" hspace="1px" alt="<?php echo $v['t']['forwardlabel']; ?>"/></a>
<br /><a onClick=" submitForm('loadEvent',<?php echo $v['eventcnt']; ?>);" title="<?php echo $v['t']['lastlabel']; ?>"><img src="images/last.png" width="10px" height="10px" hspace="1px" alt="<?php echo $v['t']['lastlabel']; ?>"/></a>
<?php
    }
    else {
?>
<img src="images/2px.png"/><img src="images/10px.png"/><img src="images/2px.png"/>
<?php
    }
?>
</td>
<td width="4px"><img src="images/2px.png"/><img src="images/2px.png"/></td>
<td width="20px">
<?php
    if(( TRUE !== @ECSINGLEEVENT ) && ( TRUE === @ECEVENTCREATE ) && !empty( $v['filename'] )) {
?>
<a onClick=" submitForm('newEvent');" title="<?php echo $v['t']['newEventlabel']; ?>"><img src="images/new.png" alt="<?php echo $v['t']['newEventlabel']; ?>"/></a>
<?php
    }
    else {
?>
<img src="images/10px.png"/><img src="images/10px.png"/>
<?php
    }
?>
</td>
<td width="20px">
<?php
    if(( TRUE === @ECEVENTUPDATE ) && ((TRUE !== @ECSINGLEFILE ) || !empty( $v['filename'] ))) {
?>
<a onClick=" if(fieldcheck('iCal')) submitForm('saveEvent');" title="<?php echo $v['t']['updateEventlabel']; ?>"><img src="images/save.png" alt="<?php echo $v['t']['updateEventlabel']; ?>"/></a>
<?php
    }
    else {
?>
<img src="images/10px.png"/><img src="images/10px.png"/>
<?php
    }
?>
</td>
<td width="20px">
<?php
    if(( TRUE === @ECEVENTDELETE ) && !empty( $v['filename'] ) && !empty( $v['UID'] )) {
?>
<a onClick=" if ($('uid').present() || 1 < $F('eventcnt')) submitForm('deleteEvent'); else submitForm('deleteFile');" title="<?php echo $v['t']['deleteEventlabel']; ?>"><img src="images/trash.png" alt="<?php echo $v['t']['deleteEventlabel']; ?>"/></a>
<?php
    }
    else {
?>
<img src="images/10px.png"/><img src="images/10px.png"/><img src="images/10px.png"/><img src="images/10px.png"/>
<?php
    }
?>
</td>
<td width="20px">
<?php
    if( TRUE === @ECCLOSEWINDOW ) {
?>
<a onClick=" window.close();"><img src="images/window-close.png" alt="<?php echo ECCLOSEWINDOWTEXT; ?>" title="<?php echo ECCLOSEWINDOWTEXT; ?>"/></a>
<?php
    }
    elseif( TRUE === @ECREDIRECTONCLOSE ) {
?>
<a onClick=" location.href=<?php echo $v['redirecturl']; ?>;" title="<?php echo ECREDIRECTONCLOSETEXT; ?>"><img src="images/window-close.png" alt="<?php echo ECREDIRECTONCLOSETEXT; ?>"/></a>
<?php
    }
    else {
?>
<img src="images/10px.png"/><img src="images/10px.png"/>
<?php
    }
?>
</td>
<?php
    if(( TRUE === @ECLANGCHANGE ) && is_array( $v['flags'] )) {
?>
<td class="nowrap">
<?php
      foreach( $v['flags'] as $langflag ) {
        if( $v['lang'] <> $langflag ) {
?>
<a onClick=" $('lang').value='<?php echo $langflag; ?>'; if ($('uid').present()) submitForm('loadEvent',$F('eventordno')); else submitForm('newEvent');" title="<?php echo $langflag; ?>">
<?php
        }
?>
<img src="images/flags/png/<?php echo $langflag; ?>.png" alt="<?php echo $langflag; ?>" title="<?php echo $langflag; ?>"/>
<?php
        if( $v['lang'] <> $langflag )
          echo "</a>\n";
      }
    }
?>
</td>
<td width="2px"><img src="images/2px.png"/></td>
</tr></table>
</td></tr>
</tbody>
<?php
  }
           /**********************************************/
  function _ecEditEventOption( $options, $selected, $start=FALSE, $end=FALSE ) {
    if( !is_array( $options )) {
      if( empty( $start ) || empty( $end ))
        return null;
      $options = array();
      for( $x = $start; $x <= (int) $end; $x++ )
        $options[$x] = $x;
    }
    $str = null;
    foreach( $options as $key => $value ) {
      $key = (( ctype_digit( (string) $key )) && ( 10 > $key )) ? '0'.$key : $key;
      $str .= "<option label='$key' value='$key'";
      if( $key == $selected )
        $str .= ' selected="selected"';
      $str .= ">$value</option>\n";
    }
    return $str;
  }
            /**********************************************/
  function ecEditEventUpload( $v ) {
    $lang = ( isset( $v['lang'] )) ? ' lang="'.$v['lang'].'"' : '';
?>
<div class="eCnorm eCh30">
<form name="eCform2" id="eCform2" method="post" enctype="multipart/form-data" action="<?php echo ECURL; ?>">
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo ECFILEUPLOADMAXSIZE; ?>"/>
<div style="float:left;"><div class="eC1col eClabel"><label for="uploadFile"><?php echo $v['t']['uploadFilelabel']; ?></label></div></div>
<span><input name="uploadFile" id="uploadFile" type="file"<?php echo $lang; ?> size="30"/><input type="submit" value="<?php echo $v['t']['upload_btn']; ?>"><input type="hidden" name="v[task]" value="uploadFile"/>
</span>
</form>
</div>
<?php
  }
            /**********************************************/
}
?>
Return current item: eventCreator