本文整理匯總了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);
}