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
cbfea4c0
Commit
cbfea4c0
authored
7 years ago
by
Morris Jobke
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #5781 from nextcloud/fix_5780
Allow overwriting of IOS theming values
parents
8e6b707d
e48ca730
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/theming/lib/ThemingDefaults.php
+30
-1
30 additions, 1 deletion
apps/theming/lib/ThemingDefaults.php
apps/theming/tests/ThemingDefaultsTest.php
+61
-0
61 additions, 0 deletions
apps/theming/tests/ThemingDefaultsTest.php
with
91 additions
and
1 deletion
apps/theming/lib/ThemingDefaults.php
+
30
−
1
View file @
cbfea4c0
...
...
@@ -51,6 +51,12 @@ class ThemingDefaults extends \OC_Defaults {
private
$color
;
/** @var Util */
private
$util
;
/** @var string */
private
$iTunesAppId
;
/** @var string */
private
$iOSClientUrl
;
/** @var string */
private
$AndroidClientUrl
;
/**
* ThemingDefaults constructor.
...
...
@@ -82,6 +88,9 @@ class ThemingDefaults extends \OC_Defaults {
$this
->
url
=
parent
::
getBaseUrl
();
$this
->
slogan
=
parent
::
getSlogan
();
$this
->
color
=
parent
::
getColorPrimary
();
$this
->
iTunesAppId
=
parent
::
getiTunesAppId
();
$this
->
iOSClientUrl
=
parent
::
getiOSClientUrl
();
$this
->
AndroidClientUrl
=
parent
::
getAndroidClientUrl
();
}
public
function
getName
()
{
...
...
@@ -180,6 +189,27 @@ class ThemingDefaults extends \OC_Defaults {
return
$this
->
urlGenerator
->
linkToRoute
(
'theming.Theming.getLoginBackground'
)
.
'?v='
.
$cacheBusterCounter
;
}
/**
* @return string
*/
public
function
getiTunesAppId
()
{
return
$this
->
config
->
getAppValue
(
'theming'
,
'iTunesAppId'
,
$this
->
iTunesAppId
);
}
/**
* @return string
*/
public
function
getiOSClientUrl
()
{
return
$this
->
config
->
getAppValue
(
'theming'
,
'iOSClientUrl'
,
$this
->
iOSClientUrl
);
}
/**
* @return string
*/
public
function
getAndroidClientUrl
()
{
return
$this
->
config
->
getAppValue
(
'theming'
,
'AndroidClientUrl'
,
$this
->
AndroidClientUrl
);
}
/**
* @return array scss variables to overwrite
...
...
@@ -290,5 +320,4 @@ class ThemingDefaults extends \OC_Defaults {
return
$returnValue
;
}
}
This diff is collapsed.
Click to expand it.
apps/theming/tests/ThemingDefaultsTest.php
+
61
−
0
View file @
cbfea4c0
...
...
@@ -543,4 +543,65 @@ class ThemingDefaultsTest extends TestCase {
];
$this
->
assertEquals
(
$expected
,
$this
->
template
->
getScssVariables
());
}
public
function
testGetDefaultAndroidURL
()
{
$this
->
config
->
expects
(
$this
->
once
())
->
method
(
'getAppValue'
)
->
with
(
'theming'
,
'AndroidClientUrl'
,
'https://play.google.com/store/apps/details?id=com.nextcloud.client'
)
->
willReturn
(
'https://play.google.com/store/apps/details?id=com.nextcloud.client'
);
$this
->
assertEquals
(
'https://play.google.com/store/apps/details?id=com.nextcloud.client'
,
$this
->
template
->
getAndroidClientUrl
());
}
public
function
testGetCustomAndroidURL
()
{
$this
->
config
->
expects
(
$this
->
once
())
->
method
(
'getAppValue'
)
->
with
(
'theming'
,
'AndroidClientUrl'
,
'https://play.google.com/store/apps/details?id=com.nextcloud.client'
)
->
willReturn
(
'https://play.google.com/store/apps/details?id=com.mycloud.client'
);
$this
->
assertEquals
(
'https://play.google.com/store/apps/details?id=com.mycloud.client'
,
$this
->
template
->
getAndroidClientUrl
());
}
public
function
testGetDefaultiOSURL
()
{
$this
->
config
->
expects
(
$this
->
once
())
->
method
(
'getAppValue'
)
->
with
(
'theming'
,
'iOSClientUrl'
,
'https://itunes.apple.com/us/app/nextcloud/id1125420102?mt=8'
)
->
willReturn
(
'https://itunes.apple.com/us/app/nextcloud/id1125420102?mt=8'
);
$this
->
assertEquals
(
'https://itunes.apple.com/us/app/nextcloud/id1125420102?mt=8'
,
$this
->
template
->
getiOSClientUrl
());
}
public
function
testGetCustomiOSURL
()
{
$this
->
config
->
expects
(
$this
->
once
())
->
method
(
'getAppValue'
)
->
with
(
'theming'
,
'iOSClientUrl'
,
'https://itunes.apple.com/us/app/nextcloud/id1125420102?mt=8'
)
->
willReturn
(
'https://itunes.apple.com/us/app/nextcloud/id1234567890?mt=8'
);
$this
->
assertEquals
(
'https://itunes.apple.com/us/app/nextcloud/id1234567890?mt=8'
,
$this
->
template
->
getiOSClientUrl
());
}
public
function
testGetDefaultiTunesAppId
()
{
$this
->
config
->
expects
(
$this
->
once
())
->
method
(
'getAppValue'
)
->
with
(
'theming'
,
'iTunesAppId'
,
'1125420102'
)
->
willReturn
(
'1125420102'
);
$this
->
assertEquals
(
'1125420102'
,
$this
->
template
->
getiTunesAppId
());
}
public
function
testGetCustomiTunesAppId
()
{
$this
->
config
->
expects
(
$this
->
once
())
->
method
(
'getAppValue'
)
->
with
(
'theming'
,
'iTunesAppId'
,
'1125420102'
)
->
willReturn
(
'1234567890'
);
$this
->
assertEquals
(
'1234567890'
,
$this
->
template
->
getiTunesAppId
());
}
}
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