| [ Index ] |
|
Code source de Joomla 1.0.13 |
1 <?php 2 /** 3 * @version $Id: content_item_link.class.php 7211 2007-04-29 02:26:51Z robs $ 4 * @package Joomla 5 * @subpackage Menus 6 * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved. 7 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php 8 * Joomla! is free software. This version may have been modified pursuant 9 * to the GNU General Public License, and as distributed it includes or 10 * is derivative of works licensed under the GNU General Public License or 11 * other free or open source software licenses. 12 * See COPYRIGHT.php for copyright notices and details. 13 */ 14 15 // no direct access 16 defined( '_VALID_MOS' ) or die( 'Restricted access' ); 17 18 /** 19 * Content item link class 20 * @package Joomla 21 * @subpackage Menus 22 */ 23 class content_item_link_menu { 24 25 function edit( &$uid, $menutype, $option ) { 26 global $database, $my, $mainframe; 27 global $mosConfig_absolute_path; 28 29 $menu = new mosMenu( $database ); 30 $menu->load( (int)$uid ); 31 32 // fail if checked out not by 'me' 33 if ($menu->checked_out && $menu->checked_out != $my->id) { 34 mosErrorAlert( "The module ".$menu->title." is currently being edited by another administrator" ); 35 } 36 37 if ( $uid ) { 38 $menu->checkout( $my->id ); 39 } else { 40 // load values for new entry 41 $menu->type = 'content_item_link'; 42 $menu->menutype = $menutype; 43 $menu->browserNav = 0; 44 $menu->ordering = 9999; 45 $menu->parent = intval( mosGetParam( $_POST, 'parent', 0 ) ); 46 $menu->published = 1; 47 } 48 49 if ( $uid ) { 50 $link = 'javascript:submitbutton( \'redirect\' );'; 51 52 $temp = explode( 'id=', $menu->link ); 53 $query = "SELECT a.title, c.name AS category, s.name AS section" 54 . "\n FROM #__content AS a" 55 . "\n LEFT JOIN #__categories AS c ON a.catid = c.id" 56 . "\n LEFT JOIN #__sections AS s ON a.sectionid = s.id" 57 . "\n WHERE a.id = " . (int) $temp[1] 58 ; 59 $database->setQuery( $query ); 60 $content = $database->loadObjectlist(); 61 // outputs item name, category & section instead of the select list 62 $lists['content'] = ' 63 <table width="100%"> 64 <tr> 65 <td width="10%"> 66 Item: 67 </td> 68 <td> 69 <a href="'. $link .'" title="Edit Content Item"> 70 '. $content[0]->title .' 71 </a> 72 </td> 73 </tr> 74 <tr> 75 <td width="10%"> 76 Category: 77 </td> 78 <td> 79 '. $content[0]->category .' 80 </td> 81 </tr> 82 <tr> 83 <td width="10%"> 84 Section: 85 </td> 86 <td> 87 '. $content[0]->section .' 88 </td> 89 </tr> 90 </table>'; 91 $contents = ''; 92 $lists['content'] .= '<input type="hidden" name="content_item_link" value="'. $temp[1] .'" />'; 93 } else { 94 $query = "SELECT a.id AS value," 95 . "\n CONCAT(s.title, ' - ',c.title,' / ',a.title, ' ') AS text" 96 . "\n FROM #__content AS a" 97 . "\n INNER JOIN #__categories AS c ON a.catid = c.id" 98 . "\n INNER JOIN #__sections AS s ON a.sectionid = s.id AND s.scope = 'content'" 99 . "\n WHERE a.state = 1" 100 . "\n ORDER BY a.sectionid, a.catid, a.title"; 101 $database->setQuery($query); 102 $contents = $database->loadObjectList(); 103 104 // Create a list of links 105 $lists['content'] = mosHTML::selectList( $contents, 'content_item_link', 'class="inputbox" size="10"', 'value', 'text', '' ); 106 } 107 108 // build html select list for target window 109 $lists['target'] = mosAdminMenus::Target( $menu ); 110 111 // build the html select list for ordering 112 $lists['ordering'] = mosAdminMenus::Ordering( $menu, $uid ); 113 // build the html select list for the group access 114 $lists['access'] = mosAdminMenus::Access( $menu ); 115 // build the html select list for paraent item 116 $lists['parent'] = mosAdminMenus::Parent( $menu ); 117 // build published button option 118 $lists['published'] = mosAdminMenus::Published( $menu ); 119 // build the url link output 120 $lists['link'] = mosAdminMenus::Link( $menu, $uid ); 121 122 // get params definitions 123 $params = new mosParameters( $menu->params, $mainframe->getPath( 'menu_xml', $menu->type ), 'menu' ); 124 125 content_item_link_menu_html::edit( $menu, $lists, $params, $option, $contents ); 126 } 127 128 function redirect( $id ) { 129 global $database; 130 131 $menu = new mosMenu( $database ); 132 $menu->bind( $_POST ); 133 $menuid = intval( mosGetParam( $_POST, 'menuid', 0 ) ); 134 if ( $menuid ) { 135 $menu->id = $menuid; 136 } 137 $menu->checkin(); 138 139 mosRedirect( 'index2.php?option=com_content&task=edit&id='. $id ); 140 } 141 } 142 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Wed Nov 21 14:43:32 2007 | par Balluche grâce à PHPXref 0.7 |
|