[ Index ]

PHP Cross Reference of Mambo 4.6.5

[ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/administrator/components/com_messages/ -> admin.messages.html.php (source)

   1  <?php
   2  /**
   3  * @package Mambo
   4  * @subpackage Messages
   5  * @author Mambo Foundation Inc see README.php
   6  * @copyright (C) 2000 - 2009 Mambo Foundation Inc.
   7  * See COPYRIGHT.php for copyright notices and details.
   8  * @license GNU/GPL Version 2, see LICENSE.php
   9  *
  10  * Redistributions of files must retain the above copyright notice.
  11  *
  12  * Mambo is free software; you can redistribute it and/or
  13  * modify it under the terms of the GNU General Public License
  14  * as published by the Free Software Foundation; version 2 of the License.
  15  */
  16  
  17  /** ensure this file is being included by a parent file */
  18  defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
  19  
  20  class HTML_messages {
  21  	function showMessages( &$rows, $pageNav, $search, $option ) {
  22  ?>
  23  <form action="index2.php" method="post" name="adminForm">
  24    <table class="adminheading">
  25      <tr>
  26        <th class="inbox"><?php echo T_('Private Messaging'); ?></th>
  27        <td><?php echo T_('Search:'); ?></td>
  28        <td> <input type="text" name="search" value="<?php echo $search;?>" class="inputbox" onChange="document.adminForm.submit();" />
  29        </td>
  30      </tr>
  31    </table>
  32    <table class="adminlist">
  33      <tr>
  34        <th width="20">#</th>
  35        <th width="5%" class="title"> <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count($rows); ?>);" />
  36        </th>
  37        <th width="60%" class="title"><?php echo T_('Subject'); ?></th>
  38        <th width="15%" class="title"><?php echo T_('From'); ?></th>
  39        <!-- <th width="20%" class="title">UserType</th> -->
  40        <th width="15%" class="title"><?php echo T_('Date'); ?></th>
  41        <th width="5%" class="title"><?php echo T_('Read'); ?></th>
  42      </tr>
  43  <?php
  44  $k = 0;
  45  for ($i=0, $n=count( $rows ); $i < $n; $i++) {
  46      $row =& $rows[$i];
  47  ?>
  48      <tr class="<?php echo "row$k"; ?>">
  49        <td width="20"><?php echo $i+1+$pageNav->limitstart;?></td>
  50        <td width="5%"><?php echo mosHTML::idBox( $i, $row->message_id ); ?></td>
  51        <td width="60%"> <a href="#edit" onClick="hideMainMenu();return listItemTask('cb<?php echo $i;?>','view')">
  52          <?php echo $row->subject; ?> </a> </td>
  53        <td width="15%"><?php echo $row->user_from; ?></td>
  54        <td width="15%"><?php echo $row->date_time; ?></td>
  55        <td width="15%"><?php
  56        if (intval( $row->state ) == "1") {
  57            echo T_("Read");
  58        } else {
  59            echo T_("Unread");
  60        } ?></td>
  61      </tr>
  62      <?php $k = 1 - $k;
  63              } ?>
  64      </table>
  65      <?php echo $pageNav->getListFooter(); ?>
  66    <input type="hidden" name="option" value="<?php echo $option;?>" />
  67    <input type="hidden" name="task" value="" />
  68    <input type="hidden" name="boxchecked" value="0" />
  69    <input type="hidden" name="hidemainmenu" value="0" />
  70  </form>
  71  <?php }
  72  
  73  function editConfig( &$vars, $option) {
  74  
  75      $tabs = new mosTabs(0);
  76  ?>
  77  <table class="adminheading">
  78    <tr>
  79      <th class="msgconfig"><?php echo T_('Private Messaging Configuration'); ?></th>
  80    </tr>
  81  </table>
  82  <?php
  83  $tabs->startPane("messages");
  84  $tabs->startTab(T_("General"),"general-page");
  85  ?>
  86  <form action="index2.php" method="post" name="adminForm">
  87  <script type="text/javascript">
  88  function submitbutton(pressbutton) {
  89      var form = document.adminForm;
  90      if (pressbutton == 'saveconfig') {
  91          if (confirm ("<?php echo T_('Are you sure?'); ?>")) {
  92              submitform( pressbutton );
  93          }
  94      } else {
  95          document.location.href = 'index2.php?option=<?php echo $option;?>';
  96      }
  97  }
  98  </script>
  99  
 100  
 101      <table class="adminform">
 102        <tr>
 103          <td width="20%"><?php echo T_('Lock Inbox:'); ?></td>
 104          <td> <?php echo $vars['lock']; ?> </td>
 105        </tr>
 106        <tr>
 107          <td width="20%"><?php echo T_('Mail me on new Message:'); ?></td>
 108          <td> <?php echo $vars['mail_on_new']; ?> </td>
 109        </tr>
 110      </table>
 111  
 112  
 113  <?php
 114  $tabs->endTab();
 115  $tabs->endPane();
 116  ?>  <input type="hidden" name="option" value="<?php echo $option; ?>">
 117    <input type="hidden" name="task" value="">
 118  </form>
 119  <?php }
 120  
 121  function viewMessage( &$row, $option ) {
 122  ?>
 123      <table class="adminheading">
 124          <tr>
 125              <th class="inbox"><?php echo T_('View Private Message'); ?></th>
 126          </tr>
 127      </table>
 128  
 129      <form action="index2.php" method="post" name="adminForm">
 130      <table class="adminform">
 131          <tr>
 132              <td width="100"><?php echo T_('From:'); ?></td>
 133              <td width="85%" bgcolor="#ffffff"><?php echo $row->user_from;?></td>
 134          </tr>
 135          <tr>
 136              <td><?php echo T_('Posted:'); ?></td>
 137              <td bgcolor="#ffffff"><?php echo $row->date_time;?></td>
 138          </tr>
 139          <tr>
 140              <td><?php echo T_('Subject:'); ?></td>
 141              <td bgcolor="#ffffff"><?php echo $row->subject;?></td>
 142          </tr>
 143          <tr>
 144              <td valign="top"><?php echo T_('Message:'); ?></td>
 145              <td width="100%" bgcolor="#ffffff"><pre><?php echo htmlspecialchars( $row->message );?></pre></td>
 146          </tr>
 147      </table>
 148      <input type="hidden" name="option" value="<?php echo $option;?>" />
 149      <input type="hidden" name="task" value="" />
 150      <input type="hidden" name="boxchecked" value="1" />
 151      <input type="hidden" name="cid[]" value="<?php echo $row->message_id; ?>" />
 152      <input type="hidden" name="userid" value="<?php echo $row->user_id_from; ?>" />
 153      <input type="hidden" name="subject" value="Re: <?php echo $row->subject; ?>" />
 154      <input type="hidden" name="hidemainmenu" value="0" />
 155      </form>
 156  <?php }
 157  
 158  function newMessage($option, $recipientslist, $subject ) {
 159      global $my;
 160  ?>
 161      <script type="text/javascript">
 162  	function submitbutton(pressbutton) {
 163          var form = document.adminForm;
 164          if (pressbutton == 'cancel') {
 165              submitform( pressbutton );
 166              return;
 167          }
 168  
 169          // do field validation
 170          if (form.subject.value == "") {
 171              alert( "<?php echo T_('You must provide a subject.'); ?>" );
 172          } else if (form.message.value == "") {
 173              alert( "<?php echo T_('You must provide a message.'); ?>" );
 174          } else if (getSelectedValue('adminForm','user_id_to') < 1) {
 175              alert( "<?php echo T_('You must select a recipient.'); ?>" );
 176          } else {
 177              submitform( pressbutton );
 178          }
 179      }
 180      </script>
 181  
 182      <table class="adminheading">
 183          <tr>
 184              <th class="inbox"><?php echo T_('New Private Message'); ?></th>
 185          </tr>
 186      </table>
 187  
 188      <form action="index2.php" method="post" name="adminForm">
 189      <table class="adminform">
 190          <tr>
 191              <td width="100"><?php echo T_('To:'); ?></td>
 192              <td width="85%"><?php echo $recipientslist; ?></td>
 193          </tr>
 194          <tr>
 195              <td><?php echo T_('Subject:'); ?></td>
 196              <td>
 197                  <input type="text" name="subject" size="50" maxlength="100" class="inputbox" value="<?php echo $subject; ?>"/>
 198              </td>
 199          </tr>
 200          <tr>
 201              <td valign="top"><?php echo T_('Message:'); ?></td>
 202              <td width="100%">
 203                  <textarea name="message" style="width:100%" rows="30" class="inputbox"></textarea>
 204              </td>
 205          </tr>
 206      </table>
 207      <input type="hidden" name="user_id_from" value="<?php echo $my->id; ?>">
 208      <input type="hidden" name="option" value="<?php echo $option; ?>">
 209      <input type="hidden" name="task" value="">
 210      </form>
 211  <?php }
 212  
 213  }?>