YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/LangManagement/views/Index.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
<?php

/**
 * Settings LangManagement index view class.
 *
 * @copyright YetiForce S.A.
 * @license   YetiForce Public License 6.5 (licenses/LicenseEN.txt or yetiforce.com)
 */
class Settings_LangManagement_Index_View extends Settings_Vtiger_Index_View
{
    /**
     * Process function.
     *
     * @param App\Request $request
     */
    public function process(App\Request $request)
    {
        $moduleName = $request->getModule();
        $qualifiedModuleName = $request->getModule(false);
        $moduleModel = Settings_LangManagement_Module_Model::getInstance($qualifiedModuleName);
        $viewer = $this->getViewer($request);
        $viewer->assign('LANGS', App\Language::getAll());
        $viewer->assign('MODULE_MODEL', $moduleModel);
        $viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName);
        $viewer->assign('MODULE', $moduleName);
        $viewer->assign('IS_NET_CONNECTED', \App\RequestUtil::isNetConnection());
        $viewer->view('Index.tpl', $qualifiedModuleName);
    }

    /**
     * Function to get the list of Script models to be included.
     *
     * @param \App\Request $request
     *
     * @return Vtiger_JsScript_Model[]
     */
    public function getFooterScripts(App\Request $request)
    {
        return array_merge(parent::getFooterScripts($request), $this->checkAndConvertJsScripts([
            'modules.Settings.' . $request->getModule() . '.resources.LangManagement',
            '~libraries/datatables.net/js/jquery.dataTables.js',
            '~libraries/datatables.net-bs4/js/dataTables.bootstrap4.js',
            '~libraries/datatables.net-responsive/js/dataTables.responsive.js',
            '~libraries/datatables.net-responsive-bs4/js/responsive.bootstrap4.js',
            'modules.Vtiger.resources.dashboards.Widget',
            '~libraries/chart.js/dist/Chart.js',
            '~libraries/chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.js'
        ]));
    }

    /**
     * Function to get the list of Css models to be included.
     *
     * @param \App\Request $request
     *
     * @return Vtiger_CssScript_Model[]
     */
    public function getHeaderCss(App\Request $request)
    {
        return array_merge(parent::getHeaderCss($request), $this->checkAndConvertCssStyles([
            '~libraries/datatables.net-bs4/css/dataTables.bootstrap4.css',
            '~libraries/datatables.net-responsive-bs4/css/responsive.bootstrap4.css',
            'modules.Settings.LangManagement.LangManagement',
        ]));
    }
}