fixed problems reported by LFRZ

This commit is contained in:
Ralf Becker 2014-07-16 12:25:40 +00:00
parent d7c6caac47
commit 91eecc8812
3 changed files with 65 additions and 31 deletions

View File

@ -196,7 +196,7 @@ class calendar_ui
}
if (count($no_access))
{
$msg = '<p class="redItalic" align="center">'.lang('Access denied to the calendar of %1 !!!',implode(', ',$no_access))."</p>\n";
$msg = '<p class="redItalic" align="center">'.htmlspecialchars(lang('Access denied to the calendar of %1 !!!',implode(', ',$no_access)))."</p>\n";
if ($GLOBALS['egw_info']['flags']['currentapp'] == 'home')
{
@ -229,7 +229,7 @@ class calendar_ui
if ($_GET['msg']) echo '<p class="redItalic" align="center">'.html::htmlspecialchars($_GET['msg'])."</p>\n";
if ($this->group_warning) echo '<p class="redItalic" align="center">'.$this->group_warning."</p>\n";
if ($this->group_warning) echo '<p class="redItalic" align="center">'.html::htmlspecialchars($this->group_warning)."</p>\n";
}
/**

View File

@ -873,8 +873,7 @@ class etemplate extends boetemplate
{
$onclick = $this->expand_name($onclick,$c,$r,$content['.c'],$content['.row'],$content);
}
$row_data[".$col"] .= ' onclick="'.$this->js_pseudo_funcs($onclick,$cname).'"' .
($cell['id'] ? ' id="'.str_replace('"','&quot;',$cell['id']).'"' : '');
$row_data[".$col"] .= ' onclick="'.$this->js_pseudo_funcs($onclick,$cname).'"' .self::get_id('',$cell['name'],$cell['id']);
}
$colspan = $span == 'all' ? $grid['cols']-$c : 0+$span;
if ($colspan > 1)
@ -1171,7 +1170,7 @@ class etemplate extends boetemplate
}
if ($form_name != '')
{
$options = 'id="'.str_replace('"','&quot;',$cell['id'] ? $cell['id'] : $form_name).'" '.$options;
$options = self::get_id($form_name,$cell['name'],$cell['id']).' '.$options;
}
switch ($type)
{
@ -1318,7 +1317,8 @@ class etemplate extends boetemplate
if ($multiple)
{
// add the set_val to the id to make it unique
$options = str_replace('id="'.$form_name,'id="'.substr($form_name,0,-2)."[$set_val]",$options);
$options = str_replace('id="'.self::get_id($form_name).'"',
'id="'.self::get_id(substr($form_name,0,-2)."[$set_val]"), $options);
}
$html .= html::input($form_name,$set_val,'checkbox',$options);
@ -1345,7 +1345,8 @@ class etemplate extends boetemplate
$options .= ' checked="checked"';
}
// add the set_val to the id to make it unique
$options = str_replace('id="'.$form_name,'id="'.$form_name."[$set_val]",$options);
$options = str_replace('id="'.self::get_id($form_name).'"',
'id="'.self::get_id(substr($form_name,0,-2)."[$set_val]"), $options);
if ($readonly)
{
@ -1396,7 +1397,7 @@ class etemplate extends boetemplate
{
if (!empty($img))
{
$options .= ' title="'.$title.'"';
$options .= ' title="'.html::htmlspecialchars($title).'"';
}
if ($cell['onchange'] && $cell['onchange'] != 1)
{
@ -1607,7 +1608,7 @@ class etemplate extends boetemplate
}
$html .= html::image($app,$img,strlen($label) > 1 && !$cell['no_lang'] ? lang($label) : $label,
'border="0"'.($imagemap?' usemap="#'.html::htmlspecialchars($imagemap).'"':'').
($id || $value ? ' id="'.str_replace('"','&quot;',$id ? $id : $name).'"' : ''));
($id || $value ? self::get_id($name,$cell['name'],$id) : ''));
$extra_label = False;
break;
case 'file': // size: size of the filename field
@ -1678,7 +1679,7 @@ class etemplate extends boetemplate
if (strlen($child['onclick']) > 1)
{
$rows[$box_row]['.'.$box_col] .= ' onclick="'.$this->js_pseudo_funcs($child['onclick'],$cname).'"'.
($child['id'] ? ' id="'.str_replace('"','&quot;',$child['id']).'"' : '');
self::get_id('',$child['name'],$child['id']);
}
// allow to set further attributes in the tablecell, beside the class
if (is_array($cl))
@ -1701,7 +1702,7 @@ class etemplate extends boetemplate
{
$html = html::table($rows,html::formatOptions($cell_options,',,cellpadding,cellspacing').
($type != 'groupbox' ? html::formatOptions($class,'class').
($cell['name'] ? ' id="'.str_replace('"','&quot;',$form_name).'"' : '') : '').
self::get_id($form_name,$cell['name'],$cell['id']) : '').
($cell['align'] && $orient != 'horizontal' || $sub_cell_has_align ? ' width="100%"' : '')); // alignment only works if table has full width
if ($type != 'groupbox') $class = ''; // otherwise we create an extra div
}
@ -1716,7 +1717,7 @@ class etemplate extends boetemplate
{
$label = lang($label);
}
$html = html::fieldset($html,$label,($cell['name'] ? ' id="'.str_replace('"','&quot;',$form_name).'"' : '').
$html = html::fieldset($html,$label,self::get_id($form_name,$cell['name'],$cell['id']).
($class ? ' class="'.$class.'"' : ''));
$class = ''; // otherwise we create an extra div
}
@ -1727,8 +1728,7 @@ class etemplate extends boetemplate
$cell['height'],
$cell['width'],
$class,
$cell['name'] ? $form_name : '',
),'height,width,class,id')). ($html ? '' : '</div>');
),'height,width,class').self::get_id($form_name,$cell['name'],$cell['id'])). ($html ? '' : '</div>');
$class = ''; // otherwise we create an extra div
}
if ($box_anz > 1) // small docu in the html-source
@ -1860,7 +1860,7 @@ class etemplate extends boetemplate
// if necessary show validation-error behind field
if (isset(self::$validation_errors[$form_name]))
{
$html .= ' <span style="color: red; white-space: nowrap;">'.self::$validation_errors[$form_name].'</span>';
$html .= ' <span style="color: red; white-space: nowrap;">'.htmlspecialchars(self::$validation_errors[$form_name]).'</span>';
}
// generate an extra div, if we have an onclick handler and NO children or it's an extension
//echo "<p>$this->name($this->onclick_handler:$this->no_onclick:$this->onclick_proxy): $cell[type]/$cell[name]</p>\n";
@ -1877,6 +1877,38 @@ class etemplate extends boetemplate
return $html;
}
/**
* Return id="..." attribute, using the following order to determine the id:
* - $id if not empty
* - $name if starting with a hash (#), without the hash of cause
* - $form_name otherwise
*
* This is necessary to not break backward compatibility: if you want to specify
* a certain id, you can use now "#something" as name to get id="something",
* otherwise the $form_name "exec[something]" is used.
* (If no id is directly supplied internally.)
*
* @param string $form_name
* @param string $name=null
* @param string $id=null
* @return string ' id="..."' or '' if no id found
*/
static public function get_id($form_name,$name=null,$id=null)
{
if (empty($id))
{
if ($name[0] == '#')
{
$id = substr($name,1);
}
else
{
$id = $form_name;
}
}
return !empty($id) ? ' id="'.htmlspecialchars($id).'"' : '';
}
/**
* Format a number according to user prefs with decimal and thousands separator (later only for readonly)
*

View File

@ -52,22 +52,24 @@ class about
$nonavbar = false;
// application detail?
if (isset($_GET['app']) && $_GET['app'] != 'eGroupWare') {
$name = basename($_GET['app']);
if (isset($_GET['app']) && $_GET['app'] != 'eGroupWare' &&
($name = basename($_GET['app'])) &&
isset($GLOBALS['egw_info']['apps'][$name])) {
$type = 'application';
$detail = true;
}
// template detail?
if (isset($_GET['template']) && $_GET['template'] != 'eGroupWare') {
$name = basename($_GET['template']);
if (isset($_GET['template']) && $_GET['template'] != 'eGroupWare' &&
($name = basename($_GET['template'])) &&
(is_dir(EGW_SERVER_ROOT.'/phpgwapi/templates/'.$name) || is_dir(EGW_SERVER_ROOT.'/'.$name))) {
$type = 'template';
$detail = true;
}
// navbar or not
if (isset($_GET['nonavbar'])) {
$nonavbar = $_GET['nonavbar'];
$nonavbar = (boolean)$_GET['nonavbar'];
}
@ -95,23 +97,23 @@ class about
function _listView()
{
$text_content = str_replace('GPLLINK',self::$knownLicenses['GPL'],'
<p><b>EGroupware is a <a href="GPLLINK" title="read more about open source and the GPL" target="_blank">free</a>
enterprise ready groupware software</b> for your network. It enables you to manage contacts, appointments, todos
<p><b>EGroupware is a <a href="GPLLINK" title="read more about open source and the GPL" target="_blank">free</a>
enterprise ready groupware software</b> for your network. It enables you to manage contacts, appointments, todos
and many more for your whole business.</p>
<p><b>EGroupware is a groupware server.</b> It comes with a native web-interface which allowes to access your data
from any platform all over the planet. Moreover you also have the choice to access the EGroupware server with
your favorite groupware client (Kontact, Evolution, Outlook, iCal, Lightning) and also with your mobile or PDA
<p><b>EGroupware is a groupware server.</b> It comes with a native web-interface which allowes to access your data
from any platform all over the planet. Moreover you also have the choice to access the EGroupware server with
your favorite groupware client (Kontact, Evolution, Outlook, iCal, Lightning) and also with your mobile or PDA
via SyncML.</p>
<p><b>EGroupware is international.</b> At the time, it supports more than
<p><b>EGroupware is international.</b> At the time, it supports more than
<a href="http://www.egroupware.org/languages" target="_blank">25 languages</a> including rtl support.</p>
<p><b>EGroupware is platform independent.</b> The server runs on Linux, Mac, Windows and many more other operating systems.
On the client side, all you need is a internet browser such as Firefox, Safari, Chrome, Konqueror or Internet Explorer
<p><b>EGroupware is platform independent.</b> The server runs on Linux, Mac, Windows and many more other operating systems.
On the client side, all you need is a internet browser such as Firefox, Safari, Chrome, Konqueror or Internet Explorer
and many more.</p>
<p><b>EGroupware is developed by <a href="http://www.stylite.de/" target="_blank">Stylite AG</a></b> with contributions
from community developers.</p>
<br />
<p><b>For more information visit the <a href="http://www.egroupware.org" target="_blank">EGroupware Website</a></b></p>');
// get informations about the applications
$apps = array();
$apps[] = ''; // first empty row for eTemplate
@ -177,7 +179,7 @@ from community developers.</p>
*
* @param string $name application/template name
* @param string $type can be 'application' or 'template' :default $type='application'
* @param string $nonavbar don't show navbar :default $nonavbar=false
* @param boolean $nonavbar don't show navbar :default $nonavbar=false
* @return nothing
*
* @access private
@ -397,7 +399,7 @@ from community developers.</p>
'PHP' => 'http://opensource.org/licenses/php.php',
);
/**
* surround license string with link to license if it is known
*