<?php
require_once(LIB_PATH . 'HtmlElements.inc'); 
class x_1z extends kp_HtmlElements { 
var $x_jf = Array('day', 'week', 'month', 'custom'); 
var $x_jg = Array('day'=>'dayIcon.gif', 'week'=>'weekIcon.gif', 'month'=>'monthIcon.gif', 'custom'=>'customIcon.gif'); 
var $x_jh = 16; 
var $x_g3 = IMAGE_PATH; 
var $x_ji = ''; 
function x_1z($x_ji) { 
$x_ji = strtolower($x_ji); 
if (!in_array($x_ji, $this->x_jf)) { 
$x_ji = $this->x_jf[0]; 
} 
$this->x_ji = $x_ji; 
} 
function x_22() { 
$x_5c = '	<div id="x_jj" class="periodDiv" onmouseup="x_jk(event);">


							<div class="dialogBody">


								<div class="mainDiv">


									' . $this->x_jl() 
. $this->x_jm() 
. '									


									<div class="buttons">' 
. $this->kp_getInput('button', '', '<kerio:text id="ok" />', 'class="button" style="margin-right: 20px;"  onClick="x_jn()"') 
. $this->kp_getInput('button', '', '<kerio:text id="cancel" />', 'class="button" onClick="x_2k(0)"') . '


									</div>


									<div class="invisible">' . $this->x_jo() . '</div>


								</div>


							</div>


						</div>'; 
return $x_5c; 
} 
function x_jm() { 
$x_5c = ''; 
foreach ($this->x_jf as $x_84) { 
if ($x_84 == $this->x_ji) { 
$x_jp = 'block'; 
} else { 
$x_jp = 'none'; 
} 
switch ($x_84) { 
case $this->x_jf[0]: 
$x_5c .= '<div id="x_jq" class="calendar typeDay" style="display: ' . $x_jp . ';"></div>'; 
break; 
case $this->x_jf[1]: 
$x_5c .= '<div id="x_jr" class="calendar typeWeek" style="display: ' . $x_jp . ';"></div>'; 
break; 
case $this->x_jf[2]: 
$x_5c .= '<div id="x_js" class="calendar typeMonth" style="display: ' . $x_jp . ';"></div>'; 
break; 
case $this->x_jf[3]: 
$x_7x = kerio("webiface::PhpNonAuth"); 
$x_jt = $x_7x->dateFormat(); 
$x_5c .= '<div id="x_ju" class="calendar typeCustom" style="display: ' . $x_jp . ';">


									<table cellpadding="0" cellspacing="0" border="0">


										<tr>


											<td class="captionRow bold"><kerio:text id="start_date" />: </td>


											<td>' 
. $this->kp_getInput('text', '', '', 
'title="' . '<kerio:text id="dateFormatType" />' . ': ' . $x_jt . '" class="bgWhite"' 
, 'x_jv') 
. '</td>


										   <td>' 
. $this->kp_getImage($this->x_g3 . 'calendar.gif', 24, 20, '', 
'id="x_jw" class="calendarIcon"') 
. '</td>


										</tr>


										<tr>


											<td class="bold"><kerio:text id="end_date" />: </td>


											<td>' 
. $this->kp_getInput('text', '', '', 
'title="' . '<kerio:text id="dateFormatType" />' . ': ' . $x_jt . '" class="bgWhite"', 
'x_jx') 
. '</td>


										   <td>' 
. $this->kp_getImage($this->x_g3 . 'calendar.gif', 24, 20, '', 
'id="x_jy" class="calendarIcon"') 
. '</td>											


										</tr>


									</table>


									<div id="x_jz" class="messageBox"></div>									


								</div>'; 
break; 
} 
} 
return $x_5c; 
} 
function x_jl() { 
switch ($this->x_ji) { 
case $this->x_jf[0]: 
$x_j7 = 'Day'; 
break; 
case $this->x_jf[1]: 
$x_j7 = 'Week'; 
break; 
case $this->x_jf[2]: 
$x_j7 = 'Month'; 
break; 
case $this->x_jf[3]: 
$x_j7 = 'Custom'; 
break; 
} 
$x_5c = '<div class="typeSelection">


							<div class="caption"><kerio:text id="period_length" />:</div>


							<div id="popup_period" class="comboBox" onMouseOver="this.style.borderColor = \'black\';" onMouseOut="this.style.borderColor = \'#C0C0C0\';" onClick="x_k0(\'period\')">


								<div id="x_k1">


									<div class="icon">' . $this->kp_getImage($this->x_g3 . $this->x_jg[$this->x_ji], 16, 16) . '</div>


									<div class="text">


										' . $x_j7 . '


									</div>


								</div>


								<div class="expander"></div>


							</div>											 


					</div>'; 
return $x_5c; 
} 
function x_jo() { 
$x_bq = intval((mktime()/86400)); 
$x_k2 = '	<div id="period_day">


									<div class="icon">' . $this->kp_getImage($this->x_g3 . $this->x_jg['day'], $this->x_jh, $this->x_jh) . '</div>


									<div class="text"><kerio:text id="day" /></div>


								</div>


								<div id="period_week">


									<div class="icon">' . $this->kp_getImage($this->x_g3 . $this->x_jg['week'], $this->x_jh, $this->x_jh) . '</div>


									<div class="text"><kerio:text id="week" /></div>


								</div>


								<div id="period_month">


									<div class="icon">' . $this->kp_getImage($this->x_g3 . $this->x_jg['month'], $this->x_jh, $this->x_jh) . '</div>


									<div class="text"><kerio:text id="month" /></div>


								</div>


								<div id="period_custom">


									<div class="icon">' . $this->kp_getImage($this->x_g3 . $this->x_jg['custom'], $this->x_jh, $this->x_jh) . '</div>


									<div class="text"><kerio:text id="custom" /></div>


								</div>' 
. $this->kp_getInput('hidden', 'x_k3', $x_bq, '', 'x_k3') 
. $this->kp_getInput('hidden', 'x_k4', $x_bq, '', 'x_k4'); 
$x_k5 = '<input type="text" id="x_k6" name="x_k6" value="" class="invisible">'; 
return $x_k2 . $x_k5; 
} 
} 
?>
