當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。