Source for file admin.newsfeeds.html.php

Documentation is available at admin.newsfeeds.html.php

  1. <?php
  2. /**
  3. @package Mambo
  4. @subpackage Newsfeeds
  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_newsfeeds {
  14.  
  15.     function showNewsFeeds&$rows&$lists$pageNav$option {
  16.         global $my;
  17.  
  18.         mosCommonHTML::loadOverlib();
  19.         ?>
  20.         <form action="index2.php" method="post" name="adminForm">
  21.         <table class="adminheading">
  22.         <tr>
  23.             <th>
  24.             <?php echo T_('News Feed Manager')?>
  25.             </th>
  26.             <td width="right">
  27.             <?php echo $lists['category'];?>
  28.             </td>
  29.         </tr>
  30.         </table>
  31.  
  32.         <table class="adminlist">
  33.         <tr>
  34.             <th width="20">
  35.             #
  36.             </th>
  37.             <th width="20">
  38.             <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count$rows )?>);" />
  39.             </th>
  40.             <th class="title">
  41.             <?php echo T_('News Feed')?>
  42.             </th>
  43.             <th width="5%">
  44.             <?php echo T_('Published')?>
  45.             </th>
  46.             <th colspan="2" width="5%">
  47.             <?php echo T_('Reorder')?>
  48.             </th>
  49.             <th class="title" width="20%">
  50.             <?php echo T_('Category')?>
  51.             </th>
  52.             <th width="5%" nowrap="nowrap">
  53.             <?php echo T_('# Articles')?>
  54.             </th>
  55.             <th width="10%">
  56.             <?php echo T_('Cache time')?>
  57.             </th>
  58.         </tr>
  59.         <?php
  60.         $k 0;
  61.         for ($i=0$n=count$rows )$i $n$i++{
  62.             $row &$rows[$i];
  63.  
  64.             $link     'index2.php?option=com_newsfeeds&task=editA&hidemainmenu=1&id='$row->id;
  65.  
  66.             $img     $row->published 'tick.png' 'publish_x.png';
  67.             $task     $row->published 'unpublish' 'publish';
  68.             $alt     $row->published 'Published' 'Unpublished';
  69.  
  70.             $checked     mosCommonHTML::CheckedOutProcessing$row$i );
  71.  
  72.             $row->cat_link     'index2.php?option=com_categories&section=com_newsfeeds&task=editA&hidemainmenu=1&id='$row->catid;
  73.             ?>
  74.             <tr class="<?php echo 'row'$k?>">
  75.                 <td align="center">
  76.                 <?php echo $pageNav->rowNumber$i )?>
  77.                 </td>
  78.                 <td>
  79.                 <?php echo $checked?>
  80.                 </td>
  81.                 <td>
  82.                 <?php
  83.                 if $row->checked_out && $row->checked_out != $my->id ) ) {
  84.                     ?>
  85.                     <?php echo $row->name?>
  86.                     &nbsp;[ <i><?php echo T_('Checked Out')?></i> ]
  87.                     <?php
  88.                 else {
  89.                     ?>
  90.                     <a href="<?php echo $link?>" title="<?php echo T_('Edit News Feed')?>">
  91.                     <?php echo $row->name?>
  92.                     </a>
  93.                     <?php
  94.                 }
  95.                 ?>
  96.                 </td>
  97.                 <td width="10%" align="center">
  98.                 <a href="javascript: void(0);" onclick="return listItemTask('cb<?php echo $i;?>','<?php echo $task;?>')">
  99.                 <img src="images/<?php echo $img;?>" border="0" alt="<?php echo $alt?>" />
  100.                 </a>
  101.                 </td>
  102.                 <td align="center">
  103.                 <?php echo $pageNav->orderUpIcon$i )?>
  104.                 </td>
  105.                 <td align="center">
  106.                 <?php echo $pageNav->orderDownIcon$i$n )?>
  107.                 </td>
  108.                 <td>
  109.                 <a href="<?php echo $row->cat_link?>" title="<?php echo T_('Edit Category')?>">
  110.                 <?php echo $row->catname;?>
  111.                 </a>
  112.                 </td>
  113.                 <td align="center">
  114.                 <?php echo $row->numarticles;?>
  115.                 </td>
  116.                 <td align="center">
  117.                 <?php echo $row->cache_time;?>
  118.                 </td>
  119.             </tr>
  120.             <?php
  121.             $k $k;
  122.         }
  123.         ?>
  124.         </table>
  125.         <?php echo $pageNav->getListFooter()?>
  126.  
  127.         <input type="hidden" name="option" value="<?php echo $option;?>" />
  128.         <input type="hidden" name="task" value="" />
  129.         <input type="hidden" name="boxchecked" value="0" />
  130.         <input type="hidden" name="hidemainmenu" value="0">
  131.         </form>
  132.         <?php
  133.     }
  134.  
  135.  
  136.     function editNewsFeed&$row&$lists$option {
  137.         mosMakeHtmlSafe$rowENT_QUOTES );
  138.         ?>
  139.         <script language="javascript" type="text/javascript">
  140.         function submitbutton(pressbutton) {
  141.             var form = document.adminForm;
  142.             if (pressbutton == 'cancel') {
  143.                 submitform( pressbutton );
  144.                 return;
  145.             }
  146.  
  147.             // do field validation
  148.             if (form.name.value == '') {
  149.                 alert( "<?php echo T_('Please fill in the news feed name.')?>" );
  150.             } else if (form.catid.value == 0) {
  151.                 alert( "<?php echo T_('Please select a Category.')?>" );
  152.             } else if (form.link.value == '') {
  153.                 alert( "<?php echo T_('Please fill in the news feed link.')?>" );
  154.             } else if (getSelectedValue('adminForm','catid') < 0) {
  155.                 alert( "<?php echo T_('Please select a category.')?>" );
  156.             } else if (form.numarticles.value == "" || form.numarticles.value == 0) {
  157.                 alert( "<?php echo T_('Please fill in the number of articles to display.')?>" );
  158.             } else if (form.cache_time.value == "" || form.cache_time.value == 0) {
  159.                 alert( "<?php echo T_('Please fill in the cache refresh time.')?>" );
  160.             } else {
  161.                 submitform( pressbutton );
  162.             }
  163.         }
  164.         </script>
  165.  
  166.         <form action="index2.php" method="post" name="adminForm">
  167.         <table class="adminheading">
  168.         <tr>
  169.             <th class="edit">
  170.             <?php echo T_('News Feed:')?> <small><?php echo $row->id T_('Edit'T_('New');?></small> <small><small>[ <?php echo $row->name;?> ]</small></small>
  171.             </th>
  172.         </tr>
  173.         </table>
  174.  
  175.         <table class="adminform">
  176.         <tr>
  177.             <th colspan="2">
  178.             <?php echo T_('Details')?>
  179.             </th>
  180.         </tr>
  181.         <tr>
  182.             <td>
  183.             <?php echo T_('Name')?>
  184.             </td>
  185.             <td>
  186.             <input class="inputbox" type="text" size="40" name="name" value="<?php echo $row->name?>">
  187.             </td>
  188.         </tr>
  189.         <tr>
  190.             <td>
  191.             <?php echo T_('Category')?>
  192.             </td>
  193.             <td>
  194.             <?php echo $lists['category']?>
  195.             </td>
  196.         </tr>
  197.         <tr>
  198.             <td>
  199.             <?php echo T_('Link')?>
  200.             </td>
  201.             <td>
  202.             <input class="inputbox" type="text" size="60" name="link" value="<?php echo $row->link?>" dir="ltr">
  203.             </td>
  204.         </tr>
  205.         <tr>
  206.             <td>
  207.             <?php echo T_('Number of Articles')?>
  208.             </td>
  209.             <td>
  210.             <input class="inputbox" type="text" size="2" name="numarticles" value="<?php echo $row->numarticles?>">
  211.             </td>
  212.         </tr>
  213.         <tr>
  214.             <td>
  215.             <?php echo T_('Cache time (in seconds)')?>
  216.             </td>
  217.             <td>
  218.             <input class="inputbox" type="text" size="4" name="cache_time" value="<?php echo $row->cache_time?>">
  219.             </td>
  220.         </tr>
  221.         <tr>
  222.             <td>
  223.             <?php echo T_('Ordering')?>
  224.             </td>
  225.             <td>
  226.             <?php echo $lists['ordering']?>
  227.             </td>
  228.         </tr>
  229.         <tr>
  230.             <td valign="top" align="right">
  231.             <?php echo T_('Published:')?>
  232.             </td>
  233.             <td>
  234.             <?php echo $lists['published']?>
  235.             </td>
  236.         </tr>
  237.         <tr>
  238.             <td colspan="2" align="center">
  239.             </td>
  240.         </tr>
  241.         </table>
  242.  
  243.         <input type="hidden" name="id" value="<?php echo $row->id?>">
  244.         <input type="hidden" name="option" value="<?php echo $option?>">
  245.         <input type="hidden" name="task" value="">
  246.         </form>
  247.     <?php
  248.     }
  249. }
  250. ?>

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