Source for file component_item_link.class.php

Documentation is available at component_item_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. /** ensure this file is being included by a parent file */
  10. defined'_VALID_MOS' or die'Direct Access to this location is not allowed.' );
  11.  
  12. /**
  13. * Component item link class
  14. */
  15.  
  16.     function edit&$uid$menutype$option {
  17.         global $database$my$mainframe;
  18.     
  19.         $menu new mosMenu$database );
  20.         $menu->load$uid );
  21.     
  22.         // fail if checked out not by 'me'
  23.         if ($menu->checked_out && $menu->checked_out <> $my->id{
  24.             echo "<script>alert('".sprintf(T_('The module %s is currently being edited by another administrator'),$menu->title )."'); document.location.href='index2.php?option=$option'</script>\n";
  25.             exit(0);
  26.         }
  27.     
  28.         if $uid {
  29.             $menu->checkout$my->id );
  30.         else {
  31.             // load values for new entry
  32.             $menu->type 'component_item_link';
  33.             $menu->menutype $menutype;
  34.             $menu->browserNav 0;
  35.             $menu->ordering 9999;
  36.             $menu->parent intvalmosGetParam$_POST'parent') );
  37.             $menu->published 1;
  38.         }
  39.     
  40.         if $uid {
  41.             $temp explode'&Itemid='$menu->link );
  42.              $query "SELECT a.name"
  43.             . "\n FROM #__menu AS a"
  44.             . "\n WHERE a.link = '"$temp[0."'"
  45.             ;
  46.             $database->setQuery$query );
  47.             $components $database->loadResult();
  48.             $lists['components'=  $components;
  49.             $lists['components'.= '<input type="hidden" name="link" value="'$menu->link .'" />';
  50.         else {
  51.             $query "SELECT CONCAT( a.link, '&amp;Itemid=', a.id ) AS value, a.name AS text"
  52.             . "\n FROM #__menu AS a"
  53.             . "\n WHERE a.published = '1'"
  54.             . "\n AND a.type = 'components'"
  55.             . "\n ORDER BY a.menutype, a.name"
  56.             ;
  57.             $database->setQuery$query );
  58.             $components $database->loadObjectList);
  59.     
  60.             //    Create a list of links
  61.             $lists['components'mosHTML::selectList$components'link''class="inputbox" size="10"''value''text''' );
  62.         }
  63.     
  64.         // build html select list for target window
  65.         $lists['target']         mosAdminMenus::Target$menu );
  66.     
  67.         // build the html select list for ordering
  68.         $lists['ordering']         mosAdminMenus::Ordering$menu$uid );
  69.         // build the html select list for the group access
  70.         $lists['access']         mosAdminMenus::Access$menu );
  71.         // build the html select list for paraent item
  72.         $lists['parent']         mosAdminMenus::Parent$menu );
  73.         // build published button option
  74.         $lists['published']     mosAdminMenus::Published$menu );
  75.         // build the url link output
  76.         $lists['link']         mosAdminMenus::Link$menu$uid);
  77.         
  78.         // get params definitions
  79.         $params =new mosAdminParameters$menu->params$mainframe->getPath'menu_xml'$menu->type )'menu' );
  80.     
  81.         component_item_link_menu_html::edit$menu$lists$params$option );
  82.     }
  83. }
  84. ?>

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