本文整理汇总了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;
}
示例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');
}
示例3: testgetLinkTypes
public function testgetLinkTypes()
{
$result = SugarFeed::getLinkTypes();
$expected = array('Image' => 'Image', 'Link' => 'Link', 'YouTube' => 'YouTube');
$this->assertEquals($expected, $result);
}