diff --git a/codepot/src/codepot/views/code_search.php b/codepot/src/codepot/views/code_search.php new file mode 100644 index 00000000..efd869db --- /dev/null +++ b/codepot/src/codepot/views/code_search.php @@ -0,0 +1,191 @@ + + + + + + + + + + + + + + + + +<?=htmlspecialchars($project->name)?> + + + + +
+ + + +load->view ('taskbar'); ?> + + + +load->view ( + 'projectbar', + array ( + 'banner' => NULL, + + 'page' => array ( + 'type' => 'project', + 'id' => 'code', + 'project' => $project, + ), + + 'ctxmenuitems' => array () + ) +); +?> + + + +
+ +
+converter->AsciiToHex('.') . $revreq; + } + + // print the main anchor for the root folder. + // let the anchor text be the project name. + print anchor ( + "code/file/{$project->id}{$revreqroot}", + htmlspecialchars($project->name)); + + // explode non-root folder parts to anchors + $exps = explode ('/', $headpath); + $expsize = count($exps); + $par = ''; + for ($i = 1; $i < $expsize; $i++) + { + print '/'; + $par .= '/' . $exps[$i]; + $xpar = $this->converter->AsciiToHex ($par); + print anchor ( + "code/file/{$project->id}/{$xpar}{$revreq}", + htmlspecialchars($exps[$i])); + } + + if ($headpath != $file['fullpath']) + { + print ' - '; + print htmlspecialchars ($file['fullpath']); + } +?> +
+ + +
+ id}/", 'id="code_search_search_form"')?> + + + lang->line('Search'), 'id="code_search_search_submit"')?> + | + lang->line('Revision')?>: + + +
+ +
+ +subversion->getFile ($project->id, $fullpath, $revision); + if ($file2 !== FALSE) + { + if ($file2['type'] == 'file') + { + $lines = explode ("\n", $file2['content']); + //$matchkeys = preg_grep ("/{$pattern}/i", $lines, 0); + $matchlines = preg_grep ("/{$pattern}/", $lines, 0); + if (count($matchlines) > 0) + { + $hexpath = $controller->converter->AsciiToHex($fullpath); + if ($revision <= 0) + { + $revreq = ''; + $revreqroot = ''; + } + else + { + $revreq = "/{$file2['rev']}"; + $revreqroot = '/' . $controller->converter->AsciiToHex ('.') . $revreq; + } + + print '
  • '; + print anchor ( + "code/file/{$project->id}/{$hexpath}{$revreq}", + htmlspecialchars($fullpath)); + + print '
    ';
    +						foreach ($matchlines as $linenum => $line)
    +						{
    +							printf ('% 6d: ', $linenum);
    +							print htmlspecialchars($line);
    +							print "\n";
    +						}
    +						print '
    '; + + print '
  • '; + } + } + else + { + search_and_show ($controller, $project, $file2, $revision, $pattern); + } + } + } + } +} + +$file = $this->subversion->getFile ($project->id, $file['fullpath'], $revision); +search_and_show ($this, $project, $file, $revision, $pattern); +?> + +
    + +
    + + + + +load->view ('footer'); ?> + + + +
    + + + + +