本文整理汇总了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();
}