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

/**
 * Controller ciext_help_admin
 *
 * @author Roman Ratsun
 */
class ciext_help_admin extends MX_Controller
{

    public function __construct()
    {
        // Load language file
        $this->load->library('gettext_language');
        $this->gettext_language->load(__DIR__.'/../language/'.$this->config->item('language').'.po');
    }

    /**
     * Render documentation page
     *
     * @return array
     */
    public function documentation()
    {
        // checking rules
        if (!$this->rt_user->isAllowed('ciext_help', 'view_ciext_help')) {
            show_404();
        }

        // load model
        $this->load->model('ciext_help/ciext_help_model');

        // get content data
        $content = $this->ciext_help_model->get_documentation_content();

        return [
            'content' => $this->parser->parse('ciext_help/documentation', $content, TRUE),
            'title'   => $this->lang->line('Ciext help')
        ];
    }
}
