本文整理汇总了PHP中ReferenceManager::addProjectReferences方法的典型用法代码示例。如果您正苦于以下问题:PHP ReferenceManager::addProjectReferences方法的具体用法?PHP ReferenceManager::addProjectReferences怎么用?PHP ReferenceManager::addProjectReferences使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ReferenceManager
的用法示例。
在下文中一共展示了ReferenceManager::addProjectReferences方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createProject
/**
* createProject
*
* Create a new project
*
* Insert in group table
* Insert group_desc_value, trove_group_link
* Create filemodule in DB
* Assign an admin user
* Copy from template:
* - activate the same services (using the ame server id and options)
* - send message to the project requested (pepend on template values)
* - create forums with the same name and public status
* - copy CVS properties
* - copy SVN settings and start .SVNAccessFile hisr=tiry
* - add system references withut services
* - copy ugroups and save mapping for further import
* - copy FRS packages with permissions
* - copy trackers
* - copy wiki
* - copy layout summary page
* - Add the template as a project reference
* - Copy Truncated email option
* - Raise an event for plugin configuration
*
* @param data ProjectCreationData
*/
protected function createProject(ProjectCreationData $data)
{
$admin_user = UserManager::instance()->getCurrentUser();
$group_id = $this->createGroupEntry($data);
if ($group_id === false) {
return;
}
$this->setCategories($data, $group_id);
$this->initFileModule($group_id);
$this->setProjectAdmin($group_id, $admin_user);
// Instanciate all services from the project template that are 'active'
$group = $this->projectManager->getProject($group_id);
if (!$group || !is_object($group)) {
exit_no_group();
}
$this->fakeGroupIdIntoHTTPParams($group_id);
$template_id = $group->getTemplate();
$template_group = $this->projectManager->getProject($template_id);
if (!$template_group || !is_object($template_group) || $template_group->isError()) {
exit_no_group();
}
$this->activateServicesFromTemplate($group_id, $template_group, $data);
$this->setMessageToRequesterFromTemplate($group_id, $template_id);
$this->initForumModuleFromTemplate($group_id, $template_id);
$this->initCVSModuleFromTemplate($group_id, $template_id);
$this->initSVNModuleFromTemplate($group_id, $template_id);
// Activate other system references not associated with any service
$this->reference_manager->addSystemReferencesWithoutService($template_id, $group_id);
//Copy ugroups
$ugroup_mapping = array();
ugroup_copy_ugroups($template_id, $group_id, $ugroup_mapping);
$this->initFRSModuleFromTemplate($group_id, $template_id, $ugroup_mapping);
list($tracker_mapping, $report_mapping) = $this->initTrackerV3ModuleFromTemplate($group, $template_group, $ugroup_mapping);
$this->initWikiModuleFromTemplate($group_id, $template_id);
$this->initLayoutFromTemplate($group_id, $template_id);
//Create project specific references if template is not default site template
if (!$template_group->isSystem()) {
$this->reference_manager->addProjectReferences($template_id, $group_id);
}
$this->copyEmailOptionsFromTemplate($group_id, $template_id);
// Raise an event for plugin configuration
$em = EventManager::instance();
$em->processEvent('register_project_creation', array('reportMapping' => $report_mapping, 'trackerMapping' => $tracker_mapping, 'ugroupsMapping' => $ugroup_mapping, 'group_id' => $group_id, 'template_id' => $template_id));
$this->autoActivateProject($group);
return $group_id;
}