| [ Index ] |
PHP Cross Reference of Joomla 1.5.25 |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * @version $Id: admin.messages.html.php 18162 2010-07-16 07:00:47Z ian $ 4 * @package Joomla 5 * @subpackage Messages 6 * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. 7 * @license GNU/GPL, see LICENSE.php 8 * Joomla! is free software. This version may have been modified pursuant 9 * to the GNU General Public License, and as distributed it includes or 10 * is derivative of works licensed under the GNU General Public License or 11 * other free or open source software licenses. 12 * See COPYRIGHT.php for copyright notices and details. 13 */ 14 15 // no direct access 16 defined( '_JEXEC' ) or die( 'Restricted access' ); 17 18 /** 19 * @package Joomla 20 * @subpackage Messages 21 */ 22 class HTML_messages 23 { 24 function showMessages( &$rows, &$pageNav, $option, &$lists ) 25 { 26 // Initialize variables 27 $user =& JFactory::getUser(); 28 ?> 29 <form action="index.php?option=com_messages" method="post" name="adminForm"> 30 31 <table> 32 <tr> 33 <td align="left" width="100%"> 34 <?php echo JText::_( 'Search' ); ?>: 35 <input type="text" name="search" id="search" value="<?php echo htmlspecialchars($lists['search']);?>" class="text_area" onchange="document.adminForm.submit();" /> 36 <button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button> 37 <button onclick="document.getElementById('search').value='';this.form.getElementById('filter_state').value='';this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button> 38 </td> 39 <td nowrap="nowrap"> 40 <?php 41 echo $lists['state']; 42 ?> 43 </td> 44 </tr> 45 </table> 46 47 <div id="tablecell"> 48 <table class="adminlist"> 49 <thead> 50 <tr> 51 <th width="20"> 52 <?php echo JText::_( 'NUM' ); ?> 53 </th> 54 <th width="20" class="title"> 55 <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($rows); ?>);" /> 56 </th> 57 <th width="50%" class="title"> 58 <?php echo JHTML::_('grid.sort', 'Subject', 'a.subject', @$lists['order_Dir'], @$lists['order'] ); ?> 59 </th> 60 <th width="5%" class="title" align="center"> 61 <?php echo JHTML::_('grid.sort', 'Read', 'a.state', @$lists['order_Dir'], @$lists['order'] ); ?> 62 </th> 63 <th width="25%" class="title"> 64 <?php echo JHTML::_('grid.sort', 'From', 'user_from', @$lists['order_Dir'], @$lists['order'] ); ?> 65 </th> 66 <th width="15%" class="title" nowrap="nowrap" align="center"> 67 <?php echo JHTML::_('grid.sort', 'Date', 'a.date_time', @$lists['order_Dir'], @$lists['order'] ); ?> 68 </th> 69 </tr> 70 </thead> 71 <tfoot> 72 <tr> 73 <td colspan="6"> 74 <?php echo $pageNav->getListFooter(); ?> 75 </td> 76 </tr> 77 </tfoot> 78 <tbody> 79 <?php 80 $k = 0; 81 for ($i=0, $n=count( $rows ); $i < $n; $i++) { 82 $row =& $rows[$i]; 83 $img = $row->state ? 'tick.png' : 'publish_x.png'; 84 $alt = $row->state ? JText::_( 'Read' ) : JText::_( 'Read' ); 85 86 if ( $user->authorize( 'com_users', 'manage' ) ) { 87 $linkA = 'index.php?option=com_users&view=user&task=edit&cid[]='. $row->user_id_from; 88 $author = '<a href="'. JRoute::_( $linkA ) .'" title="'. JText::_( 'Edit User' ) .'">'. $row->user_from .'</a>'; 89 } else { 90 $author = $row->user_from; 91 } 92 93 ?> 94 <tr class="<?php echo "row$k"; ?>"> 95 <td> 96 <?php echo $i+1+$pageNav->limitstart;?> 97 </td> 98 <td> 99 <?php echo JHTML::_('grid.id', $i, $row->message_id ); ?> 100 </td> 101 <td> 102 <a href="#edit" onclick="return listItemTask('cb<?php echo $i;?>','view')"> 103 <?php echo htmlspecialchars($row->subject); ?></a> 104 </td> 105 <td align="center"> 106 <a href="javascript: void(0);"> 107 <img src="images/<?php echo $img;?>" width="16" height="16" border="0" alt="<?php echo $alt; ?>" /></a> 108 </td> 109 <td> 110 <?php echo $author; ?> 111 </td> 112 <td> 113 <?php echo JHTML::_('date', $row->date_time, JText::_('DATE_FORMAT_LC2')); ?> 114 </td> 115 </tr> 116 <?php $k = 1 - $k; 117 } 118 ?> 119 </tbody> 120 </table> 121 </div> 122 123 <input type="hidden" name="option" value="<?php echo $option;?>" /> 124 <input type="hidden" name="task" value="" /> 125 <input type="hidden" name="boxchecked" value="0" /> 126 <input type="hidden" name="filter_order" value="<?php echo $lists['order']; ?>" /> 127 <input type="hidden" name="filter_order_Dir" value="<?php echo $lists['order_Dir']; ?>" /> 128 <?php echo JHTML::_( 'form.token' ); ?> 129 </form> 130 <?php 131 } 132 133 function editConfig( &$vars, $option) { 134 ?> 135 <script language="javascript" type="text/javascript"> 136 function submitbutton(pressbutton) { 137 var form = document.adminForm; 138 if (pressbutton == 'saveconfig') { 139 if (confirm ("<?php echo JText::_( 'Are you sure?' ); ?>")) { 140 submitform( pressbutton ); 141 } 142 } else { 143 document.location.href = 'index.php?option=<?php echo $option;?>'; 144 } 145 } 146 </script> 147 <form action="index.php" method="post" name="adminForm"> 148 149 <div id="editcell"> 150 <table class="adminform"> 151 <tr> 152 <td width="20%"> 153 <?php echo JText::_( 'Lock Inbox' ); ?>: 154 </td> 155 <td> 156 <?php echo $vars['lock']; ?> 157 </td> 158 </tr> 159 <tr> 160 <td width="20%"> 161 <?php echo JText::_( 'Mail me on new Message' ); ?>: 162 </td> 163 <td> 164 <?php echo $vars['mail_on_new']; ?> 165 </td> 166 </tr> 167 <tr> 168 <td> 169 <?php echo JText::_( 'Auto Purge Messages' ); ?>: 170 </td> 171 <td> 172 <input type="text" name="vars[auto_purge]" size="5" value="<?php echo $vars['auto_purge']; ?>" class="inputbox" /> 173 <?php echo JText::_( 'days old' ); ?> 174 </td> 175 </tr> 176 </table> 177 </div> 178 179 <input type="hidden" name="option" value="<?php echo $option; ?>" /> 180 <input type="hidden" name="task" value="" /> 181 <?php echo JHTML::_( 'form.token' ); ?> 182 </form> 183 <?php 184 } 185 186 function viewMessage( &$row, $option ) { 187 ?> 188 <form action="index.php" method="post" name="adminForm"> 189 190 <table class="adminform"> 191 <tr> 192 <td width="100"> 193 <?php echo JText::_( 'From' ); ?>: 194 </td> 195 <td width="85%" bgcolor="#ffffff"> 196 <?php echo $row->user_from;?> 197 </td> 198 </tr> 199 <tr> 200 <td> 201 <?php echo JText::_( 'Posted' ); ?>: 202 </td> 203 <td bgcolor="#ffffff"> 204 <?php echo $row->date_time;?> 205 </td> 206 </tr> 207 <tr> 208 <td> 209 <?php echo JText::_( 'Subject' ); ?>: 210 </td> 211 <td bgcolor="#ffffff"> 212 <?php echo htmlspecialchars($row->subject);?> 213 </td> 214 </tr> 215 <tr> 216 <td valign="top"> 217 <?php echo JText::_( 'Message' ); ?>: 218 </td> 219 <td width="100%" bgcolor="#ffffff"> 220 <pre><?php echo htmlspecialchars( $row->message, ENT_COMPAT, 'UTF-8' );?></pre> 221 </td> 222 </tr> 223 </table> 224 225 <input type="hidden" name="option" value="<?php echo $option;?>" /> 226 <input type="hidden" name="task" value="" /> 227 <input type="hidden" name="boxchecked" value="1" /> 228 <input type="hidden" name="cid[]" value="<?php echo $row->message_id; ?>" /> 229 <input type="hidden" name="userid" value="<?php echo $row->user_id_from; ?>" /> 230 <input type="hidden" name="subject" value="Re: <?php echo htmlspecialchars($row->subject); ?>" /> 231 <?php echo JHTML::_( 'form.token' ); ?> 232 </form> 233 <?php 234 } 235 236 function newMessage($option, $recipientslist, $subject ) 237 { 238 $user =& JFactory::getUser(); 239 ?> 240 <script language="javascript" type="text/javascript"> 241 function submitbutton(pressbutton) { 242 var form = document.adminForm; 243 if (pressbutton == 'cancel') { 244 submitform( pressbutton ); 245 return; 246 } 247 248 // do field validation 249 if (form.subject.value == "") { 250 alert( "<?php echo JText::_( 'You must provide a subject.' ); ?>" ); 251 } else if (form.message.value == "") { 252 alert( "<?php echo JText::_( 'You must provide a message.' ); ?>" ); 253 } else if (getSelectedValue('adminForm','user_id_to') < 1) { 254 alert( "<?php echo JText::_( 'You must select a recipient.' ); ?>" ); 255 } else { 256 submitform( pressbutton ); 257 } 258 } 259 </script> 260 <form action="index.php" method="post" name="adminForm"> 261 262 <table class="adminform"> 263 <tr> 264 <td width="100"> 265 <?php echo JText::_( 'To' ); ?>: 266 </td> 267 <td width="85%"> 268 <?php echo $recipientslist; ?> 269 </td> 270 </tr> 271 <tr> 272 <td> 273 <?php echo JText::_( 'Subject' ); ?>: 274 </td> 275 <td> 276 <input type="text" name="subject" size="50" maxlength="100" class="inputbox" value="<?php echo $subject; ?>"/> 277 </td> 278 </tr> 279 <tr> 280 <td valign="top"> 281 <?php echo JText::_( 'Message' ); ?>: 282 </td> 283 <td width="100%"> 284 <textarea name="message" style="width:95%" rows="30" class="inputbox"></textarea> 285 </td> 286 </tr> 287 </table> 288 289 <input type="hidden" name="user_id_from" value="<?php echo $user->get('id'); ?>"> 290 <input type="hidden" name="option" value="<?php echo $option; ?>"> 291 <input type="hidden" name="task" value=""> 292 <?php echo JHTML::_( 'form.token' ); ?> 293 </form> 294 <?php 295 } 296 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Mon Nov 14 16:47:20 2011 | Cross-referenced by PHPXref 0.7.1 |