当前位置: 首页>>代码示例>>PHP>>正文


PHP current_user_get_accessible_projects函数代码示例

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


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

示例1: bug_group_action_init

/**
 * Initialise bug action group api
 * @param string $p_action Custom action to run.
 * @return void
 */
function bug_group_action_init($p_action)
{
    $t_valid_actions = bug_group_action_get_commands(current_user_get_accessible_projects());
    $t_action = strtoupper($p_action);
    if (!isset($t_valid_actions[$t_action]) && !isset($t_valid_actions['EXT_' . $t_action])) {
        trigger_error(ERROR_GENERIC, ERROR);
    }
    $t_include_file = config_get_global('absolute_path') . 'bug_actiongroup_' . $p_action . '_inc.php';
    if (!file_exists($t_include_file)) {
        trigger_error(ERROR_GENERIC, ERROR);
    } else {
        require_once $t_include_file;
    }
}
开发者ID:derrickweaver,项目名称:mantisbt,代码行数:19,代码来源:bug_group_action_api.php

示例2: print_project_option_list

/**
 * List projects that the current user has access to.
 *
 * @param integer $p_project_id 	The current project id or null to use cookie.
 * @param bool $p_include_all_projects  true: include "All Projects", otherwise false.
 * @param mixed $p_filter_project_id  The id of a project to exclude or null.
 * @param string $p_trace  The current project trace, identifies the sub-project via a path from top to bottom.
 * @return void
 */
function print_project_option_list($p_project_id = null, $p_include_all_projects = true, $p_filter_project_id = null, $p_trace = false)
{
    $t_project_ids = current_user_get_accessible_projects();
    project_cache_array_rows($t_project_ids);
    if ($p_include_all_projects) {
        echo '<option value="' . ALL_PROJECTS . '"';
        if ($p_project_id !== null) {
            check_selected((int) $p_project_id, ALL_PROJECTS);
        }
        echo '>' . lang_get('all_projects') . '</option>' . "\n";
    }
    $t_project_count = count($t_project_ids);
    for ($i = 0; $i < $t_project_count; $i++) {
        $t_id = $t_project_ids[$i];
        if ($t_id != $p_filter_project_id) {
            echo '<option value="' . $t_id . '"';
            if ($p_project_id !== null) {
                check_selected((int) $p_project_id, $t_id);
            }
            echo '>' . 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, array());
        }
    }
}
开发者ID:nextgens,项目名称:mantisbt,代码行数:33,代码来源:print_api.php

示例3: require_api

/**
 * MantisBT Core API's
 */
require_once 'core.php';
require_api('authentication_api.php');
require_api('constant_inc.php');
require_api('current_user_api.php');
require_api('gpc_api.php');
require_api('html_api.php');
require_api('lang_api.php');
require_api('print_api.php');
require_api('string_api.php');
auth_ensure_user_authenticated();
$f_ref = string_sanitize_url(gpc_get_string('ref', ''));
if (count(current_user_get_accessible_projects()) == 1) {
    $t_project_ids = current_user_get_accessible_projects();
    $t_project_id = (int) $t_project_ids[0];
    if (count(current_user_get_accessible_subprojects($t_project_id)) == 0) {
        $t_ref_urlencoded = string_url($f_ref);
        print_header_redirect("set_project.php?project_id={$t_project_id}&ref={$t_ref_urlencoded}", true);
        /* print_header_redirect terminates script execution */
    }
}
html_page_top(lang_get('select_project_button'));
?>

<!-- Project Select Form BEGIN -->
<div id="select-project-div" class="form-container">
	<form id="select-project-form" method="post" action="set_project.php">
		<?php 
# CSRF protection not required here - form does not result in modifications
开发者ID:Kirill,项目名称:mantisbt,代码行数:31,代码来源:login_select_proj_page.php

示例4: print_extended_project_browser

function print_extended_project_browser($p_trace = array(), $p_project_id = null)
{
    project_cache_all();
    $t_project_ids = current_user_get_accessible_projects();
    echo '<script type="text/javascript" language="JavaScript">' . "\n";
    echo "<!--\n";
    echo "var subprojects = new Object();\n";
    echo 'function unescapeHTML(html) {' . "\n";
    echo '	var htmlNode = document.createElement("DIV");' . "\n";
    echo '	htmlNode.innerHTML = html;' . "\n";
    echo '	if(htmlNode.innerText)' . "\n";
    echo '		return htmlNode.innerText; // IE' . "\n";
    echo '	return htmlNode.textContent; // FF' . "\n";
    echo '} ' . "\n";
    $t_projects = array();
    $t_project_count = count($t_project_ids);
    for ($i = 0; $i < $t_project_count; $i++) {
        $t_id = $t_project_ids[$i];
        echo 'subprojects[\'' . $t_id . '\'] = new Object();' . "\n";
        $t_name = project_get_field($t_id, 'name');
        $c_name = addslashes(str_replace(array("\r", "\n"), '', $t_name));
        echo 'subprojects[\'' . $t_id . '\'][\'' . $t_id . '\'] = \'' . $c_name . '\';' . "\n";
        $t_projects[$t_id] = $t_name;
        print_extended_project_browser_subproject_javascript($t_id);
    }
    echo "\n";
    echo 'function setProject(projectVal) {' . "\n";
    echo "\t" . 'var spInput = document.form_set_project.project_id;' . "\n";
    echo "\t" . 'spInput.options.length = 0' . "\n";
    echo "\t" . 'if (projectVal == "' . ALL_PROJECTS . '") {' . "\n";
    echo "\t\t" . 'spInput.options[0] = new Option(\'' . lang_get('all_projects') . '\', \'' . ALL_PROJECTS . '\');' . "\n";
    echo "\t" . '} else {' . "\n";
    echo "\t\t" . 'var i = 0;' . "\n";
    echo "\t\t" . 'var project = subprojects[ projectVal ];' . "\n";
    echo "\t\t" . 'for ( var sp in project ) {' . "\n";
    echo "\t\t\t" . 'spInput.options[ i++ ] = new Option( unescapeHTML(project[sp]), sp );' . "\n";
    echo "\t\t" . '}' . "\n";
    echo "\t" . '}' . "\n";
    echo '}' . "\n";
    echo '// --></script>' . "\n";
    echo '<select name="top_id" onChange="setProject(this.value); document.form_set_project.submit()" class="small">' . "\n";
    echo '<option value="' . ALL_PROJECTS . '"';
    echo check_selected($p_project_id, ALL_PROJECTS);
    echo '>' . lang_get('all_projects') . '</option>' . "\n";
    foreach ($t_projects as $t_id => $t_name) {
        $c_name = string_attribute($t_name);
        echo '<option value="' . $t_id . '"';
        echo check_selected($p_project_id, $t_id);
        echo '>' . $c_name . '</option>' . "\n";
    }
    echo '</select>' . "\n";
    if (0 === count($p_trace)) {
        $t_top_id = ALL_PROJECTS;
    } else {
        $t_top_id = $p_trace[0];
        $t_trace_str = join(';', $p_trace);
    }
    echo '<select name="project_id" onChange="document.form_set_project.submit()" class="small-subprojects"></select>' . "\n";
    echo '<script type="text/javascript" language="JavaScript">' . "\n";
    echo '<!--' . "\n";
    echo 'document.form_set_project.top_id.value = \'' . $t_top_id . '\';' . "\n";
    echo 'setProject(' . $t_top_id . ');' . "\n";
    echo 'document.form_set_project.project_id.value = \'' . $t_trace_str . '\';' . "\n";
    echo '// --></script>' . "\n";
}
开发者ID:Tarendai,项目名称:spring-website,代码行数:65,代码来源:print_api.php

示例5: edit_account_prefs

/**
 * Display html form to edit account preferences
 *
 * @param integer $p_user_id            A valid user identifier.
 * @param boolean $p_error_if_protected Whether to error if the account is protected.
 * @param boolean $p_accounts_menu      Display account preferences menu.
 * @param string  $p_redirect_url       Redirect URI.
 * @return void
 */
function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_accounts_menu = true, $p_redirect_url = '')
{
    if (null === $p_user_id) {
        $p_user_id = auth_get_current_user_id();
    }
    $t_redirect_url = $p_redirect_url;
    if (is_blank($t_redirect_url)) {
        $t_redirect_url = 'account_prefs_page.php';
    }
    # protected account check
    if (user_is_protected($p_user_id)) {
        if ($p_error_if_protected) {
            trigger_error(ERROR_PROTECTED_ACCOUNT, ERROR);
        } else {
            return;
        }
    }
    $t_pref = user_pref_get($p_user_id);
    # Account Preferences Form BEGIN
    ?>

<div id="account-prefs-update-div" class="form-container">
	<form id="account-prefs-update-form" method="post" action="account_prefs_update.php">
		<fieldset>
			<legend><span><?php 
    echo lang_get('default_account_preferences_title');
    ?>
</span></legend>
			<?php 
    echo form_security_field('account_prefs_update');
    ?>
			<input type="hidden" name="user_id" value="<?php 
    echo $p_user_id;
    ?>
" />
			<input type="hidden" name="redirect_url" value="<?php 
    echo $t_redirect_url;
    ?>
" />
		<?php 
    if ($p_accounts_menu) {
        print_account_menu('account_prefs_page.php');
    }
    ?>
			<div class="field-container">
				<label for="default-project-id"><span><?php 
    echo lang_get('default_project');
    ?>
</span></label>
				<span class="select">
					<select id="default-project-id" name="default_project">
<?php 
    # Count number of available projects
    $t_projects = current_user_get_accessible_projects();
    $t_num_proj = count($t_projects);
    if ($t_num_proj == 1) {
        $t_num_proj += count(current_user_get_accessible_subprojects($t_projects[0]));
    }
    # Don't display "All projects" in selection list if there is only 1
    print_project_option_list((int) $t_pref->default_project, $t_num_proj != 1);
    ?>
					</select>
				</span>
				<span class="label-style"></span>
			</div>
			<div class="field-container">
				<label for="refresh-delay"><span><?php 
    echo lang_get('refresh_delay');
    ?>
</span></label>
				<span class="input"><input id="refresh-delay" type="text" name="refresh_delay" size="4" maxlength="4" value="<?php 
    echo $t_pref->refresh_delay;
    ?>
" /> <?php 
    echo lang_get('minutes');
    ?>
</span>
				<span class="label-style"></span>
			</div>
			<div class="field-container">
				<label for="redirect-delay"><span><?php 
    echo lang_get('redirect_delay');
    ?>
</span></label>
				<span class="input"><input id="redirect-delay" type="text" name="redirect_delay" size="4" maxlength="3" value="<?php 
    echo $t_pref->redirect_delay;
    ?>
" /> <?php 
    echo lang_get('seconds');
    ?>
</span>
//.........这里部分代码省略.........
开发者ID:gtn,项目名称:mantisbt,代码行数:101,代码来源:account_prefs_inc.php

示例6: print_project_menu_bar

function print_project_menu_bar()
{
    $t_project_ids = current_user_get_accessible_projects();
    print '<table class="width100" cellspacing="0">';
    print '<tr>';
    print '<td class="menu">';
    print '<a href="set_project.php?project_id=' . ALL_PROJECTS . '">' . lang_get('all_projects') . '</a>';
    foreach ($t_project_ids as $t_id) {
        print " | <a href=\"set_project.php?project_id={$t_id}\">" . string_display(project_get_field($t_id, 'name')) . '</a>';
        print_subproject_menu_bar($t_id, $t_id . ';');
    }
    print '</td>';
    print '</tr>';
    print '</table>';
}
开发者ID:amjadtbssm,项目名称:website,代码行数:15,代码来源:html_api.php

示例7: lang_get

echo lang_get('versions');
?>
    	</td>
			<?php 
//echo $t_orcttab;
?>
		</tr>
<?php 
//PARAMS
$p_projects = null;
$p_level = 0;
$p_cache = null;
if (null == $p_projects) {
    $t_project_id = helper_get_current_project();
    if (ALL_PROJECTS == $t_project_id) {
        $p_projects = current_user_get_accessible_projects();
    } else {
        $p_projects = array($t_project_id);
    }
}
foreach ($p_projects as $t_project) {
    ?>
        <!-- PROJECTS -->
<?php 
    $t_project_name = str_repeat("&raquo; ", $p_level) . project_get_name($t_project);
    ?>
        <tr valign="top">
          <td class="category"><?php 
    echo $t_project_name;
    ?>
</td>
开发者ID:martijnveen,项目名称:GanttChart,代码行数:31,代码来源:summary_gantt_table_page.php

示例8: summary_print_by_project

/**
 * print bug counts by project
 * @todo check p_cache - static?
 *
 * @param array   $p_projects Array of project id's.
 * @param integer $p_level    Indicates the depth of the project within the sub-project hierarchy.
 * @param array   $p_cache    Summary cache.
 * @return void
 */
function summary_print_by_project(array $p_projects = array(), $p_level = 0, array $p_cache = null)
{
    $t_project_id = helper_get_current_project();
    if (empty($p_projects)) {
        if (ALL_PROJECTS == $t_project_id) {
            $p_projects = current_user_get_accessible_projects();
        } else {
            $p_projects = array($t_project_id);
        }
    }
    # Retrieve statistics one time to improve performance.
    if (null === $p_cache) {
        $t_query = 'SELECT project_id, status, COUNT( status ) AS bugcount
					FROM {bug}
					GROUP BY project_id, status';
        $t_result = db_query($t_query);
        $p_cache = array();
        $t_resolved_val = config_get('bug_resolved_status_threshold');
        $t_closed_val = config_get('bug_closed_status_threshold');
        while ($t_row = db_fetch_array($t_result)) {
            $t_project_id = $t_row['project_id'];
            $t_status = $t_row['status'];
            $t_bugcount = $t_row['bugcount'];
            if ($t_closed_val <= $t_status) {
                if (isset($p_cache[$t_project_id]['closed'])) {
                    $p_cache[$t_project_id]['closed'] += $t_bugcount;
                } else {
                    $p_cache[$t_project_id]['closed'] = $t_bugcount;
                }
            } else {
                if ($t_resolved_val <= $t_status) {
                    if (isset($p_cache[$t_project_id]['resolved'])) {
                        $p_cache[$t_project_id]['resolved'] += $t_bugcount;
                    } else {
                        $p_cache[$t_project_id]['resolved'] = $t_bugcount;
                    }
                } else {
                    if (isset($p_cache[$t_project_id]['open'])) {
                        $p_cache[$t_project_id]['open'] += $t_bugcount;
                    } else {
                        $p_cache[$t_project_id]['open'] = $t_bugcount;
                    }
                }
            }
        }
    }
    foreach ($p_projects as $t_project) {
        $t_name = str_repeat('&raquo; ', $p_level) . project_get_name($t_project);
        $t_pdata = isset($p_cache[$t_project]) ? $p_cache[$t_project] : array('open' => 0, 'resolved' => 0, 'closed' => 0);
        $t_bugs_open = isset($t_pdata['open']) ? $t_pdata['open'] : 0;
        $t_bugs_resolved = isset($t_pdata['resolved']) ? $t_pdata['resolved'] : 0;
        $t_bugs_closed = isset($t_pdata['closed']) ? $t_pdata['closed'] : 0;
        $t_bugs_total = $t_bugs_open + $t_bugs_resolved + $t_bugs_closed;
        summary_helper_print_row(string_display_line($t_name), $t_bugs_open, $t_bugs_resolved, $t_bugs_closed, $t_bugs_total);
        if (count(project_hierarchy_get_subprojects($t_project)) > 0) {
            $t_subprojects = current_user_get_accessible_subprojects($t_project);
            if (count($t_subprojects) > 0) {
                summary_print_by_project($t_subprojects, $p_level + 1, $p_cache);
            }
        }
    }
}
开发者ID:gtn,项目名称:mantisbt,代码行数:71,代码来源:summary_api.php

示例9: print_project_menu_bar

/**
 * Print the menu bar with a list of projects to which the user has access
 * @return null
 */
function print_project_menu_bar()
{
    $t_project_ids = current_user_get_accessible_projects();
    echo '<table class="width100" cellspacing="0">';
    echo '<tr>';
    echo '<td class="menu">';
    echo '<a href="' . helper_mantis_url('set_project.php?project_id=' . ALL_PROJECTS) . '">' . lang_get('all_projects') . '</a>';
    foreach ($t_project_ids as $t_id) {
        echo ' | <a href="' . helper_mantis_url('set_project.php?project_id=' . $t_id) . '">' . string_html_specialchars(project_get_field($t_id, 'name')) . '</a>';
        print_subproject_menu_bar($t_id, $t_id . ';');
    }
    echo '</td>';
    echo '</tr>';
    echo '</table>';
}
开发者ID:nextgens,项目名称:mantisbt,代码行数:19,代码来源:html_api.php

示例10: category_get_filter_list

/**
 *	Get a distinct array of categories accessible to the current user for
 *	the specified projects.  If no project is specified, use the current project.
 *	If the current project is ALL_PROJECTS get all categories for all accessible projects.
 *	For all cases, get global categories and subproject categories according to configured inheritance settings.
 *	@param mixed $p_project_id A specific project or null
 *	@return array A unique array of category names
 */
function category_get_filter_list( $p_project_id = null ) {
	if( null === $p_project_id ) {
		$t_project_id = helper_get_current_project();
	} else {
		$t_project_id = $p_project_id;
	}

	if( $t_project_id == ALL_PROJECTS ) {
		$t_project_ids = current_user_get_accessible_projects();
	} else {
		$t_project_ids = array( $t_project_id );
	}

	$t_subproject_ids = array();
	foreach( $t_project_ids as $t_project_id ) {
		$t_subproject_ids = array_merge( $t_subproject_ids, current_user_get_all_accessible_subprojects( $t_project_id ) );
	}

	$t_project_ids = array_merge( $t_project_ids, $t_subproject_ids );

	$t_categories = array();
	foreach( $t_project_ids AS $t_id ) {
		$t_categories = array_merge( $t_categories, category_get_all_rows( $t_id ) );
	}

	$t_unique = array();
	foreach( $t_categories AS $t_category ) {
		if( !in_array( $t_category['name'], $t_unique ) ) {
			$t_unique[] = $t_category['name'];
		}
	}

	return $t_unique;
}
开发者ID:rombert,项目名称:mantisbt,代码行数:42,代码来源:category_api.php

示例11: summary_print_by_project

function summary_print_by_project($p_projects = null, $p_level = 0, $p_cache = null)
{
    $t_mantis_bug_table = config_get('mantis_bug_table');
    $t_mantis_project_table = config_get('mantis_project_table');
    $t_project_id = helper_get_current_project();
    if (null == $p_projects) {
        if (ALL_PROJECTS == $t_project_id) {
            $p_projects = current_user_get_accessible_projects();
        } else {
            $p_projects = array($t_project_id);
        }
    }
    # Retrieve statistics one time to improve performance.
    if (null === $p_cache) {
        $query = "SELECT project_id, status, COUNT( status ) AS count\n\t\t\t\t\tFROM {$t_mantis_bug_table}\n\t\t\t\t\tGROUP BY project_id, status";
        $result = db_query($query);
        $p_cache = array();
        $t_resolved_val = RESOLVED;
        $t_closed_val = CLOSED;
        while ($row = db_fetch_array($result)) {
            extract($row, EXTR_PREFIX_ALL, 'v');
            if ($t_closed_val <= $v_status) {
                if (isset($p_cache[$v_project_id]['closed'])) {
                    $p_cache[$v_project_id]['closed'] += $v_count;
                } else {
                    $p_cache[$v_project_id]['closed'] = $v_count;
                }
            } else {
                if ($t_resolved_val <= $v_status) {
                    if (isset($p_cache[$v_project_id]['resolved'])) {
                        $p_cache[$v_project_id]['resolved'] += $v_count;
                    } else {
                        $p_cache[$v_project_id]['resolved'] = $v_count;
                    }
                } else {
                    if (isset($p_cache[$v_project_id]['open'])) {
                        $p_cache[$v_project_id]['open'] += $v_count;
                    } else {
                        $p_cache[$v_project_id]['open'] = $v_count;
                    }
                }
            }
        }
    }
    foreach ($p_projects as $t_project) {
        $t_name = str_repeat("» ", $p_level) . project_get_name($t_project);
        $t_pdata = isset($p_cache[$t_project]) ? $p_cache[$t_project] : array('open' => 0, 'resolved' => 0, 'closed' => 0);
        $t_bugs_open = isset($t_pdata['open']) ? $t_pdata['open'] : 0;
        $t_bugs_resolved = isset($t_pdata['resolved']) ? $t_pdata['resolved'] : 0;
        $t_bugs_closed = isset($t_pdata['closed']) ? $t_pdata['closed'] : 0;
        $t_bugs_total = $t_bugs_open + $t_bugs_resolved + $t_bugs_closed;
        summary_helper_print_row($t_name, $t_bugs_open, $t_bugs_resolved, $t_bugs_closed, $t_bugs_total);
        $t_subprojects = current_user_get_accessible_subprojects($t_project);
        if (count($t_subprojects) > 0) {
            summary_print_by_project($t_subprojects, $p_level + 1, $p_cache);
        }
    }
}
开发者ID:centaurustech,项目名称:BenFund,代码行数:58,代码来源:summary_api.php

示例12: edit_account_prefs

function edit_account_prefs($p_user_id = null, $p_error_if_protected = true, $p_accounts_menu = true, $p_redirect_url = '')
{
    if (null === $p_user_id) {
        $p_user_id = auth_get_current_user_id();
    }
    $t_redirect_url = $p_redirect_url;
    if (is_blank($t_redirect_url)) {
        $t_redirect_url = 'account_prefs_page.php';
    }
    # protected account check
    if (user_is_protected($p_user_id)) {
        if ($p_error_if_protected) {
            trigger_error(ERROR_PROTECTED_ACCOUNT, ERROR);
        } else {
            return;
        }
    }
    # prefix data with u_
    $t_pref = user_pref_get($p_user_id);
    # Account Preferences Form BEGIN
    ?>
<br />
<div align="center">
<form method="post" action="account_prefs_update.php">
<?php 
    echo form_security_field('account_prefs_update');
    ?>
<input type="hidden" name="user_id" value="<?php 
    echo $p_user_id;
    ?>
" />
<input type="hidden" name="redirect_url" value="<?php 
    echo $t_redirect_url;
    ?>
" />
<table class="width75" cellspacing="1">
<tr>
	<td class="form-title">
		<?php 
    echo lang_get('default_account_preferences_title');
    ?>
	</td>
	<td class="right">
		<?php 
    if ($p_accounts_menu) {
        print_account_menu('account_prefs_page.php');
    }
    ?>
	</td>
</tr>
<tr <?php 
    echo helper_alternate_class();
    ?>
>
	<td class="category" width="50%">
		<?php 
    echo lang_get('default_project');
    ?>
	</td>
	<td width="50%">
		<select name="default_project">
<?php 
    # Count number of available projects
    $t_projects = current_user_get_accessible_projects();
    $t_num_proj = count($t_projects);
    if ($t_num_proj == 1) {
        $t_num_proj += count(current_user_get_accessible_subprojects($t_projects[0]));
    }
    # Don't display "All projects" in selection list if there is only 1
    print_project_option_list($t_pref->default_project, $t_num_proj != 1);
    ?>
		</select>
	</td>
</tr>
<tr <?php 
    echo helper_alternate_class();
    ?>
>
	<td class="category">
		<?php 
    echo lang_get('refresh_delay');
    ?>
	</td>
	<td>
		<input type="text" name="refresh_delay" size="4" maxlength="4" value="<?php 
    echo $t_pref->refresh_delay;
    ?>
" /> <?php 
    echo lang_get('minutes');
    ?>
	</td>
</tr>
<tr <?php 
    echo helper_alternate_class();
    ?>
>
	<td class="category">
		<?php 
    echo lang_get('redirect_delay');
    ?>
//.........这里部分代码省略.........
开发者ID:Tarendai,项目名称:spring-website,代码行数:101,代码来源:account_prefs_inc.php

示例13: print_project_option_list

function print_project_option_list($p_project_id = null, $p_include_all_projects = true, $p_filter_project_id = null, $p_trace = false)
{
    project_cache_all();
    $t_project_ids = current_user_get_accessible_projects();
    if ($p_include_all_projects) {
        print '<option value="' . ALL_PROJECTS . '"';
        check_selected($p_project_id, ALL_PROJECTS);
        print '>' . lang_get('all_projects') . '</option>' . "\n";
    }
    $t_project_count = count($t_project_ids);
    for ($i = 0; $i < $t_project_count; $i++) {
        $t_id = $t_project_ids[$i];
        if ($t_id != $p_filter_project_id) {
            print "<option value=\"{$t_id}\"";
            check_selected($p_project_id, $t_id);
            print '>' . string_display(project_get_field($t_id, 'name')) . '</option>' . "\n";
            print_subproject_option_list($t_id, $p_project_id, $p_filter_project_id, $p_trace);
        }
    }
}
开发者ID:centaurustech,项目名称:BenFund,代码行数:20,代码来源:print_api.php


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