/** * Icon for email * * @param object $member Member info * @param JRegistry $params HTML Params * @param array $attribs Member attribs * * @return string * * @since 1.5 */ public static function email($member, $params, $attribs = []) { require_once JPATH_SITE . '/components/com_mailto/helpers/mailto.php'; $uri = JUri::getInstance(); $base = $uri->toString(['scheme', 'host', 'port']); $link = $base . JRoute::_(ContentHelperRoute::getArticleRoute($member->slug, $member->catid), false); $url = 'index.php?option=com_mailto&tmpl=component&link=' . MailtoHelper::addLink($link); $status = 'width=400,height=350,menubar=yes,resizable=yes'; if ($params->get('show_icons')) { $text = JHtml::_('image', 'system/emailButton.png', JText::_('JGLOBAL_EMAIL'), null, true); } else { $text = ' ' . JText::_('JGLOBAL_EMAIL'); } $attribs['title'] = JText::_('JGLOBAL_EMAIL'); $attribs['onclick'] = "window.open(this.href,'win2','" . $status . "'); return false;"; $output = JHtml::_('link', JRoute::_($url), $text, $attribs); return $output; }
/** * Method to generate a link to the email item page for the given article * * @param object $article The article information * @param Registry $params The item parameters * @param array $attribs Optional attributes for the link * @param boolean $legacy True to use legacy images, false to use icomoon based graphic * * @return string The HTML markup for the email item link */ public static function email($article, $params, $attribs = array(), $legacy = false) { JLoader::register('MailtoHelper', JPATH_SITE . '/components/com_mailto/helpers/mailto.php'); $uri = JUri::getInstance(); $base = $uri->toString(array('scheme', 'host', 'port')); $template = JFactory::getApplication()->getTemplate(); $link = $base . JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catid, $article->language), false); $url = 'index.php?option=com_mailto&tmpl=component&template=' . $template . '&link=' . MailtoHelper::addLink($link); $status = 'width=400,height=350,menubar=yes,resizable=yes'; $text = JLayoutHelper::render('joomla.content.icons.email', array('params' => $params, 'legacy' => $legacy)); $attribs['title'] = JText::_('JGLOBAL_EMAIL_TITLE'); $attribs['onclick'] = "window.open(this.href,'win2','" . $status . "'); return false;"; $attribs['rel'] = 'nofollow'; $output = JHtml::_('link', JRoute::_($url), $text, $attribs); return $output; }
/** * Method to generate a link to the email item page for the given article * * @param object $article The article information * @param Registry $params The item parameters * @param array $attribs Optional attributes for the link * @param boolean $legacy True to use legacy images, false to use icomoon based graphic * * @return string The HTML markup for the email item link */ public static function email($article, $params, $attribs = array(), $legacy = false) { JLoader::register('MailtoHelper', JPATH_SITE . '/components/com_mailto/helpers/mailto.php'); $uri = JUri::getInstance(); $base = $uri->toString(array('scheme', 'host', 'port')); $template = JFactory::getApplication()->getTemplate(); $link = $base . JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catid, $article->language), false); $url = 'index.php?option=com_mailto&tmpl=component&template=' . $template . '&link=' . MailtoHelper::addLink($link); $status = 'width=400,height=350,menubar=yes,resizable=yes'; if ($params->get('show_icons')) { if ($legacy) { $text = JHtml::_('image', 'system/emailButton.png', JText::_('JGLOBAL_EMAIL'), null, true); } else { $text = '<span class="icon-envelope"></span>' . JText::_('JGLOBAL_EMAIL'); } } else { $text = JText::_('JGLOBAL_EMAIL'); } $attribs['title'] = JText::_('JGLOBAL_EMAIL_TITLE'); $attribs['onclick'] = "window.open(this.href,'win2','" . $status . "'); return false;"; $attribs['rel'] = 'nofollow'; $output = JHtml::_('link', JRoute::_($url), $text, $attribs); return $output; }