示例#1
0
文件: symbol.php 项目: horde/horde
}
$references = $index->getReference($ident);
Horde_Array::arraySort($references, 'filename', 0, false);
$curfile = '';
$rs = array();
$r = array();
foreach ($references as $info) {
    if ($curfile != $info['filename']) {
        if ($r) {
            $rs[] = $r;
        }
        $curfile = $info['filename'];
        $r = array();
        $r['file'] = '<a href="' . Luxor::url($info['filename']) . '">' . htmlspecialchars($info['filename']) . '</a>';
        $r['lines'] = array();
    }
    $r['lines'][] = '<a href="' . Luxor::url($info['filename'], array(), 'l' . $info['line']) . '">' . sprintf(_("Line %s"), $info['line']) . '</a>';
}
if ($r) {
    $rs[] = $r;
}
$title = sprintf(_("%s :: Symbol \"%s\""), $source['name'], $index->symname($ident));
$page_output->header(array('title' => $title));
require LUXOR_TEMPLATES . '/menu.inc';
$view = new Horde_View(array('templatePath' => LUXOR_TEMPLATES));
$view->addHelper('Text');
$view->title = $title;
$view->declarations = $ds;
$view->references = $rs;
echo $view->render('symbol.html.php');
$page_output->footer();
示例#2
0
 function fileRef($desc, $css, $path, $line = 0, $args = array())
 {
     if ($line > 0 && strlen($line) < 3) {
         $line = str_repeat('0', 3 - strlen($line)) . $line;
     }
     return '<a href="' . Luxor::url($path, $args, $line > 0 ? 'l' . $line : '') . '" class="' . htmlspecialchars($css) . '">' . htmlspecialchars($desc) . '</a>';
 }
示例#3
0
    $id = current($ids);
    Horde::url('symbol.php', true)->add('i', $id)->redirect();
}
// If there are multiple search results, display some info for all of them.
$page_output->header(array('title' => sprintf(_("Symbol Search for \"%s\""), $symbol)));
require LUXOR_TEMPLATES . '/menu.inc';
echo '<h1 class="header">' . htmlspecialchars($title) . '</h1>';
foreach ($ids as $ident) {
    // Change source if the symbol isn't from the current source.
    $symbolSource = $index->getSourceBySymbol($ident);
    if ($symbolSource != $sourceid) {
        $source = $sources[$symbolSource];
        $index = Luxor_Driver::factory($symbolSource);
    }
    $name = $index->symname($ident);
    echo '<br /><span class="header">' . Horde::link(Horde::url('symbol.php?i=' . $ident), $name, 'header') . $name . '</a></span><br />';
    $references = $index->getIndex($ident);
    $sorted = array();
    foreach ($references as $ref) {
        $sorted[$ref['declaration']][] = array('filename' => $ref['filename'], 'line' => $ref['line']);
    }
    foreach ($sorted as $type => $locations) {
        echo _("Declared as ") . $type . "\n";
        foreach ($locations as $loc) {
            $href = Luxor::url($loc['filename'], array(), 'l' . $loc['line']);
            echo '    <a href="' . $href . '">' . $loc['filename'] . ' Line: ' . $loc['line'] . '</a><br />';
        }
        echo '<br />';
    }
}
$page_output->footer();