Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Menrath committed Sep 3, 2024
1 parent 39be9ad commit 8614a91
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 1 deletion.
13 changes: 13 additions & 0 deletions db/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,18 @@
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS>
</TABLE>
<TABLE NAME="theme_boost_union_snippets" COMMENT="CSS Snippets">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="sortorder" TYPE="int" LENGTH="18" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="source" TYPE="char" LENGTH="255" NOTNULL="false" DEFAULT="theme_boost_union" SEQUENCE="false"/>
<FIELD NAME="domain" TYPE="char" LENGTH="255" NOTNULL="false" DEFAULT="" SEQUENCE="false"/>
<FIELD NAME="key" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="enabled" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS>
</TABLE>
</TABLES>
</XMLDB>
24 changes: 24 additions & 0 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
3 changes: 3 additions & 0 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
10 changes: 10 additions & 0 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -2398,3 +2407,4 @@ function theme_boost_union_remove_hookmanipulation_marker() {
// Remove the markers.
$cache->delete('theme_boost_union_manipulation_done');
}

2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 8614a91

Please sign in to comment.