From 8614a91e362f38712e261bce3bde0da5aa95a6c3 Mon Sep 17 00:00:00 2001 From: Andre Menrath Date: Tue, 3 Sep 2024 15:41:22 +0200 Subject: [PATCH] wip --- db/install.xml | 13 +++++++++++++ db/upgrade.php | 24 ++++++++++++++++++++++++ lib.php | 3 +++ locallib.php | 10 ++++++++++ version.php | 2 +- 5 files changed, 51 insertions(+), 1 deletion(-) diff --git a/db/install.xml b/db/install.xml index 7d865e8dc9b..966a46f030c 100644 --- a/db/install.xml +++ b/db/install.xml @@ -98,5 +98,18 @@ + + + + + + + + + + + + +
diff --git a/db/upgrade.php b/db/upgrade.php index 00f8c2593b7..5593204a347 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -324,5 +324,29 @@ function xmldb_theme_boost_union_upgrade($oldversion) { upgrade_plugin_savepoint(true, 2023102027, 'theme', 'boost_union'); } + if ($oldversion < 2024060101) { + // Define table theme_boost_union_snippets to be created. + $table = new xmldb_table('theme_boost_union_snippets'); + + // Adding fields to table theme_boost_union_snippets. + $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); + $table->add_field('sortorder', XMLDB_TYPE_INTEGER, '18', null, null, null, null); + $table->add_field('source', XMLDB_TYPE_CHAR, '255', null, null, null, 'theme_boost_union'); + $table->add_field('domain', XMLDB_TYPE_CHAR, '255', null, null, null, ''); + $table->add_field('key', XMLDB_TYPE_CHAR, '255', null, null, null, null); + $table->add_field('enabled', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0'); + + // Adding keys to table theme_boost_union_snippets. + $table->add_key('primary', XMLDB_KEY_PRIMARY, ['id']); + + // Conditionally launch create table for theme_boost_union_snippets. + if (!$dbman->table_exists($table)) { + $dbman->create_table($table); + } + + // Boost_union savepoint reached. + upgrade_plugin_savepoint(true, 2024060101, 'theme', 'boost_union'); + } + return true; } diff --git a/lib.php b/lib.php index 8b7404dfe3e..4489232d62d 100644 --- a/lib.php +++ b/lib.php @@ -159,6 +159,9 @@ function theme_boost_union_get_main_scss_content($theme) { // Thus, we sadly have to get and include the external Post SCSS here already. $scss .= theme_boost_union_get_external_scss('post'); + // Setting: CSS Snippets. + $scss .= theme_boost_union_get_snippets_scss(); + return $scss; } diff --git a/locallib.php b/locallib.php index e6e9a366043..049111d3896 100644 --- a/locallib.php +++ b/locallib.php @@ -2221,6 +2221,15 @@ function theme_boost_union_get_external_scss($type) { return $extscss; } +/** + * TODO: get CSS for snippets. + * + * @return string The (S)CSS strings content. + */ +function theme_boost_union_get_snippets_scss() { + return ''; +} + /** * Helper function which wxtracts and returns the pluginname for the given callback name. * This function simply differentiates between real plugins and core components. @@ -2398,3 +2407,4 @@ function theme_boost_union_remove_hookmanipulation_marker() { // Remove the markers. $cache->delete('theme_boost_union_manipulation_done'); } + diff --git a/version.php b/version.php index 0acc6fc1e0d..7bc392e46e6 100644 --- a/version.php +++ b/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'theme_boost_union'; -$plugin->version = 2024060100; +$plugin->version = 2024060101; $plugin->release = 'v4.4-r1'; $plugin->requires = 2024042200; $plugin->supported = [404, 404];