<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Response
 *
 * @author Vitalii Aloksa
 */
namespace MGModule\DNSManager2\mgLibs\ModuleAPI;
use \MGModule\DNSManager2\mgLibs\lang;


class Response
{
    
    
    public static function successZoneRemove( )
    {
        return array('message' => lang::T( 'addonCA','dashboard', 'infos' ,'zone_removed_successfully' ));
    }
    
    
    public static function successZoneCreate( )
    {
        return array('message' => lang::T( 'addonCA','dashboard', 'infos' ,'zone_created_successfully' ));
    }
    
    
    
    public static function successZoneUpdate( )
    {
        return array('message' => lang::T( 'addonCA','dashboard', 'infos' ,'zone_updated_successfully' ));
    }
    
    
    public static function successRecordsRemove( )
    {
        return array('message' => lang::T( 'addonCA','dashboard', 'infos' ,'records_removed_successfully' ));
    }
    
    
    public static function successRecordsCreate( )
    {
        return array('message' => lang::T( 'addonCA','dashboard', 'infos' ,'records_created_successfully' ));
    }
    
    
    
    public static function successRecordsUpdate( )
    {
        return array('message' => lang::T( 'addonCA','dashboard', 'infos' ,'records_updated_successfully' ));
    }
    
    
    
    public static function errorSubmodule( $param )
    {
        $erros = array(
            'default' => '"There have been problems with Submodule. Please try again later.',
            'notfound' => lang::T( 'addonCA','dns_submodule_connection_problem' )
                );
        
        
        return isset($erros[$param]) ? $erros[$param] : $erros['default'];
    }
    
    
    public static function proccessExceptionResponse( &$errors, $Exception )
    {
        $trace = $Exception->getTrace();
        if(!strpos($trace[0]['class'], '\loader'))
        {
            $errors[] = $Exception->getMessage();
            return ;
        }
    }
    
    
    
    
    
    
}
