mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 11:05:56 +02:00
Resolve test failures
This commit is contained in:
parent
3753c331d4
commit
473b830867
@ -122,10 +122,8 @@ class DocumentationManifest {
|
|||||||
|
|
||||||
$key = (isset($details['Key'])) ? $details['Key'] : $details['Title'];
|
$key = (isset($details['Key'])) ? $details['Key'] : $details['Title'];
|
||||||
|
|
||||||
if($path && !is_dir($path)) {
|
if(!$path || !is_dir($path)) {
|
||||||
throw new Exception($path . ' is not a valid documentation directory');
|
throw new Exception($details['Path'] . ' is not a valid documentation directory');
|
||||||
} else if(!$path) {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$version = (isset($details['Version'])) ? $details['Version'] : '';
|
$version = (isset($details['Version'])) ? $details['Version'] : '';
|
||||||
|
@ -316,15 +316,19 @@ class DocumentationViewer extends Controller {
|
|||||||
$current = $this->getEntity();
|
$current = $this->getEntity();
|
||||||
|
|
||||||
foreach($entities as $entity) {
|
foreach($entities as $entity) {
|
||||||
|
$checkLang = $entity->getLanguage();
|
||||||
|
$checkVers = $entity->getVersion();
|
||||||
|
|
||||||
// only show entities with the same language
|
// only show entities with the same language or any entity that
|
||||||
if($entity->getLanguage() !== $this->getLanguage()) {
|
// isn't registered under any particular language (auto detected)
|
||||||
|
if($checkLang && $checkLang !== $this->getLanguage()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// only show entities with the same version
|
if($current && $checkVers) {
|
||||||
if($entity->getVersion() !== $current->getVersion()) {
|
if($entity->getVersion() !== $current->getVersion()) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$mode = 'link';
|
$mode = 'link';
|
||||||
@ -459,7 +463,7 @@ class DocumentationViewer extends Controller {
|
|||||||
* @return ArrayList
|
* @return ArrayList
|
||||||
*/
|
*/
|
||||||
public function getVersions() {
|
public function getVersions() {
|
||||||
return $this->manifest->getVersions($this->getEntity());
|
return $this->getManifest()->getVersions($this->getEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3,12 +3,11 @@
|
|||||||
class DocumentationSearchForm extends Form {
|
class DocumentationSearchForm extends Form {
|
||||||
|
|
||||||
public function __construct($controller) {
|
public function __construct($controller) {
|
||||||
|
$versions = HiddenField::create(
|
||||||
//pass through the current version
|
'Versions',
|
||||||
$page = $controller->getPage();
|
_t('DocumentationViewer.VERSIONS', 'Versions'),
|
||||||
if($page){
|
implode(',', $controller->getManifest()->getAllVersions())
|
||||||
$versions = HiddenField::create('Versions','Versions',$page->getEntity()->getVersion());
|
);
|
||||||
}
|
|
||||||
|
|
||||||
$fields = new FieldList(
|
$fields = new FieldList(
|
||||||
TextField::create('q', _t('DocumentationViewer.SEARCH', 'Search'), '')
|
TextField::create('q', _t('DocumentationViewer.SEARCH', 'Search'), '')
|
||||||
|
@ -48,7 +48,7 @@ class RebuildLuceneDocsIndex extends BuildTask {
|
|||||||
$index->removeReference();
|
$index->removeReference();
|
||||||
}
|
}
|
||||||
catch (Zend_Search_Lucene_Exception $e) {
|
catch (Zend_Search_Lucene_Exception $e) {
|
||||||
// user_error($e);
|
user_error($e);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -135,6 +135,7 @@
|
|||||||
$(this).removeClass('hover');
|
$(this).removeClass('hover');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
$(".search input").live("keyup", function(e) {
|
$(".search input").live("keyup", function(e) {
|
||||||
clearTimeout($.data(this, 'timer'));
|
clearTimeout($.data(this, 'timer'));
|
||||||
|
|
||||||
@ -185,7 +186,9 @@
|
|||||||
return false;
|
return false;
|
||||||
}, 100));
|
}, 100));
|
||||||
};
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
/** ---------------------------------------------
|
/** ---------------------------------------------
|
||||||
* LANGAUGE SELECTER
|
* LANGAUGE SELECTER
|
||||||
|
Loading…
Reference in New Issue
Block a user