english/components/com_content/helpers/icon.php
/**
	 * Display an edit icon for the article.
	 *
	 * This icon will not display in a popup window, nor if the article is trashed.
	 * Edit access checks must be performed in the calling code.
	 *
	 * @param	object	$article	The article in question.
	 * @param	object	$params		The article parameters
	 * @param	array	$attribs	Not used??
	 *
	 * @return	string	The HTML for the article edit icon.
	 * @since	1.6
	 */
Display an edit icon for the article.
This icon will not display in a popup window, nor if the article is trashed.
Edit access checks must be performed in the calling code.

@param       object  $article        The article in question.

@return      string  The HTML for the article edit icon.
Display an edit icon for the article . This icon will not display in a popup window nor if the article is trashed . Edit access checks must be performed in the calling code . @param object $article The article in question . @return string The HTML for the article edit icon .
static function edit($article, $params, $attribs = array())
	{
		$user	= JFactory::getUser();
		$userId	= $user->get('id');
		$uri	= JFactory::getURI();
		if ($params && $params->get('popup')) {
			return;
		}
		if ($article->state < 0) {
			return;
		}
		JHtml::_('behavior.tooltip');
		if (property_exists($article, 'checked_out') && property_exists($article, 'checked_out_time') && $article->checked_out > 0 && $article->checked_out != $user->get('id')) {
			$checkoutUser = JFactory::getUser($article->checked_out);
			$button = JHtml::_('image','system/checked_out.png', NULL, NULL, true);
			$date = JHtml::_('date',$article->checked_out_time);
			$tooltip = JText::_('JLIB_HTML_CHECKED_OUT').' :: '.JText::sprintf('COM_CONTENT_CHECKED_OUT_BY', $checkoutUser->name).' <br /> '.$date;
			return '<span class="hasTip" title="'.htmlspecialchars($tooltip, ENT_COMPAT, 'UTF-8').'">'.$button.'</span>';
		}
		$url	= 'index.php?option=com_content&task=article.edit&a_id='.$article->id.'&return='.base64_encode($uri);
		$icon	= $article->state ? 'edit.png' : 'edit_unpublished.png';
		$text	= JHtml::_('image','system/'.$icon, JText::_('JGLOBAL_EDIT'), NULL, true);
		if ($article->state == 0) {
			$overlib = JText::_('JUNPUBLISHED');
		}
		else {
			$overlib = JText::_('JPUBLISHED');
		}
		$date = JHtml::_('date',$article->created);
		$author = $article->created_by_alias ? $article->created_by_alias : $article->author;
		$overlib .= '&lt;br /&gt;';
		$overlib .= $date;
		$overlib .= '&lt;br /&gt;';
		$overlib .= JText::sprintf('COM_CONTENT_WRITTEN_BY', htmlspecialchars($author, ENT_COMPAT, 'UTF-8'));
		$button = JHtml::_('link',JRoute::_($url), $text);
		$output = '<span class="hasTip" title="'.JText::_('COM_CONTENT_EDIT_ITEM').' :: '.$overlib.'">'.$button.'</span>';
		return $output;
	}
static function edit ( $ article , $ params , $ attribs = array ( ) ) { $ user = JFactory :: getUser ( ) ; $ userId = $ user -> get ( 'id' ) ; $ uri = JFactory :: getURI ( ) ; if ( $ params && $ params -> get ( 'popup' ) ) { return ; } if ( $ article -> state < 0 ) { return ; } JHtml :: _ ( 'behavior.tooltip' ) ; if ( property_exists ( $ article , 'checked_out' ) && property_exists ( $ article , 'checked_out_time' ) && $ article -> checked_out > 0 && $ article -> checked_out != $ user -> get ( 'id' ) ) { $ checkoutUser = JFactory :: getUser ( $ article -> checked_out ) ; $ button = JHtml :: _ ( 'image' , 'system/checked_out.png' , NULL , NULL , true ) ; $ date = JHtml :: _ ( 'date' , $ article -> checked_out_time ) ; $ tooltip = JText :: _ ( 'JLIB_HTML_CHECKED_OUT' ) . ' :: ' . JText :: sprintf ( 'COM_CONTENT_CHECKED_OUT_BY' , $ checkoutUser -> name ) . ' <br /> ' . $ date ; return '<span class="hasTip" title="' . htmlspecialchars ( $ tooltip , ENT_COMPAT , 'UTF-8' ) . '">' . $ button . '</span>' ; } $ url = 'index.php?option=com_content&task=article.edit&a_id=' . $ article -> id . '&return=' . base64_encode ( $ uri ) ; $ icon = $ article -> state ? 'edit.png' : 'edit_unpublished.png' ; $ text = JHtml :: _ ( 'image' , 'system/' . $ icon , JText :: _ ( 'JGLOBAL_EDIT' ) , NULL , true ) ; if ( $ article -> state == 0 ) { $ overlib = JText :: _ ( 'JUNPUBLISHED' ) ; } else { $ overlib = JText :: _ ( 'JPUBLISHED' ) ; } $ date = JHtml :: _ ( 'date' , $ article -> created ) ; $ author = $ article -> created_by_alias ? $ article -> created_by_alias : $ article -> author ; $ overlib .= '&lt;br /&gt;' ; $ overlib .= $ date ; $ overlib .= '&lt;br /&gt;' ; $ overlib .= JText :: sprintf ( 'COM_CONTENT_WRITTEN_BY' , htmlspecialchars ( $ author , ENT_COMPAT , 'UTF-8' ) ) ; $ button = JHtml :: _ ( 'link' , JRoute :: _ ( $ url ) , $ text ) ; $ output = '<span class="hasTip" title="' . JText :: _ ( 'COM_CONTENT_EDIT_ITEM' ) . ' :: ' . $ overlib . '">' . $ button . '</span>' ; return $ output ; }
Display an edit icon for the article.
Display an edit icon for the article .
// Initialise variables. // Ignore if in a popup window. // Ignore if the state is negative (trashed). // Show checked_out icon if the article is checked out by a different user