/pdf/code/trunk/administrator/components/com_artofpdf/helpers/html/artofpdf.php
PHP | 122 lines | 54 code | 15 blank | 53 comment | 2 complexity | 5ba17a923d1244e000e68cea486b5d59 MD5 | raw file
- <?php
- /**
- * @version $Id: artofpdf.php 278 2010-09-14 11:11:09Z eddieajau $
- * @package NewLifeInIT
- * @subpackage com_artofpdf
- * @copyright Copyright 2010 New Life in IT Pty Ltd. All rights reserved.
- * @license GNU General Public License version 2 or later.
- * @link http://www.theartofjoomla.com
- */
- // no direct access
- defined('_JEXEC') or die;
- /**
- * General HTML Helper
- *
- * @package NewLifeInIT
- * @subpackage com_artofpdf
- */
- class JHtmlArtofPdf
- {
- /**
- * Returns the options for a access select list.
- *
- * @return array
- * @since 1.0
- */
- function accessOptions()
- {
- // Published filter
- $options = array();
- $options[] = JHtml::_('select.option', '0', 'Public');
- $options[] = JHtml::_('select.option', '1', 'Registered');
- $options[] = JHtml::_('select.option', '2', 'Special');
- return $options;
- }
- /**
- * Display the checked out icon
- *
- * @param string The editor name
- * @param string The checked out time
- *
- * @return string
- * @since 1.0
- */
- function checkedout($editor, $time)
- {
- $text = addslashes(htmlspecialchars($editor));
- $date = JHtml::_('date', $time, '%A, %d %B %Y');
- $time = JHtml::_('date', $time, '%H:%M');
- $hover = '<span class="editlinktip hasTip" title="'. JText::_('Checked Out') .'::'. $text .'<br />'. $date .'<br />'. $time .'">';
- $checked = $hover .'<img src="components/com_artofpdf/media/images/icon_16_checkedout.png" alt="" /></span>';
- return $checked;
- }
- /**
- * Displays the view footer.
- *
- * @return void
- * @since 1.0
- */
- public function footer()
- {
- // Initialise variables.
- $version = new ArtofPdfVersion;
- JHtml::_('behavior.modal', 'a.modal');
- return '<div id="taojfooter">'.
- '<a href="'.JRoute::_('index.php?option=com_artofpdf&view=about&tmpl=component').'" class="modal" rel="{handler: \'iframe\'}">'.
- 'Artof PDF '.$version->version.'.'.$version->subversion.' '.$version->status.'</a>'.
- ' © 2005 - 2010 <a href="http://www.newlifeinit.com" target="_blank">New Life in IT Pty Ltd</a>. All rights reserved.'.
- '</div>';
- }
- /**
- * Display the published setting and icon
- *
- * @param int The value of the published field
- * @param int The row index
- * @param string Optional task prefix
- *
- * @return string
- */
- function published($i, $value, $prefix='')
- {
- $images = array(-2 => 'components/com_artofpdf/media/images/icon_16_trash.png', 0 => 'images/publish_x.png', 1 => 'images/tick.png');
- $alts = array(-2 => 'Trash', 0 => 'Unpublished', 1 => 'Published');
- $img = JArrayHelper::getValue($images, $value, $images[0]);
- $task = $value == 1 ? 'unpublish' : 'publish';
- $alt = JArrayHelper::getValue($alts, $value, $images[0]);
- $action = $value == 1 ? JText::_('Unpublish Item') : JText::_('Publish item');
- $href = '
- <a href="javascript:void(0);" onclick="return listItemTask(\'cb'. $i .'\',\''. $prefix.$task .'\')" title="'. $action .'">
- <img src="'. $img .'" border="0" alt="'. $alt .'" /></a>';
- return $href;
- }
- /**
- * Returns the options for a published select list.
- *
- * @return array
- */
- function publishedOptions()
- {
- // Published filter
- $options = array();
- $options[] = JHtml::_('select.option', '1', 'JOPTION_PUBLISHED');
- $options[] = JHtml::_('select.option', '0', 'JOPTION_UNPUBLISHED');
- $options[] = JHtml::_('select.option', '-2', 'JOPTION_TRASH');
- $options[] = JHtml::_('select.option', '*', 'JOPTION_ALL');
- return $options;
- }
- }