本文整理汇总了PHP中Vtiger_Module_Model::getQuickCreateModules方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Module_Model::getQuickCreateModules方法的具体用法?PHP Vtiger_Module_Model::getQuickCreateModules怎么用?PHP Vtiger_Module_Model::getQuickCreateModules使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Module_Model
的用法示例。
在下文中一共展示了Vtiger_Module_Model::getQuickCreateModules方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showFieldLayout
public function showFieldLayout(Vtiger_Request $request)
{
$sourceModule = $request->get('sourceModule');
$menuModelsList = Vtiger_Module_Model::getQuickCreateModules();
if (empty($sourceModule)) {
//To get the first element
$firstElement = reset($menuModelsList);
$sourceModule = array($firstElement->get('name'));
} else {
$sourceModule = array($sourceModule);
}
$quickCreateContents = array();
if (in_array('Calendar', $sourceModule)) {
$sourceModule = array('Calendar', 'Events');
}
foreach ($sourceModule as $module) {
$recordModel = Vtiger_Record_Model::getCleanInstance($module);
$recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_QUICKCREATE);
$quickCreateContents[$module] = $recordStructureInstance->getStructure();
}
$qualifiedModule = $request->getModule(false);
$viewer = $this->getViewer($request);
$viewer->assign('SELECTED_MODULE_NAME', $sourceModule[0]);
$viewer->assign('SUPPORTED_MODULES', $menuModelsList);
$viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
$viewer->assign('RECORDS_STRUCTURE', $quickCreateContents);
$viewer->assign('QUALIFIED_MODULE', $qualifiedModule);
$viewer->view('Index.tpl', $qualifiedModule);
}
示例2: getConfig
public function getConfig($id, $module, $baseModule)
{
$db = PearDatabase::getInstance();
$modulesQuickCreate = Vtiger_Module_Model::getQuickCreateModules(true);
$modules = [];
foreach ($modulesQuickCreate as $moduleName => $moduleModel) {
$quickCreateModule = $moduleModel->isQuickCreateSupported();
$singularLabel = $moduleModel->getSingularLabelKey();
if ($singularLabel == 'SINGLE_Calendar') {
$singularLabel = 'LBL_EVENT_OR_TASK';
}
if ($quickCreateModule == 1) {
$modules[$moduleName] = $singularLabel;
}
}
return array('modules' => $modules);
}