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

[3.0] Theme #7933

Draft
wants to merge 94 commits into
base: release-3.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
d53885a
Initial theme upload
TwitchisMental Feb 11, 2024
be835b4
Add new form grids
jdarwood007 Apr 28, 2024
c32b987
Adding font awesome for real this time
live627 Feb 20, 2024
7c561cf
fontawesome helptext
DiegoAndresCortes Dec 5, 2023
f21f24d
Add files via upload
live627 Dec 7, 2023
9d05882
Improve popup
live627 Feb 20, 2024
18e242d
select login container, not login icon
live627 Dec 8, 2023
6b679b6
make unread links have the same as menu buttons
live627 Dec 8, 2023
45cd3ad
Delete Themes/default/scripts/editor.js
live627 Dec 9, 2023
4553b2f
Update index.css
live627 Dec 9, 2023
9cbac99
Update Theme.php
live627 Dec 9, 2023
ee65fde
scrollabble
live627 Dec 10, 2023
d86d92c
no more eval
live627 Feb 1, 2024
1888d41
move variables to a separate file
live627 Dec 11, 2023
ed375e3
code tag changes
live627 Sep 24, 2023
e6d5dea
extract poll js
live627 Feb 20, 2024
5befd54
nuke tabindex
live627 Feb 20, 2024
122f706
Disable forms on submit using the new `inert` HTML property
live627 Feb 20, 2024
0c921f1
Update quick modify to support Ctrl+Enter
live627 Feb 20, 2024
bff361a
css rev
DiegoAndresCortes Dec 29, 2023
591959e
move quicksearch
DiegoAndresCortes Dec 29, 2023
9aa853d
load icons.css and variables.css
DiegoAndresCortes Dec 29, 2023
0fb848d
responsive css minor changes
DiegoAndresCortes Dec 29, 2023
7756f40
layout tweaks
DiegoAndresCortes Dec 29, 2023
2f045d2
print top_info once
live627 Feb 20, 2024
677a131
generic notification popups
DiegoAndresCortes Dec 29, 2023
3daf17b
move toggle outside header tags
live627 Feb 20, 2024
77119a9
tweaks to mobile menu action
live627 Feb 20, 2024
6a5f97f
more layout changes
DiegoAndresCortes Jan 7, 2024
32bbe07
buttonlist initial 'rework'
DiegoAndresCortes Jan 7, 2024
119296e
update slider
DiegoAndresCortes Jan 8, 2024
5e1df58
pagesection order
DiegoAndresCortes Jan 9, 2024
2172d5d
quickbuttons
DiegoAndresCortes Jan 9, 2024
316c3fa
remove information class from display_head
DiegoAndresCortes Jan 10, 2024
2d4a1c7
change report icon
DiegoAndresCortes Jan 10, 2024
6c5ed87
infocenter indent and cleanup
DiegoAndresCortes Jan 10, 2024
a97259d
calendar css and small tweaks
DiegoAndresCortes Jan 15, 2024
ee7789c
more miscellaneous changes/fixes
DiegoAndresCortes Jan 15, 2024
99e9bc2
icons css file rev 1
DiegoAndresCortes Jan 15, 2024
8ee3f0e
admin css rev 1
DiegoAndresCortes Jan 15, 2024
91daa27
tidy up variables file
DiegoAndresCortes Jan 15, 2024
edda3ad
reset specificity, profilelinks vars and fixes
DiegoAndresCortes Jan 16, 2024
2a4a775
no overflow in jump_to_select
DiegoAndresCortes Jan 30, 2024
3253f6a
Change calendar 'Location' field to input box
GL700Wing Feb 21, 2024
95d3f4a
fix stats panel
DiegoAndresCortes Feb 1, 2024
e40175a
fix headings
DiegoAndresCortes Feb 1, 2024
ca56682
fix markup/html issues
DiegoAndresCortes Feb 11, 2024
0171b6a
other minor fixes
DiegoAndresCortes Feb 11, 2024
22c57f4
use avatar height as baseline for notis
DiegoAndresCortes Feb 12, 2024
f6f48f8
extract profile css and js
live627 Feb 29, 2024
a8a8f02
popup_container and generic menus
DiegoAndresCortes Feb 29, 2024
502eb76
Update Recent.template.php
dragomano Feb 29, 2024
d70b378
Basic light/dark mode selected from system preferences
live627 Mar 1, 2024
8616cb4
A big blob of native js to replace jq
live627 Mar 9, 2024
d5a3659
Amend
live627 Mar 10, 2024
3c35686
Rewrite our editor integration
live627 Mar 14, 2024
09511e2
fixes
DiegoAndresCortes Mar 9, 2024
28901ab
remove padding and margins from variables
DiegoAndresCortes Mar 9, 2024
c761781
decouple postbit css
DiegoAndresCortes Mar 10, 2024
79e3cb9
expand and select fix
DiegoAndresCortes Mar 10, 2024
4b5e68c
use same styles/markup for item lists
DiegoAndresCortes Mar 10, 2024
9934702
revamp variants and dark mode
DiegoAndresCortes Mar 11, 2024
6c1eff2
additional fixes
DiegoAndresCortes Mar 11, 2024
861e553
use correct method for time
DiegoAndresCortes Mar 11, 2024
092473b
variant and color mode fixes
DiegoAndresCortes Mar 11, 2024
f9c951a
style and color fixes
DiegoAndresCortes Mar 11, 2024
84a5c74
update user option for variant or color mode when switching
DiegoAndresCortes Mar 12, 2024
6d8f75a
fix search layout
DiegoAndresCortes Mar 13, 2024
7706ba6
dark mode colors
DiegoAndresCortes Mar 13, 2024
7aa0a22
calendar and date fixes
DiegoAndresCortes Mar 22, 2024
7f3afdf
sceditor css vars
DiegoAndresCortes Apr 3, 2024
23b4715
timepicker css
DiegoAndresCortes Apr 3, 2024
941d83a
rtl more cleanup
DiegoAndresCortes Apr 3, 2024
d83558c
random news, newsfader fix, slogan and user_panel alignment
DiegoAndresCortes Apr 14, 2024
8c9eae4
tweak info_center markup and css
DiegoAndresCortes Apr 14, 2024
20b6eb2
genericmenu fixes
DiegoAndresCortes Apr 15, 2024
cbb4046
word-break for signatures
DiegoAndresCortes Apr 25, 2024
76b8880
fix buttonlist dropdown and remove bloat
DiegoAndresCortes Apr 25, 2024
5215fc0
redesign report selection form
live627 Apr 30, 2024
93b70b5
Nothing to see here
live627 May 7, 2024
3ffdf81
simplify menu a tad
live627 Sep 5, 2024
b44bf95
Delete Themes/default/images/bbc/bbc_bg.png
live627 Sep 18, 2024
5094bb2
Delete Themes/default/images/bbc/bbc_hoverbg.png
live627 Sep 18, 2024
7a0e998
Delete Themes/default/images/bbc/index.php
live627 Sep 18, 2024
d55c635
formatting, tweaks + css fixes
DiegoAndresCortes Oct 12, 2024
68dbb40
board and topic layout
DiegoAndresCortes Oct 12, 2024
c720138
postbit and poster layout
DiegoAndresCortes Oct 12, 2024
51fe61f
tidy up attachments css and use css variables
DiegoAndresCortes Oct 12, 2024
41c57fd
icons cleanup
DiegoAndresCortes Oct 12, 2024
c394f97
admin layout tweaks
DiegoAndresCortes Oct 12, 2024
9df19dc
replace wrapper id selectors with a generic wrapper container selector
DiegoAndresCortes Oct 12, 2024
ab45d9e
calendar and events css tidy up
DiegoAndresCortes Oct 12, 2024
d7e7026
responsive css tidy up, and change breakpoints
DiegoAndresCortes Oct 12, 2024
b9949c2
fix buttonlist dropmenu items
DiegoAndresCortes Oct 12, 2024
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 Languages/en_US/General.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
$txt['page'] = 'Page';
$txt['prev'] = 'Previous page';
$txt['next'] = 'Next page';
$txt['breadcrumb'] = 'Breadcrumb';

$txt['page_title_number'] = '{title} - Page {pagenum, number, integer}';

Expand Down
1 change: 1 addition & 0 deletions Languages/en_US/Help.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@
$helptxt['enable_ajax_alerts'] = 'This option allows your members to receive AJAX notifications. This means that members do not need to refresh the page to get new notifications.<br><strong>NOTE:</strong> This option might cause a severe load at your server with many users online.';
$helptxt['alerts_auto_purge'] = 'Once an alert has been read, it is rarely needed again. For performance reasons, it is a good idea to automatically delete them after a while.';
$helptxt['jquery_source'] = 'This will determine the source used to load the jQuery Library. <em>Google CDN, jQuery CDN</em> and <em>Microsoft CDN</em> will load the jQuery library from those respective CDN networks. <em>Local</em> will only use the local source. <em>Custom</em> allows you to specify a custom URL for the library.';
$helptxt['fontawesome_source'] = 'This will determine the source used to load the Font Awesome Library. <em>Cloudflare CDN</em>, and <em>Font Awesome CDN</em> will load the Font Awesome library from those respective CDN networks. <em>Local</em> will only use the local source. <em>Custom</em> allows you to specify a custom URL for the library.';
$helptxt['compactTopicPagesEnable'] = 'This will just show a selection of the number of pages.<br><em>Example:</em>
&quot;3&quot; to display: 1 ... 4 [5] 6 ... 9 <br>
&quot;5&quot; to display: 1 ... 3 4 [5] 6 7 ... 9';
Expand Down
34 changes: 16 additions & 18 deletions Languages/en_US/ManageMaintenance.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
$txt['repair_missing_topic_for_cache'] = 'Cached word "{0}" is linked to a non-existent topic.';
$txt['repair_missing_log_poll_member'] = 'Poll #{0, number, integer} has been given a vote from member #{1, number, integer} , who is now missing.';
$txt['repair_missing_log_poll_vote'] = 'A vote was cast by member #{0, number, integer} on a non-existent poll #{1, number, integer}.';
$txt['repair_missing_thumbnail_parent'] = 'A thumbnail exists called {0}, but it does not have a parent.';
$txt['repair_missing_thumbnail_parent'] = 'A thumbnail exists called {0}, but it doesn\'t have a parent.';
$txt['repair_report_missing_comments'] = 'Report #{0, number, integer} of topic: "{1}" has no comments.';
$txt['repair_comments_missing_report'] = 'Report comment #{0, number, integer} submitted by {1} has no related report.';
$txt['repair_group_request_missing_member'] = 'A group request still exists for deleted member #{0, number, integer}.';
Expand Down Expand Up @@ -100,7 +100,7 @@
$txt['database_optimize_attempt'] = 'Attempting to optimize your database...';
$txt['database_optimizing'] = 'Optimizing {0}... {1} KB optimized.';
$txt['database_already_optimized'] = 'All of the tables were already optimized.';
$txt['database_opimize_unneeded'] = 'It was not necessary to optimize any tables.';
$txt['database_opimize_unneeded'] = 'It wasn\'t necessary to optimize any tables.';
$txt['database_optimized'] = ' table(s) optimized.';
$txt['database_no_id'] = 'has a non-existent member ID';

Expand Down Expand Up @@ -162,16 +162,14 @@

$txt['maintain_recount'] = 'Recount all forum totals and statistics';
$txt['maintain_recount_info'] = 'Should the total replies of a topic or the number of PMs in your inbox be incorrect: this function will recount all saved counts and statistics for you.';
$txt['maintain_errors'] = 'Find and repair any errors';
$txt['maintain_errors_info'] = 'If, for example, posts or topics are missing after a server crash, this function may help in finding them again.';
$txt['maintain_logs'] = 'Empty out unimportant logs';
$txt['maintain_logs_info'] = 'This function will empty out all unimportant logs. This should be avoided unless something is wrong, but it does not hurt anything.';
$txt['maintain_cache'] = 'Empty SMF’s cache';
$txt['maintain_cache_info'] = 'This function will empty out the cache should you need it to be cleared.';
$txt['maintain_optimize'] = 'Optimize all tables';
$txt['maintain_optimize_info'] = 'This task allows you to optimize all tables. This will get rid of overhead, effectively making the tables smaller in size and your forum faster.';
$txt['maintain_repair'] = 'Find and repair any errors';
$txt['maintain_repair_info'] = 'Try to find and fix any errors that may prevent posts or topics from showinng up or being searchable. This should be run afer a forum conversion.';
$txt['maintain_logs'] = 'Clear logs';
$txt['maintain_logs_info'] = 'Clear out all information-related logs, xuch as the error log. This should be avoided unless something is wrong, annd won’t adversely affect forum operations';
$txt['maintain_cleancache'] = 'Empty SMF’s cache';
$txt['maintain_cleancache_info'] = 'Empty out the cache should you need it to be cleared.';
$txt['maintain_version'] = 'Check all files against current versions';
$txt['maintain_version_info'] = 'This maintenance task allows you to do a detailed version check of all forum files against the official list of latest versions.';
$txt['maintain_version_info'] = 'Runs a detailed version check of all forum files against the official list of latest versions and displays the results.';
$txt['maintain_rebuild_settings'] = 'Rebuild Settings.php';
$txt['maintain_rebuild_settings_info'] = 'This task reconstructs your Settings.php file. It does not change the values stored in the file. Instead, it cleans up and reformats your Settings.php file to a pristine version.';
$txt['maintain_run_now'] = 'Run task now';
Expand All @@ -190,7 +188,7 @@
$txt['maintain_old_nothing_else'] = 'Any sort of topic.';
$txt['maintain_old_are_moved'] = 'Moved/merged topic notices.';
$txt['maintain_old_are_locked'] = 'Locked.';
$txt['maintain_old_are_not_stickied'] = 'But do not count stickied topics.';
$txt['maintain_old_are_not_stickied'] = 'Exclude sticky topics.';
$txt['maintain_old_all'] = 'All boards (click to select specific boards)';
$txt['maintain_old_choose'] = 'Specific boards (click to select all)';
$txt['maintain_old_remove'] = 'Remove now';
Expand All @@ -212,20 +210,20 @@

$txt['text_title'] = 'Convert to TEXT';
$txt['mediumtext_title'] = 'Convert to MEDIUMTEXT';
$txt['mediumtext_introduction'] = 'The default messages table can contain posts up to a size of 65535 characters, in order be able to store bigger texts the column must be converted to "MEDIUMTEXT". It is also possible to revert the column back to TEXT (that operation would reduce the space occupied), but <strong>only if</strong> none of the posts in your database exceed the size of 65535 characters. This condition will be verified before the conversion.';
$txt['mediumtext_info'] = 'The default messages table can contain posts up to a size of 65535 characters, in order be able to store bigger texts the column must be converted to "MEDIUMTEXT". It is also possible to revert the column back to TEXT (that operation would reduce the space occupied), but <strong>only if</strong> none of the posts in your database exceed the size of 65535 characters. This condition will be verified before the conversion.';
$txt['body_checking_introduction'] = 'This function will convert the column of your database that contains the text of the messages into a "TEXT" format (currently is "MEDIUMTEXT"). This operation will allow to slightly reduce the amount of space occupied by each message (1 byte per message). If any message stored into the database is longer than 65535 characters it will be truncated and part of the text will be lost.';
$txt['exceeding_messages'] = 'The following messages are longer than 65535 characters and will be truncated by the process:';
$txt['exceeding_messages_morethan'] = '{0, plural,
one {... and # more message.}
other {... and # more messages.}
}';
$txt['convert_to_text'] = 'No messages are longer than 65535 characters. You can safely proceed with the conversion without losing any part of the text.';
$txt['convert_to_suggest_text'] = 'The messages body column in your database is currently set as MEDIUMTEXT, but the maximum allowed length set for the messages is lower than 65535 characters. You may free some space converting the column to TEXT.';
$txt['convert_to_suggest_text'] = 'The messages body column in your database is currently set as MEDIUMTEXT, but the maximum allowed length set for the messages is less than 65535 characters. You may free some space converting the column to TEXT.';

$txt['entity_convert_title'] = 'Convert HTML-entities to UTF-8 characters';
$txt['entity_convert_only_utf8'] = 'The database needs to be in UTF-8 format before HTML-entities can be converted to UTF-8';
$txt['entity_convert_introduction'] = 'This function will convert all characters that are stored in the database as HTML-entities to UTF-8 characters. This is especially useful when you have just converted your forum from a character set like ISO-8859-1 while non-latin characters were used on the forum. The browser then sends all characters as HTML-entities. For example, the HTML-entity &amp;#945; represents the greek letter &#945; (alpha). Converting entities to UTF-8 will improve searching and sorting of text and reduce storage size.';
$txt['entity_convert_proceed'] = 'Proceed';
$txt['maintain_convertentities'] = 'Convert HTML-entities to UTF-8 characters';
$txt['maintain_convertentities_only_utf8'] = 'The database needs to be in UTF-8 format before HTML-entities can be converted to UTF-8';
$txt['maintain_convertentities_info'] = 'This function will convert all characters that are stored in the database as HTML-entities to UTF-8 characters. This is especially useful when you have just converted your forum from a character set like ISO-8859-1 while non-latin characters were used on the forum. The browser then sends all characters as HTML-entities. For example, the HTML-entity &amp;#945; represents the greek letter &#945; (alpha). Converting entities to UTF-8 will improve searching and sorting of text and reduce storage size.';
$txt['maintain_convertentities_proceed'] = 'Proceed';

// Move topics out.
$txt['move_topics_maintenance'] = 'Move Topics';
Expand Down
14 changes: 9 additions & 5 deletions Languages/en_US/ManageSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,16 @@
$txt['alerts_auto_purge_0'] = 'Never';
$txt['alerts_per_page'] = 'Alerts Per Page';
$txt['jquery_source'] = 'Source for the jQuery Library';
$txt['jquery_custom_label'] = 'Custom';
$txt['jquery_custom'] = 'Custom URL to the jQuery Library';
$txt['jquery_local'] = 'Local';
$txt['jquery_google_cdn'] = 'Google CDN';
$txt['jquery_jquery_cdn'] = 'jQuery CDN';
$txt['jquery_microsoft_cdn'] = 'Microsoft CDN';
$txt['fontawesome_source'] = 'Source for the FontAwesome Library';
$txt['fontawesome_custom'] = 'Custom URL to the FontAwesome Library';
$txt['cdn_custom_label'] = 'Custom';
$txt['local_cdn'] = 'Local';
$txt['google_cdn'] = 'Google CDN';
$txt['jquery_cdn'] = 'jQuery CDN';
$txt['microsoft_cdn'] = 'Microsoft CDN';
$txt['cloudflare_cdn'] = 'Cloudflare CDN';
$txt['fontawesome_cdn'] = 'FontAwesome CDN';
$txt['queryless_urls'] = 'Search engine friendly URLs';
$txt['minimize_files'] = 'Minimize CSS and JavaScript files';
$txt['queryless_urls_note'] = 'Apache/Lighttpd only';
Expand Down
2 changes: 2 additions & 0 deletions Languages/en_US/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,8 @@
$txt['theme_opt_posting'] = 'Posting';
$txt['theme_opt_moderation'] = 'Moderation';
$txt['theme_opt_personal_messages'] = 'Personal Messages';
$txt['theme_opt_colormode'] = 'Theme Color Mode';
$txt['theme_opt_variant'] = 'Theme Variant';

$txt['export_profile_data'] = 'Download profile data';
$txt['export_profile_data_desc'] = 'This section allows you to export a copy of your forum profile data to a downloadable file, optionally including your posts and personal messages.<br>Please note:<ul class="bbc_list">{list}</ul>';
Expand Down
12 changes: 12 additions & 0 deletions Languages/en_US/Themes.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@

$txt['theme_url_config'] = 'Theme URLs and Configuration';
$txt['theme_variants'] = 'Theme Variants';
$txt['theme_colormodes'] = 'Theme Color Modes';
$txt['theme_options'] = 'Theme Options and Preferences';
$txt['actual_theme_name'] = 'This theme’s name: ';
$txt['actual_theme_dir'] = 'This theme’s directory: ';
Expand All @@ -71,6 +72,7 @@
$txt['current_theme_style'] = 'This theme’s style: ';

$txt['theme_variants_default'] = 'Default theme variant';
$txt['variant_default'] = 'Default';
$txt['theme_variants_user_disable'] = 'Disable user variant selection';

$txt['site_slogan'] = 'Site slogan';
Expand Down Expand Up @@ -165,4 +167,14 @@
$txt['og_image'] = 'Open Graph image';
$txt['og_image_desc'] = 'Suggested size: 175x175px. <a href="https://ogp.me/" target="_blank" class="bbc_link">Open Graph</a> is used for social media sharing.';


// Theme Mode (dark, light, system, etc)
$txt['theme_pick_colormode'] = 'Select Color Mode';
$txt['theme_colormode_default'] = 'Default color mode';
$txt['theme_colormode_user_disable'] = 'Disable user color mode selection';
$txt['colormode_light'] = 'Light';
$txt['colormode_dark'] = 'Dark';
$txt['colormode_system'] = 'System Default';


?>
3 changes: 3 additions & 0 deletions Sources/Actions/Activate.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,13 @@ public function execute(): void
ErrorHandler::fatalLang('no_access', false);
}

Theme::loadJavaScriptFile('login.js', ['minimize' => true], 'smf_login');
Utils::$context['member_id'] = 0;
Utils::$context['sub_template'] = 'resend';
Utils::$context['page_title'] = Lang::$txt['invalid_activation_resend'];
Utils::$context['can_activate'] = empty(Config::$modSettings['registration_method']) || Config::$modSettings['registration_method'] == '1';
Utils::$context['default_username'] = $_GET['user'] ?? '';
Utils::$context['default_password'] = '';

return;
}
Expand Down Expand Up @@ -216,6 +218,7 @@ public function execute(): void
Mail::adminNotify('activation', $row['id_member'], $row['member_name']);
}

Theme::loadJavaScriptFile('login.js', ['minimize' => true], 'smf_login');
Utils::$context += [
'page_title' => Lang::$txt['registration_successful'],
'sub_template' => 'login',
Expand Down
26 changes: 22 additions & 4 deletions Sources/Actions/Admin/Features.php
Original file line number Diff line number Diff line change
Expand Up @@ -1532,10 +1532,10 @@ public static function basicConfigVars(): array
'select',
'jquery_source',
[
'cdn' => Lang::$txt['jquery_google_cdn'],
'jquery_cdn' => Lang::$txt['jquery_jquery_cdn'],
'microsoft_cdn' => Lang::$txt['jquery_microsoft_cdn'],
'local' => Lang::$txt['jquery_local'],
'cdn' => Lang::$txt['google_cdn'],
'jquery_cdn' => Lang::$txt['jquery_cdn'],
'microsoft_cdn' => Lang::$txt['microsoft_cdn'],
'local' => Lang::$txt['local_cdn'],
'custom' => Lang::$txt['jquery_custom'],
],
'onchange' => 'if (this.value == \'custom\'){document.getElementById(\'jquery_custom\').disabled = false; } else {document.getElementById(\'jquery_custom\').disabled = true;}',
Expand All @@ -1545,6 +1545,24 @@ public static function basicConfigVars(): array
'jquery_custom',
'disabled' => !isset(Config::$modSettings['jquery_source']) || (isset(Config::$modSettings['jquery_source']) && Config::$modSettings['jquery_source'] != 'custom'), 'size' => 75,
],

// FontAwesome source
[
'select',
'fontawesome_source',
[
'cdn' => Lang::$txt['cloudflare_cdn'],
'fontawesome_cdn' => Lang::$txt['fontawesome_cdn'],
'local' => Lang::$txt['local_cdn'],
'custom' => Lang::$txt['fontawesome_custom'],
],
'onchange' => 'if (this.value == \'custom\'){document.getElementById(\'fontawesome_custom\').disabled = false; } else {document.getElementById(\'fontawesome_custom\').disabled = true;}',
],
[
'text',
'fontawesome_custom',
'disabled' => !isset(Config::$modSettings['fontawesome_source']) || (isset(Config::$modSettings['fontawesome_source']) && Config::$modSettings['fontawesome_source'] != 'custom'), 'size' => 75,
],
'',

// css and js minification.
Expand Down
39 changes: 25 additions & 14 deletions Sources/Actions/Admin/Maintenance.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ class Maintenance implements ActionInterface
public static array $subactions = [
'routine' => [
'function' => 'routine',
'template' => 'maintain_routine',
'activities' => [
'version' => 'version',
'repair' => 'repair',
Expand All @@ -92,7 +91,6 @@ class Maintenance implements ActionInterface
],
'database' => [
'function' => 'database',
'template' => 'maintain_database',
'activities' => [
'optimize' => 'optimize',
'convertentities' => 'entitiesToUnicode',
Expand Down Expand Up @@ -162,32 +160,45 @@ public function routine(): void
if (isset($_GET['done']) && in_array($_GET['done'], ['recount', 'rebuild_settings'])) {
Utils::$context['maintenance_finished'] = Lang::$txt['maintain_' . $_GET['done']];
}
Utils::$context['template_layers'][] = 'maintain';
Utils::$context['options'] = array_combine(
array_keys(self::$subactions[$this->subaction]['activities']),
array_fill(0, count(self::$subactions[$this->subaction]['activities']), []),
);
Utils::$context['post_url'] = Config::$scripturl . '?action=admin;area=maintain';
}

/**
* Supporting function for the database maintenance area.
*/
public function database(): void
{
Utils::$context['template_layers'][] = 'maintain';
Utils::$context['options'] = array_combine(
array_keys(self::$subactions[$this->subaction]['activities']),
array_fill(0, count(self::$subactions[$this->subaction]['activities']), []),
);
Utils::$context['post_url'] = Config::$scripturl . '?action=admin;area=maintain;sa=database';

// Show some conversion options?
Utils::$context['convert_entities'] = isset(Config::$modSettings['global_character_set']) && Config::$modSettings['global_character_set'] === 'UTF-8';
if (!isset(Config::$modSettings['global_character_set']) || Config::$modSettings['global_character_set'] !== 'UTF-8') {
unset(Utils::$context['options']['convertentities']);
}

if (Config::$db_type == 'mysql') {
$colData = Db::$db->list_columns('{db_prefix}messages', true);
$body_type = array_column(Db::$db->list_columns('{db_prefix}messages', true), 'type', 'name')['body'];
Utils::$context['options']['convertmsgbody']['title'] = Lang::$txt[($body_type == 'text' ? 'mediumtext' : 'text') . '_title'];
Utils::$context['options']['convertmsgbody']['info'] = Lang::$txt['mediumtext_info'];

foreach ($colData as $column) {
if ($column['name'] == 'body') {
$body_type = $column['type'];
}
if ($body_type != 'text' && !empty(Config::$modSettings['max_messageLength']) && Config::$modSettings['max_messageLength'] < 65536) {
Utils::$context['options']['convertmsgbody']['after'] = '<p class="infobox">' . Lang::$txt['convert_to_suggest_text'] . '</p>';
}

Utils::$context['convert_to'] = $body_type == 'text' ? 'mediumtext' : 'text';

Utils::$context['convert_to_suggest'] = ($body_type != 'text' && !empty(Config::$modSettings['max_messageLength']) && Config::$modSettings['max_messageLength'] < 65536);
} else {
unset(Utils::$context['options']['convertmsgbody']);
}

if (isset($_GET['done']) && $_GET['done'] == 'convertentities') {
Utils::$context['maintenance_finished'] = Lang::$txt['entity_convert_title'];
Utils::$context['maintenance_finished'] = Lang::$txt['maintain_convertentities_title'];
}
}

Expand Down Expand Up @@ -2319,7 +2330,7 @@ protected function __construct()
// Set a few things.
Utils::$context['page_title'] = Lang::$txt['maintain_title'];
Utils::$context['sub_action'] = $this->subaction;
Utils::$context['sub_template'] = !empty(self::$subactions[$this->subaction]['template']) ? self::$subactions[$this->subaction]['template'] : '';
Utils::$context['sub_template'] = self::$subactions[$this->subaction]['template'] ?? 'maintain_options';
}

/**
Expand Down
Loading