<?php
namespace NeoAnimateBeta\NeoDraw; if (!defined("ABSPATH")) { die("neoWP direct access not allowed"); }




\NeoAnimateBeta\NeoGlobal\add_action_hook("current_screen", function ($hook) {
    
    if (!($hook instanceof \WP_Screen && $hook->base === "media" && $hook->action === "add")) { return; }
    [$neo_library_page_url, $interface_ok] = \NeoAnimateBeta\NeoGlobal\call_interface_func_implemented('\NeoAnimateBeta\NeoLibrary\interface_neo_library_menu_page_url_20250618')();
    if (!$interface_ok) { $neo_library_page_url = admin_url("admin.php?page=" . \NeoAnimateBeta\NeoGlobal\plugin_settings_page_slug()); }
    \NeoAnimateBeta\NeoGlobal\enqueue_js_variable_backend("neoDrawUploadOldHintLibraryUrl", $neo_library_page_url);
    \NeoAnimateBeta\NeoGlobal\enqueue_js("neo-draw--upload-old-hint.js");
});

\NeoAnimateBeta\NeoGlobal\add_action_hook("admin_head",                            function () { ?><style>#post-upload-info::after { content: "Use the neoLibrary to upload neoDraw SVG files correctly."; }</style><?php });
\NeoAnimateBeta\NeoGlobal\add_action_hook("elementor/editor/after_enqueue_styles", function () { ?><style>#post-upload-info::after { content: "Use the neoLibrary to upload neoDraw SVG files correctly."; }</style><?php });

if (str_starts_with(\NeoAnimateBeta\NeoGlobal\request_uri(), "/wp-admin/async-upload.php")) {
    \NeoAnimateBeta\NeoGlobal\add_filter_hook("gettext:1", function ($translated_text, $text, $domain) {
        if (isset($_SERVER["HTTP_X_NEO_LIBRARY"])) { return $translated_text; }
        if (!($text === "Sorry, you are not allowed to upload this file type.")) { return $translated_text; }
        return $translated_text . " ▶︎▶︎ " . \NeoAnimateBeta\NeoGlobal\neo__("Use the neoLibrary to upload neoDraw SVG files correctly.", "Verwende die neoLibrary, um neoDraw SVG-Dateien korrekt hochzuladen.") . " ◀︎◀︎";
    });
}
