Source for file admin.trash.html.php

Documentation is available at admin.trash.html.php

  1. <?php
  2. /**
  3. @package Mambo
  4. @subpackage Trash
  5. @copyright  Refer to copyright.php
  6. @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
  7. @author Mambo Foundation Inc see README.php
  8. */
  9.  
  10. /** ensure this file is being included by a parent file */
  11. defined'_VALID_MOS' or die'Direct Access to this location is not allowed.' );
  12.  
  13. /**
  14. * HTML class for all trash component output
  15. @package Mambo
  16. @subpackage Trash
  17. */
  18. class HTML_trash {
  19.     /**
  20.     * Writes a list of the Trash items
  21.     */
  22.     function showList$option$contents$menus$pageNav_content$pageNav_menu {
  23.         global $my;
  24.         $tabs new mosTabs(1);
  25.         ?>
  26.         <script language="javascript" type="text/javascript">
  27.         /**
  28.         * Toggles the check state of a group of boxes
  29.         *
  30.         * Checkboxes must have an id attribute in the form cb0, cb1...
  31.         * @param The number of box to 'check'
  32.         */
  33.         function checkAll_xtd ( n ) {
  34.             //var f = document.adminForm;
  35.             var f=document.getElementById("adminForm1");
  36.             var d=document.getElementById("adminForm");
  37.             var c = f.toggle1.checked;
  38.             var n2 = 0;
  39.             for ( i=0; i < n; i++ ) {
  40.                 cb = eval ( 'f.cb1' + i );
  41.                 dcb = eval ('d.dcb' + i );
  42.                 if (cb) {
  43.                     cb.checked = c;
  44.                     dcb.checked = c;
  45.                     n2++;
  46.                 }
  47.             }
  48.             if (c) {
  49.                 f.boxchecked.value = n2;
  50.                 d.boxchecked.value = n2;
  51.             } else {
  52.                 f.boxchecked.value = 0;
  53.                 d.boxchecked.value = 0;
  54.             }
  55.         }
  56.         </script>
  57.         <form action="index2.php" method="post" name="adminForm" id="adminForm">
  58.         <table class="adminheading">
  59.         <tr>
  60.             <th class="trash"><?php echo T_('Trash Manager')?></th>
  61.         </tr>
  62.         </table>
  63.  
  64.         <?php
  65.         $tabs->startPane("content-pane");
  66.         $tabs->startTab(T_("Content Items"),"content_items");
  67.         ?>
  68.         <table class="adminheading" width="90%">
  69.         <tr>
  70.             <th><small><?php echo T_('Content Items')?></small></th>
  71.         </tr>
  72.         </table>
  73.  
  74.         <table class="adminlist" width="90%">
  75.         <tr>
  76.             <th width="20">#</th>
  77.             <th width="20">
  78.             <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count$contents );?>);" />
  79.             </th>
  80.             <th width="20px">&nbsp;</th>
  81.             <th class="title">
  82.             <?php echo T_('Title')?>
  83.             </th>
  84.             <th>
  85.             <?php echo T_('Section')?>
  86.             </th>
  87.             <th>
  88.             <?php echo T_('Category')?>
  89.             </th>
  90.             <th width="70px">
  91.             <?php echo T_('ID')?>
  92.             </th>
  93.         </tr>
  94.         <?php
  95.         $k 0;
  96.         $i 0;
  97.         $n count$contents );
  98.         foreach $contents as $row {
  99.             ?>
  100.             <tr class="<?php echo "row"$k?>">
  101.                 <td align="center" width="30px">
  102.                 <?php echo $i $pageNav_content->limitstart;?>
  103.                 </td>
  104.                 <td width="20px" align="center"><?php echo mosHTML::idBox$i$row->id )?></td>
  105.                 <td width="20px"></td>
  106.                 <td nowrap>
  107.                 <?php
  108.                 echo $row->title;
  109.                 ?>
  110.                 </td>
  111.                 <td align="center" width="20%">
  112.                 <?php
  113.                 echo $row->sectname;
  114.                 ?>
  115.                 </td>
  116.                 <td align="center" width="20%">
  117.                 <?php
  118.                 echo $row->catname;
  119.                 ?>
  120.                 </td>
  121.                 <td align="center">
  122.                 <?php
  123.                 echo $row->id;
  124.                 ?>
  125.                 </td>
  126.             </tr>
  127.             <?php
  128.             $k $k;
  129.             $i++;
  130.         }
  131.         ?>
  132.         </table>
  133.         <?php echo $pageNav_content->getListFooter()?>
  134.         <?php
  135.         $tabs->endTab();
  136.         ?>
  137.         <input type="hidden" name="option" value="<?php echo $option;?>" />
  138.         <input type="hidden" name="task" value="" />
  139.         <input type="hidden" name="boxchecked" value="0" />
  140.  
  141.         <?php
  142.         $i=0;
  143.         foreach $menus as $row {
  144.             ?>
  145.             <input type="checkbox" style="visibility:hidden;" id="dcb<?php echo $i;?>" name="mid[]" value="<?php echo $row->id?>">
  146.             <?php
  147.             $i++;
  148.             }
  149.             ?>
  150.         </form>
  151.  
  152.         <form action="index2.php" method="post" name="adminForm1" id="adminForm1">
  153.         <?php
  154.         $tabs->startTab(T_("Menu Items"),"menu_items");
  155.         ?>
  156.         <table class="adminheading" width="90%">
  157.         <tr>
  158.             <th><small><?php echo T_('Menu Items')?></small></th>
  159.         </tr>
  160.         </table>
  161.  
  162.         <table class="adminlist" width="90%">
  163.         <tr>
  164.             <th width="20">#</th>
  165.             <th width="20">
  166.             <input type="checkbox" name="toggle1" value="" onClick="checkAll_xtd(<?php echo count$menus );?>);" />
  167.             </th>
  168.             <th width="20px">&nbsp;</th>
  169.             <th class="title">
  170.             <?php echo T_('Title')?>
  171.             </th>
  172.             <th>
  173.             <?php echo T_('Menu')?>
  174.             </th>
  175.             <th>
  176.             <?php echo T_('Type')?>
  177.             </th>
  178.             <th width="70px">
  179.             <?php echo T_('ID')?>
  180.             </th>
  181.         </tr>
  182.         <?php
  183.         $k 0;
  184.         $i 0;
  185.         $n count$menus );
  186.         foreach $menus as $row {
  187.             ?>
  188.             <tr class="<?php echo "row"$k?>">
  189.                 <td align="center" width="30px">
  190.                 <?php echo $i $pageNav_menu->limitstart;?>
  191.                 </td>
  192.                 <td width="30px" align="center">
  193.                 <input type="checkbox" id="cb1<?php echo $i;?>" name="mid[]" value="<?php echo $row->id?>" onclick="isChecked(this.checked);document.getElementById('dcb<?php echo $i;?>').checked=this.checked;" />
  194.                 </td>
  195.                 <td width="20px"></td>
  196.                 <td nowrap>
  197.                 <?php
  198.                 echo $row->name;
  199.                 ?>
  200.                 </td>
  201.                 <td align="center" width="20%">
  202.                 <?php
  203.                 echo $row->menutype;
  204.                 ?>
  205.                 </td>
  206.                 <td align="center" width="20%">
  207.                 <?php
  208.                 echo $row->type;
  209.                 ?>
  210.                 </td>
  211.                 <td align="center">
  212.                 <?php
  213.                 echo $row->id;
  214.                 ?>
  215.                 </td>
  216.             </tr>
  217.             <?php
  218.             $k $k;
  219.             $i++;
  220.         }
  221.         ?>
  222.         </table>
  223.         <?php echo $pageNav_menu->getListFooter()?>
  224.         <?php
  225.         $tabs->endTab();
  226.         $tabs->endPane();
  227.         ?>
  228.  
  229.         <input type="hidden" name="option" value="<?php echo $option;?>" />
  230.         <input type="hidden" name="task" value="" />
  231.         <input type="hidden" name="boxchecked" value="0" />
  232.         </form>
  233.         <?php
  234.     }
  235.  
  236.  
  237.     /**
  238.     * A delete confirmation page
  239.     * Writes list of the items that have been selected for deletion
  240.     */
  241.     function showDelete$option$cid$items$type {
  242.     ?>
  243.         <form action="index2.php" method="post" name="adminForm">
  244.         <table class="adminheading">
  245.         <tr>
  246.             <th><?php echo T_('Delete Items')?></th>
  247.         </tr>
  248.         </table>
  249.  
  250.         <br />
  251.         <table class="adminform">
  252.         <tr>
  253.             <td width="3%"></td>
  254.             <td align="left" valign="top" width="20%">
  255.             <strong><?php echo T_('Number of Items:')?></strong>
  256.             <br />
  257.             <font color="#000066"><strong><?php echo count$cid )?></strong></font>
  258.             <br /><br />
  259.             </td>
  260.             <td align="left" valign="top" width="25%">
  261.             <strong><?php echo T_('Items being Deleted:')?></strong>
  262.             <br />
  263.             <?php
  264.             echo "<ol>";
  265.             foreach $items as $item {
  266.                 echo "<li>"$item->name ."</li>";
  267.             }
  268.             echo "</ol>";
  269.             ?>
  270.             </td>
  271.              <td valign="top">
  272.             * <?php echo T_('This will <strong><font color="#FF0000">Permanently Delete</font></strong> <br />these Items from the Database')?> *
  273.             <br /><br /><br />
  274.             <div style="border: 1px dotted gray; width: 70px; padding: 10px; margin-left: 50px;">
  275.             <a class="toolbar" href="javascript:if (confirm('<?php echo T_('Are you sure you want to Deleted the listed items? \nThis will Permanently Delete them from the database.')?>')){ submitbutton('delete');}" onmouseout="MM_swapImgRestore();"  onmouseover="MM_swapImage('remove','','images/delete_f2.png',1);">
  276.             <img name="remove" src="images/delete.png" alt="<?php echo T_('Delete')?>" border="0" align="middle" />
  277.             &nbsp;<?php echo T_('Delete')?>
  278.             </a>
  279.             </div>
  280.             </td>
  281.         </tr>
  282.         <tr>
  283.             <td>&nbsp;</td>
  284.         </tr>
  285.         </table>
  286.         <br /><br />
  287.  
  288.         <input type="hidden" name="option" value="<?php echo $option;?>" />
  289.         <input type="hidden" name="task" value="" />
  290.         <input type="hidden" name="boxchecked" value="1" />
  291.         <input type="hidden" name="type" value="<?php echo $type?>" />
  292.         <?php
  293.         foreach ($cid as $id{
  294.             echo "\n<input type=\"hidden\" name=\"cid[]\" value=\"$id\" />";
  295.         }
  296.         ?>
  297.         </form>
  298.         <?php
  299.     }
  300.  
  301.  
  302.     /**
  303.     * A restore confirmation page
  304.     * Writes list of the items that have been selected for restore
  305.     */
  306.     function showRestore$option$cid$items$type {
  307.     ?>
  308.         <form action="index2.php" method="post" name="adminForm">
  309.         <table class="adminheading">
  310.         <tr>
  311.             <th><?php echo T_('Restore Items')?></th>
  312.         </tr>
  313.         </table>
  314.  
  315.         <br />
  316.         <table class="adminform">
  317.         <tr>
  318.             <td width="3%"></td>
  319.             <td align="left" valign="top" width="20%">
  320.             <strong><?php echo T_('Number of Items:')?></strong>
  321.             <br />
  322.             <font color="#000066"><strong><?php echo count$cid )?></strong></font>
  323.             <br /><br />
  324.             </td>
  325.             <td align="left" valign="top" width="25%">
  326.             <strong><?php echo T_('Items being Restored:')?></strong>
  327.             <br />
  328.             <?php
  329.             echo "<ol>";
  330.             foreach $items as $item {
  331.                 echo "<li>"$item->name ."</li>";
  332.             }
  333.             echo "</ol>";
  334.             ?>
  335.             </td>
  336.              <td valign="top">
  337.             * <?php echo T_('This will <strong><font color="#FF0000">Restore</font></strong> these Items,<br />they will be returned to their orignial places as Unpublished items')?> *
  338.             <br /><br /><br />
  339.             <div style="border: 1px dotted gray; width: 80px; padding: 10px; margin-left: 50px;">
  340.             <a class="toolbar" href="javascript:if (confirm('<?php echo T_('Are you sure you want to Restore the listed items?.')?>')){ submitbutton('restore');}" onmouseout="MM_swapImgRestore();"  onmouseover="MM_swapImage('restore','','images/restore_f2.png',1);">
  341.             <img name="restore" src="images/restore.png" alt="<?php echo T_('Restore')?>" border="0" align="middle" />
  342.             &nbsp;<?php echo T_('Restore')?>
  343.             </a>
  344.             </div>
  345.             </td>
  346.         </tr>
  347.         <tr>
  348.             <td>&nbsp;</td>
  349.         </tr>
  350.         </table>
  351.         <br /><br />
  352.  
  353.         <input type="hidden" name="option" value="<?php echo $option;?>" />
  354.         <input type="hidden" name="sectionid" value="<?php echo $sectionid?>" />
  355.         <input type="hidden" name="task" value="" />
  356.         <input type="hidden" name="boxchecked" value="1" />
  357.         <input type="hidden" name="type" value="<?php echo $type?>" />
  358.         <?php
  359.         foreach ($cid as $id{
  360.             echo "\n<input type=\"hidden\" name=\"cid[]\" value=\"$id\" />";
  361.         }
  362.         ?>
  363.         </form>
  364.         <?php
  365.     }
  366.  
  367. }
  368. ?>

Documentation generated on Mon, 05 May 2008 16:16:25 +0400 by phpDocumentor 1.4.0