get_id() !== 'menubar' || !method_exists($menu, 'register_block')) { return; } if (!class_exists('RegisteredBlock')) { return; } $menu->register_block(new RegisteredBlock( 'mbBratonienCustomerQr', 'QR-Code hochladen', BRATONIEN_TOOLS_ID )); } function bratonien_tools_customer_qr_prepare_frontend_menu($menu_ref_array) { if (defined('IN_ADMIN')) { return; } $settings = bratonien_tools_customer_qr_settings(); if (empty($settings['enabled'])) { return; } if (!is_array($menu_ref_array) || empty($menu_ref_array[0]) || !is_object($menu_ref_array[0])) { return; } $menu = $menu_ref_array[0]; if (!method_exists($menu, 'get_id') || $menu->get_id() !== 'menubar') { return; } $block = $menu->get_block('mbBratonienCustomerQr'); if ($block === null) { return; } $url = htmlspecialchars( get_root_url().'plugins/'.BRATONIEN_TOOLS_ID.'/customer-qr-upload.php', ENT_QUOTES, 'UTF-8' ); // Bootstrap Darkroom renders raw-content blocks directly in the root navbar. // Keeping this as a separate Piwigo menu block avoids hiding the customer // action inside mbMenu/"Entdecken" and still follows the normal menubar // lifecycle instead of modifying the theme. $block->raw_content = '