diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index a90ccac61..c490c55f2 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -208,12 +208,11 @@ class e_form if(vartrue($options['typeahead'])) { - $options['data-provide'] ="typeahead"; if(vartrue($options['typeahead']) == 'users') { - $options['data-source'] = e_BASE."user.php"; - } - + $options['data-source'] = e_BASE."user.php"; + $options['class'] .= " e-typeahead"; + } } $options = $this->format_options('text', $name, $options); @@ -642,6 +641,14 @@ class e_form function userpicker($name_fld, $id_fld, $default_name, $default_id, $options = array()) { if(!is_array($options)) parse_str($options, $options); + + //TODO Auto-calculate $name_fld from $id_fld ie. append "_usersearch" here ? + + return $this->text($name_fld,$default_name,20, "typeahead=users&readonly=".vartrue($options['readonly'])) + .$this->hidden($id_fld,$default_id, array('id' => $this->name2id($id_fld)))." id# ".$default_id; + + + /* $label_fld = str_replace('_', '-', $name_fld).'-upicker-lable'; @@ -657,9 +664,9 @@ class e_form
'; - // FIXME - switch to external JS, jQuery support + e107::getJs()->requireCoreLib('scriptaculous/controls.js', 2); - //TODO - external JS + e107::getJs()->footerInline(" //autocomplete fields \$\$('input[name={$name_fld}]').each(function(el) { @@ -695,7 +702,7 @@ class e_form }); "); return $ret; - + */ } @@ -1045,6 +1052,7 @@ class e_form $name = (strpos($name, '[') === false) ? $name.'[]' : $name; if(!is_array($selected)) $selected = explode(",",$selected); } + $text = $this->select_open($name, $options)."\n"; if(isset($options['default'])) diff --git a/e107_plugins/pm/pm.php b/e107_plugins/pm/pm.php index e9f6844ec..819038877 100755 --- a/e107_plugins/pm/pm.php +++ b/e107_plugins/pm/pm.php @@ -137,7 +137,11 @@ class pm_extended extends private_message $tpl_file = THEME.'pm_template.php'; include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN.'pm/pm_template.php'); $enc = (check_class($this->pmPrefs['attach_class']) ? "enctype='multipart/form-data'" : ''); - setScVar('pm_handler_shortcodes','pmInfo', $pm_info); + // setScVar('pm_handler_shortcodes','pmInfo', $pm_info); + + $sc = e107::getScBatch('pm',TRUE); + $sc->setVars($pm_info); + $text = "