Files
@ 9a29f073412c
Branch filter:
Location: hot67beta/administrator/components/com_messages/admin.messages.html.php
9a29f073412c
8.5 KiB
text/x-php
pad
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 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | <?php
/**
* @version $Id: admin.messages.html.php 10381 2008-06-01 03:35:53Z pasamio $
* @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&view=user&task=edit&cid[]='. $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
}
}
|