- md5
- 723b9d96c205d76c3ad7b5e764586339
- sha1
- fb0d5971ccc052ecb080f109fa3893131193dea3
- sha256
- d8352ecece4a7dcc8c96b4fa3a5420765560e597ceed846d5b7203c9c5e4ea6a
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
<?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2012 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 8 releases, Joomla 2.5.1 to 2.5.8. See them all, or every version of this file.