From 00e1d5f4013e8e8b83c4de9c67b4615d87bf6473 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sun, 31 Jan 2010 13:20:48 +0000 Subject: [PATCH] enhanced source browser by fixing minor bugs and adding a diff view --- codepot/src/codepot/controllers/project.php | 6 + codepot/src/codepot/controllers/source.php | 110 +++++- .../codepot/language/english/common_lang.php | 3 + .../language/indonesian/common_lang.php | 3 + .../codepot/language/korean/common_lang.php | 5 +- codepot/src/codepot/models/projectmodel.php | 4 +- .../src/codepot/models/subversionmodel.php | 331 ++++++++++++++++++ codepot/src/codepot/views/Makefile.am | 1 + codepot/src/codepot/views/Makefile.in | 1 + codepot/src/codepot/views/file_home.php | 15 +- codepot/src/codepot/views/source_blame.php | 86 +++-- codepot/src/codepot/views/source_diff.php | 223 ++++++++++++ codepot/src/codepot/views/source_file.php | 84 +++-- codepot/src/codepot/views/source_folder.php | 93 +++-- codepot/src/codepot/views/source_history.php | 27 +- codepot/src/config.php.in | 26 +- codepot/src/css/Makefile.am | 3 +- codepot/src/css/Makefile.in | 3 +- codepot/src/css/common.css | 146 ++++---- codepot/src/css/project.css | 109 +++++- codepot/src/css/websvn.css | 90 +++++ codepot/src/websvn/include/svnlook.php | 4 +- codepot/src/websvn/templates/calm/diff.tmpl | 16 +- .../src/websvn/templates/calm/directory.tmpl | 6 +- codepot/src/websvn/templates/calm/file.tmpl | 4 +- codepot/src/websvn/templates/calm/header.tmpl | 1 + 26 files changed, 1168 insertions(+), 232 deletions(-) create mode 100644 codepot/src/codepot/views/source_diff.php create mode 100644 codepot/src/css/websvn.css diff --git a/codepot/src/codepot/controllers/project.php b/codepot/src/codepot/controllers/project.php index 0709fe72..9c1f2a46 100644 --- a/codepot/src/codepot/controllers/project.php +++ b/codepot/src/codepot/controllers/project.php @@ -154,17 +154,20 @@ class Project extends Controller $project = $this->projects->get ($projectid); if ($project === FALSE) { + $data['loginid'] = $loginid; $data['message'] = 'DATABASE ERROR'; $this->load->view ($this->VIEW_ERROR, $data); } else if ($project === NULL) { + $data['loginid'] = $loginid; $data['message'] = "NO SUCH PROJECT - $projectid"; $this->load->view ($this->VIEW_ERROR, $data); } else if (!$this->login->isSysadmin() && $this->projects->projectHasMember($project->id, $loginid) === FALSE) { + $data['loginid'] = $loginid; $data['message'] = "NO PERMISSION - $projectid"; $this->load->view ($this->VIEW_ERROR, $data); } @@ -243,17 +246,20 @@ class Project extends Controller $project = $this->projects->get ($projectid); if ($project === FALSE) { + $data['loginid'] = $loginid; $data['message'] = 'DATABASE ERROR'; $this->load->view ($this->VIEW_ERROR, $data); } else if ($project === NULL) { + $data['loginid'] = $loginid; $data['message'] = "NO SUCH PROJECT - $projectid"; $this->load->view ($this->VIEW_ERROR, $data); } else if (!$this->login->isSysadmin() && $this->projects->projectHasMember($project->id, $loginid) === FALSE) { + $data['loginid'] = $loginid; $data['message'] = "NO PERMISSION - $projectid"; $this->load->view ($this->VIEW_ERROR, $data); } diff --git a/codepot/src/codepot/controllers/source.php b/codepot/src/codepot/controllers/source.php index 019a694f..f157574d 100644 --- a/codepot/src/codepot/controllers/source.php +++ b/codepot/src/codepot/controllers/source.php @@ -7,6 +7,7 @@ class Source extends Controller var $VIEW_FILE = 'source_file'; var $VIEW_BLAME = 'source_blame'; var $VIEW_HISTORY = 'source_history'; + var $VIEW_DIFF = 'source_diff'; function Source () { @@ -36,6 +37,7 @@ class Source extends Controller $data['loginid'] = $loginid; $path = $this->converter->HexToAscii ($path); + if ($path == '.') $path = ''; /* treat a period specially */ $project = $this->projects->get ($projectid); if ($project === FALSE) @@ -58,10 +60,17 @@ class Source extends Controller } else { + $data['project'] = $project; $data['folder'] = $path; $data['files'] = $files; + $data['revision'] = $rev; + $data['prev_revision'] = + $this->subversion->getPrevRev ($projectid, $path, $rev); + $data['next_revision'] = + $this->subversion->getNextRev ($projectid, $path, $rev); + $this->load->view ($this->VIEW_FOLDER, $data); } } @@ -112,11 +121,26 @@ class Source extends Controller } else { - $data['project'] = $project; - $data['folder'] = substr ($path, 0, strrpos($path, '/')); - $data['file'] = $file; - $data['revision'] = $rev; - $this->load->view ($this->VIEW_FILE, $data); + $head_rev = $this->subversion->getHeadRev ($projectid, $path); + if ($head_rev === FALSE) + { + $data['message'] = 'Failed to get head revision'; + $this->load->view ($this->VIEW_ERROR, $data); + } + else + { + $file['head_rev'] = $head_rev; + $file['prev_rev'] = $this->subversion->getPrevRev ( + $projectid, $path, $file['created_rev']); + $file['next_rev'] = $this->subversion->getNextRev ( + $projectid, $path, $file['created_rev']); + + $data['project'] = $project; + $data['folder'] = substr ($path, 0, strrpos($path, '/')); + $data['file'] = $file; + $data['revision'] = $rev; + $this->load->view ($this->VIEW_FILE, $data); + } } } } @@ -154,11 +178,26 @@ class Source extends Controller } else { - $data['project'] = $project; - $data['folder'] = substr ($path, 0, strrpos($path, '/')); - $data['file'] = $file; - $data['revision'] = $rev; - $this->load->view ($this->VIEW_BLAME, $data); + $head_rev = $this->subversion->getHeadRev ($projectid, $path); + if ($head_rev === FALSE) + { + $data['message'] = 'Failed to get head revision'; + $this->load->view ($this->VIEW_ERROR, $data); + } + else + { + $file['head_rev'] = $head_rev; + $file['prev_rev'] = $this->subversion->getPrevRev ( + $projectid, $path, $file['created_rev']); + $file['next_rev'] = $this->subversion->getNextRev ( + $projectid, $path, $file['created_rev']); + + $data['project'] = $project; + $data['folder'] = substr ($path, 0, strrpos($path, '/')); + $data['file'] = $file; + $data['revision'] = $rev; + $this->load->view ($this->VIEW_BLAME, $data); + } } } } @@ -207,4 +246,55 @@ class Source extends Controller } } + function diff ($projectid, $path, $rev1 = SVN_REVISION_HEAD, $rev2 = SVN_REVISION_PREV) + { + $this->load->model ('ProjectModel', 'projects'); + $this->load->model ('SubversionModel', 'subversion'); + + $loginid = $this->login->getUserid (); + if (CODEPOT_ALWAYS_REQUIRE_SIGNIN && $loginid == '') + redirect ('main/signin'); + $data['loginid'] = $loginid; + + $path = $this->converter->HexToAscii ($path); + + $project = $this->projects->get ($projectid); + if ($project === FALSE) + { + $data['message'] = 'DATABASE ERROR'; + $this->load->view ($this->VIEW_ERROR, $data); + } + else if ($project === NULL) + { + $data['message'] = "NO SUCH PROJECT - $projectid"; + $this->load->view ($this->VIEW_ERROR, $data); + } + else + { + $file = $this->subversion->getDiff ($projectid, $path, $rev1, $rev2); + if ($file === FALSE) + { + $data['message'] = 'Failed to get diff'; + $this->load->view ($this->VIEW_ERROR, $data); + } + else + { + $file['prev_rev'] = + $this->subversion->getPrevRev ($projectid, $path, $file['created_rev']); + $file['next_rev'] = + $this->subversion->getNextRev ($projectid, $path, $file['created_rev']); + $file['against']['prev_rev'] = + $this->subversion->getPrevRev ($projectid, $path, $file['against']['created_rev']); + $file['against']['next_rev'] = + $this->subversion->getNextRev ($projectid, $path, $file['against']['created_rev']); + + $data['project'] = $project; + $data['folder'] = substr ($path, 0, strrpos($path, '/')); + $data['file'] = $file; + $data['revision1'] = $rev1; + $data['revision2'] = $rev2; + $this->load->view ($this->VIEW_DIFF, $data); + } + } + } } diff --git a/codepot/src/codepot/language/english/common_lang.php b/codepot/src/codepot/language/english/common_lang.php index cb4791ff..706ca19b 100644 --- a/codepot/src/codepot/language/english/common_lang.php +++ b/codepot/src/codepot/language/english/common_lang.php @@ -7,8 +7,10 @@ $lang['Created on'] = 'Created on'; $lang['Delete'] = 'Delete'; $lang['Description'] = 'Description'; $lang['Details'] = 'Details'; +$lang['Difference'] = 'Diff'; $lang['Download'] = 'Download'; $lang['Edit'] = 'Edit'; +$lang['Head revision'] = 'Head revision'; $lang['History'] = 'History'; $lang['Home'] = 'Home'; $lang['File'] = 'File'; @@ -45,6 +47,7 @@ $lang['Username'] = 'Username'; $lang['Wiki'] = 'Wiki'; $lang['Wikis'] = 'Wikis'; +$lang['MSG_NO_DIFF'] = 'No difference found'; $lang['MSG_NO_FILES_AVAIL'] = 'No files available'; $lang['MSG_NO_SOURCE_AVAIL'] = 'No source available'; $lang['MSG_NO_WIKIS_AVAIL'] = 'No wiki pages available'; diff --git a/codepot/src/codepot/language/indonesian/common_lang.php b/codepot/src/codepot/language/indonesian/common_lang.php index c0ace5f7..9b8a89c5 100644 --- a/codepot/src/codepot/language/indonesian/common_lang.php +++ b/codepot/src/codepot/language/indonesian/common_lang.php @@ -7,8 +7,10 @@ $lang['Created on'] = 'Waktu dibuat'; $lang['Delete'] = 'Hapus'; $lang['Description'] = 'Penjelasan'; $lang['Details'] = 'Detail'; +$lang['Difference'] = 'Beda'; $lang['Download'] = 'Download'; $lang['Edit'] = 'Rubah'; +$lang['Head revision'] = 'Kepala Revisi'; $lang['History'] = 'Sejarah'; $lang['Home'] = 'Beranda'; $lang['File'] = 'File'; @@ -45,6 +47,7 @@ $lang['Username'] = 'Nama pemakai'; $lang['Wiki'] = 'Wiki'; $lang['Wikis'] = 'Wiki'; +$lang['MSG_NO_DIFF'] = 'Tidak ada bedanya'; $lang['MSG_NO_FILES_AVAIL'] = 'Tidak ada file tersedia'; $lang['MSG_NO_SOURCE_AVAIL'] = 'Tidak ada sumber tersedia'; $lang['MSG_NO_WIKIS_AVAIL'] = 'Tidak ada halaman wiki tersedia'; diff --git a/codepot/src/codepot/language/korean/common_lang.php b/codepot/src/codepot/language/korean/common_lang.php index f8ebc6cb..cbe691f8 100644 --- a/codepot/src/codepot/language/korean/common_lang.php +++ b/codepot/src/codepot/language/korean/common_lang.php @@ -7,9 +7,11 @@ $lang['Created on'] = '최초생성시간'; $lang['Delete'] = '삭제'; $lang['Description'] = '설명'; $lang['Details'] = '상세내역'; +$lang['Difference'] = '차이점'; $lang['Download'] = '내려받기'; $lang['Edit'] = '수정'; -$lang['History'] = '변경내역'; +$lang['Head revision'] = '최신리비전'; +$lang['History'] = '변경기록'; $lang['Home'] = '홈'; $lang['File'] = '파일'; $lang['Files'] = '파일'; @@ -45,6 +47,7 @@ $lang['Username'] = '사용자명'; $lang['Wiki'] = '위키'; $lang['Wikis'] = '위키'; +$lang['MSG_NO_DIFF'] = '차이점이 없습니다'; $lang['MSG_NO_FILES_AVAIL'] = '사용가능한 파일이 없습니다'; $lang['MSG_NO_SOURCE_AVAIL'] = '사용가능한 소스가 없습니다'; $lang['MSG_NO_WIKIS_AVAIL'] = '사용가능한 위키페이지가 없습니다'; diff --git a/codepot/src/codepot/models/projectmodel.php b/codepot/src/codepot/models/projectmodel.php index 5d058b0e..de550adc 100644 --- a/codepot/src/codepot/models/projectmodel.php +++ b/codepot/src/codepot/models/projectmodel.php @@ -241,9 +241,9 @@ class ProjectModel extends Model function deleteDirectory($dir) { - if (is_link($dir)) return unlink($dir); + if (is_link($dir)) return @unlink($dir); if (!file_exists($dir)) return TRUE; - if (!is_dir($dir)) return unlink($dir); + if (!is_dir($dir)) return @unlink($dir); foreach ($this->_scandir($dir) as $item) { diff --git a/codepot/src/codepot/models/subversionmodel.php b/codepot/src/codepot/models/subversionmodel.php index 35c8a906..796d27f8 100644 --- a/codepot/src/codepot/models/subversionmodel.php +++ b/codepot/src/codepot/models/subversionmodel.php @@ -68,6 +68,337 @@ class SubversionModel extends Model $fileinfo['history'] = $str; return $fileinfo; } + + function _get_diff ($diff, $all, $ent) + { + /* copied from websvn */ + + if ($all) + { + $ofile = fopen ($oldtname, "r"); + $nfile = fopen ($newtname, "r"); + } + + // Ignore the 4 header lines + $line = fgets($diff); + $line = fgets($diff); + $line = fgets($diff); + $line = fgets($diff); + + // Get the first real line + $line = fgets($diff); + + $index = 0; + $listing = array(); + + $curoline = 1; + $curnline = 1; + + while (!feof($diff)) + { + // Get the first line of this range + sscanf($line, "@@ -%d", $oline); + + $line = substr($line, strpos($line, "+")); + sscanf($line, "+%d", $nline); + + if ($all) + { + while ($curoline < $oline || $curnline < $nline) + { + $listing[$index]["rev1diffclass"] = "diff"; + $listing[$index]["rev2diffclass"] = "diff"; + + if ($curoline < $oline) + { + $nl = fgets($ofile); + + $line = rtrim($nl); + if ($ent) $line = replaceEntities($line, $rep); + + //$listing[$index]["rev1line"] = hardspace($line); + $listing[$index]["rev1line"] = $line; + + $curoline++; + } + else + { + //$listing[$index]["rev1line"] = " "; + $listing[$index]["rev1line"] = ""; + } + + if ($curnline < $nline) + { + $nl = fgets($nfile); + + $line = rtrim($nl); + if ($ent) $line = replaceEntities($line, $rep); + + //$listing[$index]["rev2line"] = hardspace($line); + $listing[$index]["rev2line"] = $line; + $curnline++; + } + else + { + //$listing[$index]["rev2line"] = " "; + $listing[$index]["rev2line"] = ""; + } + + $listing[$index]["rev1lineno"] = 0; + $listing[$index]["rev2lineno"] = 0; + + $index++; + } + } + else + { + // Output the line numbers + $listing[$index]["rev1lineno"] = $oline; + $listing[$index]["rev2lineno"] = $nline; + $index++; + } + + $fin = false; + while (!feof($diff) && !$fin) + { + $line = fgets($diff); + if ($line === false || strncmp($line, "@@", 2) == 0) + { + $fin = true; + } + else + { + $listing[$index]["rev1lineno"] = 0; + $listing[$index]["rev2lineno"] = 0; + + $mod = $line{0}; + + $line = rtrim(substr($line, 1)); + if ($ent) $line = replaceEntities($line, $rep); + + //if (strip_tags($line) == '') $line = ' '; + //$listing[$index]["rev1line"] = hardspace($line); + $listing[$index]["rev1line"] = $line; + + //$text = hardspace($line); + $text = $line; + + switch ($mod) + { + case "-": + $listing[$index]["rev1diffclass"] = "diffdeleted"; + $listing[$index]["rev2diffclass"] = "diff"; + + $listing[$index]["rev1line"] = $text; + //$listing[$index]["rev2line"] = " "; + $listing[$index]["rev2line"] = ''; + + if ($all) { + fgets($ofile); + $curoline++; + } + + break; + + case "+": + // Try to mark "changed" line sensibly + if (!empty($listing[$index-1]) && + empty($listing[$index-1]["rev1lineno"]) && + @$listing[$index-1]["rev1diffclass"] == "diffdeleted" && + @$listing[$index-1]["rev2diffclass"] == "diff") + { + $i = $index - 1; + while (!empty($listing[$i-1]) && + empty($listing[$i-1]["rev1lineno"]) && + $listing[$i-1]["rev1diffclass"] == "diffdeleted" && + $listing[$i-1]["rev2diffclass"] == "diff") + { + $i--; + } + + $listing[$i]["rev1diffclass"] = "diffchanged"; + $listing[$i]["rev2diffclass"] = "diffchanged"; + $listing[$i]["rev2line"] = $text; + + if ($all) { + fgets($nfile); + $curnline++; + } + + // Don't increment the current index count + $index--; + + } else { + $listing[$index]["rev1diffclass"] = "diff"; + $listing[$index]["rev2diffclass"] = "diffadded"; + + //$listing[$index]["rev1line"] = " "; + $listing[$index]["rev1line"] = ''; + $listing[$index]["rev2line"] = $text; + + if ($all) { + fgets($nfile); + $curnline++; + } + } + break; + + default: + $listing[$index]["rev1diffclass"] = "diff"; + $listing[$index]["rev2diffclass"] = "diff"; + + $listing[$index]["rev1line"] = $text; + $listing[$index]["rev2line"] = $text; + + if ($all) { + fgets($ofile); + fgets($nfile); + $curoline++; + $curnline++; + } + + break; + } + } + + if (!$fin) { + $index++; + } + } + } + + // Output the rest of the files + if ($all) + { + while (!feof($ofile) || !feof($nfile)) + { + $listing[$index]["rev1diffclass"] = "diff"; + $listing[$index]["rev2diffclass"] = "diff"; + + $line = rtrim(fgets($ofile)); + if ($ent) $line = replaceEntities($line, $rep); + + if (!feof($ofile)) { + //$listing[$index]["rev1line"] = hardspace($line); + $listing[$index]["rev1line"] = $line; + } + else { + //$listing[$index]["rev1line"] = " "; + $listing[$index]["rev1line"] = ''; + } + + $line = rtrim(fgets($nfile)); + if ($ent) $line = replaceEntities(rtrim(fgets($nfile)), $rep); + + if (!feof($nfile)) { + //$listing[$index]["rev2line"] = hardspace($line); + $listing[$index]["rev2line"] = $line; + } + else { + //$listing[$index]["rev2line"] = " "; + $listing[$index]["rev2line"] = ''; + } + + $listing[$index]["rev1lineno"] = 0; + $listing[$index]["rev2lineno"] = 0; + + $index++; + } + } + + return $listing; + } + + function getDiff ($projectid, $file, $rev1, $rev2) + { + $path = 'file:///' . CODEPOT_SVNREPO_DIR . '/' . $projectid . '/' . $file; + + $info = @svn_ls ($path, $rev1, FALSE); + if ($info === FALSE) return FALSE; + + $last = substr(strrchr($path, '/'), 1); + if (array_key_exists ($last, $info) === FALSE) return FALSE; + $fileinfo = $info[$last]; + + $rev1 = $info[$last]['created_rev']; + + if ($rev2 <= 0) + { + /* + $log = @svn_log ($path, $rev1, SVN_REVISION_INITIAL, 2); + if ($log === FALSE) return FALSE; + if (count($log) < 2) return FALSE; + $rev2 = $log[1]['rev']; + */ + $rev2 = $rev1 - 1; + if ($rev2 <= 0) $rev2 = $rev1; + } + + $info2 = @svn_ls ($path, $rev2, FALSE); + if ($info2 === FALSE) + { + $rev2 = $rev1; + $info2 = @svn_ls ($path, $rev2, FALSE); + if ($info2 === FALSE) return FALSE; + } + + if (array_key_exists ($last, $info2) === FALSE) return FALSE; + $rev2 = $info2[$last]['created_rev']; + + list($diff, $errors) = @svn_diff ($path, $rev2, $path, $rev1); + if (!$diff) return FALSE; + + fclose($errors); + + $fileinfo['content'] = $this->_get_diff ($diff, FALSE, FALSE); + fclose ($diff); + +/* +print_r ($info[$last]); +print_r ($info2[$last]); +*/ + $fileinfo['against'] = $info2[$last]; + return $fileinfo; + } + + function getPrevRev ($projectid, $file, $rev) + { + $path = 'file:///' . CODEPOT_SVNREPO_DIR . '/' . $projectid . '/' . $file; + + $info = @svn_log ($path, $rev, SVN_REVISION_INITIAL, 2, SVN_OMIT_MESSAGES); + if ($info === FALSE) return $rev; + + $count = count($info); + if ($count <= 0) return $rev; + if ($count == 1) return $info[0]['rev']; + + return $info[1]['rev']; + } + + function getNextRev ($projectid, $file, $rev) + { + $path = 'file:///' . CODEPOT_SVNREPO_DIR . '/' . $projectid . '/' . $file; + + $info = @svn_log ($path, SVN_REVISION_HEAD, $rev, 0, SVN_OMIT_MESSAGES); + if ($info === FALSE) return $rev; + + $count = count($info); + if ($count <= 0) return $rev; + if ($count == 1) return $info[0]['rev']; + + return $info[$count-2]['rev']; + } + + function getHeadRev ($projectid, $file) + { + $path = 'file:///' . CODEPOT_SVNREPO_DIR . '/' . $projectid . '/' . $file; + + $info = @svn_log ($path, SVN_REVISION_HEAD, SVN_REVISION_INITIAL, 1, SVN_OMIT_MESSAGES); + if ($info === FALSE) return FALSE; + if (count($info) != 1) return FALSE; + return $info[0]['rev']; + } + } ?> diff --git a/codepot/src/codepot/views/Makefile.am b/codepot/src/codepot/views/Makefile.am index ee85d56b..d1a765eb 100644 --- a/codepot/src/codepot/views/Makefile.am +++ b/codepot/src/codepot/views/Makefile.am @@ -14,6 +14,7 @@ www_DATA = \ project_list.php \ projectbar.php \ source_blame.php \ + source_diff.php \ source_file.php \ source_folder.php \ source_history.php \ diff --git a/codepot/src/codepot/views/Makefile.in b/codepot/src/codepot/views/Makefile.in index 5865189f..7148cb6f 100644 --- a/codepot/src/codepot/views/Makefile.in +++ b/codepot/src/codepot/views/Makefile.in @@ -177,6 +177,7 @@ www_DATA = \ project_list.php \ projectbar.php \ source_blame.php \ + source_diff.php \ source_file.php \ source_folder.php \ source_history.php \ diff --git a/codepot/src/codepot/views/file_home.php b/codepot/src/codepot/views/file_home.php index 9a414f53..a254f15f 100644 --- a/codepot/src/codepot/views/file_home.php +++ b/codepot/src/codepot/views/file_home.php @@ -34,7 +34,7 @@ $this->load->view (
lang->line('Files')?>
-
+
'; - print ''; + print ''; + print ''; print ''; print ''; print ''; @@ -65,10 +65,13 @@ else print ''; $oldtag = ''; + $rownum = 0; + $rowclasses = array ('odd', 'even'); foreach ($files as $file) { $hexname = $this->converter->AsciiToHex ($file->name); - print ''; + $rowclass = $rowclasses[$rownum++ % 2]; + print ""; print ''; - print ''; + print ''; print ''; diff --git a/codepot/src/codepot/views/source_blame.php b/codepot/src/codepot/views/source_blame.php index 384ffc40..b9559784 100644 --- a/codepot/src/codepot/views/source_blame.php +++ b/codepot/src/codepot/views/source_blame.php @@ -33,31 +33,29 @@ $this->load->view ( ); ?> - - - - -
id; -print anchor ($xpar, htmlspecialchars($project->name)); +if ($revision <= 0) +{ + $revreq = ''; + $revreqroot = ''; +} +else +{ + //$revreq = ($file['created_rev'] == $file['head_rev'])? '': "/{$file['created_rev']}"; + //$revreqroot = ($revreq == '')? '': ('/' . $this->converter->AsciiToHex ('.') . $revreq); + $revreq = "/{$revision}"; + $revreqroot = '/' . $this->converter->AsciiToHex ('.') . $revreq; +} + +print anchor ( + "/source/folder/{$project->id}{$revreqroot}", + htmlspecialchars($project->name)); + if ($folder != '') { $exps = explode ('/', $folder); @@ -65,39 +63,59 @@ if ($folder != '') $par = ''; for ($i = 1; $i < $expsize; $i++) { + print '/'; + $par .= '/' . $exps[$i]; $hexpar = $this->converter->AsciiToHex ($par); - print '/'; - $xpar = 'source/folder/' . $project->id . '/' . $hexpar; - if ($revision != SVN_REVISION_HEAD) $xpar .= '/' . $revision; - print anchor ($xpar, htmlspecialchars($exps[$i])); + print anchor ( + "source/folder/{$project->id}/{$hexpar}{$revreq}", + htmlspecialchars($exps[$i])); } } -$par = $folder . '/' . $file['name']; -$par = $this->converter->AsciiTohex ($par); + print '/'; -$xpar = '/source/blame/' . $project->id . '/' . $par; -if ($revision != SVN_REVISION_HEAD) $xpar .= '/' . $revision; -print anchor ($xpar, htmlspecialchars($file['name'])); + +$par = $this->converter->AsciiTohex ("{$folder}/{$file['name']}"); +print anchor ( + "/source/blame/{$project->id}/{$par}{$revreq}", + htmlspecialchars($file['name'])); ?>
+
+id}/${par}/{$file['prev_rev']}", '<<')?> +lang->line('Revision')?>: +id}/${par}/{$file['next_rev']}", '>>')?> | +lang->line('Author')?>: | +lang->line('Size')?>: | +lang->line('Last updated on')?>: +
+ +
 
+
+
+
+
+
+
+
+
+
+
+
+<?=htmlspecialchars($project->name)?>
+
+
+
+
+
+ + + +load->view ('taskbar'); ?> + + + +load->view ( + 'projectbar', + array ( + 'pageid' => 'source', + 'ctxmenuitems' => array () + ) +); +?> + + + +
+ +
+id; +print anchor ($xpar, htmlspecialchars($project->name)); +if ($folder != '') +{ + $exps = explode ('/', $folder); + $expsize = count($exps); + $par = ''; + for ($i = 1; $i < $expsize; $i++) + { + $par .= '/' . $exps[$i]; + $hexpar = $this->converter->AsciiToHex ($par); + print '/'; + $xpar = 'source/folder/' . $project->id . '/' . $hexpar; + if ($revision1 != SVN_REVISION_HEAD) $xpar .= '/' . $revision1; + print anchor ($xpar, htmlspecialchars($exps[$i])); + } +} +$par = $folder . '/' . $file['name']; +$par = $this->converter->AsciiTohex ($par); +print '/'; +$xpar = '/source/file/' . $project->id . '/' . $par; +if ($revision1 != SVN_REVISION_HEAD) $xpar .= '/' . $revision1; +print anchor ($xpar, htmlspecialchars($file['name'])); +?> +
+ + + + +
+lang->line('Revision')?>: | +lang->line('Author')?>: | +lang->line('Size')?>: | +lang->line('Last updated on')?>: +
+ + + + +
+
' . $this->lang->line('Tag') . '' . $this->lang->line('Name') . '' . $this->lang->line('Summary') . '
'; if ($file->tag != $oldtag) { @@ -82,9 +85,9 @@ else print ''; print htmlspecialchars($file->summary); print ''; + print ''; print $file->md5sum; - print ''; print anchor ("file/get/{$project->id}/{$hexname}", $this->lang->line('Download')); print '
+'; + print_r ($file['content']); + print ''; + */ + + print ''; + print ''; + + print ''; + print ''; + + if (empty($file['content'])) + { + print ''; + print ''; + print ''; + } + else + { + foreach ($file['content'] as $x) + { + print ''; + + if (array_key_exists('rev1line', $x)) + { + $diffclass = array_key_exists('rev1diffclass', $x)? $x['rev1diffclass']: 'diff'; + print "'; + } + else + { + print ''; + } + + if (array_key_exists('rev2line', $x)) + { + $diffclass = array_key_exists('rev2diffclass', $x)? $x['rev2diffclass']: 'diff'; + print "'; + } + else + { + print ''; + } + + print ''; + } + } +?> +
'; + + $currev = $file['created_rev']; + $prevrev = $file['against']['prev_rev']; + $prevanc = "source/diff/{$project->id}/{$par}/{$currev}/{$prevrev}"; + print anchor ($prevanc, '<<'); + print '   '; + + print $this->lang->line('Revision'); + print ' '; + print $file['against']['created_rev']; + + $currev = $file['created_rev']; + $nextrev = $file['against']['next_rev']; + $nextanc = "source/diff/{$project->id}/{$par}/{$currev}/{$nextrev}"; + print '   '; + print anchor ($nextanc, '>>'); + + print ''; + + $currev = $file['against']['created_rev']; + $prevrev = $file['prev_rev']; + $prevanc = "source/diff/{$project->id}/{$par}/{$prevrev}/{$currev}"; + print anchor ($prevanc, '<<'); + print '   '; + + print $this->lang->line('Revision'); + print ' '; + print $file['created_rev']; + + $currev = $file['against']['created_rev']; + $nextrev = $file['next_rev']; + $nextanc = "source/diff/{$project->id}/{$par}/{$nextrev}/{$currev}"; + print '   '; + print anchor ($nextanc, '>>'); + + print '
'; + print htmlspecialchars ($this->lang->line('MSG_NO_DIFF')); + print '
"; + print "
";
+				print htmlspecialchars($x['rev1line']);
+				print '
'; + print '
'; + print $x['rev1lineno']; + print '"; + print "
";
+				print htmlspecialchars($x['rev2line']);
+				print '
'; + print '
'; + print $x['rev2lineno']; + print '
+
+ +
+ + + + + +load->view ('footer'); ?> + + + +
+ + + + + diff --git a/codepot/src/codepot/views/source_file.php b/codepot/src/codepot/views/source_file.php index ff3ca8e9..3d536a67 100644 --- a/codepot/src/codepot/views/source_file.php +++ b/codepot/src/codepot/views/source_file.php @@ -32,30 +32,30 @@ $this->load->view ( ) ); ?> - - - -
-
+
id; -print anchor ($xpar, htmlspecialchars($project->name)); +if ($revision <= 0) +{ + $revreq = ''; + $revreqroot = ''; +} +else +{ + //$revreq = ($file['created_rev'] == $file['head_rev'])? '': "/{$file['created_rev']}"; + //$revreqroot = ($revreq == '')? '': ('/' . $this->converter->AsciiToHex ('.') . $revreq); + $revreq = "/{$revision}"; + $revreqroot = '/' . $this->converter->AsciiToHex ('.') . $revreq; +} + +print anchor ( + "/source/folder/{$project->id}{$revreqroot}", + htmlspecialchars($project->name)); + if ($folder != '') { $exps = explode ('/', $folder); @@ -63,36 +63,52 @@ if ($folder != '') $par = ''; for ($i = 1; $i < $expsize; $i++) { + print '/'; + $par .= '/' . $exps[$i]; $hexpar = $this->converter->AsciiToHex ($par); - print '/'; - $xpar = 'source/folder/' . $project->id . '/' . $hexpar; - if ($revision != SVN_REVISION_HEAD) $xpar .= '/' . $revision; - print anchor ($xpar, htmlspecialchars($exps[$i])); + print anchor ( + "source/folder/{$project->id}/{$hexpar}{$revreq}", + htmlspecialchars($exps[$i])); } } -$par = $folder . '/' . $file['name']; -$par = $this->converter->AsciiTohex ($par); + print '/'; -$xpar = '/source/file/' . $project->id . '/' . $par; -if ($revision != SVN_REVISION_HEAD) $xpar .= '/' . $revision; -print anchor ($xpar, htmlspecialchars($file['name'])); + +$par = $this->converter->AsciiTohex ("{$folder}/{$file['name']}"); +print anchor ( + "/source/file/{$project->id}/{$par}{$revreq}", + htmlspecialchars($file['name'])); ?>
- +
+id}/${par}/{$file['prev_rev']}", '<<')?> +lang->line('Revision')?>: +id}/${par}/{$file['next_rev']}", '>>')?> | +lang->line('Author')?>: | +lang->line('Size')?>: | +lang->line('Last updated on')?>: +
+ load->view ( - += 0): ?> + + @@ -46,7 +47,18 @@ $this->load->view (
id, htmlspecialchars($project->name)); +if ($revision <= 0) +{ + $revreq = ''; + $revreqroot = ''; +} +else +{ + $revreq = "/{$revision}"; + $revreqroot = '/' . $this->converter->AsciiToHex ('.') . $revreq; +} + +print anchor ("/source/folder/{$project->id}{$revreqroot}", htmlspecialchars($project->name)); if ($folder != '') { $exps = explode ('/', $folder); @@ -54,10 +66,11 @@ if ($folder != '') $par = ''; for ($i = 1; $i < $expsize; $i++) { + print '/'; + $par .= '/' . $exps[$i]; $hexpar = $this->converter->AsciiToHex ($par); - print '/'; - print anchor ('source/folder/' . $project->id . '/' . $hexpar, htmlspecialchars($exps[$i])); + print anchor ("source/folder/{$project->id}/{$hexpar}{$revreq}", htmlspecialchars($exps[$i])); } } ?> @@ -82,32 +95,45 @@ if ($folder != '') else { print ''; usort ($files, 'comp_files'); - print ''; - print ''; + print '
'; + print '
'; + print ''; print ''; print ''; print ''; print ''; print ''; + print ''; + print ''; print ''; + + $rowclasses = array ('even', 'odd'); + $rownum = 0; foreach ($files as $f) { $fullpath = $folder . '/' . $f['name']; + $rowclass = $rowclasses[++$rownum % 2]; if ($f['type'] === 'dir') { // directory - print ''; + $hexpath = $this->converter->AsciiToHex($fullpath); + print ""; print ''; print ''; - print ''; + print ''; + print ''; + print ''; print ''; } else { // file - print ''; + $hexpath = $this->converter->AsciiToHex($fullpath); + print ""; print ''; print ''; - print ''; + + print ''; + print ''; print ''; } } print '
' . $this->lang->line('Name') . '' . $this->lang->line('Revision') . '' . $this->lang->line('Size') . '' . $this->lang->line('Author') . '' . $this->lang->line('Time') . '' . '' . '
'; - $url = 'source/folder/' . $project->id . '/' . - $this->converter->AsciiToHex ($fullpath); - print anchor ($url, htmlspecialchars($f['name'])); + print anchor ( + "source/folder/{$project->id}/{$hexpath}{$revreq}", + htmlspecialchars($f['name'])); print ''; print $f['created_rev']; @@ -116,19 +142,22 @@ if ($folder != '') print ''; print htmlspecialchars($f['last_author']); print ''; + print ''; print date('r', $f['time_t']); - print '
'; - $url = 'source/file/' . $project->id . '/' . - $this->converter->AsciiToHex($fullpath); - print anchor ($url, htmlspecialchars($f['name'])); + print anchor ( + "source/file/{$project->id}/{$hexpath}{$revreq}", + htmlspecialchars($f['name'])); print ''; print $f['created_rev']; @@ -139,13 +168,25 @@ if ($folder != '') print ''; print htmlspecialchars($f['last_author']); print ''; + print ''; print date('r', $f['time_t']); + print ''; + print anchor ( + "source/blame/{$project->id}/{$hexpath}{$revreq}", + $this->lang->line('Blame')); + print ''; + print anchor ( + "source/diff/{$project->id}/{$hexpath}{$revreq}", + $this->lang->line('Difference')); print '
'; + print '
'; } ?> diff --git a/codepot/src/codepot/views/source_history.php b/codepot/src/codepot/views/source_history.php index 7dfb2ac6..ce012004 100644 --- a/codepot/src/codepot/views/source_history.php +++ b/codepot/src/codepot/views/source_history.php @@ -66,19 +66,22 @@ if ($type == 'file') { $par = $folder; $par = $this->converter->AsciiTohex ($par); - $xpar = 'source/file/' . $project->id . '/' . $par; + $xpar = "source/file/{$project->id}/{$par}"; print anchor ($xpar, $this->lang->line('Details')); print ' | '; - $xpar = 'source/blame/' . $project->id . '/' . $par; + $xpar = "source/blame/{$project->id}/{$par}"; print anchor ($xpar, $this->lang->line('Blame')); + print ' | '; + $xpar = "source/diff/{$project->id}/{$par}"; + print anchor ($xpar, $this->lang->line('Difference')); } ?>
-
- - +
+
+ @@ -86,26 +89,28 @@ if ($type == 'file') 0; ) { $h = $history[--$i]; - print ''; + $rowclass = $rowclasses[($history_count - $i) % 2]; + print ""; print ''; print ''; - print ''; + print ''; print ''; } diff --git a/codepot/src/config.php.in b/codepot/src/config.php.in index 1264c30e..9344d928 100644 --- a/codepot/src/config.php.in +++ b/codepot/src/config.php.in @@ -50,10 +50,28 @@ function load_ini ($file) if (array_key_exists ($idx, $cfg)) { $rawval = $cfg[$idx]; - if ($x[1] == 'string') define ($const, $rawval); - else if ($x[1] == 'boolean') define ($const, strcasecmp ($rawval, 'yes') == 0); - else if ($x[1] == 'integer') define ($const, intval ($rawval)); - else define ($const, $x[2]); + if ($x[1] == 'string') + { + define ($const, $rawval); + } + else if ($x[1] == 'boolean') + { + if (is_bool($rawval)) + define ($const, $rawval); + else if (is_numeric($rawval) === TRUE) + define ($const, $rawval != 0); + else + define ($const, strcasecmp ($rawval, 'yes') == 0); + } + else if ($x[1] == 'integer') + { + define ($const, intval ($rawval)); + } + else + { + // set the default value + define ($const, $x[2]); + } } else define ($const, $x[2]); } diff --git a/codepot/src/css/Makefile.am b/codepot/src/css/Makefile.am index 2580e954..4f77d85f 100644 --- a/codepot/src/css/Makefile.am +++ b/codepot/src/css/Makefile.am @@ -3,7 +3,8 @@ SUBDIRS = images wwwdir=$(WWWDIR)/css www_DATA = \ common.css \ - project.css + project.css \ + websvn.css EXTRA_DIST = $(www_DATA) diff --git a/codepot/src/css/Makefile.in b/codepot/src/css/Makefile.in index f03e0997..1d8c53da 100644 --- a/codepot/src/css/Makefile.in +++ b/codepot/src/css/Makefile.in @@ -205,7 +205,8 @@ wwwdir = $(WWWDIR)/css SUBDIRS = images www_DATA = \ common.css \ - project.css + project.css \ + websvn.css EXTRA_DIST = $(www_DATA) all: all-recursive diff --git a/codepot/src/css/common.css b/codepot/src/css/common.css index 5adcc812..f9a3266a 100644 --- a/codepot/src/css/common.css +++ b/codepot/src/css/common.css @@ -1,12 +1,10 @@ -ody { - //margin: 0; +body { padding: 0; margin: 5px 5px 5px 5px; } .content { - //margin: 2px 2px 2px 2px; font-size: 90%; font-family: sans-serif; } @@ -178,109 +176,76 @@ ody { border: 1px solid #BBCCDD; } -.content .mainarea table { - border-collapse:collapse; - border-bottom: 2px solid #BBCCDD; - margin-top: 0.5em; - margin-bottom: 0.5em; -} - .content .mainarea .icon { border: 0; } -.content .mainarea table th { - color:#FFFFFF; - background-color: #7777FF; - font-weight: normal; +.content .mainarea pre { + padding: .3em .3em .3em .3em; + border: 1px dashed #BBCCDD; + background-color: #F1F1FF; + overflow: auto; + width: inherit; +} + +.content .mainarea tt { + padding: .1em .1em .1em .1em; + background-color: #F1F1FF; +} + +.content .mainarea tt:hover { + background-color: inherit; +} + +.content .mainarea table { + font-size: inherit; + background-color: inherit; +} + +.content .mainarea table tr.heading { + color: #FFFFFF; + background-color: #7777FF; +} + +.content .mainarea table tr.heading a { + color: inherit; + background-color: inherit; + text-decoration: none; +} + +.content .mainarea table tr.odd { + background-color: inherit; +} + +.content .mainarea table tr.even { + background-color: #EEEEFF; +} + +.content .mainarea table tr th { white-space: nowrap; } -.content .mainarea table tr:hover { - background-color: #BBCCFF; -} - -.content .mainarea table td { +.content .mainarea table tr td { padding-left: 0.2em; padding-right: 0.2em; } -.content .mainarea table td img { +.content .mainarea table tr td img { vertical-align: middle; display:inline-block; } -.content .mainarea pre, -.content .mainarea tt, -.content .mainarea .codebox { - padding: .3em .3em .3em .3em; - border: 1px dashed #BBCCDD; - background-color: #F1F1FF; -} - -.content .mainarea .codebox pre, -.content .mainarea .codebox tt { - padding: 0; - border: 0; -} - -.content .mainarea table td.code { +.content .mainarea table tr td.code { white-space: nowarp; } -.content .mainarea table td.code pre { +.content .mainarea table tr td.code pre { padding: 0; margin: 0; -} - -.content .mainarea table td.code pre { - padding: 0; border: 0 none; background-color: inherit; } -.content .mainarea table tbody tr.diffcode td.diff pre { - display:block; - height:100%; - margin: 0; - padding: 0; - padding-left:22px; - border: 0 none; - background-color: inherit; -} - -.content .mainarea table tbody td.diffdeleted pre { - border:1px solid #e8d4bc; - background-color:#f8e4cc; - background-image:url(images/bullet_delete.png); - background-position:2px 50%; - background-repeat:no-repeat; - padding: 0; - padding-left:22px; - margin: 0; -} - -.content .mainarea table tbody tr.diffcode td.diffadded pre { - border:1px solid #cdf0cd; - background-color:#ddffdd; - background-image:url(images/bullet_add.png); - background-repeat:no-repeat; - background-position:2px 50%; - padding: 0; - padding-left:22px; - margin: 0; -} -.content .mainarea table tbody tr.diffcode td.diffchanged pre { - border:1px solid #f0f0bc; - background-color:#ffffcc; - background-image:url(images/bullet_yellow.png); - background-repeat:no-repeat; - background-position:2px 50%; - padding: 0; - padding-left:22px; - margin: 0; -} - .content .mainarea pre.prettyprint { /* anything that make prettyprint area different from other pres? */ background-color: #FFFFFF; @@ -336,8 +301,19 @@ pre.prettyprint .nocode a:hover { } } +.content .infostrip { + font-size: 0.9em; + background: #E5ECF9 none repeat scroll 0 0; + margin: 0.3em 0em 0em 0em; + padding: 0.3em 0.3em 0.3em 0.3em; + text-align: right; +} + +.content .infostrip a { + text-decoration: none; +} + .content .sidebar { - /* sidebar to show extra information holding one or more infoboxes */ font-size: 0.9em; float: right; width: 20em; @@ -398,10 +374,6 @@ pre.prettyprint .nocode a:hover { padding: 0.2em 0 0.2em 1em; } - -.content .sidebar a:hover { -} - .content .footer { padding: 0.3em 0em 0.3em 0em; font-size: .9em; diff --git a/codepot/src/css/project.css b/codepot/src/css/project.css index 4eaca2d3..2191c44e 100644 --- a/codepot/src/css/project.css +++ b/codepot/src/css/project.css @@ -1,5 +1,110 @@ -/* specific IDs */ +/* + * This file contains specific IDs for furthur customization. + */ -#project_list_mainarea { +/*----------------------------------------------- + * project source folder view + *-----------------------------------------------*/ +#project_source_folder_mainarea_result { + overflow: auto; +} + +#project_source_folder_mainarea_result_table tr { + vertical-align: top; + white-space: nowrap; +} + +/*----------------------------------------------- + * project source folder view + *-----------------------------------------------*/ +#project_file_home_mainarea_result { + overflow: auto; +} + +#project_file_home_mainarea_result_table tr { + vertical-align: top; + white-space: nowrap; +} + +/*----------------------------------------------- + * project source history view + *-----------------------------------------------*/ +#project_source_history_mainarea_result { + overflow: auto; +} + +#project_source_history_mainarea_result_table tr { + vertical-align: top; + white-space: nowrap; +} + +#project_source_history_mainarea_result_table_path_list { + /* the list in the 'paths' column */ + margin: 0; + padding: 0; + list-style: none; + white-space: nowrap; +} + +/*----------------------------------------------- + * project source diff view + *-----------------------------------------------*/ +#project_source_diff_mainarea_result { + overflow: auto; +} + +#project_source_diff_mainarea_result_table { + border: 0; +} + +#project_source_diff_mainarea_result_table tr.diff td pre { + background-color: inherit; + border: 0; + margin: 0; + padding: 0; +} + +#project_source_diff_mainarea_result_table tr.diff td.diff { + padding: 0; + padding-left:22px; + margin: 0; +} + +#project_source_diff_mainarea_result_table tr.diff td.diffrow { + font-style: italic; + font-weight: bold; +} + +#project_source_diff_mainarea_result_table tr.diff td.diffadded { + border:1px solid #cdf0cd; + background-color:#ddffdd; + background-image:url(images/bullet_add.png); + background-repeat:no-repeat; + background-position:2px 50%; + padding: 0; + padding-left:22px; + margin: 0; +} + +#project_source_diff_mainarea_result_table tr.diff td.diffdeleted { + border:1px solid #e8d4bc; + background-color:#f8e4cc; + background-image:url(images/bullet_delete.png); + background-position:2px 50%; + background-repeat:no-repeat; + padding: 0; + padding-left:22px; + margin: 0; +} + +#project_source_diff_mainarea_result_table tr.diff td.diffchanged { + border:1px solid #f0f0bc; + background-color:#ffffcc; + background-image:url(images/bullet_yellow.png); + background-repeat:no-repeat; + background-position:2px 50%; + padding: 0; + padding-left:22px; + margin: 0; } diff --git a/codepot/src/css/websvn.css b/codepot/src/css/websvn.css new file mode 100644 index 00000000..ec5b0679 --- /dev/null +++ b/codepot/src/css/websvn.css @@ -0,0 +1,90 @@ + +/*----------------------------------------------- + * websvn source folder view + *-----------------------------------------------*/ +#websvn_folder_mainarea_result { + overflow: auto; +} + +#websvn_folder_mainarea_result_table { + border: 0; + border-collapse: collapse; + vertical-align: top; +} + +#websvn_folder_mainarea_result_table tr { + border: 0; + margin: 0; + padding: 0; + white-space: nowrap; +} + +#websvn_folder_mainarea_result_table tr td { + margin: 0; + padding: 0; + padding-left: 0.2em; + padding-right: 0.2em; +} + +/*----------------------------------------------- + * websvn source diff view + *-----------------------------------------------*/ +#websvn_diff_mainarea_result { + overflow: auto; +} + +#websvn_diff_mainarea_result_table { + border: 0; +} + +#websvn_diff_mainarea_result_table tr.diff pre { + background-color: inherit; + border: 0; + margin: 0; + padding: 0; +} + +#websvn_diff_mainarea_result_table tr.diff td.diff { + padding: 0; + padding-left:22px; + margin: 0; +} + +#websvn_diff_mainarea_result_table tr.diff td.diffrow { + font-style: italic; + font-weight: bold; +} + +#websvn_diff_mainarea_result_table tr.diff td.diffadded { + border:1px solid #cdf0cd; + background-color:#ddffdd; + background-image:url(images/bullet_add.png); + background-repeat:no-repeat; + background-position:2px 50%; + padding: 0; + padding-left:22px; + margin: 0; +} + +#websvn_diff_mainarea_result_table tr.diff td.diffdeleted { + border:1px solid #e8d4bc; + background-color:#f8e4cc; + background-image:url(images/bullet_delete.png); + background-position:2px 50%; + background-repeat:no-repeat; + padding: 0; + padding-left:22px; + margin: 0; +} + +#websvn_diff_mainarea_result_table tr.diff td.diffchanged { + border:1px solid #f0f0bc; + background-color:#ffffcc; + background-image:url(images/bullet_yellow.png); + background-repeat:no-repeat; + background-position:2px 50%; + padding: 0; + padding-left:22px; + margin: 0; +} + diff --git a/codepot/src/websvn/include/svnlook.php b/codepot/src/websvn/include/svnlook.php index b6e02f18..11395024 100644 --- a/codepot/src/websvn/include/svnlook.php +++ b/codepot/src/websvn/include/svnlook.php @@ -549,7 +549,7 @@ class SVNRepository { @exec($cmd); // Get the file as a string (memory hogging, but we have no other options) - $content = highlight_file($filename, true); + $content = '
' . highlight_file($filename, true) . '
'; // Destroy the previous version, and replace it with the highlighted version $f = fopen($filename, "w"); @@ -664,7 +664,9 @@ class SVNRepository { @exec($cmd); $tmpStr = file_get_contents($tmp); $tmpStr = str_replace(array("\r\n"), array("\n"), $tmpStr); + print '
';
       highlight_string($tmpStr);
+      print '
'; @unlink($tmp); } else if ($l !== null && $config->useGeshi) { $tmp = tempnam("temp", "wsvn"); diff --git a/codepot/src/websvn/templates/calm/diff.tmpl b/codepot/src/websvn/templates/calm/diff.tmpl index f4db299f..88b61146 100755 --- a/codepot/src/websvn/templates/calm/diff.tmpl +++ b/codepot/src/websvn/templates/calm/diff.tmpl @@ -26,7 +26,7 @@ -
+
[websvn-test:noaccess] [lang:NOACCESS] @@ -49,26 +49,26 @@ [websvn:fileviewloglink]
-
+
[websvn-test:noprev] [lang:NOPREVREV] [websvn-else] -
lang->line('Revision')?> lang->line('Author')?> lang->line('Time')?>lang->line('Files')?>
'; $hexfolder = $this->converter->AsciiToHex(($folder == '')? '.': $folder); - print anchor ("/source/$type/" . $project->id . '/' . $hexfolder . '/' . $h['rev'], $h['rev']); + print anchor ("/source/$type/{$project->id}/{$hexfolder}/{$h['rev']}", $h['rev']); print ''; print htmlspecialchars($h['author']); print ''; + print ''; print date('r', strtotime($h['date'])); - print ''; print htmlspecialchars($h['msg']); @@ -115,15 +120,19 @@ if ($type == 'file') if (count($paths) > 0) { print ''; + print '
    '; foreach ($paths as $p) { print '
  • '; + print ''; print '['; print $p['action']; print '] '; print_path ($project, $p['path'], 'file', $this->converter, $h['rev']); + print ''; print '
  • '; } + print '
'; print '
- +
+ [websvn-startlisting] [websvn-test:rev1lineno] - - - + + + [websvn-else] - + diff --git a/codepot/src/websvn/templates/calm/directory.tmpl b/codepot/src/websvn/templates/calm/directory.tmpl index 0a7b836e..69ff71e4 100755 --- a/codepot/src/websvn/templates/calm/directory.tmpl +++ b/codepot/src/websvn/templates/calm/directory.tmpl @@ -62,7 +62,7 @@ [websvn-endtest] -
+
[websvn-defineicons] dir=[FOLDER] @@ -92,9 +92,9 @@ e-node=[
 [websvn-enddefineicons]
 
 [websvn:compare_form]
-   <table>
+   <table id=
- + diff --git a/codepot/src/websvn/templates/calm/file.tmpl b/codepot/src/websvn/templates/calm/file.tmpl index c7a865f2..80029c05 100755 --- a/codepot/src/websvn/templates/calm/file.tmpl +++ b/codepot/src/websvn/templates/calm/file.tmpl @@ -41,9 +41,7 @@ [websvn:fileviewloglink] -
- [websvn-getlisting] -
+ [websvn-getlisting] [websvn-endtest] diff --git a/codepot/src/websvn/templates/calm/header.tmpl b/codepot/src/websvn/templates/calm/header.tmpl index 9a705aad..92893657 100755 --- a/codepot/src/websvn/templates/calm/header.tmpl +++ b/codepot/src/websvn/templates/calm/header.tmpl @@ -6,6 +6,7 @@ + [websvn-test:rssurl]
[lang:REV] [websvn:rev2] [lang:REV] [websvn:rev1]
[lang:LINE] [websvn:rev1lineno]...[lang:LINE] [websvn:rev2lineno]...
[lang:LINE] [websvn:rev1lineno]...[lang:LINE] [websvn:rev2lineno]...
[websvn:rev1line]
[websvn:rev2line]
    [lang:PATH]