Source for file admin.comment.html.php

Documentation is available at admin.comment.html.php

  1. <?php
  2. /**
  3. @package Mambo
  4. @subpackage Comment
  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. class HTML_comment {
  15.  
  16.     /**
  17.      * @param option 
  18.      * @param rows - article details
  19.      * @param search - search criteria
  20.      * @param pageNav - page navigation status
  21.      * @return list of comments.
  22.      */
  23.   function showComments$option&$rows&$search&$pageNav {
  24.  
  25.     # Load configuration file
  26.     global $mosConfig_absolute_path$mosConfig_live_site$mainframe$acl$my;
  27.     
  28.   require($mosConfig_absolute_path."/administrator/components/com_comment/config.comment.php");
  29.  
  30.     ?>
  31.     <form action="index2.php" method="post" name="adminForm">
  32.     <table class="adminheading">
  33.         <tr>
  34.             <th>
  35.             <?php echo T_('Comment Manager')?>
  36.             </th>
  37.             <td>
  38.             <?php echo T_('Filter:')?>
  39.             </td>
  40.             <td>
  41.             <input type="text" name="search" value="<?php echo $search;?>" class="inputbox" onChange="document.adminForm.submit();" />
  42.             </td>
  43.         </tr>
  44.     </table>
  45.     <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">
  46.       <tr>
  47.           <th width="20">#</th>
  48.         <th width="20" class="title"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count$rows )?>);" /></th>
  49.         <th><div align="right"><?php echo T_('Author')?></div></th>
  50.         <th><div align="right"><?php echo T_('Comments')?></div></th>
  51.         <th><div align="right"><?php echo T_('Date')?></div></th>
  52.         <th><div align="right"><?php echo T_('Content Item')?></div></th>
  53.         <th><div align="right"><?php echo T_('Published')?></div></th>
  54.       </tr>
  55.       <?php
  56.     $k 0;
  57.     for ($i=0$n=count$rows )$i $n$i++{
  58.       $row &$rows[$i];
  59.       $row->article_link 'index2.php?option=com_comment&task=editA&hidemainmenu=1&id='$row->id;
  60.       $link 'index2.php?option=com_content&sectionid=0&task=edit&hidemainmenu=1&id='$row->articleid;
  61.  
  62.       echo "<tr class='row$k'>";
  63.       echo "<td width='20'>".$pageNav->rowNumber$i )."</td>";
  64.       echo "<td width='5%'><input type='checkbox' id='cb$i' name='cid[]' value='$row->id' onclick='isChecked(this.checked);' /></td>";
  65.       echo "<td align='right'>$row->name</td>";
  66.  
  67.       if(strlen($row->comments$admin_comments_length{
  68.         $row->comments  substr($row->comments,0,$admin_comments_length-3);
  69.         $row->comments .= "...";
  70.       }
  71.  
  72.       echo "<td align='right'><a href='$row->article_link'>$row->comments</td>";
  73.       echo "<td align='right'>".MosFormatDate($row->startdate"Y-m-d H:i:s")."</td>";
  74.       echo "<td align='right'><a href='$link'>$row->title</a></td>";
  75.  
  76.       $task $row->published 'unpublish' 'publish';
  77.       $img $row->published 'publish_g.png' 'publish_x.png';
  78.  
  79.       ?>
  80.         <td width="10%" align="right"><a href="javascript: void(0);" onclick="return listItemTask('cb<?php echo $i;?>','<?php echo $task;?>')"><img src="images/<?php echo $img;?>" width="12" height="12" border="0" alt="" /></a></td>
  81.     </tr>
  82.     <?php    $k $k?>
  83.  
  84.   </table>
  85.  
  86.         <?php echo $pageNav->getListFooter()?>
  87.   <input type="hidden" name="option" value="<?php echo $option;?>" />
  88.   <input type="hidden" name="task" value="" />
  89.   <input type="hidden" name="hidemainmenu" value="0">
  90.   <input type="hidden" name="boxchecked" value="0" />
  91.   </form>
  92.   <?php
  93.   }
  94.  
  95.     /**
  96.      * @param option 
  97.      * @param rows - article id, or 0 for new comment
  98.      * @param clist - article list to enable comments to be moved
  99.      * @param puplist - yes/no publish selection box
  100.      * @return article comments to edit/move or new article comments box
  101.      */
  102.   function editComment$option&$row&$clist&$puplist {
  103.     mosMakeHtmlSafe$rowENT_QUOTES'comments' );
  104.     ?>
  105.  
  106.     <script language="javascript" type="text/javascript">
  107.     function submitbutton(pressbutton) {
  108.       var form = document.adminForm;
  109.       if (pressbutton == 'cancel') {
  110.         submitform( pressbutton );
  111.         return;
  112.       }
  113.       // validation
  114.       if (form.comments.value == ""){
  115.         alert( "<?php echo T_('You must add a comment'?>" );
  116.       } else if (form.articleid.value == "0"){
  117.         alert( "<?php echo T_('You must select a content item.'?>" );
  118.       } else {
  119.         submitform( pressbutton );
  120.       }
  121.     }
  122.     </script>
  123.  
  124.     <table cellpadding="4" cellspacing="0" border="0" width="100%">
  125.         <tr>
  126.             <td width="100%"><span class="sectionname"><?php echo $row->id 'Edit' 'Add';?> <?php echo T_('Comments')?></span></td>
  127.         </tr>
  128.     </table>
  129.  
  130.     <table cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform">
  131.     <form action="index2.php" method="post" name="adminForm" id="adminForm">
  132.       <tr>
  133.         <td width="20%" align="right"><?php echo T_('Name';?>:</td>
  134.         <td width="80%">
  135.           <input class="inputbox" type="text" name="name" size="50" maxlength="30" value="<?php echo $row->name;?>" />
  136.         </td>
  137.       </tr>
  138.  
  139.       <tr>
  140.         <td valign="top" align="right"><?php echo T_('Comments';?>:</td>
  141.         <td>
  142.           <textarea class="inputbox" cols="50" rows="5" name="comments"><?php echo $row->comments;?></textarea>
  143.         </td>
  144.       </tr>
  145.  
  146.       <tr>
  147.         <td valign="top" align="right"><?php echo T_('Published';?>:</td>
  148.         <td>
  149.           <?php echo $puplist?>
  150.         </td>
  151.       </tr>
  152.       
  153.       <tr>
  154.         <td valign="top" align="right"><?php echo T_('Content Item';?>:</td>
  155.         <td>
  156.           <?php echo $clist?>
  157.         </td>
  158.       </tr>
  159.       
  160.     </table>
  161.  
  162.     <input type="hidden" name="id" value="<?php echo $row->id?>" />
  163.     <input type="hidden" name="option" value="<?php echo $option;?>" />
  164.     <input type="hidden" name="task" value="" />
  165.     </form>
  166.   <?php
  167.   }
  168.  
  169.  
  170. }
  171. ?>

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