as et2 adds options as text, we can NOT use html entities, but direct utf-8 chars, which unfortunately php does not support as string literals, using html_entity_decode therefor

This commit is contained in:
Ralf Becker 2013-02-05 11:24:02 +00:00
parent d47c508190
commit daac136f47
3 changed files with 25 additions and 13 deletions

View File

@ -5,7 +5,7 @@
* @link www.egroupware.org
* @author Cornelius Weiss <egw@von-und-zu-weiss.de>
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @copyright (c) 2005-12 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @copyright (c) 2005-13 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @copyright (c) 2005/6 by Cornelius Weiss <egw@von-und-zu-weiss.de>
* @package addressbook
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
@ -1392,14 +1392,20 @@ class addressbook_ui extends addressbook_bo
$this->type_icon($row['owner'],$row['private'],$row['tid'],$row['type'],$row['type_label']);
static $tel2show = array('tel_work','tel_cell','tel_home','tel_fax');
static $prefer_marker;
if (is_null($prefer_marker))
{
// as et2 adds options with .text(), it can't be entities, but php knows no string literals with utf-8
$prefer_marker = html_entity_decode(' &#9829;', ENT_NOQUOTES, 'utf-8');
}
foreach($tel2show as $name)
{
$row[$name] .= ' '.($row['tel_prefer'] == $name ? '&#9829;' : ''); // .' ' to NOT remove the field
$row[$name] .= ' '.($row['tel_prefer'] == $name ? $prefer_marker : ''); // .' ' to NOT remove the field
}
// allways show the prefered phone, if not already shown
if (!in_array($row['tel_prefer'],$tel2show) && $row[$row['tel_prefer']])
{
$row['tel_prefered'] = $row[$row['tel_prefer']].' &#9829;';
$row['tel_prefered'] = $row[$row['tel_prefer']].$prefer_marker;
}
if (!$this->check_perms(EGW_ACL_DELETE,$row) || (!$GLOBALS['egw_info']['user']['apps']['admin'] && $this->config['history'] != 'userpurge' && $query['col_filter']['tid'] == addressbook_so::DELETED_TYPE))
{

View File

@ -7,7 +7,7 @@
* @subpackage api
* @link http://www.egroupware.org
* @author Ralf Becker <RalfBecker@outdoor-training.de>
* @copyright 2002-11 by RalfBecker@outdoor-training.de
* @copyright 2002-13 by RalfBecker@outdoor-training.de
* @version $Id$
*/
@ -296,13 +296,7 @@ class etemplate_widget_menupopup extends etemplate_widget
if (categories::is_global($cat))
{
static $global_marker;
if (is_null($global_marker))
{
// as we add options with .text(), it can't be entities, but php knows no string literals with utf-8
$global_marker = html_entity_decode(' &#9830;', ENT_NOQUOTES, 'utf-8');
}
$s .= $global_marker;
$s .= categories::$global_marker;
}
$options[$cat['id']] = array(
'label' => $s,

View File

@ -105,6 +105,13 @@ class categories
*/
private $global_owners = array(self::GLOBAL_ACCOUNT);
/**
* string to postfix global cats
*
* @var string
*/
static public $global_marker;
/**
* constructor for categories class
*
@ -133,6 +140,11 @@ class categories
{
self::init_cache();
}
if (is_null(self::$global_marker))
{
// as et2 adds options with .text(), it can't be entities, but php knows no string literals with utf-8
self::$global_marker = html_entity_decode(' &#9830;', ENT_NOQUOTES, 'utf-8');
}
}
/**
@ -1156,7 +1168,7 @@ class categories
$s .= $GLOBALS['egw']->strip_html($cat['name']);
if (self::is_global($cat))
{
$s .= ' &#9830;';
$s .= self::$global_marker;
}
$s .= '</option>' . "\n";
}