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