本文整理汇总了PHP中XoopsFormSelect::setClass方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsFormSelect::setClass方法的具体用法?PHP XoopsFormSelect::setClass怎么用?PHP XoopsFormSelect::setClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsFormSelect
的用法示例。
在下文中一共展示了XoopsFormSelect::setClass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addOwnershipList
function addOwnershipList($form, $groups, $member_handler, $gperm_handler, $fid, $mid, $entry_id = "")
{
global $xoopsDB;
$add_groups = $gperm_handler->getGroupIds("add_own_entry", $fid, $mid);
// May 5, 2006 -- limit to the user's own groups unless the user has global scope
if (!($globalscope = $gperm_handler->checkRight("view_globalscope", $fid, $groups, $mid))) {
$add_groups = array_intersect($add_groups, $groups);
}
$all_add_users = array();
foreach ($add_groups as $grp) {
$add_users = $member_handler->getUsersByGroup($grp);
$all_add_users = array_merge((array) $add_users, $all_add_users);
unset($add_users);
}
$unique_users = array_unique($all_add_users);
$punames = array();
foreach ($unique_users as $uid) {
$uqueryforrealnames = "SELECT name, uname FROM " . $xoopsDB->prefix("users") . " WHERE uid={$uid}";
$uresqforrealnames = $xoopsDB->query($uqueryforrealnames);
$urowqforrealnames = $xoopsDB->fetchRow($uresqforrealnames);
$punames[] = $urowqforrealnames[0] ? $urowqforrealnames[0] : $urowqforrealnames[1];
// use the uname if there is no full name
}
// alphabetize the proxy list added 11/2/04
array_multisort($punames, $unique_users);
if ($entry_id) {
include_once XOOPS_ROOT_PATH . "/modules/formulize/class/data.php";
$data_handler = new formulizeDataHandler($fid);
$entryMeta = $data_handler->getEntryMeta($entry_id);
$entryOwner = $entryMeta[2];
$entryOwnerName = $punames[array_search($entryOwner, $unique_users)];
// need to look in one array to find the key to lookup in the other array...a legacy from when corresponding arrays were a common data structure in Formulize...multidimensional arrays were not well understood in the beginning
$proxylist = new XoopsFormSelect(_AM_SELECT_UPDATE_OWNER, 'updateowner_' . $fid . '_' . $entry_id, 0, 1);
$proxylist->addOption('nochange', _AM_SELECT_UPDATE_NOCHANGE . $entryOwnerName);
} else {
$proxylist = new XoopsFormSelect(_AM_SELECT_PROXY, 'proxyuser', 0, 5, TRUE);
// made multi May 3 05
$proxylist->addOption('noproxy', _formulize_PICKAPROXY);
}
for ($i = 0; $i < count($unique_users); $i++) {
if ($unique_users[$i]) {
$proxylist->addOption($unique_users[$i], $punames[$i]);
}
}
if (!$entry_id) {
$proxylist->setValue('noproxy');
} else {
$proxylist->setValue('nochange');
}
$proxylist->setClass("no-print");
$form->addElement($proxylist);
return $form;
}