1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41:
<?php
defined("ICMS_ROOT_PATH") or die("ImpressCMS root path not defined");
class icms_ipf_form_elements_User extends icms_form_elements_Select {
private $_multiple = false;
public function __construct($object, $key) {
$var = $object->vars[$key];
$size = isset($var['size']) ? $var['size'] : ($this->_multiple ? 5 : 1);
parent::__construct($var['form_caption'], $key, $object->getVar($key, 'e'), $size, $this->_multiple);
$sql = "SELECT uid, uname FROM " . icms::$xoopsDB->prefix("users"). " ORDER BY uname ASC";
$result = icms::$xoopsDB->query($sql);
if ($result) {
while ($myrow = icms::$xoopsDB->fetchArray($result)) {
$uArray[$myrow["uid"]] = $myrow["uname"];
}
}
$this->addOptionArray($uArray);
}
}