diff --git a/core/migrations/20240720110121_change_widgets_location_length.php b/core/migrations/20240720110121_change_widgets_location_length.php new file mode 100644 index 0000000000..152f59b711 --- /dev/null +++ b/core/migrations/20240720110121_change_widgets_location_length.php @@ -0,0 +1,15 @@ +table('nl2_widgets'); + $table->changeColumn('location', 'string', ['length' => 16, 'default' => 'right']); + $table->update(); + } +} \ No newline at end of file diff --git a/core/templates/navbar.php b/core/templates/navbar.php index 5051c3c744..ceae531cc7 100644 --- a/core/templates/navbar.php +++ b/core/templates/navbar.php @@ -2,7 +2,7 @@ /* * Made by Samerton * https://github.com/NamelessMC/Nameless/ - * NamelessMC version 2.0.0-pr8 + * NamelessMC version 2.2.0 * * License: MIT * @@ -190,6 +190,8 @@ ), 'INTERNET_EXPLORER_HEADER' => $language->get('general', 'internet_explorer_header'), 'INTERNET_EXPLORER_INFO' => $language->get('general', 'internet_explorer_info'), + 'WIDGETS_TOP' => $widgets->getWidgets('top'), + 'WIDGETS_FOOTER' => $widgets->getWidgets('footer'), ]); if ($user->isLoggedIn()) { diff --git a/custom/panel_templates/Default/core/widgets_edit.tpl b/custom/panel_templates/Default/core/widgets_edit.tpl index 36a0f74e03..52b1d00515 100644 --- a/custom/panel_templates/Default/core/widgets_edit.tpl +++ b/custom/panel_templates/Default/core/widgets_edit.tpl @@ -66,6 +66,8 @@ diff --git a/custom/templates/DefaultRevamp/footer.tpl b/custom/templates/DefaultRevamp/footer.tpl index dec3163d49..58cf73ec68 100755 --- a/custom/templates/DefaultRevamp/footer.tpl +++ b/custom/templates/DefaultRevamp/footer.tpl @@ -1,3 +1,8 @@ + {if count($WIDGETS_FOOTER)} + {foreach from=$WIDGETS_FOOTER item=widget} + {$widget} + {/foreach} + {/if} diff --git a/custom/templates/DefaultRevamp/navbar.tpl b/custom/templates/DefaultRevamp/navbar.tpl index c574b83742..8f238ff016 100755 --- a/custom/templates/DefaultRevamp/navbar.tpl +++ b/custom/templates/DefaultRevamp/navbar.tpl @@ -196,3 +196,9 @@ {$MAINTENANCE_ENABLED} {/if} + + {if count($WIDGETS_TOP)} + {foreach from=$WIDGETS_TOP item=widget} + {$widget} + {/foreach} + {/if} diff --git a/modules/Core/language/en_UK.json b/modules/Core/language/en_UK.json index 96862c97f3..5a11f1e26d 100644 --- a/modules/Core/language/en_UK.json +++ b/modules/Core/language/en_UK.json @@ -777,6 +777,8 @@ "admin/debugging_enabled": "Debugging is enabled, sensitive information may be exposed to unauthorised visitors. Debugging should only be used for development, not on public sites.", "admin/require_minecraft_username_on_registration": "Require Minecraft Username on registration?", "admin/integration_settings_does_not_exist": "Integration settings file for integration {{integration}} does not exist", + "admin/top": "Top", + "admin/footer": "Footer", "api/account_validated": "Account validated successfully", "api/finish_registration_email": "Please check your emails to complete registration.", "api/finish_registration_link": "Please click on the following link to complete registration:", diff --git a/modules/Core/pages/panel/widgets.php b/modules/Core/pages/panel/widgets.php index 3fc554871f..fe61daed7a 100644 --- a/modules/Core/pages/panel/widgets.php +++ b/modules/Core/pages/panel/widgets.php @@ -162,7 +162,7 @@ $order = ($_POST['order'] ?? 10); $location = Input::get('location'); - if (!in_array($location, ['left', 'right'])) { + if (!in_array($location, ['left', 'right', 'top', 'footer'])) { $location = 'right'; } @@ -191,7 +191,7 @@ } $location = Output::getClean($widget_instance->getLocation()); - if (!in_array($location, ['left', 'right'])) { + if (!in_array($location, ['left', 'right', 'top', 'footer'])) { $location = 'right'; } @@ -208,6 +208,8 @@ 'WIDGET_LOCATION' => $language->get('admin', 'widget_location'), 'LEFT' => $language->get('admin', 'left'), 'RIGHT' => $language->get('admin', 'right'), + 'TOP' => $language->get('admin', 'top'), + 'FOOTER' => $language->get('admin', 'footer'), 'ACTIVE_PAGES' => $active_pages, 'POSSIBLE_PAGES' => $pages->returnWidgetPages(), 'MODULE' => $language->get('admin', 'module'),