如题
解决方案 »
- 不错的PHP zend 视频教程
- Smarty的疑问
- 【急】简单分页算法的修改!!!!
- 请问在php mvc 中 在v层中应该怎样调取c中的方法呢?
- 急!真急,在线等,mentinfo 默认模板下的index.html内容全部删除掉,预览还是显示内容?怎么回事?
- 求 ANSI编码转UTF8编码 实现代码
- 有谁能帮我配IIS7+PHP5环境 跪求!!
- 页面跳转后提示HTTP 错误 500(Internal Server Error):服务器尝试执行请求时遇到了意外情况。
- sublime text 3 build 3059 中文 注册 下载
- 扫码单车 扫码充电
- 求cakephp框架小实例
- 如何实现一个FORM中多个提交;php同一个页面提交多个按钮为什么只能一个起作用
global $dictionary; //reverse the sort order so priority goes highest to lowest;
$templates = array_reverse($templates);
foreach($templates as $template){
VardefManager::addTemplate($module,$object,$template, $object_name);
}
LanguageManager::createLanguageFile($module, $templates); $vardef_paths = array(
'custom/modules/'.$module.'/Ext/Vardefs/vardefs.ext.php',
'custom/Extension/modules/'.$module.'/Ext/Vardefs/vardefs.php'
); //search a predefined set of locations for the vardef files
foreach($vardef_paths as $path){
if(file_exists($path)){
require($path);
}
}
}
function addTemplate($module, $object, $template, $object_name=false){
if($template == 'default')$template = 'basic';
$templates = array();
$fields = array();
if(empty($object_name))$object_name = $object;
$_object_name = strtolower($object_name);
if(!empty($GLOBALS['dictionary'][$object]['table'])){
$table_name = $GLOBALS['dictionary'][$object]['table'];
}else{
$table_name = strtolower($module);
}
if(empty($templates[$template])){
$path = 'include/SugarObjects/templates/' . $template . '/vardefs.php';
if(file_exists($path)){
require($path);
$templates[$template] = $vardefs;
}else{
$path = 'include/SugarObjects/implements/' . $template . '/vardefs.php';
if(file_exists($path)){
require($path);
$templates[$template] = $vardefs;
}
}
} if(!empty($templates[$template])){
if(empty($GLOBALS['dictionary'][$object]['fields']))$GLOBALS['dictionary'][$object]['fields'] = array();
if(empty($GLOBALS['dictionary'][$object]['relationships']))$GLOBALS['dictionary'][$object]['relationships'] = array();
if(empty($GLOBALS['dictionary'][$object]['indices']))$GLOBALS['dictionary'][$object]['indices'] = array();
$GLOBALS['dictionary'][$object]['fields'] = array_merge($templates[$template]['fields'], $GLOBALS['dictionary'][$object]['fields']);
if(!empty($templates[$template]['relationships']))$GLOBALS['dictionary'][$object]['relationships'] = array_merge($templates[$template]['relationships'], $GLOBALS['dictionary'][$object]['relationships']);
if(!empty($templates[$template]['indices']))$GLOBALS['dictionary'][$object]['indices'] = array_merge($templates[$template]['indices'], $GLOBALS['dictionary'][$object]['indices']);
// maintain a record of this objects inheritance from the SugarObject templates...
$GLOBALS['dictionary'][$object]['templates'][ $template ] = $template ;
}
}
/**
http://bbs.cnsoftware.cn