/** * Deletes an existing template * * @param module string module name * @param view string view need (eg DetailView, EditView, etc) */ function deleteTemplate($module, $view) { if (is_file($this->cacheDir . $this->templateDir . $module . '/' . $view . '.tpl')) { // Bug #54634 : RTC 18144 : Cannot add more than 1 user to role but popup is multi-selectable if (!isset($this->ss)) { $this->loadSmarty(); } $cache_file_name = $this->ss->_get_compile_path($this->cacheDir . $this->templateDir . $module . '/' . $view . '.tpl'); SugarCache::cleanFile($cache_file_name); return unlink($this->cacheDir . $this->templateDir . $module . '/' . $view . '.tpl'); } return false; }
private function writeUnifiedSearchModulesDisplayFile($unified_search_modules_display) { if (is_null($unified_search_modules_display) || empty($unified_search_modules_display)) { return false; } sugar_mkdir('custom/modules', null, true); if (!write_array_to_file("unified_search_modules_display", $unified_search_modules_display, 'custom/modules/unified_search_modules_display.php')) { //Log error message and throw Exception global $app_strings; $msg = string_format($app_strings['ERR_FILE_WRITE'], array('custom/modules/unified_search_modules_display.php')); $GLOBALS['log']->error($msg); throw new Exception($msg); } SugarCache::cleanFile('custom/modules/unified_search_modules_display.php'); return true; }