PageRenderTime 49ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/contentmanager/code/trunk/administrator/components/com_contentmanager/libraries/jxtended/form/html/decorators/url.php

https://bitbucket.org/eddieajau/the-art-of-joomla-archive
PHP | 31 lines | 12 code | 2 blank | 17 comment | 1 complexity | 1ba6fe998ecd0b52f7f346a80eb36e8b MD5 | raw file
  1. <?php
  2. /**
  3. * @version $Id: url.php 160 2009-07-09 00:06:09Z eddieajau $
  4. * @package JXtended.Libraries
  5. * @subpackage Form
  6. * @copyright Copyright (C) 2008 - 2009 JXtended, LLC. All rights reserved.
  7. * @license GNU General Public License <http://www.gnu.org/copyleft/gpl.html>
  8. * @link http://jxtended.com
  9. */
  10. defined('JPATH_BASE') or die;
  11. /**
  12. * Decorates a URL link
  13. *
  14. * If the http prefix is not supplied, one will be added
  15. *
  16. * @static
  17. * @package JXtended.Libraries
  18. * @subpackage Forms
  19. */
  20. class JXDecoratorUrl
  21. {
  22. function render($value, $text = '', $options = null)
  23. {
  24. if (strpos($value, 'http') !== 0) {
  25. $value = 'http://'.$value;
  26. }
  27. return JHTML::link($value, ($text ? $text : $value), $options);
  28. }
  29. }