Ejemplo n.º 1
0
 /**
  * Initial app setup code.
  */
 public static function initialize()
 {
     global $sources, $sourceid, $source, $files, $index, $pathname;
     require LUXOR_BASE . '/config/backends.php';
     /* Default to the first source; overridden elsewhere if necessary. */
     $sourceid = Horde_Util::getFormData('source');
     if (!isset($sources[$sourceid])) {
         $sourceid = key($sources);
     }
     $source = $sources[$sourceid];
     $files = Luxor_Files::factory($source['driver'], $source);
     $index = Luxor_Driver::factory($sourceid);
     $pathname = Luxor::fixPaths(Horde_Util::getFormData('f'));
 }
Ejemplo n.º 2
0
 * did not receive this file, see http://www.horde.org/licenses/gpl.php.
 *
 * @author Jan Schneider <*****@*****.**>
 * @author Mike Cochrane <*****@*****.**>
 */
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('luxor');
$ident = Horde_Util::getFormData('i');
// Change source if the symbol isn't from the current source.
$symbolSource = $index->getSourceBySymbol($ident);
if (!$symbolSource) {
    throw new Horde_Exception(_("Symbol not found"));
}
if ($symbolSource != $sourceid) {
    $source = $sources[$symbolSource];
    $index = Luxor_Driver::factory($symbolSource);
}
$declarations = $index->getIndex($ident);
$sorted = array();
foreach ($declarations as $decl) {
    $sorted[$decl['declaration']][] = array('filename' => $decl['filename'], 'line' => $decl['line']);
}
$ds = array();
foreach ($sorted as $type => $locations) {
    $d = array();
    $d['title'] = sprintf(_("Declared as a %s"), $type);
    $d['files'] = array();
    Horde_Array::arraySort($locations, 'filename', 0, false);
    foreach ($locations as $loc) {
        $href = Luxor::url($loc['filename'], array(), 'l' . $loc['line']);
        $d['files'][] = '<a href="' . $href . '">' . $loc['filename'] . ' ' . sprintf(_("Line %s"), $loc['line']) . '</a>';