Advertisement
theitd

Untitled

Nov 24th, 2015
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. if (!in_array($context, $allowed_contexts))
  2. {
  3. return true;
  4. }
  5.  
  6. // Return if we don't have valid params or don't link the author
  7. if (!($params instanceof Registry) || !$params->get('link_author'))
  8. {
  9. return true;
  10. }
  11.  
  12. // Return if we don't have a valid article id
  13. if (!isset($row->id) || !(int) $row->id)
  14. {
  15. return true;
  16. }
  17.  
  18. //$row->contactid = $this->getContactId($row->created_by);
  19.  
  20. if (!empty($text)) {
  21. $text = $row->text;
  22. }
  23.  
  24. if ($row->contactid)
  25. {
  26. $needle = 'index.php?option=com_contact&view=contact&id=' . $row->contactid;
  27. $menu = JFactory::getApplication()->getMenu();
  28. $item = $menu->getItems('link', $needle, true);
  29. $link = $item ? $needle . '&Itemid=' . $item->id : $needle;
  30. $row->contact_link = JRoute::_($link);
  31. }
  32. else
  33. {
  34. $row->contact_link = '';
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement