html-encoding is done in etemplate engine

This commit is contained in:
Ralf Becker 2013-08-09 11:17:30 +00:00
parent 11f7673408
commit c8aa72039f
2 changed files with 9 additions and 8 deletions

View File

@ -27,7 +27,7 @@ class etemplate_widget_taglist extends etemplate_widget
public function __construct($xml = '')
{
$this->attrs['allowFreeEntries'] = true;
if($xml) {
parent::__construct($xml);
}
@ -43,17 +43,17 @@ class etemplate_widget_taglist extends etemplate_widget
$query = $_REQUEST['query'];
$options = array();
$links = egw_link::query($app, $query, $options);
$results = array();
foreach($links as $id => $name)
{
$results[] = array('id'=>$id, 'label' => htmlspecialchars($name));
$results[] = array('id' => $id, 'label' => $name);
}
header('Content-Type: application/json; charset=utf-8');
echo json_encode($results);
common::egw_exit();
}
/**
* Search for emails
*
@ -66,11 +66,11 @@ class etemplate_widget_taglist extends etemplate_widget
$_REQUEST['app'] = 'addressbook-email';
return self::ajax_search();
}
// TODO: this should go to a BO, not a UI object
return mail_compose::ajax_searchAddress();
}
/**
* Validate input
*
@ -88,7 +88,7 @@ class etemplate_widget_taglist extends etemplate_widget
{
$value = $value_in = self::get_array($content, $form_name);
$allowed = etemplate_widget_menupopup::selOptions($form_name);
foreach((array) $value as $key => $val)
{
if(!$this->attrs['allowFreeEntries'] && !array_key_exists($val,$allowed))

View File

@ -161,7 +161,8 @@ var et2_taglist = et2_selectbox.extend(
editable: !(this.options.disabled || this.options.readonly),
selectionRenderer: jQuery.proxy(this.options.tagRenderer || this.selectionRenderer,this),
renderer: jQuery.proxy(this.options.listRenderer || this.selectionRenderer,this),
maxSelection: this.options.maxSelection
maxSelection: this.options.maxSelection,
highlight: false // otherwise renderer have to return strings
}, this.lib_options);
this.taglist = this.taglist.magicSuggest(options);