Annotation of /mambo/branches/4.6/administrator/components/com_menus/components/components.class.php
Parent Directory
|
Revision Log
Revision 138 - (view) (download)
| 1 : | root | 1 | <?php |
| 2 : | /** | ||
| 3 : | * @version $Id: components.class.php,v 1.1 2005/07/22 01:52:50 eddieajau Exp $ | ||
| 4 : | * @package Mambo | ||
| 5 : | * @subpackage Menus | ||
| 6 : | * @copyright (C) 2000 - 2005 Miro International Pty Ltd | ||
| 7 : | * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL | ||
| 8 : | * Mambo is Free Software | ||
| 9 : | */ | ||
| 10 : | |||
| 11 : | /** ensure this file is being included by a parent file */ | ||
| 12 : | defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); | ||
| 13 : | |||
| 14 : | /** | ||
| 15 : | * @package Mambo | ||
| 16 : | * @subpackage Menus | ||
| 17 : | */ | ||
| 18 : | class components_menu { | ||
| 19 : | /** | ||
| 20 : | * @param database A database connector object | ||
| 21 : | * @param integer The unique id of the category to edit (0 if new) | ||
| 22 : | */ | ||
| 23 : | function edit( $uid, $menutype, $option ) { | ||
| 24 : | global $database, $my, $mainframe; | ||
| 25 : | |||
| 26 : | $menu = new mosMenu( $database ); | ||
| 27 : | $menu->load( $uid ); | ||
| 28 : | |||
| 29 : | $row = new mosComponent( $database ); | ||
| 30 : | // load the row from the db table | ||
| 31 : | $row->load( $menu->componentid ); | ||
| 32 : | |||
| 33 : | // fail if checked out not by 'me' | ||
| 34 : | if ( $menu->checked_out && $menu->checked_out <> $my->id ) { | ||
| 35 : | echo "<script>alert('The module $menu->title is currently being edited by another administrator'); document.location.href='index2.php?option=$option'</script>\n"; | ||
| 36 : | exit(0); | ||
| 37 : | } | ||
| 38 : | |||
| 39 : | if ( $uid ) { | ||
| 40 : | // do stuff for existing item | ||
| 41 : | $menu->checkout( $my->id ); | ||
| 42 : | } else { | ||
| 43 : | // do stuff for new item | ||
| 44 : | $menu->type = 'components'; | ||
| 45 : | $menu->menutype = $menutype; | ||
| 46 : | $menu->browserNav = 0; | ||
| 47 : | $menu->ordering = 9999; | ||
| 48 : | $menu->parent = intval( mosGetParam( $_POST, 'parent', 0 ) ); | ||
| 49 : | $menu->published = 1; | ||
| 50 : | } | ||
| 51 : | |||
| 52 : | $query = "SELECT c.id AS value, c.name AS text, c.link" | ||
| 53 : | . "\n FROM #__components AS c" | ||
| 54 : | . "\n WHERE c.link <> ''" | ||
| 55 : | . "\n ORDER BY c.name" | ||
| 56 : | ; | ||
| 57 : | $database->setQuery( $query ); | ||
| 58 : | $components = $database->loadObjectList( ); | ||
| 59 : | |||
| 60 : | // build the html select list for section | ||
| 61 : | $lists['componentid'] = mosAdminMenus::Component( $menu, $uid ); | ||
| 62 : | |||
| 63 : | // componentname | ||
| 64 : | $lists['componentname'] = mosAdminMenus::ComponentName( $menu, $uid ); | ||
| 65 : | // build the html select list for ordering | ||
| 66 : | $lists['ordering'] = mosAdminMenus::Ordering( $menu, $uid ); | ||
| 67 : | // build the html select list for the group access | ||
| 68 : | $lists['access'] = mosAdminMenus::Access( $menu ); | ||
| 69 : | // build the html select list for paraent item | ||
| 70 : | $lists['parent'] = mosAdminMenus::Parent( $menu ); | ||
| 71 : | // build published button option | ||
| 72 : | $lists['published'] = mosAdminMenus::Published( $menu ); | ||
| 73 : | // build the url link output | ||
| 74 : | $lists['link'] = mosAdminMenus::Link( $menu, $uid ); | ||
| 75 : | |||
| 76 : | // get params definitions | ||
| 77 : | csouza | 138 | $params =& new mosAdminParameters( $menu->params, $mainframe->getPath( 'com_xml', $row->option ), 'component' ); |
| 78 : | root | 1 | |
| 79 : | components_menu_html::edit( $menu, $components, $lists, $params, $option ); | ||
| 80 : | } | ||
| 81 : | } | ||
| 82 : | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

