Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/theming/composer/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
'OCA\\Theming\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php',
'OCA\\Theming\\Capabilities' => $baseDir . '/../lib/Capabilities.php',
'OCA\\Theming\\Command\\UpdateConfig' => $baseDir . '/../lib/Command/UpdateConfig.php',
'OCA\\Theming\\ConfigLexicon' => $baseDir . '/../lib/ConfigLexicon.php',
'OCA\\Theming\\Controller\\IconController' => $baseDir . '/../lib/Controller/IconController.php',
'OCA\\Theming\\Controller\\ThemingController' => $baseDir . '/../lib/Controller/ThemingController.php',
'OCA\\Theming\\Controller\\UserThemeController' => $baseDir . '/../lib/Controller/UserThemeController.php',
Expand Down
1 change: 1 addition & 0 deletions apps/theming/composer/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class ComposerStaticInitTheming
'OCA\\Theming\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php',
'OCA\\Theming\\Capabilities' => __DIR__ . '/..' . '/../lib/Capabilities.php',
'OCA\\Theming\\Command\\UpdateConfig' => __DIR__ . '/..' . '/../lib/Command/UpdateConfig.php',
'OCA\\Theming\\ConfigLexicon' => __DIR__ . '/..' . '/../lib/ConfigLexicon.php',
'OCA\\Theming\\Controller\\IconController' => __DIR__ . '/..' . '/../lib/Controller/IconController.php',
'OCA\\Theming\\Controller\\ThemingController' => __DIR__ . '/..' . '/../lib/Controller/ThemingController.php',
'OCA\\Theming\\Controller\\UserThemeController' => __DIR__ . '/..' . '/../lib/Controller/UserThemeController.php',
Expand Down
116 changes: 116 additions & 0 deletions apps/theming/lib/ConfigLexicon.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<?php

declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Theming;

use OCP\Config\Lexicon\Entry;
use OCP\Config\Lexicon\ILexicon;
use OCP\Config\Lexicon\Strictness;
use OCP\Config\ValueType;

/**
* Config Lexicon for theming.
*
* Please Add & Manage your Config Keys in that file and keep the Lexicon up to date!
*
* {@see ILexicon}
*/
class ConfigLexicon implements ILexicon {
/** The cache buster index */
public const CACHE_BUSTER = 'cachebuster';
public const USER_THEMING_DISABLED = 'disable-user-theming';

/** Name of the software running on this instance (usually "Nextcloud") */
public const PRODUCT_NAME = 'productName';
/** Short name of this instance */
public const INSTANCE_NAME = 'name';
/** Slogan of this instance */
public const INSTANCE_SLOGAN = 'slogan';
/** Imprint URL of this instance */
public const INSTANCE_IMPRINT_URL = 'imprintUrl';
/** Privacy URL of this instance */
public const INSTANCE_PRIVACY_URL = 'privacyUrl';

// legacy theming
/** Base URL of this instance */
public const BASE_URL = 'url';
/** Base URL for documentation */
public const DOC_BASE_URL = 'docBaseUrl';

public function getStrictness(): Strictness {
return Strictness::NOTICE;
}

public function getAppConfigs(): array {
return [
// internals
new Entry(
self::CACHE_BUSTER,
ValueType::INT,
defaultRaw: 0,
definition: 'The current cache buster key for theming assets.',
),
new Entry(
self::USER_THEMING_DISABLED,
ValueType::BOOL,
defaultRaw: false,
definition: 'Whether user theming is disabled.',
),

// instance theming
new Entry(
self::PRODUCT_NAME,
ValueType::STRING,
defaultRaw: 'Nextcloud',
definition: 'The name of the software running on this instance (usually "Nextcloud").',
),
new Entry(
self::INSTANCE_NAME,
ValueType::STRING,
defaultRaw: '',
definition: 'Short name of this instance.',
),
new Entry(
self::INSTANCE_SLOGAN,
ValueType::STRING,
defaultRaw: '',
definition: 'Slogan of this instance.',
),
new Entry(
self::INSTANCE_IMPRINT_URL,
ValueType::STRING,
defaultRaw: '',
definition: 'Imprint URL of this instance.',
),
new Entry(
self::INSTANCE_PRIVACY_URL,
ValueType::STRING,
defaultRaw: '',
definition: 'Privacy URL of this instance.',
),

// legacy theming
new Entry(
self::BASE_URL,
ValueType::STRING,
defaultRaw: '',
definition: 'Base URL of this instance.',
),
new Entry(
self::DOC_BASE_URL,
ValueType::STRING,
defaultRaw: '',
definition: 'Base URL for documentation.',
),
];
}

public function getUserConfigs(): array {
return [];
}
}
Loading