Annotation of /mambo/branches/4.6/administrator/components/com_menus/contact_item_link/contact_item_link.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 : | /** | ||
| 17 : | * Contact item link class | ||
| 18 : | */ | ||
| 19 : | class contact_item_link_menu { | ||
| 20 : | |||
| 21 : | function edit( &$uid, $menutype, $option ) { | ||
| 22 : | global $database, $my, $mainframe; | ||
| 23 : | global $mosConfig_absolute_path; | ||
| 24 : | |||
| 25 : | $menu = new mosMenu( $database ); | ||
| 26 : | $menu->load( $uid ); | ||
| 27 : | |||
| 28 : | // fail if checked out not by 'me' | ||
| 29 : | if ($menu->checked_out && $menu->checked_out <> $my->id) { | ||
| 30 : | 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"; |
| 31 : | root | 1 | exit(0); |
| 32 : | } | ||
| 33 : | |||
| 34 : | if ( $uid ) { | ||
| 35 : | $menu->checkout( $my->id ); | ||
| 36 : | } else { | ||
| 37 : | // load values for new entry | ||
| 38 : | $menu->type = 'contact_item_link'; | ||
| 39 : | $menu->menutype = $menutype; | ||
| 40 : | $menu->browserNav = 0; | ||
| 41 : | $menu->ordering = 9999; | ||
| 42 : | $menu->parent = intval( mosGetParam( $_POST, 'parent', 0 ) ); | ||
| 43 : | $menu->published = 1; | ||
| 44 : | } | ||
| 45 : | |||
| 46 : | if ( $uid ) { | ||
| 47 : | $temp = explode( 'contact_id=', $menu->link ); | ||
| 48 : | $query = "SELECT *" | ||
| 49 : | . "\n FROM #__contact_details AS a" | ||
| 50 : | . "\n WHERE a.id = '". $temp[1] ."'" | ||
| 51 : | ; | ||
| 52 : | $database->setQuery( $query ); | ||
| 53 : | $contact = $database->loadObjectlist(); | ||
| 54 : | // outputs item name, category & section instead of the select list | ||
| 55 : | $lists['contact'] = ' | ||
| 56 : | <table width="100%"> | ||
| 57 : | <tr> | ||
| 58 : | <td width="10%"> | ||
| 59 : | csouza | 165 | '.T_('Name:').' |
| 60 : | root | 1 | </td> |
| 61 : | <td> | ||
| 62 : | '. $contact[0]->name .' | ||
| 63 : | </td> | ||
| 64 : | </tr> | ||
| 65 : | <tr> | ||
| 66 : | <td width="10%"> | ||
| 67 : | csouza | 165 | '.T_('Position:').' |
| 68 : | root | 1 | </td> |
| 69 : | <td> | ||
| 70 : | '. $contact[0]->con_position .' | ||
| 71 : | </td> | ||
| 72 : | </tr> | ||
| 73 : | </table>'; | ||
| 74 : | $lists['contact'] .= '<input type="hidden" name="contact_item_link" value="'. $temp[1] .'" />'; | ||
| 75 : | $contacts = ''; | ||
| 76 : | } else { | ||
| 77 : | $query = "SELECT a.id AS value, CONCAT( a.name, ' - ',a.con_position ) AS text, a.catid " | ||
| 78 : | . "\n FROM #__contact_details AS a" | ||
| 79 : | . "\n INNER JOIN #__categories AS c ON a.catid = c.id" | ||
| 80 : | . "\n WHERE a.published = '1'" | ||
| 81 : | . "\n ORDER BY a.catid, a.name" | ||
| 82 : | ; | ||
| 83 : | $database->setQuery( $query ); | ||
| 84 : | $contacts = $database->loadObjectList( ); | ||
| 85 : | |||
| 86 : | // Create a list of links | ||
| 87 : | $lists['contact'] = mosHTML::selectList( $contacts, 'contact_item_link', 'class="inputbox" size="10"', 'value', 'text', '' ); | ||
| 88 : | } | ||
| 89 : | |||
| 90 : | // build html select list for target window | ||
| 91 : | $lists['target'] = mosAdminMenus::Target( $menu ); | ||
| 92 : | |||
| 93 : | // build the html select list for ordering | ||
| 94 : | $lists['ordering'] = mosAdminMenus::Ordering( $menu, $uid ); | ||
| 95 : | // build the html select list for the group access | ||
| 96 : | $lists['access'] = mosAdminMenus::Access( $menu ); | ||
| 97 : | // build the html select list for paraent item | ||
| 98 : | $lists['parent'] = mosAdminMenus::Parent( $menu ); | ||
| 99 : | // build published button option | ||
| 100 : | $lists['published'] = mosAdminMenus::Published( $menu ); | ||
| 101 : | // build the url link output | ||
| 102 : | $lists['link'] = mosAdminMenus::Link( $menu, $uid ); | ||
| 103 : | |||
| 104 : | // get params definitions | ||
| 105 : | csouza | 138 | $params =& new mosAdminParameters( $menu->params, $mainframe->getPath( 'menu_xml', $menu->type ), 'menu' ); |
| 106 : | root | 1 | |
| 107 : | contact_item_link_menu_html::edit( $menu, $lists, $params, $option, $contacts ); | ||
| 108 : | } | ||
| 109 : | } | ||
| 110 : | csouza | 138 | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

