当前位置: 首页>>代码示例>>PHP>>正文


PHP XoopsFormSelect::setClass方法代码示例

本文整理汇总了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;
}
开发者ID:LeeGlendenning,项目名称:formulize,代码行数:53,代码来源:formdisplay.php


注:本文中的XoopsFormSelect::setClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。