mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 09:05:56 +00:00
43b6d42719
This major update changes the behaviour of the docviewer module to use a cached manifest rather than on demand. This allows us to simplify the URL matching and store 'nice' URL configuration rather than altering handleAction().
83 lines
1.3 KiB
PHP
83 lines
1.3 KiB
PHP
<?php
|
|
|
|
/**
|
|
* @package docsviewer
|
|
*/
|
|
class DocumentationEntityLanguage extends ViewableData {
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $language;
|
|
|
|
/**
|
|
* @var DocumentationEntityVersion
|
|
*/
|
|
protected $entity;
|
|
|
|
/**
|
|
* @param DocumentationEntityVersion $version
|
|
* @param string $language
|
|
*/
|
|
public function __construct(DocumentationEntityVersion $version, $language) {
|
|
$this->entity = $version;
|
|
$this->language = $language;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function Link() {
|
|
return Controller::join_links($this->entity->Link(), $this->language);
|
|
}
|
|
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getVersion() {
|
|
return $this->entity->getVersion();
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getLanguage() {
|
|
return $this->language;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getPath() {
|
|
return Controller::join_links($this->entity->getPath(), $this->language);
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getBasePath() {
|
|
return $this->entity->getPath();
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getTitle() {
|
|
return $this->entity->getTitle();
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getBaseFolder() {
|
|
return $this->entity->getBaseFolder();
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function getSupportedLanguages() {
|
|
return $this->entity->getSupportedLanguages();
|
|
}
|
|
} |