<?php

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

class CLASSNAME_install extends \Ciext\Controller\AbstractInstallController
{

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

        // Set acl module name
        $this->module_config['module_acl_name'] = 'MODULE';

        // Set title
        $this->module_config['module_title'] = $this->lang->line('CLASSNAME');
        
        // Set module image
        $this->module_config['module_image'] = '';

        // Set actions
        $this->module_config['module_actions'] = array(
            // 'acl_action' => 'description'
            'view_MODULE' => $this->lang->line('View'),
            'edit_MODULE' => $this->lang->line('Edit'),
        );

        // Set menu items
        $this->module_config['module_menu_items'] = array(
//            array('method in admin controller', 'title in menu', 'path to the image. empty - default image', 'acl_action')
            array('index', $this->lang->line('View'), '', 'view_MODULE'),
        );
    }

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

    public function uninstall($options = [])
    {
        return parent::uninstall([
                    'dropTables' => [
//                        'myTable',
                    ],
        ]);
    }

}
