本文整理汇总了PHP中Reference::isSystemReference方法的典型用法代码示例。如果您正苦于以下问题:PHP Reference::isSystemReference方法的具体用法?PHP Reference::isSystemReference怎么用?PHP Reference::isSystemReference使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reference
的用法示例。
在下文中一共展示了Reference::isSystemReference方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Reference
function do_create()
{
global $feedback;
$request =& HTTPRequest::instance();
// Sanity check
if (!$request->get('group_id') || !$request->get('keyword') || !$request->get('link')) {
exit_error($GLOBALS['Language']->getText('global', 'error'), $GLOBALS['Language']->getText('project_reference', 'missing_parameter'));
}
$force = $request->get('force');
if (!user_is_super_user()) {
$force = false;
}
$reference_manager =& ReferenceManager::instance();
if ($request->get('service_short_name') == 100) {
// none
$service_short_name = "";
} else {
$service_short_name = $request->get('service_short_name');
}
$ref = new Reference(0, $request->get('keyword'), $request->get('description'), $request->get('link'), $request->get('scope'), $service_short_name, $request->get('nature'), $request->get('is_used'), $request->get('group_id'));
if ($ref->getGroupId() == 100 && $ref->isSystemReference()) {
// Add reference to ALL active projects!
$result = $reference_manager->createSystemReference($ref, $force);
if (!$result) {
exit_error($GLOBALS['Language']->getText('global', 'error'), $GLOBALS['Language']->getText('project_reference', 'create_fail'));
} else {
$feedback .= " " . $GLOBALS['Language']->getText('project_reference', 'system_r_create_success');
}
} else {
$result = $reference_manager->createReference($ref, $force);
if (!$result) {
exit_error($GLOBALS['Language']->getText('global', 'error'), $GLOBALS['Language']->getText('project_reference', 'create_fail'));
} else {
$feedback .= " " . $GLOBALS['Language']->getText('project_reference', 'r_create_success') . " ";
}
}
}