Annotation of /mambo/branches/4.6/administrator/components/com_menus/weblink_category_table/weblink_category_table.class.php
Parent Directory
|
Revision Log
Revision 1754 - (view) (download)
| 1 : | andphe | 1754 | <?php |
| 2 : | /** | ||
| 3 : | * @package Mambo | ||
| 4 : | * @subpackage Menus | ||
| 5 : | ocs_cms | 1396 | * @author Mambo Foundation Inc see README.php |
| 6 : | * @copyright Mambo Foundation Inc. | ||
| 7 : | * See COPYRIGHT.php for copyright notices and details. | ||
| 8 : | * @license GNU/GPL Version 2, see LICENSE.php | ||
| 9 : | * Mambo is free software; you can redistribute it and/or | ||
| 10 : | * modify it under the terms of the GNU General Public License | ||
| 11 : | * as published by the Free Software Foundation; version 2 of the License. | ||
| 12 : | */ | ||
| 13 : | andphe | 1754 | |
| 14 : | /** ensure this file is being included by a parent file */ | ||
| 15 : | defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); | ||
| 16 : | |||
| 17 : | class weblink_category_table_menu { | ||
| 18 : | |||
| 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 editCategory( $uid, $menutype, $option ) { | ||
| 24 : | global $database, $my, $mainframe; | ||
| 25 : | global $mosConfig_absolute_path; | ||
| 26 : | |||
| 27 : | $menu = new mosMenu( $database ); | ||
| 28 : | $menu->load( $uid ); | ||
| 29 : | |||
| 30 : | // fail if checked out not by 'me' | ||
| 31 : | if ($menu->checked_out && $menu->checked_out <> $my->id) { | ||
| 32 : | 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"; | ||
| 33 : | exit(0); | ||
| 34 : | } | ||
| 35 : | |||
| 36 : | if ( $uid ) { | ||
| 37 : | $menu->checkout( $my->id ); | ||
| 38 : | } else { | ||
| 39 : | $menu->type = 'weblink_category_table'; | ||
| 40 : | $menu->menutype = $menutype; | ||
| 41 : | $menu->ordering = 9999; | ||
| 42 : | $menu->parent = intval( mosGetParam( $_POST, 'parent', 0 ) ); | ||
| 43 : | $menu->published = 1; | ||
| 44 : | } | ||
| 45 : | |||
| 46 : | // build list of categories | ||
| 47 : | $lists['componentid'] = mosAdminMenus::ComponentCategory( 'componentid', 'com_weblinks', intval( $menu->componentid ), NULL, 'ordering', 5, 0 ); | ||
| 48 : | if ( $uid ) { | ||
| 49 : | // @RawSQLUse, trivial_implementation, SELECT, CONCEPT | ||
| 50 : | $query = "SELECT name" | ||
| 51 : | . "\n FROM #__categories" | ||
| 52 : | . "\n WHERE section = 'com_weblinks'" | ||
| 53 : | . "\n AND published = '1'" | ||
| 54 : | . "\n AND id = ". $menu->componentid | ||
| 55 : | ; | ||
| 56 : | $database->setQuery( $query ); | ||
| 57 : | $category = $database->loadResult(); | ||
| 58 : | $lists['componentid'] = '<input type="hidden" name="componentid" value="'. $menu->componentid .'" />'. $category; | ||
| 59 : | } | ||
| 60 : | |||
| 61 : | // build the html select list for ordering | ||
| 62 : | $lists['ordering'] = mosAdminMenus::Ordering( $menu, $uid ); | ||
| 63 : | // build the html select list for the group access | ||
| 64 : | $lists['access'] = mosAdminMenus::Access( $menu ); | ||
| 65 : | // build the html select list for paraent item | ||
| 66 : | $lists['parent'] = mosAdminMenus::Parent( $menu ); | ||
| 67 : | // build published button option | ||
| 68 : | $lists['published'] = mosAdminMenus::Published( $menu ); | ||
| 69 : | // build the url link output | ||
| 70 : | $lists['link'] = mosAdminMenus::Link( $menu, $uid ); | ||
| 71 : | |||
| 72 : | // get params definitions | ||
| 73 : | $params =& new mosAdminParameters( $menu->params, $mainframe->getPath( 'menu_xml', $menu->type ), 'menu' ); | ||
| 74 : | |||
| 75 : | weblink_category_table_menu_html::editCategory( $menu, $lists, $params, $option ); | ||
| 76 : | } | ||
| 77 : | } | ||
| 78 : | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

