コード例 #1
0
ファイル: viewvc.php プロジェクト: neymanna/fusionforge
// Set content type header from the value set by ViewCVS
// No other headers are generated by ViewCVS because in generate_etags
// is set to 0 in the ViewCVS config file
$found = false;
$line = strtok($content, SEPARATOR);
while ($line && !$found) {
    if (preg_match('/^Content-Type:(.*)$/', $line, $matches)) {
        header('Content-Type:' . $matches[1]);
        $found = true;
    }
    $line = strtok(SEPARATOR);
}
$content = substr($content, strpos($content, $line));
if (viewcvs_is_html()) {
    // If we output html and we found the mbstring extension, we
    // should try to encode the output of ViewCVS in UTF-8
    if (extension_loaded('mbstring')) {
        $encoding = mb_detect_encoding($content, 'UTF-8, ISO-8859-1');
        if ($encoding != 'UTF-8') {
            $content = mb_convert_encoding($content, 'UTF-8', $encoding);
        }
    }
    scm_header(array('title' => _('SCM Repository'), 'group' => $Group->getID()));
    echo $content;
    scm_footer(array());
} else {
    // TODO does not seem to work when allow_tar = 1 in ViewCVS conf
    // (allow to generate on the fly a tar.gz): the generated file
    // seems to be corrupted
    echo $content;
}
コード例 #2
0
ファイル: index.php プロジェクト: neymanna/fusionforge
            $myPlugin = plugin_get_object($plugin);
            echo '<td><input type="radio" name="scmradio" ';
            echo 'value="' . $myPlugin->name . '"';
            if ($group->usesPlugin($myPlugin->name)) {
                $scm = $myPlugin->name;
                echo ' checked="checked"';
            }
            echo '>' . $myPlugin->text . '</td>';
        }
        echo '</tr></tbody></table>' . "\n";
    }
} else {
    echo '<p>' . _('Error - Site has SCM but no plugins registered') . '</p>';
}
plugin_hook("scm_admin_page", $hook_params);
?>
<input type="hidden" name="group_id" value="<?php 
echo $group_id;
?>
">
<input type="submit" name="submit" value="<?php 
echo _('Update');
?>
">
</form>
<?php 
scm_footer();
// Local Variables:
// mode: php
// c-file-style: "bsd"
// End: