Annotation of /mambo/branches/4.6/administrator/components/com_menus/weblink_category_table/weblink_category_table.class.php
Parent Directory
|
Revision Log
Revision 948 - (view) (download)
| 1 : | root | 1 | <?php |
| 2 : | /** | ||
| 3 : | csouza | 297 | * @package Mambo Open Source |
| 4 : | root | 1 | * @subpackage Menus |
| 5 : | cauld | 948 | * @copyright Refer to copyright.php |
| 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 weblink_category_table_menu { | ||
| 17 : | |||
| 18 : | /** | ||
| 19 : | * @param database A database connector object | ||
| 20 : | * @param integer The unique id of the category to edit (0 if new) | ||
| 21 : | */ | ||
| 22 : | function editCategory( $uid, $menutype, $option ) { | ||
| 23 : | global $database, $my, $mainframe; | ||
| 24 : | global $mosConfig_absolute_path; | ||
| 25 : | |||
| 26 : | $menu = new mosMenu( $database ); | ||
| 27 : | $menu->load( $uid ); | ||
| 28 : | |||
| 29 : | // fail if checked out not by 'me' | ||
| 30 : | if ($menu->checked_out && $menu->checked_out <> $my->id) { | ||
| 31 : | csouza | 165 | 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"; |
| 32 : | root | 1 | exit(0); |
| 33 : | } | ||
| 34 : | |||
| 35 : | if ( $uid ) { | ||
| 36 : | $menu->checkout( $my->id ); | ||
| 37 : | } else { | ||
| 38 : | $menu->type = 'weblink_category_table'; | ||
| 39 : | $menu->menutype = $menutype; | ||
| 40 : | $menu->ordering = 9999; | ||
| 41 : | $menu->parent = intval( mosGetParam( $_POST, 'parent', 0 ) ); | ||
| 42 : | $menu->published = 1; | ||
| 43 : | } | ||
| 44 : | |||
| 45 : | // build list of categories | ||
| 46 : | $lists['componentid'] = mosAdminMenus::ComponentCategory( 'componentid', 'com_weblinks', intval( $menu->componentid ), NULL, 'ordering', 5, 0 ); | ||
| 47 : | if ( $uid ) { | ||
| 48 : | $query = "SELECT name" | ||
| 49 : | . "\n FROM #__categories" | ||
| 50 : | . "\n WHERE section = 'com_weblinks'" | ||
| 51 : | . "\n AND published = '1'" | ||
| 52 : | . "\n AND id = ". $menu->componentid | ||
| 53 : | ; | ||
| 54 : | $database->setQuery( $query ); | ||
| 55 : | $category = $database->loadResult(); | ||
| 56 : | $lists['componentid'] = '<input type="hidden" name="componentid" value="'. $menu->componentid .'" />'. $category; | ||
| 57 : | } | ||
| 58 : | |||
| 59 : | // build the html select list for ordering | ||
| 60 : | $lists['ordering'] = mosAdminMenus::Ordering( $menu, $uid ); | ||
| 61 : | // build the html select list for the group access | ||
| 62 : | $lists['access'] = mosAdminMenus::Access( $menu ); | ||
| 63 : | // build the html select list for paraent item | ||
| 64 : | $lists['parent'] = mosAdminMenus::Parent( $menu ); | ||
| 65 : | // build published button option | ||
| 66 : | $lists['published'] = mosAdminMenus::Published( $menu ); | ||
| 67 : | // build the url link output | ||
| 68 : | $lists['link'] = mosAdminMenus::Link( $menu, $uid ); | ||
| 69 : | |||
| 70 : | // get params definitions | ||
| 71 : | csouza | 138 | $params =& new mosAdminParameters( $menu->params, $mainframe->getPath( 'menu_xml', $menu->type ), 'menu' ); |
| 72 : | root | 1 | |
| 73 : | weblink_category_table_menu_html::editCategory( $menu, $lists, $params, $option ); | ||
| 74 : | } | ||
| 75 : | } | ||
| 76 : | csouza | 138 | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

