本文整理汇总了PHP中group_get_object函数的典型用法代码示例。如果您正苦于以下问题:PHP group_get_object函数的具体用法?PHP group_get_object怎么用?PHP group_get_object使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了group_get_object函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CallHook
function CallHook($hookname, $params)
{
global $use_cvssyncmailplugin, $G_SESSION, $HTML;
$group_id = $params['group'];
if ($hookname == "groupisactivecheckbox") {
$group =& group_get_object($group_id);
if ($group->usesPlugin('scmcvs')) {
//Check if the group is active
// this code creates the checkbox in the project edit public info page to activate/deactivate the plugin
echo "<tr>";
echo "<td>";
echo ' <input type="CHECKBOX" name="use_cvssyncmailplugin" value="1" ';
// CHECKED OR UNCHECKED?
if ($group->usesPlugin($this->name)) {
echo "CHECKED";
}
echo "><br/>";
echo "</td>";
echo "<td>";
echo "<strong>Use " . $this->text . " Plugin</strong>";
echo "</td>";
echo "</tr>";
}
} elseif ($hookname == "groupisactivecheckboxpost") {
// this code actually activates/deactivates the plugin after the form was submitted in the project edit public info page
$group =& group_get_object($group_id);
$use_cvssyncmailplugin = getStringFromRequest('use_cvssyncmailplugin');
if ($use_cvssyncmailplugin == 1) {
$group->setPluginUse($this->name);
} else {
$group->setPluginUse($this->name, false);
}
}
}
示例2: news_header
function news_header($params)
{
global $HTML, $group_id, $news_name, $news_id, $sys_news_group, $sys_use_news;
if (!$sys_use_news) {
exit_disabled();
}
$params['toptab'] = 'news';
$params['group'] = $group_id;
/*
Show horizontal links
*/
if ($group_id && $group_id != $sys_news_group) {
site_project_header($params);
} else {
$HTML->header($params);
}
if ($group_id && $group_id != $sys_news_group) {
$menu_texts = array();
$menu_links = array();
$menu_texts[] = _('Submit');
$menu_links[] = '/news/submit.php?group_id=' . $group_id;
if (session_loggedin()) {
$project =& group_get_object($params['group']);
if ($project && is_object($project) && !$project->isError()) {
$perm =& $project->getPermission(session_get_user());
if ($perm && is_object($perm) && !$perm->isError() && $perm->isAdmin()) {
$menu_texts[] = _('Admin');
$menu_links[] = '/news/admin/?group_id=' . $group_id;
}
}
}
echo $HTML->subMenu($menu_texts, $menu_links);
}
}
示例3: CallHook
function CallHook($hookname, &$params)
{
if ($hookname == "project_admin_plugins") {
// this displays the link in the project admin options page to it's task board administration
$group_id = $params['group_id'];
$group = group_get_object($group_id);
if ($group->usesPlugin($this->name)) {
echo '<p><a href="/plugins/taskboard/admin/index.php?group_id=' . $group->getID() . '">' . _("Task Board Admin") . '</a></p>';
}
} elseif ($hookname == "groupmenu") {
$group_id = $params['group'];
$group = group_get_object($group_id);
if (!$group || !is_object($group)) {
return;
}
if ($group->isError()) {
return;
}
if (!$group->isProject()) {
return;
}
if ($group->usesPlugin($this->name)) {
$params['TITLES'][] = _("Task Board");
$params['DIRS'][] = '/plugins/taskboard/index.php?group_id=' . $group->getID();
if ($params['toptab'] == $this->name) {
$params['selected'] = array_search($this->text, $params['TITLES']);
}
}
}
}
示例4: docman_header
function docman_header($title, $pagehead, $style = 'xyz')
{
global $group_id, $HTML, $sys_use_docman;
if (!$sys_use_docman) {
exit_disabled();
}
$project =& group_get_object($group_id);
if (!$project || !is_object($project)) {
exit_no_group();
}
if (!$project->usesDocman()) {
exit_error(_('Error'), _('This project has turned off the Doc Manager.'));
}
site_project_header(array('title' => $title, 'group' => $group_id, 'toptab' => 'docman'));
$menu_text = array();
$menu_links = array();
$menu_text[] = _('Submit new documentation');
$menu_links[] = '/docman/new.php?group_id=' . $group_id;
$menu_text[] = _('View Documentation');
$menu_links[] = '/docman/index.php?group_id=' . $group_id;
$menu_text[] = _('Search in documents');
$menu_links[] = '/docman/search.php?group_id=' . $group_id;
if (session_loggedin()) {
$perm =& $project->getPermission(session_get_user());
if ($perm && is_object($perm) && !$perm->isError() && $perm->isDocEditor()) {
$menu_text[] = _('Admin');
$menu_links[] = '/docman/admin/index.php?group_id=' . $group_id;
}
}
echo $HTML->subMenu($menu_text, $menu_links);
}
示例5: activate_group
function activate_group($group_id)
{
global $feedback;
$group =& group_get_object($group_id);
if (!$group || !is_object($group)) {
$feedback .= _('Error creating group object') . '<br />';
return false;
} else {
if ($group->isError()) {
$feedback .= $group->getErrorMessage() . '<br />';
return false;
}
}
$feedback .= sprintf(_('Approving Group: %1$s'), $group->getUnixName()) . '<br />';
if (!$group->approve(session_get_user())) {
$feedback .= $group->getErrorMessage() . '<br />';
return false;
}
$hook_params = array();
$hook_params['group_id'] = $group_id;
plugin_hook("group_approved", $hook_params);
//plugin webcalendar
//create webcal group
plugin_hook('add_cal_group', $group_id);
return true;
}
示例6: scm_header
/**
* GForge SCM Library
*
* Copyright 2004 (c) GForge LLC
*
* @version $Id$
* @author Tim Perdue tim@gforge.org
* @date 2005-04-16
*
* This file is part of GForge.
*
* GForge is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* GForge is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GForge; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
function scm_header($params)
{
global $HTML, $sys_use_scm;
if (!$sys_use_scm) {
exit_disabled();
}
$project =& group_get_object($params['group']);
if (!$project || !is_object($project)) {
exit_error('Error', 'Could Not Get Project');
} elseif ($project->isError()) {
exit_error('Error', $project->getErrorMessage());
}
if (!$project->usesSCM()) {
exit_error('Error', _('Error - This project has turned off SCM.'));
}
site_project_header(array('title' => _('SCM Repository'), 'group' => $params['group'], 'toptab' => 'scm'));
/*
Show horizontal links
*/
if (session_loggedin()) {
$perm =& $project->getPermission(session_get_user());
if ($perm && is_object($perm) && !$perm->isError() && $perm->isAdmin()) {
echo $HTML->subMenu(array(_('SCM'), _('Admin'), _('Reporting')), array('/scm/?group_id=' . $params['group'], '/scm/admin/?group_id=' . $params['group'], '/scm/reporting/?group_id=' . $params['group']));
}
}
echo '<div style="width:99%">';
}
示例7: survey_header
function survey_header($params)
{
global $group_id, $is_admin_page, $HTML, $sys_use_survey;
if (!$sys_use_survey) {
exit_disabled();
}
$params['toptab'] = 'surveys';
$params['group'] = $group_id;
if ($project =& group_get_object($group_id)) {
if (!$project->usesSurvey()) {
exit_error(_('Error'), _('This Group Has Turned Off Surveys.'));
}
site_project_header($params);
if ($is_admin_page && $group_id) {
echo $HTML->subMenu(array(_('Surveys'), _('Admin'), _('Add Survey'), _('Edit Survey'), _('Add Questions'), _('Edit Questions'), _('Show Results')), array('/survey/?group_id=' . $group_id, '/survey/admin/?group_id=' . $group_id, '/survey/admin/add_survey.php?group_id=' . $group_id, '/survey/admin/edit_survey.php?group_id=' . $group_id, '/survey/admin/add_question.php?group_id=' . $group_id, '/survey/admin/show_questions.php?group_id=' . $group_id, '/survey/admin/show_results.php?group_id=' . $group_id));
} else {
if (session_loggedin()) {
$perm =& $project->getPermission(session_get_user());
if ($perm && is_object($perm) && !$perm->isError() && $perm->isAdmin()) {
echo $HTML->subMenu(array(_('Admin')), array('/survey/admin/?group_id=' . $group_id));
}
}
}
}
// end if (valid group id)
}
示例8: project_rdf_metadata
/**
* Declares itself as accepting RDF XML on /projects/...
* @param unknown_type $params
*/
function project_rdf_metadata(&$params)
{
# TODO : create another resource
$group_id = $params['group'];
$new_prefixes = array('admssw' => 'http://purl.org/adms/sw/', 'rad' => 'http://www.w3.org/ns/radion#', 'schema' => 'http://schema.org/');
foreach ($new_prefixes as $s => $u) {
if (!isset($params['prefixes'][$u])) {
$params['prefixes'][$u] = $s;
}
}
$res = $params['in_Resource'];
// we could save the type doap:Project in such case, as there's an equivalence, but not sure all consumers do reasoning
$types = array('doap:Project', 'admssw:SoftwareProject');
rdfutils_setPropToUri($res, 'rdf:type', $types);
$tags_list = NULL;
if (forge_get_config('use_project_tags')) {
$group = group_get_object($group_id);
$tags_list = $group->getTags();
}
// connect to FusionForge internals
$pm = ProjectManager::instance();
$project = $pm->getProject($group_id);
$tags = array();
if ($tags_list) {
$tags = split(', ', $tags_list);
// reuse the same as dcterms:subject until further specialization of adms.sw keywords
$res->setProp('rad:keyword', $tags);
}
$project_description = $project->getDescription();
if ($project_description) {
// it seems that doap:description is not equivalent to dcterms:description, so repeat
$res->setProp('dcterms:description', $project_description);
}
$res->setProp('rdfs:comment', "Generated with the doaprdf and admssw plugins of fusionforge");
rdfutils_setPropToUri($res, 'dcterms:isPartOf', util_make_url("/projects"));
$admins = $project->getAdmins();
$members = $project->getUsers();
$contributors_uris = array();
foreach ($admins as $u) {
$contributor_uri = util_make_url_u($u->getUnixName(), $u->getID());
$contributor_uri = rtrim($contributor_uri, '/');
$contributor_uri = $contributor_uri . '#person';
if (!in_array($contributor_uri, $contributors_uris)) {
$contributors_uris[] = $contributor_uri;
}
}
foreach ($members as $u) {
$contributor_uri = util_make_url_u($u->getUnixName(), $u->getID());
$contributor_uri = rtrim($contributor_uri, '/');
$contributor_uri = $contributor_uri . '#person';
if (!in_array($contributor_uri, $contributors_uris)) {
$contributors_uris[] = $contributor_uri;
}
}
rdfutils_setPropToUri($res, 'schema:contributor', $contributors_uris);
$params['out_Resources'][] = $res;
}
示例9: db_query_params
/**
* Initialize a task board
*/
function &taskboard_init($group_id)
{
$res = db_query_params('INSERT INTO plugin_taskboard(group_id) VALUES($1)', array($group_id));
if (!$res) {
return false;
}
$Group = group_get_object($data["group_id"]);
$Taskboard = new TaskBoard($Group, $data);
return $Taskboard;
}
示例10: isGroupMember
/**
* isGroupMember - returns if the logged in user is member of the current group
*
* @param int $groupId group id
*/
function isGroupMember($groupId)
{
$Group =& group_get_object($groupId);
if ($Group && is_object($Group) && !$Group->isError() && session_loggedin()) {
$perm =& $Group->getPermission(session_get_user());
if ($perm && is_object($perm) && $perm->isMember()) {
return true;
}
}
return false;
}
示例11: isAvailable
function isAvailable($parameters)
{
if (isset($parameters[SEARCH__PARAMETER_GROUP_ID]) && $parameters[SEARCH__PARAMETER_GROUP_ID]) {
$Group =& group_get_object($parameters[SEARCH__PARAMETER_GROUP_ID]);
if ($Group && is_object($Group) && !$Group->isError()) {
$this->Group =& $Group;
return true;
}
}
return false;
}
示例12: pm_header
function pm_header($params)
{
// XXX ogi: What to do with these?
global $group_id, $is_pm_page, $words, $group_project_id, $HTML, $order, $pg, $sys_use_pm;
if (!$sys_use_pm) {
exit_disabled();
}
//required by site_project_header
$params['group'] = $group_id;
$params['toptab'] = 'pm';
//only projects can use the bug tracker, and only if they have it turned on
$project =& group_get_object($group_id);
if (!$project || !is_object($project)) {
exit_no_group();
}
if (!$project->usesPm()) {
exit_error(_('Error'), _('This Project Has Turned Off The Task Manager'));
}
site_project_header($params);
$labels = array();
$links = array();
if ($group_project_id) {
$labels[] = ($pg ? $pg->getName() . ': ' : '') . _('Browse tasks');
$links[] = '/pm/task.php?group_id=' . $group_id . '&group_project_id=' . $group_project_id . '&func=browse';
if (session_loggedin()) {
$labels[] = _('Add task');
$links[] = '/pm/task.php?group_id=' . $group_id . '&group_project_id=' . $group_project_id . '&func=addtask';
}
if ($group_project_id) {
$gantt_width = 820;
$gantt_height = 680;
$gantt_url = "/pm/task.php?group_id={$group_id}&group_project_id={$group_project_id}&func=ganttpage";
$gantt_title = _('Gantt Chart');
$gantt_winopt = 'scrollbars=yes,resizable=yes,toolbar=no,height=' . $gantt_height . ',width=' . $gantt_width;
$labels[] = $gantt_title;
$links[] = $gantt_url . '" onclick="window.open(this.href, \'' . preg_replace('/\\s/', '_', $gantt_title) . '\', \'' . $gantt_winopt . '\'); return false;';
}
//upload/download as CSV files
$labels[] = _('Download as CSV');
$links[] = '/pm/task.php?group_id=' . $group_id . '&group_project_id=' . $group_project_id . '&func=downloadcsv';
$labels[] = _('Upload CSV');
$links[] = '/pm/task.php?group_id=' . $group_id . '&group_project_id=' . $group_project_id . '&func=uploadcsv';
}
if ($pg && is_object($pg) && $pg->userIsAdmin()) {
$labels[] = _('Reporting');
$links[] = '/pm/reporting/?group_id=' . $group_id;
$labels[] = _('Admin');
$links[] = '/pm/admin/?group_id=' . $group_id . '&group_project_id=' . $group_project_id . '&update_pg=1';
}
if (!empty($labels)) {
echo $HTML->subMenu($labels, $links);
}
}
示例13: Security_nforge
function Security_nforge(&$DB)
{
$this->DB = $DB;
$u = session_get_user();
$group =& group_get_object($DB->group_id);
$perm =& $group->getPermission($u);
// check if the user is docman's admin
if ($perm and !$perm->isError()) {
if ($perm->isDocEditor() || $perm->isAdmin()) {
$DB->wikimasters = array($u->getUnixName());
}
}
}
示例14: getRows
/**
* getRows - get the html output for result rows
*
* @return string html output
*/
function getRows()
{
$rowsCount = $this->searchQuery->getRowsCount();
$result =& $this->searchQuery->getResult();
$dateFormat = _('Y-m-d H:i');
$group = group_get_object($this->groupId);
$group_name = $group->getUnixName();
$data = unserialize(db_result($result, 0, 'versiondata'));
$return = '';
for ($i = 0; $i < $rowsCount; $i++) {
$return .= '<tr ' . $GLOBALS['HTML']->boxGetAltRowStyle($i) . '>' . '<td>';
$return .= util_make_link('/wiki/g/' . $group_name . '/' . db_result($result, $i, 'pagename'), html_image('ic/msg.png', '10', '12', array('border' => '0')) . ' ' . db_result($result, $i, 'pagename'));
$return .= '</td>
<td width="15%">' . $data['author'] . '</td>
<td width="15%">' . date($dateFormat, db_result($result, $i, 'mtime')) . '</td></tr>';
}
return $return;
}
示例15: db_query
/**
* Fetches a ProjectGroup object from the database
*
* @param group_project_id the projectgroup id
* @param data whether or not the db result handle is passed in
* @return the ProjectGroup object
*/
function &projectgroup_get_object($group_project_id, $data = false)
{
global $PROJECTGROUP_OBJ;
if (!isset($PROJECTGROUP_OBJ["_" . $group_project_id . "_"])) {
if ($data) {
//the db result handle was passed in
} else {
$res = db_query("SELECT * FROM project_group_list_vw\n\t\t\t\tWHERE group_project_id='{$group_project_id}'");
if (db_numrows($res) < 1) {
$PROJECTGROUP_OBJ["_" . $group_project_id . "_"] = false;
return false;
}
$data =& db_fetch_array($res);
}
$Group =& group_get_object($data["group_id"]);
$PROJECTGROUP_OBJ["_" . $group_project_id . "_"] = new ProjectGroup($Group, $group_project_id, $data);
}
return $PROJECTGROUP_OBJ["_" . $group_project_id . "_"];
}