当前位置: 首页>>代码示例>>PHP>>正文


PHP SugarFeed::getLinkClass方法代码示例

本文整理汇总了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']) . '&nbsp;</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;
 }
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:34,代码来源:SugarFeed.php

示例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'] .= '&nbsp;</span><div class="byLineRight"> ' . $this->getTimeLapse($data['DATE_ENTERED']) . ' &nbsp;' . $delete . '</div></div>';
     return $data;
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:23,代码来源:SugarFeed.php

示例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);
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:15,代码来源:SugarFeedTest.php


注:本文中的SugarFeed::getLinkClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。