本文整理匯總了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;
}