mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 09:05:56 +00:00
BUGFIX: changed $request to not return a null spaced array. Updated docs to reflect that
This commit is contained in:
parent
a07855109f
commit
3a94574ef6
@ -108,26 +108,26 @@ class DocumentationViewer extends Controller {
|
|||||||
// count the number of parameters after the language, version are taken
|
// count the number of parameters after the language, version are taken
|
||||||
// into account. This automatically includes ' ' so all the counts
|
// into account. This automatically includes ' ' so all the counts
|
||||||
// are 1 more than what you would expect
|
// are 1 more than what you would expect
|
||||||
|
|
||||||
if($this->Remaining) {
|
if($this->Remaining) {
|
||||||
$params = count(array_unique($this->Remaining));
|
|
||||||
|
|
||||||
switch($params) {
|
$paramCount = count($this->Remaining);
|
||||||
case '1':
|
|
||||||
return parent::getViewer('home');
|
if($paramCount == 1) {
|
||||||
case '2':
|
|
||||||
return parent::getViewer('folder');
|
return parent::getViewer('folder');
|
||||||
default:
|
}
|
||||||
if($module = $this->getModule()) {
|
else if($module = $this->getModule()) {
|
||||||
$params = $this->Remaining;
|
$params = $this->Remaining;
|
||||||
array_shift($params);
|
|
||||||
|
array_shift($params); // module name
|
||||||
|
|
||||||
$path = implode('/', array_unique($params));
|
$path = implode('/', array_unique($params));
|
||||||
}
|
|
||||||
|
|
||||||
if(is_dir($module->getPath() . $path)) return parent::getViewer('folder');
|
if(is_dir($module->getPath() . $path)) return parent::getViewer('folder');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
return parent::getViewer('home');
|
||||||
|
}
|
||||||
|
|
||||||
return parent::getViewer($action);
|
return parent::getViewer($action);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user