38 require_once
'HTML/QuickForm/text.php';
56 $this->index_prefix = time();
57 if ( !isset($attributes) ) $attributes = array();
58 $class = @$attributes[
'class'];
59 $class .=
' xf-lookup xf-lookup-'.$this->index_prefix.
'-'.
$this->index;
60 $attributes[
'class'] = $class;
61 $attributes[
'df:cloneable'] = 1;
62 parent::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
63 $this->_type =
'lookup';
85 if ( !defined(
'HTML_QuickForm_lookup_files_loaded') ){
86 define(
'HTML_QuickForm_lookup_files_loaded',1);
88 $jt->import(
'xataface/widgets/lookup.js');
92 $properties = $this->getProperties();
93 if ( $this->_flagFrozen ){
94 $properties[
'frozen'] = 1;
96 if ( !isset($properties[
'callback']) ){
97 $properties[
'callback'] =
'function(out){}';
101 $oldFrozen = $this->_flagFrozen;
102 $this->_flagFrozen=0;
103 $this->updateAttributes(array(
'data-xf-lookup-options'=>json_encode($properties)));
105 $this->_flagFrozen=$oldFrozen;
106 $out .= ob_get_contents();
110 if ( $this->getName() ){
111 $selector =
"input[name='".$this->getName().
"']";
113 $selector =
'.xf-lookup-'.$this->index_prefix.
'-'.
$this->index;
144 return '<span style="white-space:nowrap">'.$out.
'</span>';