Source for file admin.mambots.html.php

Documentation is available at admin.mambots.html.php

  1. <?php
  2. /**
  3. @package Mambo
  4. @subpackage Mambots
  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. class HTML_modules {
  14.  
  15.     /**
  16.     * Writes a list of the defined modules
  17.     * @param array An array of category objects
  18.     */
  19.     function showMambots&$rows$client&$pageNav$option&$lists$search {
  20.         global $my;
  21.  
  22.         mosCommonHTML::loadOverlib();
  23.         ?>
  24.         <form action="index2.php" method="post" name="adminForm">
  25.  
  26.         <table class="adminheading">
  27.         <tr>
  28.             <th class="modules">
  29.             <?php echo T_('Mambot Manager')?> <small><small>[ <?php echo $client == 'admin' T_('Administrator'T_('Site');?> ]</small></small>
  30.             </th>
  31.             <td>
  32.             <?php echo T_('Filter:')?>
  33.             </td>
  34.             <td>
  35.             <input type="text" name="search" value="<?php echo $search;?>" class="text_area" onChange="document.adminForm.submit();" />
  36.             </td>
  37.             <td width="right">
  38.             <?php echo $lists['type'];?>
  39.             </td>
  40.         </tr>
  41.         </table>
  42.  
  43.         <table class="adminlist">
  44.         <tr>
  45.             <th width="20">#</th>
  46.             <th width="20">
  47.             <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count$rows );?>);" />
  48.             </th>
  49.             <th class="title">
  50.             <?php echo T_('Mambot Name')?>
  51.             </th>
  52.             <th nowrap="nowrap" width="10%">
  53.               <?php echo T_('Published')?>
  54.             </th>
  55.             <th colspan="2" nowrap="true" width="5%">
  56.             <?php echo T_('Reorder')?>
  57.             </th>
  58.             <th width="2%">
  59.             <?php echo T_('Order')?>
  60.             </th>
  61.             <th width="1%">
  62.             <a href="javascript: saveorder( <?php echo count$rows )-1?> )"><img src="images/filesave.png" border="0" width="16" height="16" alt="<?php echo T_('Save Order')?>" /></a>
  63.             </th>
  64.             <th nowrap="nowrap" width="10%">
  65.             <?php echo T_('Access')?>
  66.             </th>
  67.             <th nowrap="nowrap" align="left" width="10%">
  68.             <?php echo T_('Type')?>
  69.             </th>
  70.             <th nowrap="nowrap" align="left" width="10%">
  71.             <?php echo T_('File')?>
  72.             </th>
  73.         </tr>
  74.         <?php
  75.         $k 0;
  76.         for ($i=0$n=count$rows )$i $n$i++{
  77.             $row     &$rows[$i];
  78.  
  79.             $link 'index2.php?option=com_mambots&client='$client .'&task=editA&hidemainmenu=1&id='$row->id;
  80.  
  81.             $access     mosCommonHTML::AccessProcessing$row$i );
  82.             $checked     mosCommonHTML::CheckedOutProcessing$row$i );
  83.             $published     mosCommonHTML::PublishedProcessing$row$i );
  84.             ?>
  85.             <tr class="<?php echo "row$k"?>">
  86.                 <td align="right"><?php echo $pageNav->rowNumber$i )?></td>
  87.                 <td>
  88.                 <?php echo $checked?>
  89.                 </td>
  90.                 <td>
  91.                 <?php
  92.                 if $row->checked_out && $row->checked_out != $my->id ) ) {
  93.                     echo $row->name;
  94.                 else {
  95.                     ?>
  96.                     <a href="<?php echo $link?>">
  97.                     <?php echo $row->name?>
  98.                     </a>
  99.                     <?php
  100.                 }
  101.                 ?>
  102.                 </td>
  103.                 <td align="center">
  104.                 <?php echo $published;?>
  105.                 </td>
  106.                 <td>
  107.                 <?php echo $pageNav->orderUpIcon$i($row->folder == @$rows[$i-1]->folder && $row->ordering > -10000 && $row->ordering 10000) )?>
  108.                 </td>
  109.                 <td>
  110.                 <?php echo $pageNav->orderDownIcon$i$n($row->folder == @$rows[$i+1]->folder && $row->ordering > -10000 && $row->ordering 10000) )?>
  111.                 </td>
  112.                 <td align="center" colspan="2">
  113.                 <input type="text" name="order[]" size="5" value="<?php echo $row->ordering?>" class="text_area" style="text-align: center" />
  114.                 </td>
  115.                 <td align="center">
  116.                 <?php echo $access;?>
  117.                 </td>
  118.                 <td align="left" nowrap="true">
  119.                 <?php echo $row->folder;?>
  120.                 </td>
  121.                 <td align="left" nowrap="true">
  122.                 <?php echo $row->element;?>
  123.                 </td>
  124.             </tr>
  125.             <?php
  126.             $k $k;
  127.         }
  128.         ?>
  129.         </table>
  130.  
  131.         <?php echo $pageNav->getListFooter()?>
  132.  
  133.         <input type="hidden" name="option" value="<?php echo $option;?>" />
  134.         <input type="hidden" name="task" value="" />
  135.         <input type="hidden" name="client" value="<?php echo $client;?>" />
  136.         <input type="hidden" name="boxchecked" value="0" />
  137.         <input type="hidden" name="hidemainmenu" value="0" />
  138.         </form>
  139.         <?php
  140.     }
  141.  
  142.     /**
  143.     * Writes the edit form for new and existing module
  144.     *
  145.     * A new record is defined when <var>$row</var> is passed with the <var>id</var>
  146.     * property set to 0.
  147.     * @param mosCategory The category object
  148.     * @param array <p>The modules of the left side.  The array elements are in the form
  149.     *  <var>$leftorder[<i>order</i>] = <i>label</i></var>
  150.     *  where <i>order</i> is the module order from the db table and <i>label</i> is a
  151.     *  text label associciated with the order.</p>
  152.     * @param array See notes for leftorder
  153.     * @param array An array of select lists
  154.     * @param object Parameters 
  155.     */
  156.     function editMambot&$row&$lists&$params$option {
  157.         global $mosConfig_live_site;
  158.  
  159.         $row->nameA '';
  160.         if $row->id {
  161.             $row->nameA '<small><small>[ '$row->name .' ]</small></small>';
  162.         }
  163.         ?>
  164.         <div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
  165.         <script language="javascript" type="text/javascript">
  166.         function submitbutton(pressbutton) {
  167.             if (pressbutton == "cancel") {
  168.                 submitform(pressbutton);
  169.                 return;
  170.             }
  171.             // validation
  172.             var form = document.adminForm;
  173.             if (form.name.value == "") {
  174.                 alert( '<?php echo T_('Mambot must have a name')?>' );
  175.             } else if (form.element.value == "") {
  176.                 alert( '<?php echo T_('Mambot must have a filename')?>' );
  177.             } else {
  178.                 submitform(pressbutton);
  179.             }
  180.         }
  181.         </script>
  182.         <table class="adminheading">
  183.         <tr>
  184.             <th class="mambots">
  185.             <?php echo T_('Site Mambot:')?>
  186.             <small>
  187.             <?php echo $row->id T_('Edit'T_('New');?>
  188.             </small>
  189.             <?php echo $row->nameA?>
  190.             </th>
  191.         </tr>
  192.         </table>
  193.  
  194.         <form action="index2.php" method="post" name="adminForm">
  195.         <table cellspacing="0" cellpadding="0" width="100%">
  196.         <tr valign="top">
  197.             <td width="60%" valign="top">
  198.                 <table class="adminform">
  199.                 <tr>
  200.                     <th colspan="2">
  201.                     <?php echo T_('Mambot Details')?>
  202.                     </th>
  203.                 <tr>
  204.                 <tr>
  205.                     <td width="100" align="left">
  206.                     <?php echo T_('Name:')?>
  207.                     </td>
  208.                     <td>
  209.                     <input class="text_area" type="text" name="name" size="35" value="<?php echo $row->name?>" />
  210.                     </td>
  211.                 </tr>
  212.                 <tr>
  213.                     <td valign="top" align="left">
  214.                     <?php echo T_('Folder:')?>
  215.                     </td>
  216.                     <td>
  217.                     <?php echo $lists['folder']?>
  218.                     </td>
  219.                 </tr>
  220.                 <tr>
  221.                     <td valign="top" align="left">
  222.                     <?php echo T_('Mambot file:')?>
  223.                     </td>
  224.                     <td>
  225.                     <input class="text_area" type="text" name="element" size="35" value="<?php echo $row->element?>" />.php
  226.                     </td>
  227.                 </tr>
  228.                 <tr>
  229.                     <td valign="top" align="left">
  230.                     <?php echo T_('Mambot Order:')?>
  231.                     </td>
  232.                     <td>
  233.                     <?php echo $lists['ordering']?>
  234.                     </td>
  235.                 </tr>
  236.                 <tr>
  237.                     <td valign="top" align="left">
  238.                     <?php echo T_('Access Level:')?>
  239.                     </td>
  240.                     <td>
  241.                     <?php echo $lists['access']?>
  242.                     </td>
  243.                 </tr>
  244.                 <tr>
  245.                     <td valign="top">
  246.                     <?php echo T_('Published:')?>
  247.                     </td>
  248.                     <td>
  249.                     <?php echo $lists['published']?>
  250.                     </td>
  251.                 </tr>
  252.                 <tr>
  253.                     <td valign="top" colspan="2">&nbsp;
  254.  
  255.                     </td>
  256.                 </tr>
  257.                 <tr>
  258.                     <td valign="top">
  259.                     <?php echo T_('Description:')?>
  260.                     </td>
  261.                     <td>
  262.                     <?php echo $row->description?>
  263.                     </td>
  264.                 </tr>
  265.                 </table>
  266.             </td>
  267.             <td width="40%">
  268.                 <table class="adminform">
  269.                 <tr>
  270.                     <th colspan="2">
  271.                     <?php echo T_('Parameters')?>
  272.                     </th>
  273.                 <tr>
  274.                 <tr>
  275.                     <td>
  276.                     <?php
  277.                     if $row->id {
  278.                         echo $params->render();
  279.                     else {
  280.                         echo '<i>'.T_('No Parameters').'</i>';
  281.                     }
  282.                     ?>
  283.                     </td>
  284.                 </tr>
  285.                 </table>
  286.             </td>
  287.         </tr>
  288.         </table>
  289.  
  290.         <input type="hidden" name="option" value="<?php echo $option?>" />
  291.         <input type="hidden" name="id" value="<?php echo $row->id?>" />
  292.         <input type="hidden" name="client" value="<?php echo $row->client_id?>" />
  293.         <input type="hidden" name="task" value="" />
  294.         </form>
  295.         <script language="Javascript" src="<?php echo $mosConfig_live_site;?>/includes/js/overlib_mini.js"></script>
  296.         <?php
  297.     }
  298. }
  299. ?>

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