| [ Index ] | PHP Cross Reference of Mambo 4.6.5 |
|
| [ Variables ] [ Functions ] [ Classes ] [ Constants ] [ Statistics ] | ||
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * @package Mambo 4 * @subpackage Menus 5 * @author Mambo Foundation Inc see README.php 6 * @copyright (C) 2000 - 2009 Mambo Foundation Inc. 7 * See COPYRIGHT.php for copyright notices and details. 8 * @license GNU/GPL Version 2, see LICENSE.php 9 * 10 * Redistributions of files must retain the above copyright notice. 11 * 12 * Mambo is free software; you can redistribute it and/or 13 * modify it under the terms of the GNU General Public License 14 * as published by the Free Software Foundation; version 2 of the License. 15 */ 16 17 /** ensure this file is being included by a parent file */ 18 defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); 19 20 class content_typed_menu { 21 22 function edit( &$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 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 exit(0); 33 } 34 35 if ( $uid ) { 36 $menu->checkout( $my->id ); 37 } else { 38 // load values for new entry 39 $menu->type = 'content_typed'; 40 $menu->menutype = $menutype; 41 $menu->browserNav = 0; 42 $menu->ordering = 9999; 43 $menu->parent = intval( mosGetParam( $_POST, 'parent', 0 ) ); 44 $menu->published = 1; 45 } 46 47 if ( $uid ) { 48 $temp = explode( 'id=', $menu->link ); 49 // @RawSQLUse, trivial_implementation, SELECT, CONCEPT 50 $query = "SELECT a.title, a.title_alias, a.id" 51 . "\n FROM #__content AS a" 52 . "\n WHERE a.id = '". $temp[1] ."'" 53 ; 54 $database->setQuery( $query ); 55 $content = $database->loadObjectlist(); 56 // outputs item name, category & section instead of the select list 57 if ( $content[0]->title_alias ) { 58 $alias = ' (<i>'. $content[0]->title_alias .'</i>)'; 59 } else { 60 $alias = ''; 61 } 62 $contents = ''; 63 $link = 'javascript:submitbutton( \'redirect\' );'; 64 $lists['content'] = '<input type="hidden" name="content_typed" value="'. $temp[1] .'" />'; 65 $lists['content'] .= '<a href="'. $link .'" title="Edit Static Content Item">'. $content[0]->title . $alias .'</a>'; 66 } else { 67 $query = "SELECT a.id AS value, CONCAT( a.title, '(', a.title_alias, ')' ) AS text" 68 . "\n FROM #__content AS a" 69 . "\n WHERE a.state = '1'" 70 . "\n AND a.sectionid = '0'" 71 . "\n AND a.catid = '0'" 72 . "\n ORDER BY a.id, a.title" 73 ; 74 $database->setQuery( $query ); 75 $contents = $database->loadObjectList( ); 76 77 // Create a list of links 78 $lists['content'] = mosHTML::selectList( $contents, 'content_typed', 'class="inputbox" size="10"', 'value', 'text', '' ); 79 } 80 81 // build html select list for target window 82 $lists['target'] = mosAdminMenus::Target( $menu ); 83 84 // build the html select list for ordering 85 $lists['ordering'] = mosAdminMenus::Ordering( $menu, $uid ); 86 // build the html select list for the group access 87 $lists['access'] = mosAdminMenus::Access( $menu ); 88 // build the html select list for paraent item 89 $lists['parent'] = mosAdminMenus::Parent( $menu ); 90 // build published button option 91 $lists['published'] = mosAdminMenus::Published( $menu ); 92 // build the url link output 93 $lists['link'] = mosAdminMenus::Link( $menu, $uid ); 94 95 // get params definitions 96 $params =& new mosAdminParameters( $menu->params, $mainframe->getPath( 'menu_xml', $menu->type ), 'menu' ); 97 98 content_menu_html::edit( $menu, $lists, $params, $option, $contents ); 99 } 100 101 function redirect( $id ) { 102 global $database; 103 104 $menu = new mosMenu( $database ); 105 $menu->bind( $_POST ); 106 $menuid = mosGetParam( $_POST, 'menuid', 0 ); 107 if ( $menuid ) { 108 $menu->id = $menuid; 109 } 110 $menu->checkin(); 111 112 mosRedirect( 'index2.php?option=com_typedcontent&task=edit&id='. $id ); 113 } 114 } 115 116 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed May 23 00:05:01 2012 | Cross-referenced by PHPXref 0.7 |
| Mambo API: Mambo is Free software released under the GNU/General Public License, Version 2 |