Source for file separator.class.php

Documentation is available at separator.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. class separator_menu {
  14.  
  15.     /**
  16.     * @param database A database connector object
  17.     * @param integer The unique id of the category to edit (0 if new)
  18.     */
  19.     function edit$uid$menutype$option {
  20.         global $database$my$mainframe;
  21.  
  22.         $menu new mosMenu$database );
  23.         $menu->load$uid );
  24.  
  25.         // fail if checked out not by 'me'
  26.         if ($menu->checked_out && $menu->checked_out <> $my->id{
  27.             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";
  28.             exit(0);
  29.         }
  30.  
  31.         if ($uid{
  32.             // do stuff for existing item
  33.             $menu->checkout$my->id );
  34.  
  35.         else {
  36.             // do stuff for new item
  37.             $menu->type 'separator';
  38.             $menu->menutype $menutype;
  39.             $menu->browserNav 0;
  40.             $menu->ordering 9999;
  41.             $menu->parent intvalmosGetParam$_POST'parent') );
  42.             $menu->published 1;
  43.         }
  44.  
  45.         if empty$menu->name ) ) {
  46.             $menu->name '- - - - - - -';
  47.         }
  48.  
  49.         // build the html select list for ordering
  50.         $lists['ordering']         mosAdminMenus::Ordering$menu$uid );
  51.         // build the html select list for the group access
  52.         $lists['access']         mosAdminMenus::Access$menu );
  53.         // build the html select list for paraent item
  54.         $lists['parent']         mosAdminMenus::Parent$menu );
  55.         // build published button option
  56.         $lists['published']     mosAdminMenus::Published$menu );
  57.         
  58.         // get params definitions
  59.         $params =new mosAdminParameters$menu->params$mainframe->getPath'menu_xml'$menu->type )'menu' );
  60.  
  61.         separator_menu_html::edit$menu$lists$params$option );
  62.     }
  63. }
  64. ?>

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