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

PHP explode_enum_string函数代码示例

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

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



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

示例1: get_enum_to_string

function get_enum_to_string($p_enum_string, $p_num)
{
    $t_arr = explode_enum_string($p_enum_string);
    $enum_count = count($t_arr);
    for ($i = 0; $i < $enum_count; $i++) {
        $t_s = explode_enum_arr($t_arr[$i]);
        if ($t_s[0] == $p_num) {
            return $t_s[1];
        }
    }
    return '@' . $p_num . '@';
}
开发者ID:renemilk,项目名称:spring-website,代码行数:12,代码来源:utility_api.php


示例2: get_enum_element

function get_enum_element($p_enum_name, $p_val)
{
    $config_var = config_get($p_enum_name . '_enum_string');
    $string_var = lang_get($p_enum_name . '_enum_string');
    # use the global enum string to search
    $t_arr = explode_enum_string($config_var);
    $t_arr_count = count($t_arr);
    for ($i = 0; $i < $t_arr_count; $i++) {
        $elem_arr = explode_enum_arr($t_arr[$i]);
        if ($elem_arr[0] == $p_val) {
            # now get the appropriate translation
            return get_enum_to_string($string_var, $p_val);
        }
    }
    return '@' . $p_val . '@';
}
开发者ID:centaurustech,项目名称:BenFund,代码行数:16,代码来源:helper_api.php


示例3: get_capability_row

function get_capability_row($p_caption, $p_access_level)
{
    $t_access_levels = explode_enum_string(config_get('access_levels_enum_string'));
    $t_output = '<tr ' . helper_alternate_class() . '><td>' . string_display($p_caption) . '</td>';
    foreach ($t_access_levels as $t_access_level) {
        $t_entry_array = explode_enum_arr($t_access_level);
        if ((int) $t_entry_array[0] >= (int) $p_access_level) {
            $t_value = '<img src="images/ok.gif" width="20" height="15" alt="X" title="X" />';
        } else {
            $t_value = '&nbsp;';
        }
        $t_output .= '<td class="center">' . $t_value . '</td>';
    }
    $t_output .= '</tr>' . "\n";
    return $t_output;
}
开发者ID:amjadtbssm,项目名称:website,代码行数:16,代码来源:adm_permissions_report.php


示例4: get_string_to_enum

function get_string_to_enum($enum_string, $string)
{
    /**
     * 	Gets Mantis's integer for the given string
     *
     * 	This is the inverse of Mantis's get_enum_to_string().  If the string is
     * 	not found in the enum string, we return -1.
     */
    if (preg_match('/^@.*@$/', $string)) {
        return substr($string, 1, -1);
    }
    $enum_array = explode_enum_string($enum_string);
    foreach ($enum_array as $pair) {
        $t_s = explode_enum_arr($pair);
        if ($t_s[1] == $string) {
            return $t_s[0];
        }
    }
    return -1;
}
开发者ID:NetWielder,项目名称:mantis-rest,代码行数:20,代码来源:misc_functions.php


示例5: lang_get

</tr>

<tr valign="top">
	<td colspan="2">
		<?php 
# DEVELOPER / RESOLUTION #
?>
		<table class="width100" cellspacing="1">
		<tr>
			<td class="form-title" colspan="1">
				<?php 
echo lang_get('developer_by_resolution');
?>
			</td>
			<?php 
$t_arr = explode_enum_string(config_get('resolution_enum_string'));
$enum_count = count($t_arr);
for ($i = 0; $i < $enum_count; $i++) {
    print '<td>';
    $t_s = explode_enum_arr($t_arr[$i]);
    $c_s[0] = db_prepare_string($t_s[0]);
    echo get_enum_element('resolution', $c_s[0]);
    print '</td>';
}
print '<td>';
print lang_get('percentage_fixed');
print '</td>';
?>
		</tr>
		<?php 
summary_print_developer_resolution(config_get('resolution_enum_string'));
开发者ID:jin255ff,项目名称:company_website,代码行数:31,代码来源:summary_page.php


示例6: get_capability_row_for_email

function get_capability_row_for_email($p_caption, $p_message_type)
{
    $t_access_levels = explode_enum_string(config_get('access_levels_enum_string'));
    echo '<tr ' . helper_alternate_class() . '><td>' . string_display($p_caption) . '</td>';
    echo '<td class="center"' . colour_notify_flag($p_message_type, 'reporter') . '>' . show_notify_flag($p_message_type, 'reporter') . '</td>';
    echo '<td class="center"' . colour_notify_flag($p_message_type, 'handler') . '>' . show_notify_flag($p_message_type, 'handler') . '</td>';
    echo '<td class="center"' . colour_notify_flag($p_message_type, 'monitor') . '>' . show_notify_flag($p_message_type, 'monitor') . '</td>';
    echo '<td class="center"' . colour_notify_flag($p_message_type, 'bugnotes') . '>' . show_notify_flag($p_message_type, 'bugnotes') . '</td>';
    foreach ($t_access_levels as $t_access_level) {
        $t_entry_array = explode_enum_arr($t_access_level);
        echo '<td class="center"' . colour_threshold_flag((int) $t_entry_array[0], $p_message_type) . '>' . show_notify_threshold((int) $t_entry_array[0], $p_message_type) . '</td>';
    }
    echo '</tr>' . "\n";
}
开发者ID:centaurustech,项目名称:BenFund,代码行数:14,代码来源:manage_config_email_page.php


示例7: config_set

            }
        }
        if ('' != $t_workflow_row) {
            $t_workflow[$t_state] = $t_workflow_row;
        }
    }
    if ($t_workflow != config_get('status_enum_workflow')) {
        config_set('status_enum_workflow', $t_workflow, NO_USER, $t_project, $f_access);
    }
}
# process the access level changes
if (config_get_access('status_enum_workflow') <= $t_access) {
    # get changes to access level to change these values
    $f_access = gpc_get('status_access');
    # walk through the status labels to set the status threshold
    $t_enum_status = explode_enum_string(config_get('status_enum_string'));
    $t_set_status = array();
    foreach ($t_statuses as $t_status_id => $t_status_label) {
        $f_level = gpc_get('access_change_' . $t_status_id);
        if (NEW_ == $t_status_id) {
            if ((int) $f_level != config_get('report_bug_threshold')) {
                config_set('report_bug_threshold', (int) $f_level, ALL_USERS, $t_project, $f_access);
            }
        } else {
            $t_set_status[$t_status_id] = (int) $f_level;
        }
    }
    if ($t_set_status != config_get('set_status_threshold')) {
        config_set('set_status_threshold', $t_set_status, ALL_USERS, $t_project, $f_access);
    }
}
开发者ID:jin255ff,项目名称:company_website,代码行数:31,代码来源:manage_config_workflow_set.php


示例8: file_type_check

function file_type_check($p_file_name)
{
    global $g_allowed_files, $g_disallowed_files;
    # grab extension
    $t_ext_array = explode(".", $p_file_name);
    $last_position = count($t_ext_array) - 1;
    $t_extension = $t_ext_array[$last_position];
    # check against disallowed files
    $t_disallowed_arr = explode_enum_string($g_disallowed_files);
    foreach ($t_disallowed_arr as $t_val) {
        if ($t_val == $t_extension) {
            return false;
        }
    }
    # check against allowed files
    $t_allowed_arr = explode_enum_string($g_allowed_files);
    # if the allowed list is populated then the file must be in the list.
    if (empty($g_allowed_files)) {
        return true;
    }
    foreach ($t_allowed_arr as $t_val) {
        if ($t_val == $t_extension) {
            return true;
        }
    }
    return false;
}
开发者ID:jgatica,项目名称:Netoffice,代码行数:27,代码来源:core_helper_API.php


示例9: print_project_user_option_list

function print_project_user_option_list($p_val)
{
    global $g_mantis_project_table, $g_access_levels_enum_string;
    $t_arr = explode_enum_string($g_access_levels_enum_string);
    $enum_count = count($t_arr);
    for ($i = 0; $i < $enum_count; $i++) {
        $t_elem = explode_enum_arr($t_arr[$i]);
        if ($t_elem[0] >= ADMINISTRATOR) {
            continue;
        }
        $t_access_level = get_enum_element("access_levels", $t_elem[0]);
        if ($p_val == $t_elem[0]) {
            print "<option value=\"{$t_elem['0']}\" SELECTED>{$t_access_level}</option>";
        } else {
            print "<option value=\"{$t_elem['0']}\">{$t_access_level}</option>";
        }
    }
    # end for
}
开发者ID:ColBT,项目名称:php_tut,代码行数:19,代码来源:core_print_API.php


示例10: lang_get

            echo lang_get($t_field_name_arr[$i]);
            ?>
</td>
<?php 
        }
        //if isset
    }
    //for
}
//if
?>
</tr>

<?php 
$field_name_count = $field_name_count;
$f_bug_arr = explode_enum_string($f_export);
# @@debug var_dump($t_field_name_arr);
for ($i = 0; $i < $row_count; $i++) {
    # prefix bug data with v_
    extract($result[$i], EXTR_PREFIX_ALL, 'v');
    if (in_array($v_id, $f_bug_arr) || $f_show_flag == 0) {
        $t_last_updated = date($g_short_date_format, $v_last_updated);
        # grab the bugnote count
        $bugnote_count = bug_get_bugnote_count($v_id);
        # grab the project name
        $project_name = project_get_field($v_project_id, 'name');
        $t_bug_text_table = config_get('mantis_bug_text_table');
        $query4 = "SELECT *\r\n                FROM {$t_bug_text_table}\r\n                WHERE id='{$v_bug_text_id}'";
        $result4 = db_query($query4);
        $row = db_fetch_array($result4);
        extract($row, EXTR_PREFIX_ALL, 'v2');
开发者ID:amjadtbssm,项目名称:website,代码行数:31,代码来源:print_all_bug_page_excel.php


示例11: summary_print_reporter_effectiveness

function summary_print_reporter_effectiveness($p_severity_enum_string, $p_resolution_enum_string)
{
    $t_mantis_bug_table = config_get('mantis_bug_table');
    $t_mantis_user_table = config_get('mantis_user_table');
    $t_reporter_summary_limit = config_get('reporter_summary_limit');
    $t_project_id = helper_get_current_project();
    $t_user_id = auth_get_current_user_id();
    # These are our overall "values" for severities and non-bug results
    $t_severity_multiplier[FEATURE] = 1;
    $t_severity_multiplier[TRIVIAL] = 2;
    $t_severity_multiplier[TEXT] = 3;
    $t_severity_multiplier[TWEAK] = 2;
    $t_severity_multiplier[MINOR] = 5;
    $t_severity_multiplier[MAJOR] = 8;
    $t_severity_multiplier[CRASH] = 8;
    $t_severity_multiplier[BLOCK] = 10;
    $t_severity_multiplier['average'] = 5;
    $t_notbug_multiplier[UNABLE_TO_DUPLICATE] = 2;
    $t_notbug_multiplier[DUPLICATE] = 3;
    $t_notbug_multiplier[NOT_A_BUG] = 5;
    $t_sev_arr = explode_enum_string($p_severity_enum_string);
    $enum_sev_count = count($t_sev_arr);
    $c_sev_s = array();
    for ($i = 0; $i < $enum_sev_count; $i++) {
        $t_sev_s = explode_enum_arr($t_sev_arr[$i]);
        $c_sev_s[$i] = db_prepare_string($t_sev_s[0]);
    }
    $t_res_arr = explode_enum_string($p_resolution_enum_string);
    $enum_res_count = count($t_res_arr);
    $c_res_s = array();
    for ($i = 0; $i < $enum_res_count; $i++) {
        $t_res_s = explode_enum_arr($t_res_arr[$i]);
        $c_res_s[$i] = db_prepare_string($t_res_s[0]);
    }
    # Checking if it's a per project statistic or all projects
    $specific_where = helper_project_specific_where($t_project_id);
    if (' 1<>1' == $specific_where) {
        return;
    }
    # Get all of the bugs and split them up into an array
    $query = "SELECT COUNT(id) as count, reporter_id, resolution, severity\n\t\t\t\tFROM {$t_mantis_bug_table}\n\t\t\t\tWHERE {$specific_where}\n\t\t\t\tGROUP BY reporter_id, resolution, severity";
    $result = db_query($query);
    $t_reporter_ressev_arr = array();
    $t_reporter_bugcount_arr = array();
    $t_arr = db_fetch_array($result);
    while ($t_arr) {
        if (!isset($t_reporter_ressev_arr[$t_arr['reporter_id']])) {
            $t_reporter_ressev_arr[$t_arr['reporter_id']] = array();
            $t_reporter_bugcount_arr[$t_arr['reporter_id']] = 0;
        }
        if (!isset($t_reporter_ressev_arr[$t_arr['reporter_id']][$t_arr['severity']])) {
            $t_reporter_ressev_arr[$t_arr['reporter_id']][$t_arr['severity']] = array();
            $t_reporter_ressev_arr[$t_arr['reporter_id']][$t_arr['severity']]['total'] = 0;
        }
        if (!isset($t_reporter_ressev_arr[$t_arr['reporter_id']][$t_arr['severity']][$t_arr['resolution']])) {
            $t_reporter_ressev_arr[$t_arr['reporter_id']][$t_arr['severity']][$t_arr['resolution']] = 0;
        }
        $t_reporter_ressev_arr[$t_arr['reporter_id']][$t_arr['severity']][$t_arr['resolution']] += $t_arr['count'];
        $t_reporter_ressev_arr[$t_arr['reporter_id']][$t_arr['severity']]['total'] += $t_arr['count'];
        $t_reporter_bugcount_arr[$t_arr['reporter_id']] += $t_arr['count'];
        $t_arr = db_fetch_array($result);
    }
    # Sort our total bug count array so that the reporters with the highest number of bugs are listed first,
    arsort($t_reporter_bugcount_arr);
    $t_row_count = 0;
    # We now have a multi dimensional array of users, resolutions and severities, with the
    # value of each resolution and severity for each user
    foreach ($t_reporter_bugcount_arr as $t_reporter_id => $t_total_user_bugs) {
        # Limit the number of reporters listed
        if ($t_row_count > $t_reporter_summary_limit) {
            break;
        }
        # Only print reporters who have reported at least one bug. This helps
        # prevent divide by zeroes, showing reporters not on this project, and showing
        # users that aren't actually reporters...
        if ($t_total_user_bugs > 0) {
            $t_arr2 = $t_reporter_ressev_arr[$t_reporter_id];
            print '<tr ' . helper_alternate_class($t_row_count) . '>';
            $t_row_count++;
            print '<td>';
            print user_get_name($t_reporter_id);
            print '</td>';
            $t_total_severity = 0;
            $t_total_errors = 0;
            for ($j = 0; $j < $enum_sev_count; $j++) {
                if (!isset($t_arr2[$c_sev_s[$j]])) {
                    continue;
                }
                $sev_bug_count = $t_arr2[$c_sev_s[$j]]['total'];
                $t_sev_mult = $t_severity_multiplier['average'];
                if ($t_severity_multiplier[$c_sev_s[$j]]) {
                    $t_sev_mult = $t_severity_multiplier[$c_sev_s[$j]];
                }
                if ($sev_bug_count > 0) {
                    $t_total_severity += $sev_bug_count * $t_sev_mult;
                }
                # Calculate the "error value" of bugs reported
                $t_notbug_res_arr = array(UNABLE_TO_DUPLICATE, DUPLICATE, NOT_A_BUG);
                foreach ($t_notbug_res_arr as $t_notbug_res) {
                    if (isset($t_arr2[$c_sev_s[$j]][$t_notbug_res])) {
//.........这里部分代码省略.........
开发者ID:centaurustech,项目名称:BenFund,代码行数:101,代码来源:summary_api.php


示例12: bug_check_workflow

function bug_check_workflow($p_bug_status, $p_wanted_status)
{
    $t_status_enum_workflow = config_get('status_enum_workflow');
    if (count($t_status_enum_workflow) < 1) {
        # workflow not defined, use default enum
        return true;
    } else {
        if ($p_bug_status == $p_wanted_status) {
            # no change in state, allow the transition
            return true;
        } else {
            # workflow defined - find allowed states
            $t_allowed_states = $t_status_enum_workflow[$p_bug_status];
            $t_arr = explode_enum_string($t_allowed_states);
            $t_enum_count = count($t_arr);
            for ($i = 0; $i < $t_enum_count; $i++) {
                # check if wanted status is allowed
                $t_elem = explode_enum_arr($t_arr[$i]);
                if ($p_wanted_status == $t_elem[0]) {
                    return true;
                }
            }
            # end for
        }
    }
    return false;
}
开发者ID:jin255ff,项目名称:company_website,代码行数:27,代码来源:bug_api.php


示例13: print_project_access_levels_option_list

function print_project_access_levels_option_list($p_val, $p_project_id = null)
{
    $t_current_user_access_level = access_get_project_level($p_project_id);
    $t_access_levels_enum_string = config_get('access_levels_enum_string');
    # Add [default access level] to add the user to a project
    # with his default access level.
    print "<option value=\"" . DEFAULT_ACCESS_LEVEL . "\"";
    print ">[" . lang_get('default_access_level') . "]</option>";
    $t_arr = explode_enum_string($t_access_levels_enum_string);
    $enum_count = count($t_arr);
    for ($i = 0; $i < $enum_count; $i++) {
        $t_elem = explode_enum_arr($t_arr[$i]);
        # a user must not be able to assign another user an access level that is higher than theirs.
        if ($t_elem[0] > $t_current_user_access_level) {
            continue;
        }
        $t_access_level = get_enum_element('access_levels', $t_elem[0]);
        print "<option value=\"{$t_elem['0']}\"";
        check_selected($p_val, $t_elem[0]);
        print ">{$t_access_level}</option>";
    }
    # end for
}
开发者ID:jin255ff,项目名称:company_website,代码行数:23,代码来源:print_api.php


示例14: file_type_check

function file_type_check($p_file_name)
{
    $t_allowed_files = config_get('allowed_files');
    $t_disallowed_files = config_get('disallowed_files');
    # grab extension
    $t_ext_array = explode('.', $p_file_name);
    $last_position = count($t_ext_array) - 1;
    $t_extension = $t_ext_array[$last_position];
    # check against disallowed files
    $t_disallowed_arr = explode_enum_string($t_disallowed_files);
    foreach ($t_disallowed_arr as $t_val) {
        if (0 == strcasecmp($t_val, $t_extension)) {
            return false;
        }
    }
    # if the allowed list is note populated then the file must be allowed
    if (is_blank($t_allowed_files)) {
        return true;
    }
    # check against allowed files
    $t_allowed_arr = explode_enum_string($t_allowed_files);
    foreach ($t_allowed_arr as $t_val) {
        if (0 == strcasecmp($t_val, $t_extension)) {
            return true;
        }
    }
    return false;
}
开发者ID:centaurustech,项目名称:BenFund,代码行数:28,代码来源:file_api.php


示例15: filter_get_bug_rows


//.........这里部分代码省略.........
            }
        }
        if (1 < count($t_clauses)) {
            array_push($t_where_clauses, "( {$t_bug_table}.category in (" . implode(', ', $t_clauses) . ") )");
        } else {
            array_push($t_where_clauses, "( {$t_bug_table}.category={$t_clauses['0']} )");
        }
    }
    # severity
    $t_any_found = false;
    foreach ($t_filter['show_severity'] as $t_filter_member) {
        if (META_FILTER_ANY == $t_filter_member || 0 === $t_filter_member) {
            $t_any_found = true;
        }
    }
    if (count($t_filter['show_severity']) == 0) {
        $t_any_found = true;
    }
    if (!$t_any_found) {
        $t_clauses = array();
        foreach ($t_filter['show_severity'] as $t_filter_member) {
            $c_show_severity = db_prepare_int($t_filter_member);
            array_push($t_clauses, $c_show_severity);
        }
        if (1 < count($t_clauses)) {
            array_push($t_where_clauses, "( {$t_bug_table}.severity in (" . implode(', ', $t_clauses) . ") )");
        } else {
            array_push($t_where_clauses, "( {$t_bug_table}.severity={$t_clauses['0']} )");
        }
    }
    # show / hide status
    # take a list of all available statuses then remove the ones that we want hidden, then make sure
    # the ones we want shown are still available
    $t_status_arr = explode_enum_string(config_get('status_enum_string'));
    $t_available_statuses = array();
    $t_desired_statuses = array();
    foreach ($t_status_arr as $t_this_status) {
        $t_this_status_arr = explode_enum_arr($t_this_status);
        $t_available_statuses[] = $t_this_status_arr[0];
    }
    if ('simple' == $t_filter['_view_type']) {
        # simple filtering: if showing any, restrict by the hide status value, otherwise ignore the hide
        $t_any_found = false;
        $t_this_status = $t_filter['show_status'][0];
        $t_this_hide_status = $t_filter['hide_status'][0];
        if (META_FILTER_ANY == $t_this_status || is_blank($t_this_status) || 0 === $t_this_status) {
            $t_any_found = true;
        }
        if ($t_any_found) {
            foreach ($t_available_statuses as $t_this_available_status) {
                if ($t_this_hide_status > $t_this_available_status) {
                    $t_desired_statuses[] = $t_this_available_status;
                }
            }
        } else {
            $t_desired_statuses[] = $t_this_status;
        }
    } else {
        # advanced filtering: ignore the hide
        $t_any_found = false;
        foreach ($t_filter['show_status'] as $t_this_status) {
            $t_desired_statuses[] = $t_this_status;
            if (META_FILTER_ANY == $t_this_status || is_blank($t_this_status) || 0 === $t_this_status) {
                $t_any_found = true;
            }
        }
开发者ID:centaurustech,项目名称:BenFund,代码行数:67,代码来源:filter_api.php


示例16: enum_bug_group

function enum_bug_group($p_enum_string, $p_enum)
{
    $t_bug_table = config_get('mantis_bug_table');
    $t_project_id = helper_get_current_project();
    $t_bug_table = config_get('mantis_bug_table');
    $t_user_id = auth_get_current_user_id();
    $t_res_val = config_get('bug_resolved_status_threshold');
    $t_clo_val = CLOSED;
    $specific_where = " AND " . helper_project_specific_where($t_project_id, $t_user_id);
    $t_arr = explode_enum_string($p_enum_string);
    $enum_count = count($t_arr);
    for ($i = 0; $i < $enum_count; $i++) {
        $t_s = explode(':', $t_arr[$i]);
        $t_key = get_enum_to_string($p_enum_string, $t_s[0]);
        # Calculates the number of bugs opened and puts the results in a table
        $query = "SELECT COUNT(*)\n\t\t\t\t\tFROM {$t_bug_table}\n\t\t\t\t\tWHERE {$p_enum}='{$t_s['0']}' AND\n\t\t\t\t\t\tstatus<'{$t_res_val}' {$specific_where}";
        $result2 = db_query($query);
        $t_metrics['open'][$t_key] = db_result($result2, 0, 0);
        # Calculates the number of bugs closed and puts the results in a table
        $query = "SELECT COUNT(*)\n\t\t\t\t\tFROM {$t_bug_table}\n\t\t\t\t\tWHERE {$p_enum}='{$t_s['0']}' AND\n\t\t\t\t\t\tstatus='{$t_clo_val}' {$specific_where}";
        $result2 = db_query($query);
        $t_metrics['closed'][$t_key] = db_result($result2, 0, 0);
        # Calculates the number of bugs resolved and puts the results in a table
        $query = "SELECT COUNT(*)\n\t\t\t\t\tFROM {$t_bug_table}\n\t\t\t\t\tWHERE {$p_enum}='{$t_s['0']}' AND\n\t\t\t\t\t\tstatus>='{$t_res_val}'  AND\n\t\t\t\t\t\tstatus<'{$t_clo_val}' {$specific_where}";
        $result2 = db_query($query);
        $t_metrics['resolved'][$t_key] = db_result($result2, 0, 0);
    }
    ### end for
    return $t_metrics;
}
开发者ID:jin255ff,项目名称:company_website,代码行数:30,代码来源:graph_api.php


示例17: access_begin

function access_begin($p_section_name)
{
    $t_enum_status = explode_enum_string(config_get('status_enum_string'));
    echo '<table class="width100">';
    echo '<tr><td class="form-title" colspan=2>' . strtoupper($p_section_name) . '</td></tr>' . "\n";
    echo '<tr><td class="form-title" colspan=2>' . lang_get('access_change') . '</td></tr>';
}
开发者ID:centaurustech,项目名称:BenFund,代码行数:7,代码来源:manage_config_workflow_page.php


示例18: mci_get_enum_value_from_label

/**
 * Get the enum id given the enum label.
 *
 * @param $p_enum_string   The enum string to search in.
 * @param $p_label         The label to search for.
 *
 * @return The id corresponding to the given label, or 0 if not found.
 */
function mci_get_enum_value_from_label($p_enum_string, $p_label)
{
    $t_arr = explode_enum_string($p_enum_string);
    $enum_count = count($t_arr);
    for ($i = 0; $i < $enum_count; $i++) {
        $t_s = explode_enum_arr($t_arr[$i]);
        if ($t_s[1] == $p_label) {
            return $t_s[0];
        }
    }
    return 0;
}
开发者ID:jin255ff,项目名称:company_website,代码行数:20,代码来源:mc_enum_api.php


示例19: html_status_percentage_legend

function html_status_percentage_legend()
{
    $t_mantis_bug_table = config_get('mantis_bug_table');
    $t_project_id = helper_get_current_project();
    $t_user_id = auth_get_current_user_id();
    #checking if it's a per project statistic or all projects
    $t_specific_where = helper_project_specific_where($t_project_id, $t_user_id);
    $query = "SELECT status, COUNT(*) AS number\r\n\t\t\t\tFROM {$t_mantis_bug_table}\r\n\t\t\t\tWHERE {$t_specific_where}\r\n\t\t\t\tGROUP BY status";
    $result = db_query($query);
    $t_bug_count = 0;
    $t_status_count_array = array();
    while ($row = db_fetch_array($result)) {
        $t_status_count_array[$row['status']] = $row['number'];
        $t_bug_count += $row['number'];
    }
    $t_arr = explode_enum_string(config_get('status_enum_string'));
    $enum_count = count($t_arr);
    if ($t_bug_count > 0) {
        echo '<br />';
        echo '<table class="width100" cellspacing="1">';
        echo '<tr>';
        echo '<td class="form-title" colspan="' . $enum_count . '">' . lang_get('issue_status_percentage') . '</td>';
        echo '</tr>';
        echo '<tr>';
        for ($i = 0; $i < $enum_count; $i++) {
            $t_s = explode_enum_arr($t_arr[$i]);
            $t_color = get_status_color($t_s[0]);
            $t_status = $t_s[0];
            if (!isset($t_status_count_array[$t_status])) {
                $t_status_count_array[$t_status] = 0;
            }
            $width = round($t_status_count_array[$t_status] / $t_bug_count * 100);
            if ($width > 0) {
                echo "<td class=\"small-caption-center\" width=\"{$width}%\" bgcolor=\"{$t_color}\">{$width}%</td>";
            }
        }
        echo '</tr>';
        echo '</table>';
    }
}
开发者ID:amjadtbssm,项目名称:website,代码行数:40,代码来源:html_api.php


示例20: filter_get_bug_rows


//.........这里部分代码省略.........
            }
        }
        if (1 < count($t_clauses)) {
            array_push($t_where_clauses, "( {$t_bug_table}.category in (" . implode(', ', $t_clauses) . ") )");
        } else {
            array_push($t_where_clauses, "( {$t_bug_table}.category={$t_clauses['0']} )");
        }
    }
    # severity
    $t_any_found = false;
    foreach ($t_filter['show_severity'] as $t_filter_member) {
        if (META_FILTER_ANY == $t_filter_member || 0 === $t_filter_member) {
            $t_any_found = true;
        }
    }
    if (count($t_filter['show_severity']) == 0) {
        $t_any_found = true;
    }
    if (!$t_any_found) {
        $t_clauses = array();
        foreach ($t_filter['show_severity'] as $t_filter_member) {
            $c_show_severity = db_prepare_int($t_filter_member);
            array_push($t_clauses, $c_show_severity);
        }
        if (1 < count($t_clauses)) {
            array_push($t_where_clauses, "( {$t_bug_table}.severity in (" . implode(', ', $t_clauses) . ") )");
        } else {
            array_push($t_where_clauses, "( {$t_bug_table}.severity={$t_clauses['0']} )");
        }
    }
    # show / hide status
    # take a list of all available statuses then remove the ones that we want hidden, then make sure
    # the ones we want shown are still available
    $t_status_arr = explode_enum_string(config_get('status_enum_string'));
    $t_available_statuses = array();
    $t_desired_statuses = array();
    foreach ($t_status_arr as $t_this_status) {
        $t_this_status_arr = explode_enum_arr($t_this_status);
        $t_available_statuses[] = $t_this_status_arr[0];
    }
    if ('simple' == $t_filter['_view_type']) {
        # simple filtering: if showing any, restrict by the hide status value, otherwise ignore the hide
        $t_any_found = false;
        $t_this_status = $t_filter['show_status'][0];
        $t_this_hide_status = $t_filter['hide_status'][0];
        if (META_FILTER_ANY == $t_this_status || is_blank($t_this_status) || 0 === $t_this_status) {
            $t_any_found = true;
        }
        if ($t_any_found) {
            foreach ($t_available_statuses as $t_this_available_status) {
                if ($t_this_hide_status > $t_this_available_status) {
                    $t_desired_statuses[] = $t_this_available_status;
                }
            }
        } else {
            $t_desired_statuses[] = $t_this_status;
        }
    } else {
        # advanced filtering: ignore the hide
        $t_any_found = false;
        foreach ($t_filter['show_status'] as $t_this_status) {
            $t_desired_statuses[] = $t_this_status;
            if (META_FILTER_ANY == $t_this_status || is_blank($t_this_status) || 0 === $t_this_status) {
                $t_any_found = true;
            }
        }
开发者ID:amjadtbssm,项目名称:website,代码行数:67,代码来源:filter_api.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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