mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 11:05:56 +02: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
|
||||
// into account. This automatically includes ' ' so all the counts
|
||||
// are 1 more than what you would expect
|
||||
|
||||
if($this->Remaining) {
|
||||
$params = count(array_unique($this->Remaining));
|
||||
|
||||
switch($params) {
|
||||
case '1':
|
||||
return parent::getViewer('home');
|
||||
case '2':
|
||||
$paramCount = count($this->Remaining);
|
||||
|
||||
if($paramCount == 1) {
|
||||
return parent::getViewer('folder');
|
||||
default:
|
||||
if($module = $this->getModule()) {
|
||||
}
|
||||
else if($module = $this->getModule()) {
|
||||
$params = $this->Remaining;
|
||||
array_shift($params);
|
||||
|
||||
array_shift($params); // module name
|
||||
|
||||
$path = implode('/', array_unique($params));
|
||||
}
|
||||
|
||||
if(is_dir($module->getPath() . $path)) return parent::getViewer('folder');
|
||||
}
|
||||
}
|
||||
else {
|
||||
return parent::getViewer('home');
|
||||
}
|
||||
|
||||
return parent::getViewer($action);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user