Skip to content

Commit

Permalink
Update tos.php
Browse files Browse the repository at this point in the history
  • Loading branch information
joomdonation committed Feb 4, 2015
1 parent a33864b commit 7873151
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions plugins/user/profile/fields/tos.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,25 +71,30 @@ protected function getLabel()
{
$label .= ' title="'
. htmlspecialchars(
trim($text, ':') . '<br />' . ($this->translateDescription ? JText::_($this->description) : $this->description),
ENT_COMPAT, 'UTF-8'
) . '"';
trim($text, ':') . '<br />' . ($this->translateDescription ? JText::_($this->description) : $this->description),
ENT_COMPAT, 'UTF-8'
) . '"';
}

$tosarticle = $this->element['article'] > 0 ? (int) $this->element['article'] : 0;

$link = '';

if ($tosarticle)
{
JLoader::register('ContentHelperRoute', JPATH_BASE . '/components/com_content/helpers/route.php');

$attribs = array();
$attribs = array();
$attribs['class'] = 'modal';
$attribs['rel'] = '{handler: \'iframe\', size: {x:800, y:500}}';

// TODO: This is broken!! We need the category ID, too, and the language
$url = ContentHelperRoute::getArticleRoute($tosarticle);
$attribs['rel'] = '{handler: \'iframe\', size: {x:800, y:500}}';

$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('id, alias, catid')
->from('#__content')
->where('id = ' . $tosarticle);
$db->setQuery($query);
$article = $db->loadObject();
$slug = $article->alias ? ($article->id . ':' . $article->alias) : $article->id;
$url = ContentHelperRoute::getArticleRoute($slug, $article->catid);

$link = JHtml::_('link', JRoute::_($url . '&tmpl=component'), $text, $attribs);
}
Expand Down

0 comments on commit 7873151

Please sign in to comment.