[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/administrator/components/com_trash/ -> admin.trash.html.php (source)

   1  <?php
   2  /**
   3  * @version        $Id: admin.trash.html.php 17299 2010-05-27 16:06:54Z ian $
   4  * @package        Joomla
   5  * @subpackage    Trash
   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  * HTML class for all trash component output
  20  * @package        Joomla
  21  * @subpackage    Trash
  22  */
  23  
  24  class HTML_trash
  25  {
  26      /**
  27      * Writes a list of the Trash items
  28      */
  29  	function showListContent( $option, &$contents, &$pageNav, &$lists )
  30      {
  31          ?>
  32          <form action="index.php?option=com_trash&amp;task=viewContent" method="post" name="adminForm">
  33  
  34          <table>
  35          <tr>
  36              <td align="left" width="100%">
  37                  <?php echo JText::_( 'Filter' ); ?>:
  38                  <input type="text" name="search" id="search" value="<?php echo htmlspecialchars($lists['search']);?>" class="text_area" onchange="document.adminForm.submit();" />
  39                  <button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button>
  40                  <button onclick="document.getElementById('search').value='';this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button>
  41              </td>
  42              <td nowrap="nowrap">
  43              </td>
  44          </tr>
  45          </table>
  46  
  47          <div id="tablecell">
  48              <table class="adminlist" width="90%">
  49              <thead>
  50                  <tr>
  51                      <th width="20">
  52                          <?php echo JText::_( 'NUM' ); ?>
  53                      </th>
  54                      <th width="20">
  55                          <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $contents );?>);" />
  56                      </th>
  57                      <th class="title">
  58                          <?php echo JHTML::_('grid.sort',   'Title', 'c.title', @$lists['order_Dir'], @$lists['order'] ); ?>
  59                      </th>
  60                      <th width="70">
  61                          <?php echo JHTML::_('grid.sort',   'ID', 'c.id', @$lists['order_Dir'], @$lists['order'] ); ?>
  62                      </th>
  63                      <th class="title" width="25%">
  64                          <?php echo JHTML::_('grid.sort',   'Section', 'sectname', @$lists['order_Dir'], @$lists['order'] ); ?>
  65                      </th>
  66                      <th class="title" width="25%">
  67                          <?php echo JHTML::_('grid.sort',   'Category', 'catname', @$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              $i = 0;
  82              $n = count( $contents );
  83              foreach ( $contents as $row ) {
  84                  ?>
  85                      <tr class="<?php echo "row". $k; ?>">
  86                          <td align="center">
  87                              <?php echo $i + 1 + $pageNav->limitstart;?>
  88                          </td>
  89                          <td align="center">
  90                              <?php echo JHTML::_('grid.id', $i, $row->id ); ?>
  91                          </td>
  92                          <td nowrap="nowrap">
  93                              <?php echo $row->title; ?>
  94                          </td>
  95                          <td align="center">
  96                              <?php echo $row->id; ?>
  97                          </td>
  98                          <td>
  99                              <?php echo $row->sectname; ?>
 100                          </td>
 101                          <td>
 102                              <?php echo $row->catname; ?>
 103                          </td>
 104                      </tr>
 105                  <?php
 106                  $k = 1 - $k;
 107                  $i++;
 108              }
 109              ?>
 110              </tbody>
 111              </table>
 112          </div>
 113  
 114          <input type="hidden" name="option" value="<?php echo $option;?>" />
 115          <input type="hidden" name="task" value="viewContent" />
 116          <input type="hidden" name="return" value="viewContent" />
 117          <input type="hidden" name="boxchecked" value="0" />
 118          <input type="hidden" name="filter_order" value="<?php echo $lists['order']; ?>" />
 119          <input type="hidden" name="filter_order_Dir" value="<?php echo $lists['order_Dir']; ?>" />
 120          </form>
 121          <?php
 122      }
 123  
 124  
 125      /**
 126      * Writes a list of the Trash items
 127      */
 128  	function showListMenu( $option, &$menus, &$pageNav, &$lists )
 129      {
 130          ?>
 131          <script language="javascript" type="text/javascript">
 132          /**
 133          * Toggles the check state of a group of boxes
 134          *
 135          * Checkboxes must have an id attribute in the form cb0, cb1...
 136          * @param The number of box to 'check'
 137          */
 138  		function checkAll_xtd ( n ) {
 139              var f = document.adminForm;
 140              var c = f.toggle1.checked;
 141              var n2 = 0;
 142              for ( i=0; i < n; i++ ) {
 143                  cb = eval( 'f.cb1' + i );
 144                  if (cb) {
 145                      cb.checked = c;
 146                      n2++;
 147                  }
 148              }
 149              if (c) {
 150                  document.adminForm.boxchecked.value = n2;
 151              } else {
 152                  document.adminForm.boxchecked.value = 0;
 153              }
 154          }
 155          </script>
 156          <form action="index.php?option=com_trash&amp;task=viewMenu" method="post" name="adminForm">
 157  
 158          <table>
 159          <tr>
 160              <td align="left" width="100%">
 161                  <?php echo JText::_( 'Filter' ); ?>:
 162                  <input type="text" name="search" id="search" value="<?php echo htmlspecialchars($lists['search']);?>" class="text_area" onchange="document.adminForm.submit();" />
 163                  <button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button>
 164                  <button onclick="document.getElementById('search').value='';this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button>
 165              </td>
 166              <td nowrap="nowrap">
 167              </td>
 168          </tr>
 169          </table>
 170  
 171          <div id="tablecell">
 172              <table class="adminlist" width="90%">
 173              <thead>
 174                  <tr>
 175                      <th width="20">
 176                          <?php echo JText::_( 'NUM' ); ?>
 177                      </th>
 178                      <th width="20">
 179                          <input type="checkbox" name="toggle1" value="" onclick="checkAll_xtd(<?php echo count( $menus );?>);" />
 180                      </th>
 181                      <th class="title">
 182                          <?php echo JHTML::_('grid.sort',   'Name', 'm.name', @$lists['order_Dir'], @$lists['order'] ); ?>
 183                      </th>
 184                      <th width="70">
 185                          <?php echo JHTML::_('grid.sort',   'ID', 'm.id', @$lists['order_Dir'], @$lists['order'] ); ?>
 186                      </th>
 187                      <th class="title" width="25%">
 188                          <?php echo JHTML::_('grid.sort',   'Menu', 'm.menutype', @$lists['order_Dir'], @$lists['order'] ); ?>
 189                      </th>
 190                      <th class="title" width="25%">
 191                          <?php echo JHTML::_('grid.sort',   'Type', 'm.type', @$lists['order_Dir'], @$lists['order'] ); ?>
 192                      </th>
 193                  </tr>
 194              </thead>
 195              <tfoot>
 196                  <tr>
 197                      <td colspan="6">
 198                          <?php echo $pageNav->getListFooter(); ?>
 199                      </td>
 200                  </tr>
 201              </tfoot>
 202              <tbody>
 203              <?php
 204              $k = 0;
 205              $i = 0;
 206              $n = count( $menus );
 207              foreach ( $menus as $row ) {
 208                  ?>
 209                  <tr class="<?php echo "row". $k; ?>">
 210                      <td align="center">
 211                          <?php echo $i + 1 + $pageNav->limitstart;?>
 212                      </td>
 213                      <td align="center">
 214                          <input type="checkbox" id="cb1<?php echo $i;?>" name="mid[]" value="<?php echo $row->id; ?>" onclick="isChecked(this.checked);" />
 215                      </td>
 216                      <td nowrap="nowrap">
 217                          <?php echo $row->name; ?>
 218                      </td>
 219                      <td align="center">
 220                          <?php echo $row->id; ?>
 221                      </td>
 222                      <td>
 223                          <?php echo $row->menutype; ?>
 224                      </td>
 225                      <td>
 226                          <?php echo $row->type; ?>
 227                      </td>
 228                  </tr>
 229                  <?php
 230                  $k = 1 - $k;
 231                  $i++;
 232              }
 233              ?>
 234              </tbody>
 235              </table>
 236          </div>
 237  
 238          <input type="hidden" name="option" value="<?php echo $option;?>" />
 239          <input type="hidden" name="task" value="viewMenu" />
 240          <input type="hidden" name="return" value="viewMenu" />
 241          <input type="hidden" name="boxchecked" value="0" />
 242          <input type="hidden" name="filter_order" value="<?php echo $lists['order']; ?>" />
 243          <input type="hidden" name="filter_order_Dir" value="" />
 244          </form>
 245          <?php
 246      }
 247  
 248  
 249      /**
 250      * A delete confirmation page
 251      * Writes list of the items that have been selected for deletion
 252      */
 253  	function showDelete( $option, $cid, $items, $type, $return ) {
 254      ?>
 255          <form action="index.php?option=com_trash&amp;task=<?php echo $return; ?>" method="post" name="adminForm">
 256  
 257          <table class="adminform">
 258          <tr>
 259              <td width="3%">
 260              </td>
 261              <td  valign="top" width="20%">
 262                  <strong><?php echo JText::_( 'Number of Items' ); ?>:</strong>
 263                  <br />
 264                  <font color="#000066"><strong><?php echo count( $cid ); ?></strong></font>
 265                  <br /><br />
 266              </td>
 267              <td  valign="top" width="25%">
 268                  <strong><?php echo JText::_( 'Items being Deleted' ); ?>:</strong>
 269                  <br />
 270                  <?php
 271                  echo "<ol>";
 272                  foreach ( $items as $item ) {
 273                      echo "<li>". $item->name ."</li>";
 274                  }
 275                  echo "</ol>";
 276                  ?>
 277                  </td>
 278                   <td valign="top"><?php echo JText::_( 'PERMDELETETHESEITEMS' ); ?>
 279                  <br /><br /><br />
 280                  <a class="icon-32-delete" style="border: 1px dotted gray; width: 70px; padding: 10px; margin-left: 50px; background-repeat: no-repeat; padding-left: 40px; "  href="javascript:void submitbutton('delete')">
 281                  &nbsp;<?php echo JText::_( 'Delete' ); ?></a>
 282              </td>
 283          </tr>
 284          <tr>
 285              <td>&nbsp;</td>
 286          </tr>
 287          </table>
 288          <br /><br />
 289  
 290          <input type="hidden" name="option" value="<?php echo $option;?>" />
 291          <input type="hidden" name="task" value="" />
 292          <input type="hidden" name="boxchecked" value="1" />
 293          <input type="hidden" name="type" value="<?php echo $type; ?>" />
 294          <input type="hidden" name="return" value="<?php echo $return;?>" />
 295          <?php
 296          foreach ($cid as $id) {
 297              echo "\n<input type=\"hidden\" name=\"cid[]\" value=\"$id\" />";
 298          }
 299          ?>
 300          <?php echo JHTML::_( 'form.token' ); ?>
 301          </form>
 302          <?php
 303      }
 304  
 305      /**
 306      * A restore confirmation page
 307      * Writes list of the items that have been selected for restore
 308      */
 309  	function showRestore( $option, $cid, $items, $type, $return ) {
 310          ?>
 311          <form action="index.php?option=com_trash&amp;task=<?php echo $return; ?>" method="post" name="adminForm">
 312  
 313          <table class="adminform">
 314          <tr>
 315              <td width="3%"></td>
 316              <td  valign="top" width="20%">
 317                  <strong><?php echo JText::_( 'Number of Items' ); ?>:</strong>
 318                  <br />
 319                  <font color="#000066"><strong><?php echo count( $cid ); ?></strong></font>
 320                  <br /><br />
 321              </td>
 322              <td  valign="top" width="25%">
 323                  <strong><?php echo JText::_( 'Items being Restored' ); ?>:</strong>
 324                  <br />
 325                  <?php
 326                  echo "<ol>";
 327                  foreach ( $items as $item ) {
 328                      echo "<li>". $item->name ."</li>";
 329                  }
 330                  echo "</ol>";
 331                  ?>
 332              </td>
 333              <td valign="top"><?php echo JText::_( 'RESTOREITEMS' ); ?><br /><?php echo JText::_( 'TIPWILLBERETURNED' ); ?>
 334                  <br /><br /><br />
 335                  <div style="border: 1px dotted gray; width: 80px; padding: 10px; margin-left: 50px;">
 336                  <a class="toolbar" href="javascript:if (confirm('<?php echo JText::_( 'WARNRESTORE' ); ?>')){ submitbutton('restore');}">
 337                  <img name="restore" src="images/restore_f2.png" alt="<?php echo JText::_( 'Restore' ); ?>" border="0" align="middle" />
 338                  &nbsp;<?php echo JText::_( 'Restore' ); ?></a>
 339                  </div>
 340              </td>
 341          </tr>
 342          <tr>
 343              <td>&nbsp;</td>
 344          </tr>
 345          </table>
 346          <br /><br />
 347  
 348          <input type="hidden" name="option" value="<?php echo $option;?>" />
 349          <input type="hidden" name="task" value="" />
 350          <input type="hidden" name="boxchecked" value="1" />
 351          <input type="hidden" name="type" value="<?php echo $type; ?>" />
 352          <input type="hidden" name="return" value="<?php echo $return;?>" />
 353          <?php
 354          foreach ($cid as $id) {
 355              echo "\n<input type=\"hidden\" name=\"cid[]\" value=\"$id\" />";
 356          }
 357          ?>
 358          <?php echo JHTML::_( 'form.token' ); ?>
 359          </form>
 360          <?php
 361      }
 362  }


Generated: Wed Mar 28 15:54:07 2012 Cross-referenced by PHPXref 0.7.1