summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-08-05 11:54:58 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-08-05 11:54:58 +0200
commita70f145d71808204193d3e1d63ad94bcf849b700 (patch)
tree3d7b02b2ea18da3879bc2122a518c804eaa1406f /lib
parent7243fc12289b6cb779701981e91b18d2aa1cd4f9 (diff)
parent8fb89056bd2f99b1df7dc7a3970fc293272c8ab6 (diff)
downloadnextcloud-server-a70f145d71808204193d3e1d63ad94bcf849b700.tar.gz
nextcloud-server-a70f145d71808204193d3e1d63ad94bcf849b700.zip
Merge pull request #17961 from owncloud/make_knowledgebase_configurable
make knowledge base url configurable
Diffstat (limited to 'lib')
-rw-r--r--lib/private/app.php3
-rw-r--r--lib/private/defaults.php19
2 files changed, 21 insertions, 1 deletions
diff --git a/lib/private/app.php b/lib/private/app.php
index 6c6f79dfa9d..74b21b2b107 100644
--- a/lib/private/app.php
+++ b/lib/private/app.php
@@ -421,6 +421,7 @@ class OC_App {
*/
public static function getSettingsNavigation() {
$l = \OC::$server->getL10N('lib');
+ $defaults = new OC_Defaults();
$settings = array();
// by default, settings only contain the help menu
@@ -431,7 +432,7 @@ class OC_App {
array(
"id" => "help",
"order" => 1000,
- "href" => OC_Helper::linkToRoute("settings_help"),
+ "href" => $defaults->getKnowledgeBaseUrl(),
"name" => $l->t("Help"),
"icon" => OC_Helper::imagePath("settings", "help.svg")
)
diff --git a/lib/private/defaults.php b/lib/private/defaults.php
index 16f45943f54..b86805357bd 100644
--- a/lib/private/defaults.php
+++ b/lib/private/defaults.php
@@ -46,9 +46,11 @@ class OC_Defaults {
private $defaultSlogan;
private $defaultLogoClaim;
private $defaultMailHeaderColor;
+ private $defaultKnowledgeBaseUrl;
function __construct() {
$this->l = \OC::$server->getL10N('lib');
+ $urlGenerator = \OC::$server->getURLGenerator();
$version = OC_Util::getVersion();
$this->defaultEntity = 'ownCloud'; /* e.g. company name, used for footers and copyright notices */
@@ -64,6 +66,7 @@ class OC_Defaults {
$this->defaultSlogan = $this->l->t('web services under your control');
$this->defaultLogoClaim = '';
$this->defaultMailHeaderColor = '#1d2d44'; /* header color of mail notifications */
+ $this->defaultKnowledgeBaseUrl = $urlGenerator->linkToRoute('settings_help');
$themePath = OC::$SERVERROOT . '/themes/' . OC_Util::getTheme() . '/defaults.php';
if (file_exists($themePath)) {
@@ -79,6 +82,7 @@ class OC_Defaults {
/**
* @param string $method
+ * @return bool
*/
private function themeExist($method) {
if (isset($this->theme) && method_exists($this->theme, $method)) {
@@ -280,4 +284,19 @@ class OC_Defaults {
}
}
+ /**
+ * get knowledge base URL, will be used for the "Help"-Link in the top
+ * right menu
+ *
+ * @return string
+ */
+ public function getKnowledgeBaseUrl() {
+ if ($this->themeExist('getKnowledgeBaseUrl')) {
+ return $this->theme->getKnowledgeBaseUrl();
+ } else {
+ return $this->defaultKnowledgeBaseUrl;
+ }
+
+ }
+
}