Chora::getFileViews PHP Méthode

getFileViews() public static méthode

Generate the link used for various file views.
public static getFileViews ( string $where, string $rev ) : array
$where string The current file path.
$rev string The current revision.
Résultat array An array of file view links.
    public static function getFileViews($where, $rev)
    {
        global $injector, $VC;
        $tabs = new Horde_Core_Ui_Tabs(null, $injector->getInstance('Horde_Variables'));
        $tabs->addTab(_("_View"), Chora::url('co', $where, array('r' => $rev)), 'co');
        $tabs->addTab(_("_Annotate"), Chora::url('annotate', $where, array('rev' => $rev)), 'annotate');
        if ($VC->hasFeature('snapshots')) {
            $snapdir = dirname($VC->getFile($where)->getPath());
            $tabs->addTab(_("_Snapshot"), Chora::url('browsedir', $snapdir == '.' ? '' : $snapdir . '/', array('onb' => $rev)));
        }
        $tabs->addTab(_("_Download"), Chora::url('co', $where, array('r' => $rev, 'p' => 1)));
        return $tabs;
    }

Usage Example

Exemple #1
0
        }
        exit;
}
if (!$VC->isValidRevision($rev)) {
    Chora::fatal(sprintf(_("Revision %s not found"), $rev), '404 Not Found');
}
try {
    $lines = $VC->annotate($fl, $rev);
} catch (Horde_Vcs_Exception $e) {
    Chora::fatal($e);
}
$title = sprintf(_("Source Annotation (revision %s) for:"), $rev);
$page_output->addScriptFile('annotate.js');
$page_output->addInlineJsVars(array('var Chora' => array('ANNOTATE_URL' => (string) Horde::url('annotate.php', true)->add(array('actionID' => 'log', 'rt' => $sourceroot, 'f' => $where, 'rev' => '')), 'loading_text' => _("Loading..."))));
Chora::header($title);
echo Chora::getFileViews($where, $rev)->render('annotate');
require CHORA_TEMPLATES . '/annotate/header.inc';
$author = '';
$style = 0;
while (list(, $line) = each($lines)) {
    $lineno = $line['lineno'];
    $author = Chora::showAuthorName($line['author']);
    $prevRev = $rev;
    $rev = $line['rev'];
    if ($prevRev != $rev) {
        $style = ++$style % 2;
    }
    $prev = $fl->getPreviousRevision($rev);
    $line = $GLOBALS['injector']->getInstance('Horde_Core_Factory_TextFilter')->filter($line['line'], 'space2html', array('encode' => true, 'encode_all' => true));
    include CHORA_TEMPLATES . '/annotate/line.inc';
}
All Usage Examples Of Chora::getFileViews