| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package FireBox |
| 4 |
* @version 3.1.14 Free |
| 5 |
* |
| 6 |
* @author FirePlugins <[email protected]> |
| 7 |
* @link https://www.fireplugins.com |
| 8 |
* @copyright Copyright © 2026 FirePlugins All Rights Reserved |
| 9 |
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later |
| 10 |
*/ |
| 11 |
|
| 12 |
if (!defined('ABSPATH')) |
| 13 |
{ |
| 14 |
exit; // Exit if accessed directly. |
| 15 |
} |
| 16 |
|
| 17 |
if (!current_user_can('read_fireboxes')) |
| 18 |
{ |
| 19 |
esc_html_e('Sorry, you are not allowed to access this page.', 'firebox'); |
| 20 |
return; |
| 21 |
} |
| 22 |
?> |
| 23 |
<h1 class="mb-3 text-default text-[32px] dark:text-white flex gap-1 items-center fp-admin-page-title"><?php echo esc_html(firebox()->_('FB_CAMPAIGNS')); ?></h1> |
| 24 |
|
| 25 |
<?php if (\FireBox\Core\Controllers\Campaigns::useDataViews()) : ?> |
| 26 |
<div id="fbox-campaigns-root"> |
| 27 |
<?php // Pre-mount placeholder: mirrors the React LoadingSkeleton so the table |
| 28 |
// structure is visible before the bundle loads. React replaces it on mount. ?> |
| 29 |
<div class="fbox-campaigns-app"> |
| 30 |
<div class="fbox-campaigns-skeleton" role="status" aria-label="<?php esc_attr_e('Loading campaigns…', 'firebox'); ?>"> |
| 31 |
<?php for ($row = 0; $row < 8; $row++) : ?> |
| 32 |
<div class="fbox-campaigns-skeleton__row"> |
| 33 |
<?php for ($cell = 0; $cell < 6; $cell++) : ?> |
| 34 |
<div class="fbox-campaigns-skeleton__cell"></div> |
| 35 |
<?php endfor; ?> |
| 36 |
</div> |
| 37 |
<?php endfor; ?> |
| 38 |
</div> |
| 39 |
</div> |
| 40 |
</div> |
| 41 |
<?php else : |
| 42 |
$table = new \FireBox\Core\FB\CampaignsList(); |
| 43 |
|
| 44 |
// Process bulk actions and show notices |
| 45 |
$table->process_bulk_action(); |
| 46 |
do_action('fpframework/admin/notices'); |
| 47 |
?> |
| 48 |
<form action="" method="get"> |
| 49 |
<?php |
| 50 |
$table->views(); |
| 51 |
$table->prepare_items(); |
| 52 |
$table->search_box(firebox()->_('FB_SEARCH_CAMPAIGNS'), 'firebox-campaign' ); |
| 53 |
$table->display(); |
| 54 |
?> |
| 55 |
<input type="hidden" name="page" value="firebox-campaigns" /> |
| 56 |
</form> |
| 57 |
<?php endif; ?> |