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


PHP CrowdfundingHelperRoute::getFriendmailRoute方法代码示例

本文整理汇总了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;
 }
开发者ID:ITPrism,项目名称:CrowdfundingDistribution,代码行数:56,代码来源:crowdfundingsocialshare.php


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