<?php
/**
 * @package         CDN for Joomla!
 * @version         7.3.6PRO
 * 
 * @author          Peter van Westen <info@regularlabs.com>
 * @link            https://regularlabs.com
 * @copyright       Copyright © 2025 Regular Labs All Rights Reserved
 * @license         GNU General Public License version 2 or later
 */

namespace RegularLabs\Plugin\System\CDNForJoomla\Extension;

use RegularLabs\Library\Plugin\System as RL_SystemPlugin;
use RegularLabs\Plugin\System\CDNForJoomla\Replace;

defined('_JEXEC') or die;

final class CDNForJoomla extends RL_SystemPlugin
{
    public $_lang_prefix = 'CDN';
    public $_page_types  = ['html', 'feed', 'ajax', 'json', 'raw'];

    protected function changeFinalHtmlOutput(string &$html): bool
    {
        Replace::replace($html);

        return true;
    }

    protected function cleanFinalHtmlOutput(string &$html): void
    {
        $html = str_replace(['{nocdn}', '{/nocdn}'], '', $html);
    }
}
