<?php

# Copyright (c) 2012 John Reese
# Licensed under the MIT license
form_security_validate('plugin_Source_repo_update_mappings');
access_ensure_global_level(plugin_config_get('manage_threshold'));
$f_repo_id = gpc_get_int('id');
$t_repo = SourceRepo::load($f_repo_id);
$t_type = SourceType($t_repo->type);
$t_mappings = $t_repo->load_mappings();
# start processing the updated form entries for each mapping
foreach ($t_mappings as $t_mapping) {
    $t_posted_branch = str_replace('.', '_', $t_mapping->branch);
    $f_mapping_delete = gpc_get_bool($t_posted_branch . '_delete', false);
    if ($f_mapping_delete) {
        $t_mapping->delete();
        continue;
    }
    $f_mapping_branch = gpc_get_string($t_posted_branch . '_branch', $t_mapping->branch);
    $f_mapping_type = gpc_get_int($t_posted_branch . '_type', $t_mapping->type);
    if (Source_PVM()) {
        $f_mapping_pvm_version_id = gpc_get_int($t_posted_branch . '_pvm_version_id', $t_mapping->pvm_version_id);
    } else {
        $f_mapping_version = gpc_get_string($t_posted_branch . '_version', $t_mapping->version);
    }
    $f_mapping_regex = gpc_get_string($t_posted_branch . '_regex', $t_mapping->regex);
    $t_update = false;
    # determine changes and if updates need to be made
    if ($t_mapping->branch != $f_mapping_branch) {
        $t_mapping->branch = $f_mapping_branch;
        $t_update = true;
Ejemplo n.º 2
0
</td>
</tr>

<?php 
foreach ($t_repos as $t_repo) {
    ?>
<tr <?php 
    echo helper_alternate_class();
    ?>
>
<td><?php 
    echo string_display($t_repo->name);
    ?>
</td>
<td class="center"><?php 
    echo string_display(SourceType($t_repo->type));
    ?>
</td>
<?php 
    if ($t_show_stats) {
        $t_stats = $t_repo->stats();
        ?>
<td class="right"><?php 
        echo $t_stats['changesets'];
        ?>
</td>
<td class="right"><?php 
        echo $t_stats['files'];
        ?>
</td>
<td class="right"><?php