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

