PageRenderTime 34ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/pdf/code/trunk/administrator/components/com_artofpdf/helpers/html/artofpdf.php

https://bitbucket.org/eddieajau/the-art-of-joomla-archive
PHP | 122 lines | 54 code | 15 blank | 53 comment | 2 complexity | 5ba17a923d1244e000e68cea486b5d59 MD5 | raw file
  1. <?php
  2. /**
  3. * @version $Id: artofpdf.php 278 2010-09-14 11:11:09Z eddieajau $
  4. * @package NewLifeInIT
  5. * @subpackage com_artofpdf
  6. * @copyright Copyright 2010 New Life in IT Pty Ltd. All rights reserved.
  7. * @license GNU General Public License version 2 or later.
  8. * @link http://www.theartofjoomla.com
  9. */
  10. // no direct access
  11. defined('_JEXEC') or die;
  12. /**
  13. * General HTML Helper
  14. *
  15. * @package NewLifeInIT
  16. * @subpackage com_artofpdf
  17. */
  18. class JHtmlArtofPdf
  19. {
  20. /**
  21. * Returns the options for a access select list.
  22. *
  23. * @return array
  24. * @since 1.0
  25. */
  26. function accessOptions()
  27. {
  28. // Published filter
  29. $options = array();
  30. $options[] = JHtml::_('select.option', '0', 'Public');
  31. $options[] = JHtml::_('select.option', '1', 'Registered');
  32. $options[] = JHtml::_('select.option', '2', 'Special');
  33. return $options;
  34. }
  35. /**
  36. * Display the checked out icon
  37. *
  38. * @param string The editor name
  39. * @param string The checked out time
  40. *
  41. * @return string
  42. * @since 1.0
  43. */
  44. function checkedout($editor, $time)
  45. {
  46. $text = addslashes(htmlspecialchars($editor));
  47. $date = JHtml::_('date', $time, '%A, %d %B %Y');
  48. $time = JHtml::_('date', $time, '%H:%M');
  49. $hover = '<span class="editlinktip hasTip" title="'. JText::_('Checked Out') .'::'. $text .'<br />'. $date .'<br />'. $time .'">';
  50. $checked = $hover .'<img src="components/com_artofpdf/media/images/icon_16_checkedout.png" alt="" /></span>';
  51. return $checked;
  52. }
  53. /**
  54. * Displays the view footer.
  55. *
  56. * @return void
  57. * @since 1.0
  58. */
  59. public function footer()
  60. {
  61. // Initialise variables.
  62. $version = new ArtofPdfVersion;
  63. JHtml::_('behavior.modal', 'a.modal');
  64. return '<div id="taojfooter">'.
  65. '<a href="'.JRoute::_('index.php?option=com_artofpdf&view=about&tmpl=component').'" class="modal" rel="{handler: \'iframe\'}">'.
  66. 'Artof PDF '.$version->version.'.'.$version->subversion.' '.$version->status.'</a>'.
  67. ' &copy; 2005 - 2010 <a href="http://www.newlifeinit.com" target="_blank">New Life in IT Pty Ltd</a>. All rights reserved.'.
  68. '</div>';
  69. }
  70. /**
  71. * Display the published setting and icon
  72. *
  73. * @param int The value of the published field
  74. * @param int The row index
  75. * @param string Optional task prefix
  76. *
  77. * @return string
  78. */
  79. function published($i, $value, $prefix='')
  80. {
  81. $images = array(-2 => 'components/com_artofpdf/media/images/icon_16_trash.png', 0 => 'images/publish_x.png', 1 => 'images/tick.png');
  82. $alts = array(-2 => 'Trash', 0 => 'Unpublished', 1 => 'Published');
  83. $img = JArrayHelper::getValue($images, $value, $images[0]);
  84. $task = $value == 1 ? 'unpublish' : 'publish';
  85. $alt = JArrayHelper::getValue($alts, $value, $images[0]);
  86. $action = $value == 1 ? JText::_('Unpublish Item') : JText::_('Publish item');
  87. $href = '
  88. <a href="javascript:void(0);" onclick="return listItemTask(\'cb'. $i .'\',\''. $prefix.$task .'\')" title="'. $action .'">
  89. <img src="'. $img .'" border="0" alt="'. $alt .'" /></a>';
  90. return $href;
  91. }
  92. /**
  93. * Returns the options for a published select list.
  94. *
  95. * @return array
  96. */
  97. function publishedOptions()
  98. {
  99. // Published filter
  100. $options = array();
  101. $options[] = JHtml::_('select.option', '1', 'JOPTION_PUBLISHED');
  102. $options[] = JHtml::_('select.option', '0', 'JOPTION_UNPUBLISHED');
  103. $options[] = JHtml::_('select.option', '-2', 'JOPTION_TRASH');
  104. $options[] = JHtml::_('select.option', '*', 'JOPTION_ALL');
  105. return $options;
  106. }
  107. }