本文整理汇总了PHP中CrowdfundingHelperRoute::getFriendmailRoute方法的典型用法代码示例。如果您正苦于以下问题:PHP CrowdfundingHelperRoute::getFriendmailRoute方法的具体用法?PHP CrowdfundingHelperRoute::getFriendmailRoute怎么用?PHP CrowdfundingHelperRoute::getFriendmailRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CrowdfundingHelperRoute
的用法示例。
在下文中一共展示了CrowdfundingHelperRoute::getFriendmailRoute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getEmbeded
/**
* @param stdClass $item
* @param Joomla\Registry\Registry $params
* @param string $url
*
* @return string
*/
private function getEmbeded($item, $params, $url)
{
$html = '';
if (!$params->get('display_embed_link', 1) and !$params->get('display_embed_button', 1) and !$params->get('display_embed_email', 1)) {
return $html;
}
$html = '<div class="clearfix"></div>';
$html .= '<div class="crowdf-embeded">';
if ($params->get('display_embed_link', 1)) {
$html .= '<input type="text" name="share_url" value="' . html_entity_decode($url, ENT_COMPAT, 'UTF-8') . '" class="crowdf-embeded-input" />';
}
if ($params->get('display_embed_button', 1)) {
$link = JRoute::_(CrowdfundingHelperRoute::getEmbedRoute($item->slug, $item->catslug), false);
$html .= '<a href="' . $link . '" class="btn btn-default" role="button"><span class="fa fa-th-large"></span> ' . JText::_('PLG_CONTENT_CROWDFUNDINGSOCIALSHARE_EMBED') . '</a>';
}
if ($params->get('display_embed_email', 1)) {
$link = JRoute::_(CrowdfundingHelperRoute::getFriendmailRoute($item->slug), false);
$html .= '<a class="btn btn-default" href="' . $link . '" role="button"><span class="fa fa-envelope"></span> ' . JText::_('PLG_CONTENT_CROWDFUNDINGSOCIALSHARE_EMAIL') . '</a>';
}
if ($params->get('display_follow', 0)) {
$userId = JFactory::getUser()->get('id');
$state = Prism\Constants::UNFOLLOWED;
$projectId = (int) $item->id;
$text = JText::_('PLG_CONTENT_CROWDFUNDINGSOCIALSHARE_FOLLOW');
$class = ' btn-default';
// Load scripts.
JHtml::_('jquery.framework');
$doc = JFactory::getDocument();
$doc->addScript(JUri::root() . 'plugins/content/crowdfundingsocialshare/script.js');
if ($userId) {
$user = new Crowdfunding\User\User(JFactory::getDbo());
$user->setId($userId);
$followed = $user->getFollowed();
if (in_array($projectId, $followed, true)) {
$state = Prism\Constants::FOLLOWED;
$text = JText::_('PLG_CONTENT_CROWDFUNDINGSOCIALSHARE_FOLLOWING');
$class = ' btn-primary';
}
JText::script('PLG_CONTENT_CROWDFUNDINGSOCIALSHARE_FOLLOW');
JText::script('PLG_CONTENT_CROWDFUNDINGSOCIALSHARE_UNFOLLOW');
JText::script('PLG_CONTENT_CROWDFUNDINGSOCIALSHARE_FOLLOWING');
}
$html .= '<a href="javascript: void(0);" class="btn ' . $class . '" id="js-plgsocialshare-btn-follow" role="button" data-uid="' . (int) $userId . '" data-state="' . (int) $state . '" data-pid="' . $projectId . '">
<span class="fa fa-heart"></span>
<span id="js-plgsocialshare-btn-text">' . $text . '</span></a>';
}
$html .= '</div>';
return $html;
}