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


PHP SugarFeed::getLinkTypes方法代码示例

本文整理汇总了PHP中SugarFeed::getLinkTypes方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarFeed::getLinkTypes方法的具体用法?PHP SugarFeed::getLinkTypes怎么用?PHP SugarFeed::getLinkTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SugarFeed的用法示例。


在下文中一共展示了SugarFeed::getLinkTypes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getLinkClass

 static function getLinkClass($linkName)
 {
     $linkTypeList = SugarFeed::getLinkTypes();
     // Have to make sure the linkName is on the list, so they can't pass in linkName's like ../../config.php ... not that they could get anywhere if they did
     if (!isset($linkTypeList[$linkName])) {
         // No class by this name...
         return FALSE;
     }
     if (file_exists('custom/modules/SugarFeed/linkHandlers/' . $linkName . '.php')) {
         require_once 'custom/modules/SugarFeed/linkHandlers/' . $linkName . '.php';
     } else {
         require_once 'modules/SugarFeed/linkHandlers/' . $linkName . '.php';
     }
     $linkClassName = 'FeedLinkHandler' . $linkName;
     $linkClass = new $linkClassName();
     return $linkClass;
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:17,代码来源:SugarFeed.php

示例2: getPostForm

 /**
  *
  * @return the form for users posting custom messages to the feed stream
  */
 function getPostForm()
 {
     global $current_user;
     if (!empty($this->selectedCategories) && !in_array('UserFeed', $this->selectedCategories)) {
         // The user feed system isn't enabled, don't let them post notes
         return '';
     }
     $user_name = ucfirst($GLOBALS['current_user']->user_name);
     $moreimg = SugarThemeRegistry::current()->getImage('advanced_search', 'onclick="toggleDisplay(\'more_' . $this->id . '\'); toggleDisplay(\'more_img_' . $this->id . '\'); toggleDisplay(\'less_img_' . $this->id . '\');"', null, null, '.gif', translate('LBL_SHOW_MORE_OPTIONS', 'SugarFeed'));
     $lessimg = SugarThemeRegistry::current()->getImage('basic_search', 'onclick="toggleDisplay(\'more_' . $this->id . '\'); toggleDisplay(\'more_img_' . $this->id . '\'); toggleDisplay(\'less_img_' . $this->id . '\');"', null, null, '.gif', translate('LBL_HIDE_OPTIONS', 'SugarFeed'));
     $ss = new Sugar_Smarty();
     $ss->assign('LBL_TO', translate('LBL_TO', 'SugarFeed'));
     $ss->assign('LBL_POST', translate('LBL_POST', 'SugarFeed'));
     $ss->assign('LBL_SELECT', translate('LBL_SELECT', 'SugarFeed'));
     $ss->assign('LBL_IS', translate('LBL_IS', 'SugarFeed'));
     $ss->assign('id', $this->id);
     $ss->assign('more_img', $moreimg);
     $ss->assign('less_img', $lessimg);
     if ($current_user->getPreference('use_real_names') == 'on') {
         $ss->assign('user_name', $current_user->full_name);
     } else {
         $ss->assign('user_name', $user_name);
     }
     $linkTypesIn = SugarFeed::getLinkTypes();
     $linkTypes = array();
     foreach ($linkTypesIn as $key => $value) {
         $linkTypes[$key] = translate('LBL_LINK_TYPE_' . $value, 'SugarFeed');
     }
     $ss->assign('link_types', $linkTypes);
     return $ss->fetch('modules/SugarFeed/Dashlets/SugarFeedDashlet/UserPostForm.tpl');
 }
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:35,代码来源:SugarFeedDashlet.php

示例3: testgetLinkTypes

 public function testgetLinkTypes()
 {
     $result = SugarFeed::getLinkTypes();
     $expected = array('Image' => 'Image', 'Link' => 'Link', 'YouTube' => 'YouTube');
     $this->assertEquals($expected, $result);
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:6,代码来源:SugarFeedTest.php


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