get('page'); $page = preg_replace('/[^a-zA-Z0-9-_]/', '', $page); $path = vglobal('root_directory') . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'Workflow2' . DIRECTORY_SEPARATOR . 'extends' . DIRECTORY_SEPARATOR . 'pluginpages' . DIRECTORY_SEPARATOR; if(file_exists($path . strtolower($page) . '.php')) { require $path . strtolower($page) . '.php'; } } /** * Function to get the list of Script models to be included * @param Vtiger_Request $request * @return - List of Vtiger_JsScript_Model instances */ function getHeaderScripts(Vtiger_Request $request) { $headerScriptInstances = parent::getHeaderScripts($request); $moduleName = $request->getModule(); $jsFileNames = array( "modules.Settings.$moduleName.views.resources.Workflow2", ); $jsScriptInstances = $this->checkAndConvertJsScripts($jsFileNames); $headerScriptInstances = array_merge($headerScriptInstances, $jsScriptInstances); $moduleModel = Vtiger_Module_Model::getInstance($moduleName); foreach($headerScriptInstances as $obj) { $src = $obj->get('src'); if(!empty($src) && strpos($src, $moduleName) !== false) { $obj->set('src', $src.'?v='.$moduleModel->version); } } return $headerScriptInstances; } function getHeaderCss(Vtiger_Request $request) { $headerScriptInstances = parent::getHeaderCss($request); $moduleName = $request->getModule(); $cssFileNames = array( "~/modules/Settings/$moduleName/views/resources/Workflow2.css", ); $cssScriptInstances = $this->checkAndConvertCssStyles($cssFileNames); $headerStyleInstances = array_merge($headerScriptInstances, $cssScriptInstances); return $headerStyleInstances; } }