本文整理匯總了PHP中SugarFeed::ACLAccess方法的典型用法代碼示例。如果您正苦於以下問題:PHP SugarFeed::ACLAccess方法的具體用法?PHP SugarFeed::ACLAccess怎麽用?PHP SugarFeed::ACLAccess使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SugarFeed
的用法示例。
在下文中一共展示了SugarFeed::ACLAccess方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: pushFeed
static function pushFeed($text, $module, $id, $record_assigned_user_id = false, $link_type = false, $link_url = false)
{
$feed = new SugarFeed();
if (empty($text) || !$feed->ACLAccess('save', true)) {
return;
}
if (!empty($link_url)) {
$linkClass = SugarFeed::getLinkClass($link_type);
if ($linkClass !== FALSE) {
$linkClass->handleInput($feed, $link_type, $link_url);
}
}
$text = '<b>{this.CREATED_BY}</b> ' . $text;
$feed->name = substr($text, 0, 255);
if (strlen($text) > 255) {
$feed->description = substr($text, 255, 510);
}
if ($record_assigned_user_id === false) {
$feed->assigned_user_id = $GLOBALS['current_user']->id;
} else {
$feed->assigned_user_id = $record_assigned_user_id;
}
$feed->related_id = $id;
$feed->related_module = $module;
$feed->save();
}
示例2: pushFeed
static function pushFeed($text, $module, $id, $record_assigned_user_id = false, $link_type = false, $link_url = false)
{
$feed = new SugarFeed();
if (empty($text) && empty($link_url) || !$feed->ACLAccess('save', true)) {
Log::error('Unable to save SugarFeed record (missing data or no ACL access)');
return;
}
if (!empty($link_url)) {
$linkClass = SugarFeed::getLinkClass($link_type);
if ($linkClass !== false) {
$linkClass->handleInput($feed, $link_type, $link_url);
}
}
$text = strip_tags(from_html($text));
$text = '<b>{this.CREATED_BY}</b> ' . $text;
$feed->name = substr($text, 0, 255);
if (strlen($text) > 255) {
$feed->description = substr($text, 255, 510);
}
if ($record_assigned_user_id === false) {
$feed->assigned_user_id = $GLOBALS['current_user']->id;
} else {
$feed->assigned_user_id = $record_assigned_user_id;
}
$feed->related_id = $id;
$feed->related_module = $module;
$feed->save();
}