- Rename UI labels from "Addons Manager" to "Server Content Manager" - Add server_content_categories.php: central category map with 8 types - Bump module db_version 1→2 with safe VARCHAR(32) migration for addon_type - addons_manager.php: use category map for type list + comments - addons_installer.php: use category map + full TODO blocks for Phase 2+ - user_addons.php: dynamic category iteration via category map - monitor_buttons.php: updated header comment - English lang: updated all user-visible strings, added new type labels - global.php + gamemanager.php: updated LANG_addons_manager, LANG_user_addons, LANG_addons - Created SERVER_CONTENT_ROADMAP.md with full review and migration plan Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/1e8f1b08-96d6-4c47-8f27-efe972d7cf17 Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
39 lines
1.6 KiB
PHP
39 lines
1.6 KiB
PHP
<?php
|
|
/*
|
|
*
|
|
* GSP - Game Server Panel (a heavily customized fork of OGP maintained by WDS)
|
|
*
|
|
* Monitor button: Server Content (module: addonsmanager)
|
|
* ─────────────────────────────────────────────────────────────────────────────
|
|
* Injects a "Server Content" button into the game monitor toolbar when at
|
|
* least one Server Content item is configured for the server's game type.
|
|
*
|
|
*/
|
|
|
|
$query_groups = "";
|
|
if($_SESSION['users_role'] != "admin")
|
|
{
|
|
$groups = $db->getUsersGroups($_SESSION['user_id']);
|
|
if (!is_array($groups)) {
|
|
$groups = [];
|
|
}
|
|
$query_groups .= " AND (";
|
|
foreach ((array)$groups as $group)
|
|
$query_groups .= "group_id=".$group['group_id']." OR ";
|
|
$query_groups .= "group_id=0 OR group_id IS NULL)";
|
|
}
|
|
$addons = $db->resultQuery("SELECT addon_id FROM OGP_DB_PREFIXaddons WHERE home_cfg_id=".$server_home['home_cfg_id'].$query_groups);
|
|
$addons_qty = is_array($addons) ? count((array)$addons) : 0;
|
|
if($addons and $addons_qty >= 1){
|
|
$module_buttons = array(
|
|
"<a class='monitorbutton' href='?m=addonsmanager&p=user_addons&home_id=".
|
|
$server_home['home_id']."&mod_id=".$server_home['mod_id'].
|
|
"&ip=".$server_home['ip']."&port=".$server_home['port']."'>
|
|
<img src='" . check_theme_image("modules/administration/images/addons_manager.png") . "' title='". get_lang("addons") ."'>
|
|
<span>". get_lang("addons") ." (".$addons_qty.")</span>
|
|
</a>"
|
|
);
|
|
}
|
|
else
|
|
$module_buttons = array();
|
|
?>
|