- md5
- a32971839aad6f3ca10baf0b57f735f8
- sha1
- cdcae552288338e3f87cbefd6e510a2c97a224ec
- sha256
- 512629f5c5485448f408be1a67ce23718cacbd445539714cfaa6115ed6a73db4
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
<?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('_JEXEC') or die;
/**
* Extended Utility class for the Users component.
*
* @package Joomla.Administrator
* @subpackage com_users
* @since 2.5
*/
class JHtmlUsers
{
/**
* Display an image.
*
* @param string $src The source of the image
*
* @return string A <img> element if the specified file exists, otherwise, a null string
*
* @since 2.5
*/
public static function image($src)
{
$src = preg_replace('#[^A-Z0-9\-_\./]#i', '', $src);
$file = JPATH_SITE . '/' . $src;
jimport('joomla.filesystem.path');
JPath::check($file);
if (!file_exists($file))
{
return '';
}
return '<img src="' . JUri::root() . $src . '" alt="" />';
}
/**
* Displays an icon to add a note for this user.
*
* @param integer $userId The user ID
*
* @return string A link to add a note
*
* @since 2.5
*/
public static function addNote($userId)
{
$title = JText::_('COM_USERS_ADD_NOTE');
return '<a href="' . JRoute::_('index.php?option=com_users&task=note.add&u_id=' . (int) $userId) . '">'
. JHtml::_('image', 'admin/note_add_16.png', 'COM_USERS_NOTES', array('title' => $title), true) . '</a>';
}
/**
* Displays an icon to filter the notes list on this user.
*
* @param integer $count The number of notes for the user
* @param integer $userId The user ID
*
* @return string A link to apply a filter
*
* @since 2.5
*/
public static function filterNotes($count, $userId)
{
if (empty($count))
{
return '';
}
$title = JText::_('COM_USERS_FILTER_NOTES');
return '<a href="' . JRoute::_('index.php?option=com_users&view=notes&filter_search=uid:' . (int) $userId) . '">'
. JHtml::_('image', 'admin/filter_16.png', 'COM_USERS_NOTES', array('title' => $title), true) . '</a>';
}
/**
* Displays a note icon.
*
* @param integer $count The number of notes for the user
* @param integer $userId The user ID
*
* @return string A link to a modal window with the user notes
*
* @since 2.5
*/
public static function notes($count, $userId)
{
if (empty($count))
{
return '';
}
$title = JText::plural('COM_USERS_N_USER_NOTES', $count);
return '<a class="modal"' .
' href="' . JRoute::_('index.php?option=com_users&view=notes&tmpl=component&layout=modal&u_id=' . (int) $userId) . '"' .
' rel="{handler: \'iframe\', size: {x: 800, y: 450}}">' .
JHtml::_('image', 'menu/icon-16-user-note.png', 'COM_USERS_NOTES', array('title' => $title), true) . '</a>';
}
}
The same content is in 11 releases, Joomla 2.5.18 to 2.5.28. See them all, or every version of this file.