本文整理汇总了PHP中Group::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP Group::getList方法的具体用法?PHP Group::getList怎么用?PHP Group::getList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Group
的用法示例。
在下文中一共展示了Group::getList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getContent
public function getContent()
{
$groupNumber = Data::get("group");
$groupLetter = Data::get("letter");
$this->tpl->groups = Group::getList($groupNumber, $groupLetter);
$this->tpl->schedule = Schedule::getData($groupNumber);
return $this->fetch($this->name . DS . "content.tpl");
}
示例2: getContent
public function getContent()
{
$group = Group::getList();
foreach ($group as $value) {
$list[] = $value;
$this->tpl->group = $list;
}
return $this->fetch($this->name . DS . "content.tpl");
}
示例3: RPCObjectGetList
public function RPCObjectGetList()
{
switch ($this->ObjectConf['ClassName']) {
case 'User':
return User::getList("");
case 'Group':
return Group::getList("");
case 'gui':
return gui::getList("");
default:
return null;
}
}
示例4: testRollback
function testRollback()
{
$f = Group::getList();
$iNumGroups = count($f);
DBUtil::startTransaction();
$g = Group::createFromArray(array('name' => 'rollback'));
if (!$this->assertGroup($g)) {
return;
}
$f = Group::getList();
$iNowNumGroups = count($f);
$this->assertEqual($iNumGroups + 1, $iNowNumGroups, 'New group not in list');
DBUtil::rollback();
$f = Group::getList();
$iRollbackNumGroups = count($f);
$this->assertEqual($iNumGroups, $iRollbackNumGroups, 'New group still in list (should be rolled back)');
}
示例5: displayConfiguration
function displayConfiguration($args)
{
// permissions
$aKeyedGroups = array();
$aGroups = Group::getList();
foreach ($aGroups as $oGroup) {
$aKeyedGroups[$oGroup->getId()] = $oGroup->getName();
}
$oTemplating =& KTTemplating::getSingleton();
$oTemplate = $oTemplating->loadTemplate('ktcore/workflowtriggers/group');
$aTemplateData = array('context' => $this, 'groups' => $aKeyedGroups, 'current_group' => KTUtil::arrayGet($this->aConfig, 'group_id'), 'args' => $args);
return $oTemplate->render($aTemplateData);
}
示例6: stdClass
/*HTML*****************************************************************************************************/
echo "<form name='form1' action='" . $self . "' method='post'>";
echo "<table border='0'>";
#User
echo "<tr>";
echo "<td>";
echo "Group: ";
echo "</td>";
echo "<td>";
echo "<select name='selected_group' onchange='submit()'>";
echo "<option value='new'>NEW...</option>";
$filter = new stdClass();
if (isset($myGroup) && $myGroup) {
$filter->owner = Mapbender::session()->get("mb_user_id");
}
$groupArray = Group::getList($filter);
foreach ($groupArray as $group) {
echo "<option value='" . htmlentities($group->getId(), ENT_QUOTES . "UTF-8") . "' ";
if ($selected_group && intval($selected_group) == $group->getId()) {
echo "selected";
}
echo ">" . htmlentities($group->name, ENT_QUOTES, "UTF-8") . "</option>";
}
echo "</select>";
echo "</td>";
echo "</tr>";
if (isset($selected_group) && $selected_group != 0) {
$group = new Group(intval($selected_group));
$data = $group->getFields();
if ($group->isValid()) {
$name = $data["name"];
示例7: json_getGroups
function json_getGroups()
{
$oConfig = KTConfig::getSingleton();
$bOnlyOwnGroup = $oConfig->get('email/onlyOwnGroups', false);
$sFilter = KTUtil::arrayGet($_REQUEST, 'filter', false);
$aGroupList = array('off' => _kt('-- Please filter --'));
if ($sFilter && trim($sFilter)) {
$sWhere = sprintf('name LIKE "%%%s%%"', $sFilter);
if ($bOnlyOwnGroup != true) {
$aGroups = Group::getList($sWhere);
} else {
$aGroups = GroupUtil::listGroupsForUser($this->oUser, array('where' => $sWhere));
}
$aGroupList = array();
foreach ($aGroups as $g) {
$aGroupList[$g->getId()] = $g->getName();
}
}
return $aGroupList;
}
示例8: getList
/**
* Returns a list of groups matching the filter criteria.
*
* @author KnowledgeTree Team
* @access public
* @static
* @param string $filter
* @param array $options
* @return array of KTAPI_Group
*/
public static function getList($filter = null, $options = null)
{
$groups = Group::getList($filter, $options);
if (PEAR::isError($groups)) {
return $groups;
}
$list = array();
foreach ($groups as $group) {
$list[] = new KTAPI_Group($group);
}
return $list;
}
示例9:
include ROOT . '/lib/begin.php';
// 글 목록
$customQuery = $event->on('Query.feedItems', '');
$pageCount = $skinConfig->postList; // 페이지갯수
list($posts, $totalFeedItems) = FeedItem::getFeedItems($searchType, $searchKeyword, $searchExtraValue, $page, $pageCount, false, 0, $customQuery);
$paging = Func::makePaging($page, $pageCount, $totalFeedItems);
$group = Group::getByName($searchKeyword);
$groupCategories = GroupCategory::getList($group['id']);
if(count($groupCategories)>0) {
$src_group = $skin->cutSkinTag('group_category');
$groups = Group::getList();
if(count($groups) > 0) {
$sp_group = "<ul>\n";
foreach($groupCategories as $groupCategory) {
$sp_group .= "<li><a href=\"{$servicePath}/group/".func::encode($group['name'])."/".func::encode($groupCategory['name'])."\">{$groupCategory['name']}</a>\n";
}
$sp_group .= "</ul>\n";
$s_group = $skin->parseTag('group_category_list',$sp_group, $src_group);
} else {
$s_group = '';
}
$skin->dress('group_category', $s_group);
}
include ROOT . '/lib/piece/message.php';
示例10: json_notificationusers
function json_notificationusers()
{
$sFilter = KTUtil::arrayGet($_REQUEST, 'filter', false);
if ($sFilter == false) {
$values = array('off' => _kt('-- Please filter --'));
// default
}
$sFilter = trim($sFilter);
$values = array('off' => _kt('-- Please filter --'));
// default
if (!empty($sFilter)) {
$allowed = array();
// Modified Jarrett Jordaan Only notify enabled users
$q = sprintf('name like "%%%s%%" AND disabled = 0', DBUtil::escapeSimple($sFilter));
$aUsers = User::getList($q);
$q = sprintf('name like "%%%s%%"', DBUtil::escapeSimple($sFilter));
$aGroups = Group::getList($q);
$aRoles = Role::getList($q);
$empty = true;
if (!PEAR::isError($aUsers)) {
$allowed['user'] = $aUsers;
if (!empty($aUsers)) {
$empty = false;
}
}
if (!PEAR::isError($aGroups)) {
$allowed['group'] = $aGroups;
if (!empty($aGroups)) {
$empty = false;
}
}
if (!PEAR::isError($aRole)) {
$allowed['role'] = $aRoles;
if (!empty($aRoles)) {
$empty = false;
}
}
if ($empty) {
$values = array('off' => '-- No results --');
// default
} else {
$values = $this->descriptorToJSON($allowed);
}
}
return $values;
}
示例11: buildGroupArray
function buildGroupArray()
{
global $default;
$aDirectGroups = array();
$aGroupMemberships = DBUtil::getResultArray("SELECT parent_group_id, member_group_id FROM {$default->groups_groups_table}");
$aGroups =& Group::getList();
foreach ($aGroups as $oGroup) {
$aDirectGroups[$oGroup->getID()] = array();
}
foreach ($aGroupMemberships as $aRow) {
$aList = KTUtil::arrayGet($aDirectGroups, $aRow['parent_group_id'], array());
$aList[] = $aRow['member_group_id'];
$aDirectGroups[$aRow['parent_group_id']] = $aList;
}
return GroupUtil::expandGroupArray($aDirectGroups);
}
示例12: json_getEntities
function json_getEntities($optFilter = null)
{
$sFilter = KTUtil::arrayGet($_REQUEST, 'filter', false);
if ($sFilter == false && $optFilter != null) {
$sFilter = $optFilter;
}
$bSelected = KTUtil::arrayGet($_REQUEST, 'selected', false);
$aEntityList = array('off' => _kt('-- Please filter --'));
// check permissions
$oPO = KTPermissionObject::get($this->oFolder->getPermissionObjectId());
$aOptions = array('redirect_to' => array('json', 'json_action=permission_error&fFolderId=' . $this->oFolder->getId()));
if (!KTBrowseUtil::inAdminMode($this->oUser, $this->oFolder)) {
$this->oValidator->userHasPermissionOnItem($this->oUser, $this->_sEditShowPermission, $this->oFolder, $aOptions);
}
// get permissions map
$aPermissionsMap =& $this->_getPermissionsMap();
if ($bSelected || $sFilter && trim($sFilter)) {
if (!$bSelected) {
$aEntityList = array();
}
$aGroups = Group::getList(sprintf('name like \'%%%s%%\'', $sFilter));
foreach ($aGroups as $oGroup) {
$aPerm = @array_keys($aPermissionsMap['group'][$oGroup->getId()]);
if (!is_array($aPerm)) {
$aPerm = array();
}
if ($bSelected) {
if (count($aPerm)) {
$aEntityList['g' . $oGroup->getId()] = array('type' => 'group', 'display' => _kt('Group') . ': ' . $oGroup->getName(), 'name' => $oGroup->getName(), 'permissions' => $aPerm, 'id' => $oGroup->getId(), 'selected' => true);
}
} else {
$aEntityList['g' . $oGroup->getId()] = array('type' => 'group', 'display' => _kt('Group') . ': ' . $oGroup->getName(), 'name' => $oGroup->getName(), 'permissions' => $aPerm, 'id' => $oGroup->getId());
}
}
$aRoles = Role::getList(sprintf('name like \'%%%s%%\'', $sFilter));
foreach ($aRoles as $oRole) {
$aPerm = @array_keys($aPermissionsMap['role'][$oRole->getId()]);
if (!is_array($aPerm)) {
$aPerm = array();
}
if ($bSelected) {
if (count($aPerm)) {
$aEntityList['r' . $oRole->getId()] = array('type' => 'role', 'display' => _kt('Role') . ': ' . $oRole->getName(), 'name' => $oRole->getName(), 'permissions' => $aPerm, 'id' => $oRole->getId(), 'selected' => true);
}
} else {
$aEntityList['r' . $oRole->getId()] = array('type' => 'role', 'display' => _kt('Role') . ': ' . $oRole->getName(), 'name' => $oRole->getName(), 'permissions' => $aPerm, 'id' => $oRole->getId());
}
}
}
return $aEntityList;
}
示例13: elseif
Auth::checkAuthentication(APP_COOKIE);
$tpl->assign("type", "groups");
$role_id = Auth::getCurrentRole();
if ($role_id == User::getRoleID('administrator') || $role_id == User::getRoleID('manager')) {
if ($role_id == User::getRoleID('administrator')) {
$tpl->assign("show_setup_links", true);
}
if (@$HTTP_POST_VARS["cat"] == "new") {
$tpl->assign("result", Group::insert());
} elseif (@$HTTP_POST_VARS["cat"] == "update") {
$tpl->assign("result", Group::update());
} elseif (@$HTTP_POST_VARS["cat"] == "delete") {
Group::remove();
}
if (@$HTTP_GET_VARS["cat"] == "edit") {
$info = Group::getDetails($HTTP_GET_VARS["id"]);
$tpl->assign("info", $info);
}
$user_options = User::getActiveAssocList(false, NULL, false, false, true);
if (@$HTTP_GET_VARS['show_customers'] == 1) {
$show_customer = true;
} else {
$show_customer = false;
}
$tpl->assign("user_options", $user_options);
$tpl->assign("list", Group::getList());
$tpl->assign("project_list", Project::getAll());
} else {
$tpl->assign("show_not_allowed_msg", true);
}
$tpl->displayTemplate();
示例14: do_editRoleGroups
function do_editRoleGroups()
{
$iFolderId = $this->oFolder->getId();
$role_allocation_id = KTUtil::arrayGet($_REQUEST, 'alloc_id');
if ($iFolderId == 1 && is_null($role_allocation_id)) {
$oRoleAllocation = $this->rootoverride($_REQUEST['role_id']);
} else {
$oRoleAllocation = RoleAllocation::get($role_allocation_id);
}
if (PEAR::isError($oRoleAllocation) || $oRoleAllocation === false) {
$this->errorRedirectToMain(_kt('No such role allocation.'), sprintf('fFolderId=%d', $iFolderId));
}
$oRole = Role::get($oRoleAllocation->getRoleId());
$this->oPage->setBreadcrumbDetails(_kt('Manage Groups for Role'));
$this->oPage->setTitle(sprintf(_kt('Manage Groups for Role "%s"'), $oRole->getName()));
$initJS = 'var optGroup = new OptionTransfer("groupSelect","chosenGroups"); ' . 'function startTrans() { var f = getElement("grouproleform"); ' . ' optGroup.saveNewRightOptions("groupFinal"); ' . ' optGroup.init(f); }; ' . ' addLoadEvent(startTrans); ';
$this->oPage->requireJSStandalone($initJS);
$aInitialUsers = $oRoleAllocation->getGroups();
$aAllUsers = Group::getList();
// FIXME this is massively non-performant for large userbases..
$aRoleUsers = array();
$aFreeUsers = array();
foreach ($aInitialUsers as $oGroup) {
$aRoleUsers[$oGroup->getId()] = $oGroup;
}
foreach ($aAllUsers as $oGroup) {
if (!array_key_exists($oGroup->getId(), $aRoleUsers)) {
$aFreeUsers[$oGroup->getId()] = $oGroup;
}
}
// Include the electronic signature on the permissions action
global $default;
if ($default->enableESignatures) {
$sUrl = KTPluginUtil::getPluginPath('electronic.signatures.plugin', true);
$heading = _kt('You are attempting to modify roles');
$input['type'] = 'button';
$input['onclick'] = "javascript: showSignatureForm('{$sUrl}', '{$heading}', 'ktcore.transactions.role_allocations_change', 'folder', 'grouproleform', 'submit', {$iFolderId});";
} else {
$input['type'] = 'submit';
$input['onclick'] = '';
}
$oTemplating =& KTTemplating::getSingleton();
$oTemplate = $oTemplating->loadTemplate("ktcore/folder/roles_managegroups");
$aTemplateData = array("context" => $this, "edit_rolealloc" => $oRoleAllocation, 'unused_groups' => $aFreeUsers, 'role_groups' => $aRoleUsers, 'rolename' => $oRole->getName(), 'input' => $input);
return $oTemplate->render($aTemplateData);
}
示例15: json_getGroups
function json_getGroups()
{
$sFilter = KTUtil::arrayGet($_REQUEST, 'filter', false);
$aGroupList = array('off' => _kt('-- Please filter --'));
if ($sFilter && trim($sFilter)) {
$aGroups = Group::getList(sprintf('name like "%%%s%%"', $sFilter));
$aGroupList = array();
foreach ($aGroups as $oGroup) {
$aGroupList[$oGroup->getId()] = $oGroup->getName();
}
}
return $aGroupList;
}