- Introduced a new `CampaignAlerts` class for handling alerts logic. - Added database migration for `campaign_alerts` table creation. - Implemented methods for fetching, marking, and deleting alerts in the `CampaignAlerts` factory class. - Created a new view for displaying campaign alerts with filtering options. - Updated the main client view to include a badge for the number of alerts. - Enhanced sync functionality to support campaigns and products separately. - Adjusted styles for alert badges in the UI.
28 lines
622 B
PHP
28 lines
622 B
PHP
<?php
|
|
namespace view;
|
|
class Site
|
|
{
|
|
public static function show()
|
|
{
|
|
global $user, $current_module;
|
|
|
|
$tpl = new \Tpl;
|
|
$tpl -> content = \controls\Site::route();
|
|
|
|
if ( !$user )
|
|
return $tpl -> render( 'site/layout-unlogged' );
|
|
else
|
|
{
|
|
$tpl -> user = $user;
|
|
$tpl -> current_module = $current_module;
|
|
$tpl -> campaign_alerts_count = \factory\CampaignAlerts::get_unseen_count();
|
|
if ( $alert = \S::get_session( 'alert' ) )
|
|
{
|
|
$tpl -> alert = $alert;
|
|
unset( $_SESSION['alert'] );
|
|
}
|
|
return $tpl -> render( 'site/layout-logged' );
|
|
}
|
|
}
|
|
}
|