PageRenderTime 45ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/content/code/trunk/administrator/components/com_artofcontent/helpers/html/jxgrid.php

https://bitbucket.org/eddieajau/the-art-of-joomla-archive
PHP | 66 lines | 27 code | 7 blank | 32 comment | 2 complexity | a6ad0b7f0d6ceed4a095aacde0da77d9 MD5 | raw file
  1. <?php
  2. /**
  3. * @version $Id: jxgrid.php 484 2010-12-20 23:40:27Z eddieajau $
  4. * @package NewLifeInIT
  5. * @subpackage com_artofcontent
  6. * @copyright Copyright 2005 - 2010 New Life in IT Pty Ltd. All rights reserved
  7. * @license GNU General Public License <http://www.fsf.org/licensing/licenses/gpl.html>
  8. * @link http://www.theartofjoomla.com
  9. */
  10. // No direct access.
  11. defined('_JEXEC') or die;
  12. /**
  13. * HTML Grid Helper
  14. *
  15. * @package NewLifeInIT
  16. * @subpackage com_artofcontent
  17. */
  18. class JHTMLJxGrid
  19. {
  20. /**
  21. * Display the published setting and icon
  22. *
  23. * @param int The value of the published field
  24. * @param int The row index
  25. * @param string Optional task prefix
  26. *
  27. * @return string
  28. */
  29. function published($value, $i, $prefix='')
  30. {
  31. $images = array(-2 => 'components/com_artofuser/media/images/icon_16_trash.png', 0 => 'images/publish_x.png', 1 => 'images/tick.png');
  32. $alts = array(-2 => 'Trash', 0 => 'Unpublished', 1 => 'Published');
  33. $img = JArrayHelper::getValue($images, $value, $images[0]);
  34. $task = $value == 1 ? 'unpublish' : 'publish';
  35. $alt = JArrayHelper::getValue($alts, $value, $images[0]);
  36. $action = $value == 1 ? JText::_('Unpublish Item') : JText::_('Publish item');
  37. $href = '
  38. <a href="javascript:void(0);" onclick="return listItemTask(\'cb'. $i .'\',\''. $prefix.$task .'\')" title="'. $action .'">
  39. <img src="'. $img .'" border="0" alt="'. $alt .'" /></a>';
  40. return $href;
  41. }
  42. /**
  43. * Display the checked out icon
  44. *
  45. * @param string The editor name
  46. * @param string The checked out time
  47. *
  48. * @return string
  49. */
  50. function checkedout($editor, $time)
  51. {
  52. $text = addslashes(htmlspecialchars($editor));
  53. $date = JHtml::_('date', $time, '%A, %d %B %Y');
  54. $time = JHtml::_('date', $time, '%H:%M');
  55. $hover = '<span class="editlinktip hasTip" title="'. JText::_('Checked Out') .'::'. $text .'<br />'. $date .'<br />'. $time .'">';
  56. $checked = $hover .'<img src="components/com_artofuser/media/images/icon_16_checkedout.png" alt="" /></span>';
  57. return $checked;
  58. }
  59. }