Source for file newsfeed_link.class.php

Documentation is available at newsfeed_link.class.php

  1. <?php
  2. /**
  3. @package Mambo
  4. @subpackage Menus
  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. * Newsfeed item link class
  15. */
  16.  
  17.     function edit&$uid$menutype$option {
  18.         global $database$my$mainframe;
  19.         global $mosConfig_absolute_path;
  20.     
  21.         $menu new mosMenu$database );
  22.         $menu->load$uid );
  23.     
  24.         // fail if checked out not by 'me'
  25.         if ($menu->checked_out && $menu->checked_out <> $my->id{
  26.             echo "<script>alert('".sprintf(T_('The module % is currently being edited by another administrator')$menu->title)."'); document.location.href='index2.php?option=$option'</script>\n";
  27.             exit(0);
  28.         }
  29.     
  30.         if $uid {
  31.             $menu->checkout$my->id );
  32.         else {
  33.             // load values for new entry
  34.             $menu->type 'newsfeed_link';
  35.             $menu->menutype $menutype;
  36.             $menu->browserNav 0;
  37.             $menu->ordering 9999;
  38.             $menu->parent intvalmosGetParam$_POST'parent') );
  39.             $menu->published 1;
  40.         }
  41.     
  42.         if $uid {
  43.             $temp explode'feedid='$menu->link );
  44.             $query "SELECT *, c.title AS category"
  45.             . "\n FROM #__newsfeeds AS a"
  46.             . "\n INNER JOIN #__categories AS c ON a.catid = c.id"
  47.             . "\n WHERE a.id = '"$temp[1."'"
  48.             ;
  49.             $database->setQuery$query );
  50.             $newsfeed $database->loadObjectlist();
  51.             // outputs item name, category & section instead of the select list
  52.             $lists['newsfeed''
  53.             <table width="100%">
  54.             <tr>
  55.                 <td width="10%">
  56.                 '.T_('Item:').'
  57.                 </td>
  58.                 <td>
  59.                 '$newsfeed[0]->name .'
  60.                 </td>
  61.             </tr>
  62.             <tr>
  63.                 <td width="10%">
  64.                 '.T_('Position:').'
  65.                 </td>
  66.                 <td>
  67.                 '$newsfeed[0]->category .'
  68.                 </td>
  69.             </tr>
  70.             </table>';
  71.             $lists['newsfeed'.= '<input type="hidden" name="newsfeed_link" value="'$temp[1.'" />';
  72.             $newsfeeds '';
  73.         else {
  74.             $query "SELECT a.id AS value, CONCAT( c.title, ' - ', a.name ) AS text, a.catid "
  75.             . "\n FROM #__newsfeeds AS a"
  76.             . "\n INNER JOIN #__categories AS c ON a.catid = c.id"
  77.             . "\n WHERE a.published = '1'"
  78.             . "\n ORDER BY a.catid, a.name"
  79.             ;
  80.             $database->setQuery$query );
  81.             $newsfeeds $database->loadObjectList);
  82.     
  83.             //    Create a list of links
  84.             $lists['newsfeed'mosHTML::selectList$newsfeeds'newsfeed_link''class="inputbox" size="10"''value''text''' );
  85.         }
  86.         
  87.         // build html select list for target window
  88.         $lists['target']         mosAdminMenus::Target$menu );
  89.     
  90.         // build the html select list for ordering
  91.         $lists['ordering']         mosAdminMenus::Ordering$menu$uid );
  92.         // build the html select list for the group access
  93.         $lists['access']         mosAdminMenus::Access$menu );
  94.         // build the html select list for paraent item
  95.         $lists['parent']         mosAdminMenus::Parent$menu );
  96.         // build published button option
  97.         $lists['published']     mosAdminMenus::Published$menu );
  98.         // build the url link output
  99.         $lists['link']         mosAdminMenus::Link$menu$uid );
  100.         
  101.         // get params definitions
  102.         $params =new mosAdminParameters$menu->params$mainframe->getPath'menu_xml'$menu->type )'menu' );
  103.     
  104.         newsfeed_link_menu_html::edit$menu$lists$params$option$newsfeeds );
  105.     }
  106. }
  107. ?>

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