Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
8fb89056
Commit
8fb89056
authored
9 years ago
by
Björn Schießle
Browse files
Options
Downloads
Patches
Plain Diff
make knowledge base url configurable
parent
3ef680d9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/private/app.php
+2
-1
2 additions, 1 deletion
lib/private/app.php
lib/private/defaults.php
+19
-0
19 additions, 0 deletions
lib/private/defaults.php
themes/example/defaults.php
+6
-0
6 additions, 0 deletions
themes/example/defaults.php
with
27 additions
and
1 deletion
lib/private/app.php
+
2
−
1
View file @
8fb89056
...
...
@@ -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"
)
)
...
...
This diff is collapsed.
Click to expand it.
lib/private/defaults.php
+
19
−
0
View file @
8fb89056
...
...
@@ -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
;
}
}
}
This diff is collapsed.
Click to expand it.
themes/example/defaults.php
+
6
−
0
View file @
8fb89056
...
...
@@ -28,6 +28,7 @@ class OC_Theme {
private
$themeSyncClientUrl
;
private
$themeSlogan
;
private
$themeMailHeaderColor
;
private
$themeKnowledgeBaseUrl
;
/* put your custom text in these variables */
function
__construct
()
{
...
...
@@ -39,6 +40,7 @@ class OC_Theme {
$this
->
themeSyncClientUrl
=
'https://owncloud.org/install'
;
$this
->
themeSlogan
=
'Your custom cloud, personalized for you!'
;
$this
->
themeMailHeaderColor
=
'#745bca'
;
$this
->
themeKnowledgeBaseUrl
=
'https://doc.owncloud.org'
;
}
/* nothing after this needs to be adjusted */
...
...
@@ -92,4 +94,8 @@ class OC_Theme {
return
$this
->
themeMailHeaderColor
;
}
public
function
getKnowledgeBaseUrl
()
{
return
$this
->
themeKnowledgeBaseUrl
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment