Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getDocBaseUrl on theming app #38900

Merged
merged 1 commit into from Jun 29, 2023

Conversation

tanganellilore
Copy link
Contributor

  • Resolves: not opened for this type of PR

Summary

With new theming introduced on nextcloud >25, we can customize DocBaseUrl only if we use "old fashion way", adding defaults.php under /themes/<custom_theme>/ .

With this PR I simply added a getDocBaseUrl() function, that will get theming docBaseUrl config and will use for doc base url.
It will fallback on the defaullt one if not found, in the same way as other function.

TODO

N/A

Checklist

@szaimen szaimen added enhancement 3. to review Waiting for reviews labels Jun 19, 2023
@szaimen szaimen added this to the Nextcloud 28 milestone Jun 19, 2023
@szaimen szaimen requested review from a team, ArtificialOwl, icewind1991 and Fenn-CS and removed request for a team June 19, 2023 19:37
apps/theming/lib/ThemingDefaults.php Fixed Show fixed Hide fixed
apps/theming/lib/ThemingDefaults.php Fixed Show fixed Hide fixed
@@ -163,6 +164,10 @@
return (string)$this->config->getAppValue('theming', 'privacyUrl', '');
}

public function getDocBaseUrl() {
return (string)$this->config->getAppValue('theming', 'docBaseUrl', $this->docBaseUrl);

Check notice

Code scanning / Psalm

RedundantCastGivenDocblockType Note

Redundant cast to string given docblock-provided type
Signed-off-by: Lorenzo Tanganelli <lorenzo.tanganelli@hotmail.it>
@tanganellilore
Copy link
Contributor Author

fixed psalm

@tanganellilore
Copy link
Contributor Author

@icewind1991 @ArtificialOwl @Fenn-CS Any chance to check this?

Copy link
Contributor

@Fenn-CS Fenn-CS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this config would live in config.php, then it should also be in the config.sample.php.

Otherwise, I don't know how much we need this so tagging @come-nc

@@ -163,6 +165,10 @@ public function getPrivacyUrl() {
return (string)$this->config->getAppValue('theming', 'privacyUrl', '');
}

public function getDocBaseUrl() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not understand where is this method used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is used on the ? or i button on some personal/admin settings:

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@come-nc it's just extending from OC_Defaults

@come-nc come-nc requested a review from skjnldsv June 29, 2023 08:33
@skjnldsv skjnldsv merged commit 5b7f81b into nextcloud:master Jun 29, 2023
36 of 37 checks passed
@tanganellilore tanganellilore deleted the add_theming_doc_url branch July 18, 2023 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants