Skip to content

Commit 8614a91

Browse files
committed
wip
1 parent 39be9ad commit 8614a91

File tree

5 files changed

+51
-1
lines changed

5 files changed

+51
-1
lines changed

db/install.xml

+13
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,18 @@
9898
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
9999
</KEYS>
100100
</TABLE>
101+
<TABLE NAME="theme_boost_union_snippets" COMMENT="CSS Snippets">
102+
<FIELDS>
103+
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
104+
<FIELD NAME="sortorder" TYPE="int" LENGTH="18" NOTNULL="false" SEQUENCE="false"/>
105+
<FIELD NAME="source" TYPE="char" LENGTH="255" NOTNULL="false" DEFAULT="theme_boost_union" SEQUENCE="false"/>
106+
<FIELD NAME="domain" TYPE="char" LENGTH="255" NOTNULL="false" DEFAULT="" SEQUENCE="false"/>
107+
<FIELD NAME="key" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false"/>
108+
<FIELD NAME="enabled" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
109+
</FIELDS>
110+
<KEYS>
111+
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
112+
</KEYS>
113+
</TABLE>
101114
</TABLES>
102115
</XMLDB>

db/upgrade.php

+24
Original file line numberDiff line numberDiff line change
@@ -324,5 +324,29 @@ function xmldb_theme_boost_union_upgrade($oldversion) {
324324
upgrade_plugin_savepoint(true, 2023102027, 'theme', 'boost_union');
325325
}
326326

327+
if ($oldversion < 2024060101) {
328+
// Define table theme_boost_union_snippets to be created.
329+
$table = new xmldb_table('theme_boost_union_snippets');
330+
331+
// Adding fields to table theme_boost_union_snippets.
332+
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
333+
$table->add_field('sortorder', XMLDB_TYPE_INTEGER, '18', null, null, null, null);
334+
$table->add_field('source', XMLDB_TYPE_CHAR, '255', null, null, null, 'theme_boost_union');
335+
$table->add_field('domain', XMLDB_TYPE_CHAR, '255', null, null, null, '');
336+
$table->add_field('key', XMLDB_TYPE_CHAR, '255', null, null, null, null);
337+
$table->add_field('enabled', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0');
338+
339+
// Adding keys to table theme_boost_union_snippets.
340+
$table->add_key('primary', XMLDB_KEY_PRIMARY, ['id']);
341+
342+
// Conditionally launch create table for theme_boost_union_snippets.
343+
if (!$dbman->table_exists($table)) {
344+
$dbman->create_table($table);
345+
}
346+
347+
// Boost_union savepoint reached.
348+
upgrade_plugin_savepoint(true, 2024060101, 'theme', 'boost_union');
349+
}
350+
327351
return true;
328352
}

lib.php

+3
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ function theme_boost_union_get_main_scss_content($theme) {
159159
// Thus, we sadly have to get and include the external Post SCSS here already.
160160
$scss .= theme_boost_union_get_external_scss('post');
161161

162+
// Setting: CSS Snippets.
163+
$scss .= theme_boost_union_get_snippets_scss();
164+
162165
return $scss;
163166
}
164167

locallib.php

+10
Original file line numberDiff line numberDiff line change
@@ -2221,6 +2221,15 @@ function theme_boost_union_get_external_scss($type) {
22212221
return $extscss;
22222222
}
22232223

2224+
/**
2225+
* TODO: get CSS for snippets.
2226+
*
2227+
* @return string The (S)CSS strings content.
2228+
*/
2229+
function theme_boost_union_get_snippets_scss() {
2230+
return '';
2231+
}
2232+
22242233
/**
22252234
* Helper function which wxtracts and returns the pluginname for the given callback name.
22262235
* This function simply differentiates between real plugins and core components.
@@ -2398,3 +2407,4 @@ function theme_boost_union_remove_hookmanipulation_marker() {
23982407
// Remove the markers.
23992408
$cache->delete('theme_boost_union_manipulation_done');
24002409
}
2410+

version.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
defined('MOODLE_INTERNAL') || die();
2626

2727
$plugin->component = 'theme_boost_union';
28-
$plugin->version = 2024060100;
28+
$plugin->version = 2024060101;
2929
$plugin->release = 'v4.4-r1';
3030
$plugin->requires = 2024042200;
3131
$plugin->supported = [404, 404];

0 commit comments

Comments
 (0)