• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP user_get_accessible_subprojects函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中user_get_accessible_subprojects函数的典型用法代码示例。如果您正苦于以下问题:PHP user_get_accessible_subprojects函数的具体用法?PHP user_get_accessible_subprojects怎么用?PHP user_get_accessible_subprojects使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了user_get_accessible_subprojects函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: print_subproject_option_list

/**
 * List projects that the current user has access to
 * @param integer $p_parent_id         A parent project identifier.
 * @param integer $p_project_id        A project identifier.
 * @param integer $p_filter_project_id A filter project identifier.
 * @param boolean $p_trace             Whether to trace parent projects.
 * @param boolean $p_can_report_only   If true, disables projects in which user can't report issues; defaults to false (all projects enabled).
 * @param array   $p_parents           Array of parent projects.
 * @return void
 */
function print_subproject_option_list($p_parent_id, $p_project_id = null, $p_filter_project_id = null, $p_trace = false, $p_can_report_only = false, array $p_parents = array())
{
    if (config_get('subprojects_enabled') == OFF) {
        return;
    }
    array_push($p_parents, $p_parent_id);
    $t_user_id = auth_get_current_user_id();
    $t_project_ids = user_get_accessible_subprojects($t_user_id, $p_parent_id);
    $t_can_report = true;
    foreach ($t_project_ids as $t_id) {
        if ($p_can_report_only) {
            $t_report_bug_threshold = config_get('report_bug_threshold', null, $t_user_id, $t_id);
            $t_can_report = access_has_project_level($t_report_bug_threshold, $t_id, $t_user_id);
        }
        if ($p_trace) {
            $t_full_id = join($p_parents, ';') . ';' . $t_id;
        } else {
            $t_full_id = $t_id;
        }
        echo '<option value="' . $t_full_id . '"';
        check_selected($p_project_id, $t_full_id, false);
        check_disabled($t_id == $p_filter_project_id || !$t_can_report);
        echo '>' . str_repeat('&#160;', count($p_parents)) . str_repeat('&raquo;', count($p_parents)) . ' ' . string_attribute(project_get_field($t_id, 'name')) . '</option>' . "\n";
        print_subproject_option_list($t_id, $p_project_id, $p_filter_project_id, $p_trace, $p_can_report_only, $p_parents);
    }
}
开发者ID:gtn,项目名称:mantisbt,代码行数:36,代码来源:print_api.php


示例2: current_user_get_accessible_subprojects

/**
 * Returns an array of subprojects of the specified project to which the
 * currently logged in user has access to.
 *
 * @param project_id	Parent project id.
 * @param show_disabled	Include disabled projects.
 * @return an array of accessible sub-project ids.
 * @access public
 */
function current_user_get_accessible_subprojects($p_project_id, $p_show_disabled = false)
{
    return user_get_accessible_subprojects(auth_get_current_user_id(), $p_project_id, $p_show_disabled);
}
开发者ID:fur81,项目名称:zofaxiopeu,代码行数:13,代码来源:current_user_api.php


示例3: user_get_all_accessible_subprojects

/**
 * retun an array of sub-project IDs of all sub-projects project to which the user has access
 * @param integer $p_user_id    A valid user identifier.
 * @param integer $p_project_id A valid project identifier.
 * @return array
 */
function user_get_all_accessible_subprojects($p_user_id, $p_project_id)
{
    # @todo (thraxisp) Should all top level projects be a sub-project of ALL_PROJECTS implicitly?
    # affects how news and some summaries are generated
    $t_todo = user_get_accessible_subprojects($p_user_id, $p_project_id);
    $t_subprojects = array();
    while ($t_todo) {
        $t_elem = (int) array_shift($t_todo);
        if (!in_array($t_elem, $t_subprojects)) {
            array_push($t_subprojects, $t_elem);
            $t_todo = array_merge($t_todo, user_get_accessible_subprojects($p_user_id, $t_elem));
        }
    }
    return $t_subprojects;
}
开发者ID:pkdevboxy,项目名称:mantisbt,代码行数:21,代码来源:user_api.php


示例4: mci_user_get_accessible_subprojects

/**
 * Gets the sub-projects that are accessible to the specified user / project.
 * @param integer $p_user_id           User id.
 * @param integer $p_parent_project_id Parent Project id.
 * @param string  $p_lang              Language string.
 * @return array
 */
function mci_user_get_accessible_subprojects($p_user_id, $p_parent_project_id, $p_lang = null)
{
    if ($p_lang === null) {
        $t_lang = mci_get_user_lang($p_user_id);
    } else {
        $t_lang = $p_lang;
    }
    $t_result = array();
    foreach (user_get_accessible_subprojects($p_user_id, $p_parent_project_id) as $t_subproject_id) {
        $t_subproject_row = project_cache_row($t_subproject_id);
        $t_subproject = array();
        $t_subproject['id'] = $t_subproject_id;
        $t_subproject['name'] = $t_subproject_row['name'];
        $t_subproject['status'] = mci_enum_get_array_by_id($t_subproject_row['status'], 'project_status', $t_lang);
        $t_subproject['enabled'] = $t_subproject_row['enabled'];
        $t_subproject['view_state'] = mci_enum_get_array_by_id($t_subproject_row['view_state'], 'project_view_state', $t_lang);
        $t_subproject['access_min'] = mci_enum_get_array_by_id($t_subproject_row['access_min'], 'access_levels', $t_lang);
        $t_subproject['file_path'] = array_key_exists('file_path', $t_subproject_row) ? $t_subproject_row['file_path'] : '';
        $t_subproject['description'] = array_key_exists('description', $t_subproject_row) ? $t_subproject_row['description'] : '';
        $t_subproject['subprojects'] = mci_user_get_accessible_subprojects($p_user_id, $t_subproject_id, $t_lang);
        $t_result[] = $t_subproject;
    }
    return $t_result;
}
开发者ID:elmarculino,项目名称:mantisbt,代码行数:31,代码来源:mc_api.php



注:本文中的user_get_accessible_subprojects函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP user_get_all_accessible_subprojects函数代码示例发布时间:2022-05-23
下一篇:
PHP user_get_accessible_projects函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap