本文整理汇总了PHP中Groups类的典型用法代码示例。如果您正苦于以下问题:PHP Groups类的具体用法?PHP Groups怎么用?PHP Groups使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Groups类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: updateAllGroups
/**
* Process headers and store in database for all active groups.
*/
function updateAllGroups()
{
$n = $this->n;
$groups = new Groups();
$res = $groups->getActive();
$s = new Sites();
echo $s->getLicense();
if ($res) {
shuffle($res);
$alltime = microtime(true);
echo 'Updating: ' . sizeof($res) . ' groups - Using compression? ' . ($this->compressedHeaders ? 'Yes' : 'No') . $n;
$nntp = new Nntp();
if ($nntp->doConnect()) {
$pos = 0;
foreach ($res as $groupArr) {
$pos++;
echo 'Group ' . $pos . ' of ' . sizeof($res) . $n;
$this->message = array();
$this->updateGroup($nntp, $groupArr);
}
$nntp->doQuit();
echo 'Updating completed in ' . number_format(microtime(true) - $alltime, 2) . ' seconds' . $n;
} else {
echo "Failed to get NNTP connection.{$n}";
}
} else {
echo "No groups specified. Ensure groups are added to newznab's database and activated before updating.{$n}";
}
}
开发者ID:scriptzteam,项目名称:newzNZB-premium-indexer,代码行数:32,代码来源:binaries.php
示例2: setUpGroups
function setUpGroups($lang)
{
if (!file_exists(GROUP_FILE_LOCATION)) {
$aGroupDB = new Groups();
$aGroupDB->setFileName(GROUP_FILE_LOCATION);
$names = ImageTypes::getMenuNames();
foreach ($names as $name) {
$aGroup = new Group();
$aGroup->setType($lang[$name]);
$aGroup->setGroupImage($name);
$aGroup->rebuildElementLine();
$aGroupDB->addElement($aGroup);
}
$aGroupDB->save();
} else {
// validate we have all the default groups
$addedElement = false;
$aGroupDB = new Groups(GROUP_FILE_LOCATION);
$names = ImageTypes::getMenuNames();
foreach ($names as $name) {
if ($aGroupDB->getAGroup($name) == "") {
$aGroup = new Group();
$aGroup->setType($lang[$name]);
$aGroup->setGroupImage($name);
$aGroup->rebuildElementLine();
$aGroupDB->addElement($aGroup);
$addedElement = true;
}
}
if ($addedElement) {
$aGroupDB->save();
}
}
}
开发者ID:bwssytems,项目名称:domuslink,代码行数:34,代码来源:setupgroups.php
示例3: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
$this->command->info("Creating Super Admins");
$group = new Groups();
$group->name = "admin";
$group->save();
$group = new Groups();
$group->name = "department-admin";
$group->save();
$group = new Groups();
$group->name = "operator";
$group->save();
$group = new Groups();
$group->name = "customer";
$group->save();
$admin = new User();
$admin->name = "Admin";
$admin->email = "[email protected]";
$admin->password = Hash::make("admin");
$admin->avatar = "/assets/images/default-avatar.jpg";
$admin->show_avatar = 1;
$admin->birthday = "01-15-1990";
$admin->bio = "This is dummy admin bio";
$admin->gender = "Male";
$admin->mobile_no = "0000000000";
$admin->country = "India";
$admin->activated = 1;
$admin->activated_at = \Carbon\Carbon::now();
$admin->save();
DB::table('users_groups')->insert(['user_id' => 1, 'group_id' => 1]);
}
开发者ID:noikiy,项目名称:Xenon-Support-Center,代码行数:37,代码来源:DatabaseSeeder.php
示例4: onBookmark
function onBookmark()
{
$this->ajaxClear();
$g = new Groups();
$g->ajaxHeader();
$g->ajaxSubscriptions();
}
开发者ID:vijo,项目名称:movim,代码行数:7,代码来源:Group.php
示例5: addUserToGroupAction
/**
* Add user to group.
* @ParamConverter("user", class="MiwClubPadelBundle:Users",options={"mapping"={"userid"="id"}})
* @ParamConverter("group", class="MiwClubPadelBundle:Groups",options={"mapping"={"groupid"="id"}})
*/
public function addUserToGroupAction(Users $user, Groups $group)
{
$em = $this->getDoctrine()->getManager();
$em->getRepository('MiwClubPadelBundle:Users');
$group->addUser($user);
$user->addGroup($group);
$em->flush();
return $user;
}
开发者ID:RaquelDiazG,项目名称:Symfony_ClubPadel,代码行数:14,代码来源:UsersController.php
示例6: __construct
public function __construct(Groups $groups)
{
parent::__construct();
$this->addText('s', 'dotaz')->setAttribute('autofocus', true);
$this->addSelect('sortBy', 'Seřadit podle:', array(SearchRequest::SORT_TIME => 'času', SearchRequest::SORT_RELEVANCE => 'relevance'));
$this->addText('from', 'Autor:');
$this->addContainer('groups');
foreach ($groups->getList() as $group) {
$this['groups']->addCheckbox($group->id, $group->name);
}
$this->addSubmit('send', 'Vyhledat');
}
开发者ID:ISCCTU,项目名称:fitak,代码行数:12,代码来源:SearchForm.php
示例7: getUsers
function getUsers($listid, $default)
{
global $idclient, $cfg, $auth;
$userlist = new Users();
$users = $userlist->getAccessibleUsers(explode(',', $auth->auth['perm']));
$grouplist = new Groups();
$groups = $grouplist->getAccessibleGroups(explode(',', $auth->auth['perm']));
$tpl2 = new Template();
$tpl2->set('s', 'NAME', 'user' . $listid);
$tpl2->set('s', 'CLASS', 'text_small');
$tpl2->set('s', 'OPTIONS', 'size=1');
$tpl2->set('d', 'VALUE', 0);
$tpl2->set('d', 'CAPTION', '--- ' . i18n("None", "workflow") . ' ---');
if ($default == 0) {
$tpl2->set('d', 'SELECTED', 'SELECTED');
} else {
$tpl2->set('d', 'SELECTED', '');
}
$tpl2->next();
if (is_array($users)) {
foreach ($users as $key => $value) {
$tpl2->set('d', 'VALUE', $key);
$tpl2->set('d', 'CAPTION', $value["realname"] . " (" . $value["username"] . ")");
if ($default == $key) {
$tpl2->set('d', 'SELECTED', 'SELECTED');
} else {
$tpl2->set('d', 'SELECTED', '');
}
$tpl2->next();
}
}
$tpl2->set('d', 'VALUE', '0');
$tpl2->set('d', 'CAPTION', '------------------------------------');
$tpl2->set('d', 'SELECTED', 'disabled');
$tpl2->next();
if (is_array($groups)) {
foreach ($groups as $key => $value) {
$tpl2->set('d', 'VALUE', $key);
$tpl2->set('d', 'CAPTION', $value["groupname"]);
if ($default == $key) {
$tpl2->set('d', 'SELECTED', 'SELECTED');
} else {
$tpl2->set('d', 'SELECTED', '');
}
$tpl2->next();
}
}
return $tpl2->generate($cfg['path']['templates'] . $cfg['templates']['generic_select'], true);
}
开发者ID:Spider-IT-Deutschland,项目名称:drugCMS-Plugin_Workflow,代码行数:49,代码来源:functions.workflow.php
示例8: actionProgress
public function actionProgress($id, $trackid)
{
$progress = array();
// получаем список пользователей
// получаем задания по пользователю, сразу же с решениями
$track = Tracks::model()->findByPk($trackid);
$group = Groups::model()->with("Students")->findByPk($id);
// пройдемся по всем студентам в группе
foreach ($group->Students as $student) {
// получим теперь таски и солюшны этого студента
$students[$student->id] = $student;
$tasks = Tasks::model()->with(array('Solutions' => array('on' => 'Solutions.student=' . $student->id)))->findAllByAttributes(array("track" => $trackid), array('order' => 't.order'));
// продемся по всем задачам
foreach ($tasks as $task) {
if (isset($task->Solutions[0])) {
// если у таска есть солюшн – возьмем
$progress[$student->id][$task->id] = $task->Solutions[0]->status;
} else {
// если нет – запишем нейтральный статус
$progress[$student->id][$task->id] = "undefined";
}
}
}
$this->render('progress', array("group" => $group, "track" => $track, "students" => $students, "progress" => $progress));
}
开发者ID:Kapodastr,项目名称:grow,代码行数:25,代码来源:TracksController.php
示例9: actionCreate
/**
* Creates a new model.
* If creation is successful, the browser will be redirected to the 'view' page.
*/
public function actionCreate()
{
$model = new X2Leads();
$users = User::getNames();
foreach (Groups::model()->findAll() as $group) {
$users[$group->id] = $group->name;
}
unset($users['admin']);
unset($users['']);
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if (isset($_POST['X2Leads'])) {
$temp = $model->attributes;
$model->setX2Fields($_POST['X2Leads']);
if (isset($_POST['x2ajax'])) {
$ajaxErrors = $this->quickCreate($model);
} else {
if ($model->save()) {
$this->redirect(array('view', 'id' => $model->id));
}
}
}
if (isset($_POST['x2ajax'])) {
$this->renderInlineCreateForm($model, isset($ajaxErrors) ? $ajaxErrors : false);
} else {
$this->render('create', array('model' => $model, 'users' => $users));
}
}
开发者ID:tymiles003,项目名称:X2CRM,代码行数:32,代码来源:X2LeadsController.php
示例10: getNextAssignee
/**
* Picks the next asignee based on the routing type
*
* @return string Username that should be assigned the next lead
*/
public function getNextAssignee()
{
$admin =& Yii::app()->settings;
$type = $admin->serviceDistribution;
if ($type == "") {
return "Anyone";
} elseif ($type == "evenDistro") {
return $this->evenDistro();
} elseif ($type == "trueRoundRobin") {
return $this->roundRobin();
} elseif ($type == 'singleUser') {
$user = User::model()->findByPk($admin->srrId);
if (isset($user)) {
return $user->username;
} else {
return "Anyone";
}
} elseif ($type == 'singleGroup') {
$group = Groups::model()->findByPk($admin->sgrrId);
if (isset($group)) {
return $group->id;
} else {
return "Anyone";
}
}
}
开发者ID:dsyman2,项目名称:X2CRM,代码行数:31,代码来源:ServiceRoutingBehavior.php
示例11: actionChangeInfo
/**
* 修改个人信息
*/
function actionChangeInfo()
{
$this->_pathway->addStep('个人信息');
$currentUser = $this->_app->currentUser();
$user = Users::find()->getById($currentUser['id']);
$form = new Form_User(url('admin::usercenter/changeInfo'));
$form->element('username')->set('readonly', 'true');
$form->remove('password');
$form->element('group_id')->items = Groups::find('id=?', $user->group_id)->order('weight desc')->getAll()->toHashMap('id', 'name');
$form->element('level_id')->items = Levels::find('weight=?', $user->level_id)->order('weight desc')->getAll()->toHashMap('weight', 'name');
$form->remove('enabled');
$form->add(QForm::ELEMENT, 'id', array('_ui' => 'hidden', 'value' => $currentUser['id']));
if ($this->_context->isPOST() && $form->validate($_POST)) {
try {
$user->changeProps($form->values());
$user->save();
return "{msg:'编辑成功'}";
} catch (QDB_ActiveRecord_ValidateFailedException $ex) {
$form->invalidate($ex);
}
} else {
$form->import($user);
}
$form->add(QForm::ELEMENT, 'reg_at', array('_ui' => 'textbox', '_label' => '注册时间', 'value' => date('Y-m-d', $user->register_at), 'class' => 'txt w200', 'readonly' => 'true'));
$form->add(QForm::ELEMENT, 'reg_ip', array('_ui' => 'textbox', '_label' => '注册IP', 'value' => $user->register_ip, 'class' => 'txt w200', 'readonly' => 'true'));
$form->add(QForm::ELEMENT, 'log_at', array('_ui' => 'textbox', '_label' => '最后登录时间', 'value' => $user->login_at == 0 ? '0000-00-00' : date('Y-m-d', $user->login_at), 'class' => 'txt w200', 'readonly' => 'true'));
$form->add(QForm::ELEMENT, 'log_ip', array('_ui' => 'textbox', '_label' => '最后登录IP', 'value' => $user->login_ip, 'class' => 'txt w200', 'readonly' => 'true'));
$form->add(QForm::ELEMENT, 'log_count', array('_ui' => 'textbox', '_label' => '登录次数', 'value' => $user->login_count, 'class' => 'txt w200', 'readonly' => 'true'));
$this->_view['form'] = $form;
}
开发者ID:Debenson,项目名称:openwan,代码行数:33,代码来源:usercenter_controller.php
示例12: testBasicFixture
/**
* A basic fixture test example
*
* @return void
*/
public function testBasicFixture()
{
$user = Sentry::findUserByLogin('[email protected]');
$this->assertEquals('Benevolent', $user->first_name);
$this->assertEquals('Dictator', $user->last_name);
$brand = Groups::getBrandProvider()->findByTitle('BizGym');
$this->assertTrue(Groups::isAdmin($user->id, $brand->id));
}
开发者ID:sgh1986915,项目名称:laravel-bizgym,代码行数:13,代码来源:ExampleTest.php
示例13: run
public function run()
{
// Refresh Brand_user_groups
DB::table('group_user_brand')->truncate();
$entries = array(array('user_id' => Sentry::findUserByLogin('[email protected]')->id, 'group_id' => Sentry::findGroupByName('Admin')->id, 'brand_id' => Groups::getBrandProvider()->findByTitle('BizGym')->id), array('user_id' => Sentry::findUserByLogin('[email protected]')->id, 'group_id' => Sentry::findGroupByName('User')->id, 'brand_id' => Groups::getBrandProvider()->findByTitle('SaaS Venture Group')->id), array('user_id' => Sentry::findUserByLogin('[email protected]')->id, 'group_id' => Sentry::findGroupByName('Admin')->id, 'brand_id' => Groups::getBrandProvider()->findByTitle('BizGym')->id), array('user_id' => Sentry::findUserByLogin('[email protected]')->id, 'group_id' => Sentry::findGroupByName('User')->id, 'brand_id' => Groups::getBrandProvider()->findByTitle('SaaS Venture Group')->id));
// Uncomment the below to run the seeder
DB::table('group_user_brand')->insert($entries);
}
开发者ID:sgh1986915,项目名称:laravel-bizgym,代码行数:8,代码来源:BrandsUsersGroupsTableSeeder.php
示例14: buildGroupTable
public function buildGroupTable()
{
if (!defined('SHOW_RPG') || SHOW_RPG != 'checked') {
return;
}
print '<div class="row-fluid">
<div class="box span12">
<div class="box-header well" data-original-title>
<h2><i class="icon-th"></i> Releases per Group</h2>
<div class="box-icon">
<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
</div>
</div>
<div class="box-content">';
echo '<table class="table table-striped table-bordered bootstrap-datatable datatable">
<thead>
<tr>
<th>Group</th>
<th>Releases</th>
</tr>
</thead>
<tbody>';
$group = new Groups();
# get all the groups
$allgroups = $group->getAll();
$pdo = new Settings();
foreach ($allgroups as $group) {
$sql = sprintf("select count(id) as num from releases where groupid = %s", $group['id']);
$res = $pdo->queryOneRow($sql);
if ($res["num"] > 0) {
echo '<tr>';
echo '<td>';
echo $group['name'];
echo '</td>';
echo '<td class="right">';
echo $res["num"];
echo '</td>';
echo '</tr>';
}
}
echo '</tbody>
</table> ';
print '</div></div></div>';
}
开发者ID:RickDB,项目名称:newznab-tmux,代码行数:45,代码来源:stats.php
示例15: __construct
public function __construct()
{
$groups = new Groups();
$doc = new Documents();
/**
* Wenn gepostet wurde
*/
if ($_POST) {
// Gruppe wird erstellt
if (isset($_POST["group_name"])) {
$groups->saveGroup($this->saveInputs($_POST["group_name"]), $this->saveInputs($_POST["group_description"]), get_current_user_id());
}
// User wird hinzugefügt
if (isset($_POST["userToAdd"])) {
$groups->addUser($this->saveInputs($_POST["group_id"]), $this->saveInputs($_POST["userToAdd"]));
}
if (isset($_POST["userToDelete"])) {
$groups->deleteUser($this->saveInputs($_POST["group_id"]), $this->saveInputs($_POST["userToDelete"]));
}
}
// Bestimmte ID wird abgefragt
if (isset($_GET["id"])) {
$user = wp_get_current_user();
$detailGroup = $groups->getGroupAndUsers($this->saveInputs($_GET["id"]));
$detailGroup->userToAdd = array();
if ($user->roles[0] == "dokuAdmin" || $user->roles[0] == "administrator") {
$detailGroup->userToAdd = $groups->getUserNotInGroup($this->saveInputs($_GET["id"]));
}
$documentsInGroup = $doc->getDocumentsInGroup($this->saveInputs($_GET["id"]));
echo $this->detailView($detailGroup, $documentsInGroup);
} else {
$arGroups = $groups->getAuthGroups();
echo $this->groupView($arGroups);
}
}
开发者ID:JanUrb,项目名称:Web-SystemeFL-WP,代码行数:35,代码来源:GroupView.php
示例16: createGroupPostAndComment
public function createGroupPostAndComment()
{
$this->user = $this->createUsers();
$this->group = $this->createGroup($this->user->id);
$this->post = $this->createPost($this->user->id);
$this->group->attachPost($this->post->id);
$this->comment = ['post_id' => $this->post->id, 'user_id' => $this->user->id, 'body' => 'This is my comment'];
return Groups::addComment($this->comment);
}
开发者ID:musonza,项目名称:groups,代码行数:9,代码来源:GroupsTestCase.php
示例17: makeOrderRecalc
public function makeOrderRecalc()
{
$obj = new Groups();
$obj->isRecalc = false;
$groups = $obj->get();
$orderArr = $atLast = [];
foreach ($groups as $gr) {
if ($gr->order_id == null) {
$atLast[] = $gr->id;
} else {
$orderArr[$gr->order_id] = $gr->id;
}
}
ksort($orderArr);
$newOrderArr = array_values($orderArr);
$finalOrderArr = array_merge($newOrderArr, $atLast);
foreach ($finalOrderArr as $orderId => $id) {
$obj->update(['id' => $id], ['order_id' => $orderId]);
}
}
开发者ID:Nordager,项目名称:setget,代码行数:20,代码来源:Groups.php
示例18: creategroupAction
public function creategroupAction()
{
if ($this->request->isPost() == true) {
try {
$this->response->setContentType('application/json');
$groupname = $this->request->getPost('groupname', 'striptags');
$user_id = $this->request->getPost('user_id');
$group = new Groups();
$group->assign(array('user_id' => $user_id, 'name' => $groupname, 'created_at' => (new \DateTime())->format('Y-m-d H:i:s'), 'updated_at' => (new \DateTime())->format('Y-m-d H:i:s')));
if ($group->save()) {
$data = array('status' => 'success', 'msg' => 'group created', 'code' => 2, 'group_name' => $group->name);
}
$this->response->setContent(json_encode($data));
$this->response->send();
} catch (Exception $ex) {
$this->response->setContent(json_encode(array('error' => $ex->getMessage())));
$this->response->send();
}
}
}
开发者ID:adeshhashbyte,项目名称:smhawkapi,代码行数:20,代码来源:GroupController.php
示例19: getMyOrganisations
public static function getMyOrganisations($detail = FALSE)
{
if ($detail) {
return Groups::getGroups(_ORGANISATION_GROUP);
} else {
$user_id = $GLOBALS['user']->uid;
$table = tableName(_ORGANISATION_GROUP);
$orgids = db_query("SELECT o.org_id from {$table} as o " . "LEFT JOIN soc_user_membership as um on o.org_id = um.group_id " . "WHERE um.uid = {$user_id} AND um.type = :organisation", array(':organisation' => _ORGANISATION_GROUP))->fetchCol();
}
return $orgids;
}
开发者ID:edwinraycom,项目名称:vals-soc,代码行数:11,代码来源:Organisations.php
示例20: subscriberCounterStat
public function subscriberCounterStat()
{
$count = 0;
$subscriber = Group::where('name', 'LIKE', '%ubscrib%')->first();
if ($subscriber) {
$related = Groups::getRelationProvider()->createModel()->where('group_id', '=', $subscriber->id);
$count = count($related->get());
}
$this->widgetData = array('count' => $count);
$this->setupWidgetLayout(__METHOD__);
}
开发者ID:sgh1986915,项目名称:laravel-bizgym,代码行数:11,代码来源:AppWidget.php
注:本文中的Groups类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论