static function getSmartyCompiledTemplateFile($template_file, $path = null) { $root_directory = vglobal('root_directory'); if ($path == null) { $path = $root_directory . 'cache/templates_c/'; } $mydir = @opendir($path); $compiled_file = null; while (false !== ($file = readdir($mydir)) && $compiled_file == null) { if ($file != "." && $file != ".." && $file != ".svn") { //chmod($path.$file, 0777); if (is_dir($path . $file)) { chdir('.'); $compiled_file = get_smarty_compiled_file($template_file, $path . $file . '/'); //rmdir($path.$file) or DIE("couldn't delete $path$file<br />"); // No need to delete the directories. } else { // Check if the file name matches the required template fiel name if (strripos($file, $template_file . '.php') == strlen($file) - strlen($template_file . '.php')) { $compiled_file = $path . $file; } } } } @closedir($mydir); return $compiled_file; }
/********************************************************************************* * The contents of this file are subject to the vtiger CRM Public License Version 1.0 * ("License"); You may not use this file except in compliance with the License * The Original Code is: vtiger CRM Open Source * The Initial Developer of the Original Code is vtiger. * Portions created by vtiger are Copyright (C) vtiger. * All Rights Reserved. * ********************************************************************************/ global $current_user; if ($current_user->is_admin != 'on') { die("<br><br><center>" . $app_strings['LBL_PERMISSION'] . " <a href='javascript:window.history.back()'>" . $app_strings['LBL_GO_BACK'] . ".</a></center>"); } // Remove the MigrationStep0.tpl file from Smarty cache $migration_tpl_file = get_smarty_compiled_file('MigrationStep0.tpl'); if ($migration_tpl_file != null) { unlink($migration_tpl_file); } global $adb, $default_charset, $theme; $theme_path = "themes/" . $theme . "/"; $image_path = $theme_path . "images/"; $smarty = new vtigerCRM_Smarty(); $smarty->assign("MOD", $mod_strings); $smarty->assign("APP", $app_strings); $smarty->assign("MODULE", "Migration"); $smarty->assign("THEME", $theme); $smarty->assign("IMAGE_PATH", $image_path); if ($adb->isPostgres()) { $db_status = '1'; } else {