ENHANCEMENT: if viewing site on current version, do not include version in the parsed links

This commit is contained in:
Will Rossiter 2011-07-04 12:05:22 +12:00
parent 762eb2323b
commit cb19549a97
3 changed files with 5 additions and 2 deletions

View File

@ -234,8 +234,8 @@ class DocumentationEntity extends ViewableData {
}
function getRelativeLink($version = false, $lang = false) {
if(!$version) $version = $this->getLatestVersion();
if(!$lang) $lang = 'en';
if($version == $this->getLatestVersion()) $version = false;
return Controller::join_links(
DocumentationViewer::get_link_base(),

View File

@ -33,6 +33,9 @@ class DocumentationPageTest extends SapphireTest {
// test with version.
$entity = DocumentationService::register("versionlinks", BASE_PATH . "/sapphiredocs/tests/docs-v2.4/", '1');
$entity->addVersion('2', BASE_PATH . "/sapphiredocs/tests/docs-v3.0/");
$entity->setLatestVersion('2');
$page = new DocumentationPage();
$page->setRelativePath('test.md');
$page->setEntity($entity);