本文整理汇总了PHP中group::getAllGroups方法的典型用法代码示例。如果您正苦于以下问题:PHP group::getAllGroups方法的具体用法?PHP group::getAllGroups怎么用?PHP group::getAllGroups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类group
的用法示例。
在下文中一共展示了group::getAllGroups方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: form
//.........这里部分代码省略.........
// foreach ($stags as $stag_id) {
// $show_tag = $db->selectObject('tags', 'id='.$stag_id);
// $object->show_tags[$show_tag->id] = $show_tag->name;
// }
// }
}
// setup the listbuilder arrays for calendar aggregation.
$loc = unserialize($object->location_data);
$calendars = expModules::listInstalledControllers('calendarmodule');
$saved_aggregates = empty($object->aggregate) ? array() : unserialize($object->aggregate);
$all_calendars = array();
$selected_calendars = array();
foreach ($calendars as $src => $cal) {
$calendar_name = (empty($cal->title) ? 'Untitled' : $cal->title) . ' on page ' . $cal->section;
if ($src != $loc->src) {
if (in_array($src, $saved_aggregates)) {
$selected_calendars[$src] = $calendar_name;
} else {
$all_calendars[$src] = $calendar_name;
}
}
}
// setup the config form
$form->register(null, '', new htmlcontrol('<h3>' . gt('General Configuration') . '</h3><hr size="1" />'));
// $form->register('enable_categories',gt('Enable Categories'),new checkboxcontrol($object->enable_categories,true));
$form->register('enable_feedback', gt('Enable Feedback'), new checkboxcontrol($object->enable_feedback, true));
$form->register(null, '', new htmlcontrol('<h3>' . gt('Events Reminder Email') . '</h3><hr size="1" />'));
// Get original style user lists
// $selected_users = array();
// foreach(unserialize($object->reminder_notify) as $i) {
// $selected_users[$i] = $db->selectValue('user', 'firstname', 'id='.$i) . ' ' . $db->selectValue('user', 'lastname', 'id='.$i) . ' (' . $db->selectValue('user', 'username', 'id='.$i) . ')';
// }
// $userlist = array();
// $list = user::getAllUsers();
// foreach ($list as $i) {
// if(!array_key_exists($i->id, $selected_users)) {
// $userlist[$i->id] = $i->firstname . ' ' . $i->lastname . ' (' . $i->username . ')';
// }
// }
// $form->register('reminder_notify',gt('Who should be reminded of events?'),new listbuildercontrol($selected_users, $userlist));
// Get User list
$defaults = array();
$userlist = array();
$users = user::getAllUsers();
foreach ($db->selectObjects('calendar_reminder_address', 'calendar_id=' . $object->id . ' and user_id != 0') as $address) {
$locuser = user::getUserById($address->user_id);
$defaults[$locuser->id] = $locuser->firstname . ' ' . $locuser->lastname . ' (' . $locuser->username . ')';
}
foreach ($users as $locuser) {
if (!array_key_exists($locuser->id, $defaults)) {
$userlist[$locuser->id] = $locuser->firstname . ' ' . $locuser->lastname . ' (' . $locuser->username . ')';
}
}
$form->register('users', gt('Users'), new listbuildercontrol($defaults, $userlist));
// Get Group list
$defaults = array();
$grouplist = array();
$groups = group::getAllGroups();
if ($groups != null) {
foreach ($db->selectObjects('calendar_reminder_address', 'calendar_id=' . $object->id . ' and group_id != 0') as $address) {
$group = group::getGroupById($address->group_id);
$defaults[$group->id] = $group->name;
}
foreach ($groups as $group) {
if (!array_key_exists($group->id, $defaults)) {
$grouplist[$group->id] = $group->name;
}
}
$form->register('groups', gt('Groups'), new listbuildercontrol($defaults, $grouplist));
}
// Get Freeform list
$defaults = array();
foreach ($db->selectObjects('calendar_reminder_address', 'calendar_id=' . $object->id . " and email != ''") as $address) {
$defaults[$address->email] = $address->email;
}
$form->register('addresses', gt('Other Addresses'), new listbuildercontrol($defaults, null));
$form->register('email_title_reminder', gt('Message Subject Prefix'), new textcontrol($object->email_title_reminder, 45));
$form->register('email_from_reminder', gt('From (Display)'), new textcontrol($object->email_from_reminder, 45));
$form->register('email_address_reminder', gt('From (Email)'), new textcontrol($object->email_address_reminder, 45));
$form->register('email_reply_reminder', gt('Reply-to'), new textcontrol($object->email_reply_reminder, 45));
$form->register('email_showdetail', gt('Show detail in message?'), new checkboxcontrol($object->email_showdetail));
$form->register('email_signature', gt('Email Signature'), new texteditorcontrol($object->email_signature, 5, 30));
$form->register(null, '', new htmlcontrol('<h3>' . gt('Merge Calendars') . '</h3><hr size="1" />'));
$form->register('aggregate', gt('Pull Events from These Other Calendars'), new listbuildercontrol($selected_calendars, $all_calendars));
$form->register(null, '', new htmlcontrol('<h3>' . gt('RSS/iCalendar Configuration') . '</h3><hr size="1" />'));
$form->register('enable_rss', gt('Enable RSS'), new checkboxcontrol($object->enable_rss));
$form->register('enable_ical', gt('Enable iCalendar'), new checkboxcontrol($object->enable_ical));
$form->register('feed_title', gt('Title for this RSS feed'), new textcontrol($object->feed_title, 35, false, 75));
$form->register('feed_desc', gt('Description for this RSS feed'), new texteditorcontrol($object->feed_desc));
$form->register('rss_cachetime', gt('Recommended RSS/iCal feed update interval in minutes (1440 = 1 day)'), new textcontrol($object->rss_cachetime));
$form->register('rss_limit', gt('Maximum days of RSS/iCal items to publish (0 = all)'), new textcontrol($object->rss_limit));
// $form->register(null,'',new htmlcontrol('<h3>'.gt('Tagging').'</h3><hr size="1" />'));
// $form->register('enable_tags',gt('Enable Tags'), new checkboxcontrol($object->enable_tags));
// $form->register('collections',gt('Tag Collections'),new listbuildercontrol($object->collections,$tc_list));
// $form->register('group_by_tags',gt('Filter events by tags'), new checkboxcontrol($object->group_by_tags));
// $form->register(null,'',new htmlcontrol(gt('Tags to show')));
// $form->register('show_tags','',new listbuildercontrol($object->show_tags,$available_tags));
$form->register('submit', '', new buttongroupcontrol(gt('Save'), '', gt('Cancel')));
return $form;
}
示例2: Group
<?php
/********************************************************
JobExpert v1.0
powered by Script Developers Group (SD-Group)
email: info@sd-group.org.ua
url: http://sd-group.org.ua/
Copyright 2010-2015 (c) SD-Group
All rights reserved
=========================================================
Настройки - Регтстрации и пользователи
********************************************************/
/**
* @package
* @todo
*/
!defined('SDG') ? die('Triple protection!') : null;
// инициируем "Наименование страницы" отображаемое в форме
$arrNamePage = array(array('name' => MENU_ADMIN_MAIN, 'link' => CONF_ADMIN_FILE), array('name' => MENU_CONFIG, 'link' => false), array('name' => MENU_CONFIG_REGISTER, 'link' => false));
// сохраняем данные, переданные из формы
if (isset($_POST['save'])) {
$data = "<?php\n\n" . "(!defined('SDG')) ? die ('Triple protection!') : null;\n\n" . 'define("CONF_USER_REGISTER", "' . (!isset($_POST['user_register']) ? false : true) . '");' . "\n\n" . 'define("CONF_USER_ACTIVATE", "' . (!isset($_POST['user_activate']) ? false : true) . '");' . "\n\n" . 'define("CONF_USER_ACTIVATE_DELETE", "' . ((int) $_POST['user_activate_delete'] ? (int) $_POST['user_activate_delete'] : 24) . '");' . "\n\n" . 'define("CONF_MAIL_ADMIN_USER_REGISTER", "' . (!isset($_POST['admin_user_register']) ? false : true) . '");' . "\n\n" . 'define("CONF_REGISTER_USER_PASSWORD", "' . ((int) $_POST['user_password'] ? (int) $_POST['user_password'] : 6) . '");' . "\n";
if (!tools::saveConfig('core/conf/const.config.register.php', $data, CONF_ADMIN_FILE . '?m=config&s=register')) {
$arrErrors[] = ERROR_FILES_MISSING_FILE;
}
}
$group = new group();
$smarty->assign('arrGroups', $group->getAllGroups("token IN ('active')", array('id' => 'ASC'), array('id')));
$smarty->assignByRef('errors', $arrErrors);
示例3: isset
$offset = isset($_GET['offset']) && (int) $_GET['offset'] > 0 ? (int) $_GET['offset'] : 0;
//текущий обработанный URL
$path = CONF_ADMIN_FILE . '?m=users&s=manager&action=filter&id=' . $returnData['id'] . '&' . 'email=' . $returnData['email'] . '&alias=' . $returnData['alias'] . '&reg_ip=' . $returnData['reg_ip'] . '&' . 'user_type=' . $returnData['user_type'] . '&user_group=' . $returnData['user_group'] . '&token=' . $returnData['token'] . '&';
// получаем данные пользователя
$usersData = $user->getCombinedUsersData(false, $strWhere, array($order => $by), $offset . ',' . CONF_USERS_STRINGS_PERPAGE_ADMIN_PANEL);
$allRecords = $user->cntUsers();
// получаем общее количество записей
$smarty->assignByRef('users', $usersData);
$smarty->assignByRef('allRecords', $allRecords);
//передаем в шаблон строку сформированных страниц
$smarty->assign('strPages', strings::generatePage($allRecords, $offset, CONF_USERS_STRINGS_PERPAGE_ADMIN_PANEL, $path, true));
$smarty->assignByRef('return_data', $returnData);
}
$group = new group();
$smarty->assign('user_types', $group->arrTypes);
$smarty->assign('user_groups', $group->getAllGroups("token IN ('active')", false, array('id')));
$arrActions['filter'] = true;
}
} else {
// инициируем "Наименование страницы" отображаемое в форме
$arrNamePage[] = array('name' => MENU_MANAGER_USERS, 'link' => false);
/**
* удаление пользователей
*/
if (isset($_POST['action'])) {
if ('del' === $_POST['action'] && isset($_POST['users'])) {
$user->deleteUsers(array_keys($_POST['users']), true, true, true, true, true);
messages::messageChangeSaved(MESSAGE_CHANGE_SAVED, false, CONF_ADMIN_FILE . '?m=users&s=manager');
}
}
/**
示例4: template
global $router;
if (expTemplate::getModuleViewFile($loc->mod, '_grouppermissions', false) == TEMPLATE_FALLBACK_VIEW) {
$template = new template('common', '_grouppermissions', $loc);
} else {
$template = new template('common', '_grouppermissions', $loc);
//$template = new template($loc->mod,'_grouppermissions',$loc);
}
$template->assign('user_form', 0);
$users = array();
// users = groups
$modulename = expModules::controllerExists($loc->mod) ? expModules::getControllerClassName($loc->mod) : $loc->mod;
//$modclass = $loc->mod;
$modclass = $modulename;
$mod = new $modclass();
$perms = $mod->permissions($loc->int);
foreach (group::getAllGroups() as $g) {
foreach ($perms as $perm => $name) {
$var = 'perms_' . $perm;
if (expPermissions::checkGroup($g, $perm, $loc, true)) {
$g->{$perm} = 1;
} else {
if (expPermissions::checkGroup($g, $perm, $loc)) {
$g->{$perm} = 2;
} else {
$g->{$perm} = 0;
}
}
}
$users[] = $g;
}
$p[gt("Group")] = 'username';
示例5: manage_groupdiscounts
public function manage_groupdiscounts()
{
global $db;
expHistory::set('manageable', $this->params);
$groups = group::getAllGroups();
$discounts = $db->selectObjects('discounts');
$group_discounts = $db->selectObjects('groupdiscounts', null, 'rank');
assign_to_template(array('groups' => $groups, 'discounts' => $discounts, 'group_discounts' => $group_discounts));
}
示例6: form
static function form($object)
{
global $db;
//global $user;
$form = new form();
if (!isset($object->id)) {
$object->name = '';
$object->description = '';
$object->is_email = 0;
$object->is_saved = 1;
$object->response = gt('Your form has been submitted');
$object->resetbtn = gt('Reset');
$object->submitbtn = gt('Submit');
$object->subject = gt('Submitted form from site');
} else {
$form->meta('id', $object->id);
}
$form->register('name', gt('Name'), new textcontrol($object->name));
$form->register('description', gt('Description'), new texteditorcontrol($object->description));
$form->register('response', gt('Response'), new htmleditorcontrol($object->response));
$form->register(null, '', new htmlcontrol('<h3>' . gt('Button Settings') . '</h3><hr size="1" />'));
$form->register('submitbtn', gt('Submit Button Text'), new textcontrol($object->submitbtn));
$form->register('resetbtn', gt('Reset Button Text'), new textcontrol($object->resetbtn));
$form->register(null, '', new htmlcontrol('<h3>' . gt('Email Settings') . '</h3><hr size="1" />'));
$form->register('is_email', gt('Email Form'), new checkboxcontrol($object->is_email, false));
// Get User list
$userlist = array();
$defaults = array();
$users = user::getAllUsers();
foreach ($db->selectObjects('formbuilder_address', 'form_id=' . $object->id . ' and user_id != 0') as $address) {
$locuser = user::getUserById($address->user_id);
$defaults[$locuser->id] = $locuser->firstname . ' ' . $locuser->lastname . ' (' . $locuser->username . ')';
}
foreach ($users as $locuser) {
if (!array_key_exists($locuser->id, $defaults)) {
$userlist[$locuser->id] = $locuser->firstname . ' ' . $locuser->lastname . ' (' . $locuser->username . ')';
}
}
$form->register('users', gt('Users'), new listbuildercontrol($defaults, $userlist));
// Get Group list
$grouplist = array();
$defaults = array();
$groups = group::getAllGroups();
if ($groups != null) {
foreach ($db->selectObjects('formbuilder_address', 'form_id=' . $object->id . ' and group_id != 0') as $address) {
$group = group::getGroupById($address->group_id);
$defaults[$group->id] = $group->name;
}
foreach ($groups as $group) {
if (!array_key_exists($group->id, $defaults)) {
$grouplist[$group->id] = $group->name;
}
}
$form->register('groups', gt('Groups'), new listbuildercontrol($defaults, $grouplist));
}
// Get free-form address list
$defaults = array();
foreach ($db->selectObjects('formbuilder_address', 'form_id=' . $object->id . " and email != ''") as $address) {
$defaults[$address->email] = $address->email;
}
$form->register('addresses', gt('Other Addresses'), new listbuildercontrol($defaults, null));
$form->register('subject', gt('Email Subject'), new textcontrol($object->subject));
$form->register(null, '', new htmlcontrol('<h3>' . gt('Database Settings') . '</h3><hr size="1" /><br />'));
$form->register('is_saved', gt('Save Submissions to the Database'), new checkboxcontrol($object->is_saved, false));
$form->register(null, '', new htmlcontrol(' ' . gt('To help prevent data loss, you cannot remove a form\'s database table once it has been added.') . '<br />'));
if ($object->is_saved == 1) {
$form->controls['is_saved']->disabled = true;
$form->meta('is_saved', '1');
}
// $form->register(null,'', new htmlcontrol('<br /><br /><br />'));
$form->register('submit', '', new buttongroupcontrol(gt('Save'), '', gt('Cancel')));
return $form;
}
示例7: exit
if (!defined('EXPONENT')) {
exit('');
}
if (expPermissions::check('administrate', $loc)) {
//$groups = explode(';',$_POST['permdata']);
$locarray = array();
// if ($loc->mod == 'navigationmodule' && (isset($_POST['permdata'][1]['manage']) && $_POST['permdata'][1]['manage'] || isset($_POST['permdata'][1]['administrate']) && $_POST['permdata'][1]['administrate'])) {
// $sections = navigationmodule::levelTemplate($loc->int);
// $locarray[] = $loc;
// foreach ($sections as $section) {
// $locarray[] = expCore::makeLocation('navigationmodule', null, $section->id);
// }
// } else {
$locarray[] = $loc;
// }
$groups = group::getAllGroups();
foreach ($locarray as $location) {
foreach ($groups as $g) {
expPermissions::revokeAllGroup($g, $location);
}
}
foreach ($_POST['permdata'] as $k => $group_str) {
$perms = array_keys($group_str);
$g = group::getGroupById($k);
foreach ($locarray as $location) {
for ($i = 0; $i < count($perms); $i++) {
expPermissions::grantGroup($g, $perms[$i], $location);
}
}
}
expPermissions::triggerRefresh();
示例8: getGroupMemberships
public function getGroupMemberships()
{
global $db, $user;
// Don't have enough information to consult the membership tables. Return an empty array.
if (!$this->isLoggedIn()) {
return array();
}
// For administrators, we synthesize group memberships - they effectively belong to all groups.
if ($this->isAdmin()) {
return group::getAllGroups(true, true);
}
$groups = array();
// Holding array for the groups.
foreach ($db->selectObjects('groupmembership', 'member_id=' . $this->id) as $m) {
$groups[] = $db->selectObject('group', 'id=' . $m->group_id);
}
return $groups;
}