Files
@ 7042e71b70da
Branch filter:
Location: hot67beta/components/com_content/helpers/icon.php
7042e71b70da
5.6 KiB
text/x-php
Added file to test commit and push
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | <?php
/**
* @version $Id: icon.php 11213 2008-10-25 12:43:11Z pasamio $
* @package Joomla
* @subpackage Content
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant to the
* GNU General Public License, and as distributed it includes or is derivative
* of works licensed under the GNU General Public License or other free or open
* source software licenses. See COPYRIGHT.php for copyright notices and
* details.
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
/**
* Content Component HTML Helper
*
* @static
* @package Joomla
* @subpackage Content
* @since 1.5
*/
class JHTMLIcon
{
function create($article, $params, $access, $attribs = array())
{
$uri =& JFactory::getURI();
$ret = $uri->toString();
$url = 'index.php?task=new&ret='.base64_encode($ret).'&id=0§ionid='.$article->sectionid;
if ($params->get('show_icons')) {
$text = JHTML::_('image.site', 'new.png', '/images/M_images/', NULL, NULL, JText::_('New') );
} else {
$text = JText::_('New').' ';
}
$attribs = array( 'title' => JText::_( 'New' ));
return JHTML::_('link', JRoute::_($url), $text, $attribs);
}
function pdf($article, $params, $access, $attribs = array())
{
$url = 'index.php?view=article';
$url .= @$article->catslug ? '&catid='.$article->catslug : '';
$url .= '&id='.$article->slug.'&format=pdf';
$status = 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no';
// checks template image directory for image, if non found default are loaded
if ($params->get('show_icons')) {
$text = JHTML::_('image.site', 'pdf_button.png', '/images/M_images/', NULL, NULL, JText::_('PDF'));
} else {
$text = JText::_('PDF').' ';
}
$attribs['title'] = JText::_( 'PDF' );
$attribs['onclick'] = "window.open(this.href,'win2','".$status."'); return false;";
$attribs['rel'] = 'nofollow';
return JHTML::_('link', JRoute::_($url), $text, $attribs);
}
function email($article, $params, $access, $attribs = array())
{
$uri =& JURI::getInstance();
$base = $uri->toString( array('scheme', 'host', 'port'));
$link = $base.JRoute::_( ContentHelperRoute::getArticleRoute($article->slug, $article->catslug, $article->sectionid) , false );
$url = 'index.php?option=com_mailto&tmpl=component&link='.base64_encode( $link );
$status = 'width=400,height=350,menubar=yes,resizable=yes';
if ($params->get('show_icons')) {
$text = JHTML::_('image.site', 'emailButton.png', '/images/M_images/', NULL, NULL, JText::_('Email'));
} else {
$text = ' '.JText::_('Email');
}
$attribs['title'] = JText::_( 'Email' );
$attribs['onclick'] = "window.open(this.href,'win2','".$status."'); return false;";
$output = JHTML::_('link', JRoute::_($url), $text, $attribs);
return $output;
}
function edit($article, $params, $access, $attribs = array())
{
$user =& JFactory::getUser();
$uri =& JFactory::getURI();
$ret = $uri->toString();
if ($params->get('popup')) {
return;
}
if ($article->state < 0) {
return;
}
if (!$access->canEdit && !($access->canEditOwn && $article->created_by == $user->get('id'))) {
return;
}
JHTML::_('behavior.tooltip');
$url = 'index.php?view=article&id='.$article->slug.'&task=edit&ret='.base64_encode($ret);
$icon = $article->state ? 'edit.png' : 'edit_unpublished.png';
$text = JHTML::_('image.site', $icon, '/images/M_images/', NULL, NULL, JText::_('Edit'));
if ($article->state == 0) {
$overlib = JText::_('Unpublished');
} else {
$overlib = JText::_('Published');
}
$date = JHTML::_('date', $article->created);
$author = $article->created_by_alias ? $article->created_by_alias : $article->author;
$overlib .= '<br />';
$overlib .= JText::_($article->groups);
$overlib .= '<br />';
$overlib .= $date;
$overlib .= '<br />';
$overlib .= $author;
$button = JHTML::_('link', JRoute::_($url), $text);
$output = '<span class="hasTip" title="'.JText::_( 'Edit Item' ).' :: '.$overlib.'">'.$button.'</span>';
return $output;
}
function print_popup($article, $params, $access, $attribs = array())
{
$url = 'index.php?view=article';
$url .= @$article->catslug ? '&catid='.$article->catslug : '';
$url .= '&id='.$article->slug.'&tmpl=component&print=1&layout=default&page='.@ $request->limitstart;
$status = 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no';
// checks template image directory for image, if non found default are loaded
if ( $params->get( 'show_icons' ) ) {
$text = JHTML::_('image.site', 'printButton.png', '/images/M_images/', NULL, NULL, JText::_( 'Print' ) );
} else {
$text = JText::_( 'ICON_SEP' ) .' '. JText::_( 'Print' ) .' '. JText::_( 'ICON_SEP' );
}
$attribs['title'] = JText::_( 'Print' );
$attribs['onclick'] = "window.open(this.href,'win2','".$status."'); return false;";
$attribs['rel'] = 'nofollow';
return JHTML::_('link', JRoute::_($url), $text, $attribs);
}
function print_screen($article, $params, $access, $attribs = array())
{
// checks template image directory for image, if non found default are loaded
if ( $params->get( 'show_icons' ) ) {
$text = JHTML::_('image.site', 'printButton.png', '/images/M_images/', NULL, NULL, JText::_( 'Print' ) );
} else {
$text = JText::_( 'ICON_SEP' ) .' '. JText::_( 'Print' ) .' '. JText::_( 'ICON_SEP' );
}
return '<a href="#" onclick="window.print();return false;">'.$text.'</a>';
}
}
|