mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
added a helpmessage to the jsCalendar input-field
This commit is contained in:
parent
940249850e
commit
940e0c1df9
@ -50,8 +50,10 @@ class jscalendar
|
|||||||
@param $name name and id of the input-field (it also names the id of the img $name.'-toggle')
|
@param $name name and id of the input-field (it also names the id of the img $name.'-toggle')
|
||||||
@param $date date as string or unix timestamp (in users localtime)
|
@param $date date as string or unix timestamp (in users localtime)
|
||||||
@param $year,$month,$day if $date is not used
|
@param $year,$month,$day if $date is not used
|
||||||
|
@param $helpmsg a helpmessage for the statusline of the browser
|
||||||
|
@param $options any other options to the inputfield
|
||||||
*/
|
*/
|
||||||
function input($name,$date,$year=0,$month=0,$day=0)
|
function input($name,$date,$year=0,$month=0,$day=0,$helpmsg='',$options='')
|
||||||
{
|
{
|
||||||
//echo "<p>jscalendar::input(name='$name', date='$date'='".date('Y-m-d',$date)."', year='$year', month='$month', day='$day')</p>\n";
|
//echo "<p>jscalendar::input(name='$name', date='$date'='".date('Y-m-d',$date)."', year='$year', month='$month', day='$day')</p>\n";
|
||||||
|
|
||||||
@ -65,8 +67,13 @@ class jscalendar
|
|||||||
{
|
{
|
||||||
$date = date($this->dateformat,mktime(12,0,0,$month,$day,$year));
|
$date = date($this->dateformat,mktime(12,0,0,$month,$day,$year));
|
||||||
}
|
}
|
||||||
|
if ($helpmsg !== '')
|
||||||
|
{
|
||||||
|
$options .= " onFocus=\"self.status='".addslashes($helpmsg)."'; return true;\"" .
|
||||||
|
" onBlur=\"self.status=''; return true;\"";
|
||||||
|
}
|
||||||
return
|
return
|
||||||
'<input type="text" id="'.$name.'" name="'.$name.'" size="10" value="'.$date.'"/>
|
'<input type="text" id="'.$name.'" name="'.$name.'" size="10" value="'.$date.'"'.$options.'/>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
document.writeln(\'<img id="'.$name.'-trigger" src="'.$this->phpgwapi_inc_url.'/jscalendar/img.gif" title="'.lang('Select date').'" style="cursor:pointer; cursor:hand;"/>\');
|
document.writeln(\'<img id="'.$name.'-trigger" src="'.$this->phpgwapi_inc_url.'/jscalendar/img.gif" title="'.lang('Select date').'" style="cursor:pointer; cursor:hand;"/>\');
|
||||||
Calendar.setup(
|
Calendar.setup(
|
||||||
@ -112,4 +119,4 @@ class jscalendar
|
|||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user