本文整理匯總了PHP中Flyspray::listallGroups方法的典型用法代碼示例。如果您正苦於以下問題:PHP Flyspray::listallGroups方法的具體用法?PHP Flyspray::listallGroups怎麽用?PHP Flyspray::listallGroups使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Flyspray
的用法示例。
在下文中一共展示了Flyspray::listallGroups方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: area_prefs
function area_prefs()
{
global $page, $user, $fs;
$page->assign('groups', Flyspray::ListGroups());
$page->assign('all_groups', Flyspray::listallGroups($user->id));
$page->assign('theuser', $user);
$page->setTitle($fs->prefs['page_title'] . L('editmydetails'));
}
示例2: show
function show()
{
global $db, $page, $fs;
// Some possibly interesting information about the user
$sql = $db->x->GetOne('SELECT count(*) FROM {comments} WHERE user_id = ?', null, $this->user->id);
$page->assign('comments', $sql);
$sql = $db->x->GetOne('SELECT count(*) FROM {tasks} WHERE opened_by = ?', null, $this->user->id);
$page->assign('tasks', $sql);
$sql = $db->x->GetOne('SELECT count(*) FROM {assigned} WHERE user_id = ?', null, $this->user->id);
$page->assign('groups', Flyspray::listallGroups($this->user->id));
$page->assign('assigned', $sql);
$page->assign('theuser', $this->user);
$page->setTitle($fs->prefs['page_title'] . L('viewprofile'));
$page->pushTpl('profile.tpl');
}
示例3: area_users
/**
* area_users
*
* @access public
* @return void
*/
function area_users()
{
global $fs, $db, $proj, $user, $page;
// Prepare the sorting
$order_keys = array('username' => 'user_name', 'realname' => 'real_name', 'email' => 'email_address', 'jabber' => 'jabber_id', 'regdate' => 'register_date', 'status' => 'account_enabled');
$order_column[0] = $order_keys[Filters::enum(Get::val('order', 'username'), array_keys($order_keys))];
$order_column[1] = $order_keys[Filters::enum(Get::val('order2', 'username'), array_keys($order_keys))];
$sortorder = sprintf('%s %s, %s %s, u.user_id ASC', $order_column[0], Filters::enum(Get::val('sort', 'desc'), array('asc', 'desc')), $order_column[1], Filters::enum(Get::val('sort2', 'desc'), array('asc', 'desc')));
// Search options
$search_keys = array('user_name', 'real_name', 'email_address', 'jabber_id');
$where = 'WHERE 1=1 ';
$args = array();
foreach ($search_keys as $key) {
if (Get::val($key) != '') {
$where .= sprintf(' AND %s LIKE ? ', $key);
$args[] = '%' . Get::val($key) . '%';
}
}
// Search for users in a specific group
$groups = Get::val('group_id');
if (is_array($groups) && count($groups) && !in_array(0, $groups)) {
$where = ' LEFT JOIN {users_in_groups} uig ON u.user_id = uig.user_id ' . $where;
$where .= ' AND (' . substr(str_repeat(' uig.group_id = ? OR ', count($groups)), 0, -3) . ' ) ';
$args = array_merge($args, $groups);
}
$sql = $db->x->getAll('SELECT u.user_id, u.user_name, u.real_name, u.register_date,
u.jabber_id, u.email_address, u.account_enabled
FROM {users} u ' . $where . 'ORDER BY ' . $sortorder, null, $args);
$users = GroupBy($sql, 'user_id');
$page->assign('user_count', count($users));
// Offset and limit
$user_list = array();
$offset = max(Get::num('pagenum') - 1, 0) * 50;
for ($i = $offset; $i < $offset + 50 && $i < count($users); $i++) {
$user_list[] = $users[$i];
}
// Get the user groups in a separate query because groups may be hidden
// because of search options which are disregarded here
if (count($user_list)) {
$in = implode(',', array_map(create_function('$x', 'return reset($x);'), $user_list));
$sql = $db->x->getAll('SELECT user_id, g.group_id, g.group_name, g.project_id
FROM {groups} g
LEFT JOIN {users_in_groups} uig ON uig.group_id = g.group_id
WHERE user_id IN (' . $in . ')');
$user_groups = GroupBy($sql, 'user_id', array('group_id', 'group_name', 'project_id'), !REINDEX);
$page->assign('user_groups', $user_groups);
}
$page->assign('all_groups', Flyspray::listallGroups());
$page->assign('user_list', $user_list);
}