<?php

namespace admin\controls;

class Emails{
  
  public static function view_list()
  {
    global $user;
    if( !\admin\factory\Users::check_privileges( 'emails_administration', $user['id']))
             return \S::alert('Nie masz uprawnień');
    return \admin\view\Emails::emails_list(); 
  }
  
  public static function email_details()
  {
    global $user;
    if( !\admin\factory\Users::check_privileges( 'emails_administration', $user['id']))
             return \S::alert('Nie masz uprawnień');
    
    return \admin\view\Emails::email_details( 
              \admin\factory\Emails::email_details( 
                  \S::get( 'id' ) 
                )
            );
  }
}
  
