- md5
- f9e80a652ca1da37821e3adefa79e0b2
- sha1
- 730f17e671309d479087b2ef621bc20c4210adb1
- sha256
- 9f2abea013f855a3c2ae3ab74bb955c2caba67faf9eb4c6f0e5bb3fc4aa7703d
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
<?php
/**
* @version $Id: admin.messages.html.php 10092 2008-02-29 23:03:38Z ircmaxell $
* @package Joomla
* @subpackage Messages
* @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' );
/**
* @package Joomla
* @subpackage Messages
*/
class HTML_messages
{
function showMessages( &$rows, &$pageNav, $option, &$lists )
{
// Initialize variables
$user =& JFactory::getUser();
?>
<form action="index.php?option=com_messages" method="post" name="adminForm">
<table>
<tr>
<td align="left" width="100%">
<?php echo JText::_( 'Search' ); ?>:
<input type="text" name="search" id="search" value="<?php echo $lists['search'];?>" class="text_area" onchange="document.adminForm.submit();" />
<button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button>
<button onclick="document.getElementById('search').value='';this.form.getElementById('filter_state').value='';this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button>
</td>
<td nowrap="nowrap">
<?php
echo $lists['state'];
?>
</td>
</tr>
</table>
<div id="tablecell">
<table class="adminlist">
<thead>
<tr>
<th width="20">
<?php echo JText::_( 'NUM' ); ?>
</th>
<th width="20" class="title">
<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($rows); ?>);" />
</th>
<th width="50%" class="title">
<?php echo JHTML::_('grid.sort', 'Subject', 'a.subject', @$lists['order_Dir'], @$lists['order'] ); ?>
</th>
<th width="5%" class="title" align="center">
<?php echo JHTML::_('grid.sort', 'Read', 'a.state', @$lists['order_Dir'], @$lists['order'] ); ?>
</th>
<th width="25%" class="title">
<?php echo JHTML::_('grid.sort', 'From', 'user_from', @$lists['order_Dir'], @$lists['order'] ); ?>
</th>
<th width="15%" class="title" nowrap="nowrap" align="center">
<?php echo JHTML::_('grid.sort', 'Date', 'a.date_time', @$lists['order_Dir'], @$lists['order'] ); ?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="6">
<?php echo $pageNav->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php
$k = 0;
for ($i=0, $n=count( $rows ); $i < $n; $i++) {
$row =& $rows[$i];
$img = $row->state ? 'tick.png' : 'publish_x.png';
$alt = $row->state ? JText::_( 'Read' ) : JText::_( 'Read' );
if ( $user->authorize( 'com_users', 'manage' ) ) {
$linkA = 'index.php?option=com_users&task=editA&id='. $row->user_id_from;
$author = '<a href="'. JRoute::_( $linkA ) .'" title="'. JText::_( 'Edit User' ) .'">'. $row->user_from .'</a>';
} else {
$author = $row->user_from;
}
?>
<tr class="<?php echo "row$k"; ?>">
<td>
<?php echo $i+1+$pageNav->limitstart;?>
</td>
<td>
<?php echo JHTML::_('grid.id', $i, $row->message_id ); ?>
</td>
<td>
<a href="#edit" onclick="return listItemTask('cb<?php echo $i;?>','view')">
<?php echo $row->subject; ?></a>
</td>
<td align="center">
<a href="javascript: void(0);">
<img src="images/<?php echo $img;?>" width="16" height="16" border="0" alt="<?php echo $alt; ?>" /></a>
</td>
<td>
<?php echo $author; ?>
</td>
<td>
<?php echo JHTML::_('date', $row->date_time, JText::_('DATE_FORMAT_LC2')); ?>
</td>
</tr>
<?php $k = 1 - $k;
}
?>
</tbody>
</table>
</div>
<input type="hidden" name="option" value="<?php echo $option;?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $lists['order']; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $lists['order_Dir']; ?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<?php
}
function editConfig( &$vars, $option) {
?>
<script language="javascript" type="text/javascript">
function submitbutton(pressbutton) {
var form = document.adminForm;
if (pressbutton == 'saveconfig') {
if (confirm ("<?php echo JText::_( 'Are you sure?' ); ?>")) {
submitform( pressbutton );
}
} else {
document.location.href = 'index.php?option=<?php echo $option;?>';
}
}
</script>
<form action="index.php" method="post" name="adminForm">
<div id="editcell">
<table class="adminform">
<tr>
<td width="20%">
<?php echo JText::_( 'Lock Inbox' ); ?>:
</td>
<td>
<?php echo $vars['lock']; ?>
</td>
</tr>
<tr>
<td width="20%">
<?php echo JText::_( 'Mail me on new Message' ); ?>:
</td>
<td>
<?php echo $vars['mail_on_new']; ?>
</td>
</tr>
<tr>
<td>
<?php echo JText::_( 'Auto Purge Messages' ); ?>:
</td>
<td>
<input type="text" name="vars[auto_purge]" size="5" value="<?php echo $vars['auto_purge']; ?>" class="inputbox" />
<?php echo JText::_( 'days old' ); ?>
</td>
</tr>
</table>
</div>
<input type="hidden" name="option" value="<?php echo $option; ?>" />
<input type="hidden" name="task" value="" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<?php
}
function viewMessage( &$row, $option ) {
?>
<form action="index.php" method="post" name="adminForm">
<table class="adminform">
<tr>
<td width="100">
<?php echo JText::_( 'From' ); ?>:
</td>
<td width="85%" bgcolor="#ffffff">
<?php echo $row->user_from;?>
</td>
</tr>
<tr>
<td>
<?php echo JText::_( 'Posted' ); ?>:
</td>
<td bgcolor="#ffffff">
<?php echo $row->date_time;?>
</td>
</tr>
<tr>
<td>
<?php echo JText::_( 'Subject' ); ?>:
</td>
<td bgcolor="#ffffff">
<?php echo $row->subject;?>
</td>
</tr>
<tr>
<td valign="top">
<?php echo JText::_( 'Message' ); ?>:
</td>
<td width="100%" bgcolor="#ffffff">
<pre><?php echo htmlspecialchars( $row->message, ENT_COMPAT, 'UTF-8' );?></pre>
</td>
</tr>
</table>
<input type="hidden" name="option" value="<?php echo $option;?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="1" />
<input type="hidden" name="cid[]" value="<?php echo $row->message_id; ?>" />
<input type="hidden" name="userid" value="<?php echo $row->user_id_from; ?>" />
<input type="hidden" name="subject" value="Re: <?php echo $row->subject; ?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<?php
}
function newMessage($option, $recipientslist, $subject )
{
$user =& JFactory::getUser();
?>
<script language="javascript" type="text/javascript">
function submitbutton(pressbutton) {
var form = document.adminForm;
if (pressbutton == 'cancel') {
submitform( pressbutton );
return;
}
// do field validation
if (form.subject.value == "") {
alert( "<?php echo JText::_( 'You must provide a subject.' ); ?>" );
} else if (form.message.value == "") {
alert( "<?php echo JText::_( 'You must provide a message.' ); ?>" );
} else if (getSelectedValue('adminForm','user_id_to') < 1) {
alert( "<?php echo JText::_( 'You must select a recipient.' ); ?>" );
} else {
submitform( pressbutton );
}
}
</script>
<form action="index.php" method="post" name="adminForm">
<table class="adminform">
<tr>
<td width="100">
<?php echo JText::_( 'To' ); ?>:
</td>
<td width="85%">
<?php echo $recipientslist; ?>
</td>
</tr>
<tr>
<td>
<?php echo JText::_( 'Subject' ); ?>:
</td>
<td>
<input type="text" name="subject" size="50" maxlength="100" class="inputbox" value="<?php echo $subject; ?>"/>
</td>
</tr>
<tr>
<td valign="top">
<?php echo JText::_( 'Message' ); ?>:
</td>
<td width="100%">
<textarea name="message" style="width:95%" rows="30" class="inputbox"></textarea>
</td>
</tr>
</table>
<input type="hidden" name="user_id_from" value="<?php echo $user->get('id'); ?>">
<input type="hidden" name="option" value="<?php echo $option; ?>">
<input type="hidden" name="task" value="">
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<?php
}
}
The same content is in 2 releases, Joomla 1.5.2 to 1.5.3. See them all, or every version of this file.