<?php if (!defined('DASHBOARD_ROOT')) { http_response_code(403); exit; } RBAC::enforce('view.reviews'); require_once DASHBOARD_ROOT . '/modules/content/reviews_moderator.php'; ?><?php if ($rvMsg === 'approved'): ?> <div class="toast toast-create">Review approved and published.</div><?php elseif ($rvMsg === 'rejected'): ?> <div class="toast toast-modify">Review rejected.</div><?php elseif ($rvMsg === 'deleted'): ?> <div class="toast toast-del">Review permanently deleted.</div><?php elseif ($rvMsg === 'replied'): ?> <div class="toast toast-create">Admin reply encrypted and saved.</div><?php elseif ($rvMsg === 'empty_reply'): ?> <div class="toast toast-del">Reply cannot be empty.</div><?php endif; ?> <script nonce="<?= $cspNonce ?? '' ?>"> (function(){ document.querySelectorAll('[data-confirm]').forEach(function(f){ f.addEventListener('submit',function(e){if(!confirm(f.dataset.confirm))e.preventDefault();}); }); document.querySelectorAll('[data-rv-reply]').forEach(function(btn){ btn.addEventListener('click',function(){ var rid=btn.getAttribute('data-rv-reply'); var detail=document.getElementById('rv-detail-'+rid); if(detail)detail.style.display=detail.style.display==='none'?'table-row':'none'; var form=document.getElementById('rv-reply-form-'+rid); if(form)form.style.display=form.style.display==='none'?'block':'none'; }); }); document.getElementById('rv-table').addEventListener('click',function(e){ var row=e.target.closest('tr[id^="rv-row-"]'); if(!row||e.target.closest('button,a,form,input'))return; var rid=row.id.replace('rv-row-',''); var detail=document.getElementById('rv-detail-'+rid); if(detail)detail.style.display=detail.style.display==='none'?'table-row':'none'; }); })(); </script>