No longer using document write to add icon (to not display it if user

has javascript switched off, as we require it now and it makes problems
with the new etemplate rendering)
This commit is contained in:
Ralf Becker 2010-06-22 15:33:44 +00:00
parent 7520c468c7
commit 8d93ce6fbb

View File

@ -134,16 +134,15 @@ class jscalendar
}
return
'<input type="text" id="'.$name.'" name="'.$name.'" size="10" value="'.htmlspecialchars($date).'"'.$options.'/>
<script type="text/javascript">'.(!$useicon ? '
document.getElementById("'.$name.'").readOnly=true;
' : '
document.writeln(\'<img id="'.$name.'-trigger" src="'.common::find_image('phpgwapi','datepopup').'" title="'.lang('Select date').'" style="cursor:pointer; cursor:hand;"/>\');').'
Calendar.setup(
{
inputField : "'.$name.'",'.(!$useicon ? '' : '
button : "'.$name.'-trigger"').'
}
);
'.($useicon ? '<img id="'.$name.'-trigger" src="'.common::find_image('phpgwapi','datepopup').'" title="'.lang('Select date').'" style="cursor:pointer; cursor:hand;">' : '').
'<script type="text/javascript">
'.(!$useicon ? 'document.getElementById("'.$name.'").readOnly=true;' : '').
'Calendar.setup(
{
inputField : "'.$name.'",'.(!$useicon ? '' : '
button : "'.$name.'-trigger"').'
}
);
</script>
';
}