YetiForceCompany/YetiForceCRM

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

Summary

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

/**
 * Settings search index view class.
 *
 * @copyright YetiForce S.A.
 * @license YetiForce Public License 6.5 (licenses/LicenseEN.txt or yetiforce.com)
 */
class Settings_Search_Index_View extends Settings_Vtiger_Index_View
{
    /**
     * Main process.
     *
     * @param \App\Request $request
     */
    public function process(App\Request $request)
    {
        $qualifiedModuleName = $request->getModule(false);
        $viewer = $this->getViewer($request);
        $viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName);
        $viewer->assign('MODULE', $request->getModule());
        $viewer->view('Index.tpl', $qualifiedModuleName);
    }

    /**
     * Function to get the list of Script models to be included.
     *
     * @param \App\Request $request
     *
     * @return array - List of Vtiger_JsScript_Model instances
     */
    public function getFooterScripts(App\Request $request)
    {
        $headerScriptInstances = parent::getFooterScripts($request);
        $moduleName = $request->getModule();
        $jsFileNames = [
            "modules.Settings.$moduleName.resources.Search",
        ];
        $jsScriptInstances = $this->checkAndConvertJsScripts($jsFileNames);

        return array_merge($headerScriptInstances, $jsScriptInstances);
    }
}