本文整理汇总了PHP中SugarFeed::getLinkClass方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarFeed::getLinkClass方法的具体用法?PHP SugarFeed::getLinkClass怎么用?PHP SugarFeed::getLinkClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SugarFeed
的用法示例。
在下文中一共展示了SugarFeed::getLinkClass方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_list_view_data
function get_list_view_data()
{
$data = parent::get_list_view_data();
$delete = '';
/* BEGIN - SECURITY GROUPS */
/**
if (ACLController::moduleSupportsACL($data['RELATED_MODULE']) && !ACLController::checkAccess($data['RELATED_MODULE'], 'view', $data['CREATED_BY'] == $GLOBALS['current_user']->id) && !ACLController::checkAccess($data['RELATED_MODULE'], 'list', $data['CREATED_BY'] == $GLOBALS['current_user']->id)){
*/
if (ACLController::moduleSupportsACL($data['RELATED_MODULE'])) {
$in_group = 'not_set';
require_once "modules/SecurityGroups/SecurityGroup.php";
$in_group = SecurityGroup::groupHasAccess($data['RELATED_MODULE'], $data['RELATED_ID'], 'list');
if (!ACLController::checkAccess($data['RELATED_MODULE'], 'view', $data['CREATED_BY'] == $GLOBALS['current_user']->id, 'module', $in_group) && !ACLController::checkAccess($data['RELATED_MODULE'], 'list', $data['CREATED_BY'] == $GLOBALS['current_user']->id, 'module', $in_group)) {
$data['NAME'] = '';
return $data;
}
}
if (is_admin($GLOBALS['current_user']) || isset($data['CREATED_BY']) && $data['CREATED_BY'] == $GLOBALS['current_user']->id) {
$delete = ' - <a id="sugarFeedDeleteLink' . $data['ID'] . '" href="#" onclick=\'SugarFeed.deleteFeed("' . $data['ID'] . '", "{this.id}"); return false;\'>' . $GLOBALS['app_strings']['LBL_DELETE_BUTTON_LABEL'] . '</a>';
}
/* END - SECURITY GROUPS */
$data['NAME'] .= $data['DESCRIPTION'];
$data['NAME'] = '<div style="padding:3px">' . html_entity_decode($data['NAME']);
if (!empty($data['LINK_URL'])) {
$linkClass = SugarFeed::getLinkClass($data['LINK_TYPE']);
if ($linkClass !== FALSE) {
$data['NAME'] .= $linkClass->getDisplay($data);
}
}
$data['NAME'] .= '<div class="byLineBox"><span class="byLineLeft">';
$data['NAME'] .= $this->getTimeLapse($data['DATE_ENTERED']) . ' </span><div class="byLineRight"><a id="sugarFeedReplyLink' . $data['ID'] . '" href="#" onclick=\'SugarFeed.buildReplyForm("' . $data['ID'] . '", "{this.id}", this); return false;\'>' . $GLOBALS['app_strings']['LBL_EMAIL_REPLY'] . '</a>' . $delete . '</div></div>';
$data['NAME'] .= $this->fetchReplies($data);
return $data;
}
示例2: get_list_view_data
function get_list_view_data()
{
$data = parent::get_list_view_data();
$delete = '';
if (ACLController::moduleSupportsACL($data['RELATED_MODULE']) && !ACLController::checkAccess($data['RELATED_MODULE'], 'view', $data['CREATED_BY'] == $GLOBALS['current_user']->id) && !ACLController::checkAccess($data['RELATED_MODULE'], 'list', $data['CREATED_BY'] == $GLOBALS['current_user']->id)) {
$data['NAME'] = '';
return $data;
}
if (is_admin($GLOBALS['current_user']) || $data['CREATED_BY'] == $GLOBALS['current_user']->id) {
$delete = get_image($GLOBALS['image_path'] . '/delete_inline', 'width="12" height="12" border="0" align="absmiddle" style="vertical-align: bottom;" onclick=\'SugarFeed.deleteFeed("' . $data['ID'] . '", "{this.id}")\'');
}
$data['NAME'] .= $data['DESCRIPTION'];
$data['NAME'] = '<div class="list view" style="padding:5px;border-right:none;border-left:none;border-top:none;">' . html_entity_decode($data['NAME']);
if (!empty($data['LINK_URL'])) {
$linkClass = SugarFeed::getLinkClass($data['LINK_TYPE']);
if ($linkClass !== FALSE) {
$data['NAME'] .= $linkClass->getDisplay($data);
}
}
$data['NAME'] .= '<div class="byLineBox"><span class="byLineLeft">';
$data['NAME'] .= ' </span><div class="byLineRight"> ' . $this->getTimeLapse($data['DATE_ENTERED']) . ' ' . $delete . '</div></div>';
return $data;
}
示例3: testgetLinkClass
public function testgetLinkClass()
{
//test with invalid LinkType
$result = SugarFeed::getLinkClass('test');
$this->assertEquals(false, $result);
//test with LinkType Image
$result = SugarFeed::getLinkClass('Image');
$this->assertInstanceOf('FeedLinkHandlerImage', $result);
//test with LinkType Link
$result = SugarFeed::getLinkClass('Link');
$this->assertInstanceOf('FeedLinkHandlerLink', $result);
//test with LinkType YouTube
$result = SugarFeed::getLinkClass('YouTube');
$this->assertInstanceOf('FeedLinkHandlerYoutube', $result);
}