echo'<p class="sg-lead">Paste these links into OBS as Browser Sources. Use the style builder to change how they look: all links update as you go.</p>';
echo'</div><p class="description">Tick a box to override that color; unticked colors come from the theme.</p></form></div>';
echo'<div class="sg-card"><h2>Links</h2>';
self::urlList(true);
echo'</div>';
echo'<div class="sg-card"><h2>Send a test donation</h2>';
echo'<p>Shows a fake donation on the <strong>Donation alerts</strong> overlay so you can check your OBS setup. Open the alerts preview above (or have OBS running) first, then press the button; the alert appears within a few seconds.</p>';
echo'<p class="description"><strong>How tests are kept out of your numbers:</strong> test donations are not attached to any goal, so they never count towards raised totals, timers or counters. They are excluded from the CSV export, and marked <em>TEST</em> in the Donations list. Test donations are kept in the database until you delete them below.</p>';
echo'<button type="submit" class="button">Delete all test donations</button></form></div>';
echo'<div class="sg-card"><h2>Security</h2><p>The links contain a secret token. If a link was shown on stream or shared by mistake, make new links. The old ones stop working immediately and you will need to paste the new ones into OBS.</p>';
echo'<button type="submit" class="button button-secondary" data-confirm="Make new overlay links? Your current links will stop working and you must update OBS.">Regenerate token</button></form></div>';
Admin::redirect(Admin::url('streamgoals-overlays'),'error','Please enter a valid test amount, for example 5.00.');
}
$id=Store::insertTestDonation($amt,$cur);
Admin::redirect(Admin::url('streamgoals-overlays'),$id?'success':'error',$id?'Test donation sent. Watch your alerts overlay.':'The test donation could not be saved.');
}
publicstaticfunctionhandleDeleteTests():void{
Admin::guard('sg_delete_tests');
$n=Store::deleteTestDonations();
Admin::redirect(Admin::url('streamgoals-overlays'),'success',$n.' test donation(s) deleted.');