X-Git-Url: https://scm.fusionforge.org/anonscm/gitweb?p=fusionforge%2Ffusionforge.git;a=blobdiff_plain;f=src%2Fplugins%2Fscmdarcs%2Fcommon%2FDarcsPlugin.class.php;h=016cc139daeb064ba3370d5a6d7bc8552fbd788d;hp=0d51613c8c1e7dd81ece89fb1391ae483a0eacdb;hb=843ccaa9f4fd56870b51c1dbcdc3f860971714c4;hpb=6d2bac6822ae36a9f50ea5bc7b007e84f6e8ae76 diff --git a/src/plugins/scmdarcs/common/DarcsPlugin.class.php b/src/plugins/scmdarcs/common/DarcsPlugin.class.php index 0d51613c8c..016cc139da 100644 --- a/src/plugins/scmdarcs/common/DarcsPlugin.class.php +++ b/src/plugins/scmdarcs/common/DarcsPlugin.class.php @@ -1,7 +1,9 @@ checkParams ($params) ; if (!$project) { - return false ; + return; } - if ($project->usesPlugin($this->name)) { + if ($project->usesPlugin($this->name) && forge_check_perm('scm', $project->getID(), 'read')) { $result = db_query_params('SELECT sum(commits) AS commits, sum(adds) AS adds FROM stats_cvs_group WHERE group_id=$1', array ($project->getID())) ; $commit_num = db_result($result,0,'commits'); @@ -84,7 +86,11 @@ class DarcsPlugin extends SCMPlugin { } function getBlurb () { - return '

' . _('Documentation for Darcs is available here.') . '

'; + return '

' + . sprintf(_('Documentation for %1$s is available at %2$s.'), + 'Darcs', + 'http://darcs.net/') + . '

'; } function getInstructionForDarcs ($project, $rw) { @@ -107,16 +113,16 @@ class DarcsPlugin extends SCMPlugin { $b = '

darcs get ' . $url . '

'; if (count($repo_names) > 1) { - $b .= _('

where REPO can be: ') . implode(_(', '), $repo_names) . '

'; + $b .= '

'._('where REPO can be: ') . implode(_(', '), $repo_names) . '

'; } } else if (is_dir($this->getRootRepositories($project))) { - $b = _('

No repositories defined.

'); + $b = '

'._('No repositories defined.').'

'; } else { - $b = _('

Repository not yet created, wait an hour.

'); + $b = '

'._('Repository not yet created, wait an hour.').'

'; }; return $b ; } @@ -135,10 +141,16 @@ class DarcsPlugin extends SCMPlugin { function getInstructionsForRW ($project) { $b = '

'; - $b .= _('Developer Darcs Access via SSH'); + $b .= sprintf(_('Developer %s Access via SSH'), 'Darcs'); $b .= '

'; $b .= '

'; - $b .= ('Only project developers can access the Darcs tree via this method. SSH must be installed on your client machine. Substitute developername with the proper values. Enter your site password when prompted.'); + $b .= sprintf(_('Only project developers can access the %s tree via this method.'), 'Darcs'); + $b .= ' '; + $b .= _('SSH must be installed on your client machine.'); + $b .= ' '; + $b .= _('Substitute developername with the proper values.'); + $b .= ' '; + $b .= _('Enter your site password when prompted.'); $b .= '

'; $b .= $this->getInstructionForDarcs($project, true); return $b ; @@ -160,9 +172,11 @@ class DarcsPlugin extends SCMPlugin { function getBrowserLinkBlock ($project) { global $HTML ; - $b = $HTML->boxMiddle(_('Darcs Repository Browser')); + $b = $HTML->boxMiddle(sprintf(_('%s Repository Browser'), 'Darcs')); $b .= '

'; - $b .= _('Browsing the Darcs tree gives you a view into the current status of this project\'s code. You may also view the complete histories of any file in the repository.'); + $b .= sprintf(_("Browsing the %s tree gives you a view into the current status of this project's code."), 'Darcs'); + $b .= ' '; + $b .= _('You may also view the complete histories of any file in the repository.'); $b .= '

'; $repo_names = $this->getRepositories($project); if (count($repo_names) > 0) @@ -171,13 +185,13 @@ class DarcsPlugin extends SCMPlugin { { $b .= '

[' ; $b .= util_make_link ("/scm/browser.php?group_id=".$project->getID()."&repo_name=".$repo_name, - _('Browse Darcs Repository '. $repo_name)); + sprintf(_('Browse %s Repository'), 'Darcs') .' ' . $repo_name); $b .= ']

' ; } } else { - $b .= _('

No repositories to browse

'); + $b .= '

'._('No repositories to browse').'

'; } return $b ; } @@ -224,11 +238,9 @@ class DarcsPlugin extends SCMPlugin { } function printBrowserPage ($params) { - global $HTML; - $project = $this->checkParams ($params) ; if (!$project) { - return false ; + return; } if ($project->usesPlugin ($this->name)) { @@ -615,10 +627,10 @@ class DarcsPlugin extends SCMPlugin { implode(_(', '), $nm) . '

'; } - print '

Create new repository:

'; - print '

'._('Repository name: '). - '

'; - print '

'._('Clone: '). + print '

'._('Create new repository:') . '

'; + print '

'._('Repository name')._(': '); + print '

'; + print '

'._('Clone')._(': '). '