errors.php 1.7 KB
<?php
    /**
	* @Description : Error Message
	* @Package : Drag & Drop Multiple File Upload - Contact Form 7
	* @Author : CodeDropz
	*/

    if ( ! defined( 'ABSPATH' ) || ! defined('dnd_upload_cf7') || ! defined('dnd_upload_cf7_PRO') ) {
		exit;
	}

    class CodeDropz_Uploader_Errors {

        private static $instance = null;

        public $error_message = array();

        public $wp_dir = array();

        public static function get_instance() {
            if( null === self::$instance ) {
                self::$instance = new self();
            }
            return self::$instance;
        }

        public function __construct(){

            // Set default error message
            $this->error_message = array(
                'server_limit'		=>	__('The uploaded file exceeds the maximum upload size of your server.','dnd-upload-cf7'),
                'failed_upload'		=>	__('Uploading a file fails for any reason','dnd-upload-cf7'),
                'large_file'		=>	__('Uploaded file is too large','dnd-upload-cf7'),
                'invalid_type'		=>	__('Uploaded file is not allowed for file type','dnd-upload-cf7'),
                'maxNumFiles'		=>	__('You have reached the maximum number of files ( Only %s files allowed )','dnd-upload-cf7'),
                'maxTotalSize'		=>	__('The total file(s) size exceeding the max size limit of %s.','dnd-upload-cf7'),
                'maxUploadLimit'	=>	__('Note : Some of the files could not be uploaded ( Only %s files allowed )','dnd-upload-cf7'),
                'minFileUpload'		=>	__('Minimum file upload at least','dnd-upload-cf7')
            );

        }

        public function get_error_message() {
            return $this->error_message;
        }

    }