<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}

class emailmng_install extends InstallController
{

    public function __construct()
    {
        parent::__construct();

        // Set acl module name
        $this->module_config['module_acl_name'] = 'emailmng';
        
        // Load language file
        $this->load->library('gettext_language');
        $this->gettext_language->load(__DIR__ . '/../language/' . $this->config->item('language') . '.po');

        // Set title
        $this->module_config['module_title'] = $this->lang->line('E-mail manager');

        // Set module image
        $this->module_config['module_image'] = '';

        // Set actions
        $this->module_config['module_actions'] = array(
            'view_emailmng' => $this->lang->line('View templates'),
            'edit_emailmng' => $this->lang->line('Edit templates'),
            'can_mng_conf'  => $this->lang->line('Configuration'),
            'can_delete'  => $this->lang->line('Can delete templates'),
        );

        // Set menu items
        $this->module_config['module_menu_items'] = array(
            array('configuration', $this->lang->line('Configuration'), '', 'can_mng_conf'),
            array('index', $this->lang->line('View templates'), '', 'view_emailmng'),
        );
    }

    public function install()
    {
        return parent::install(array(
                    'shemaFile' => dirname(__DIR__) . '/data/install.sql',
        ));
    }

    public function uninstall()
    {
        return parent::uninstall(array(
                    'dropTables' => array(
                        'emailmng',
                    ),
        ));
    }

}
