[ Index ]
 

Code source de Joomla 1.0.13

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/administrator/components/com_menus/component_item_link/ -> component_item_link.class.php (source)

   1  <?php
   2  /**
   3  * @version $Id: component_item_link.class.php 5047 2006-09-14 13:49:01Z friesengeist $
   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  * Component item link class
  20  * @package Joomla
  21  * @subpackage Menus
  22  */
  23  class component_item_link_menu {
  24  
  25  	function edit( &$uid, $menutype, $option ) {
  26          global $database, $my, $mainframe;
  27  
  28          $menu = new mosMenu( $database );
  29          $menu->load( (int)$uid );
  30  
  31          // fail if checked out not by 'me'
  32          if ($menu->checked_out && $menu->checked_out != $my->id) {
  33              mosErrorAlert( "The module ".$menu->title." is currently being edited by another administrator" );
  34          }
  35  
  36          if ( $uid ) {
  37              $menu->checkout( $my->id );
  38          } else {
  39              // load values for new entry
  40              $menu->type         = 'component_item_link';
  41              $menu->menutype     = $menutype;
  42              $menu->browserNav     = 0;
  43              $menu->ordering     = 9999;
  44              $menu->parent         = intval( mosGetParam( $_POST, 'parent', 0 ) );
  45              $menu->published     = 1;
  46          }
  47  
  48          if ( $uid ) {
  49              $temp = explode( '&Itemid=', $menu->link );
  50               $query = "SELECT a.name"
  51              . "\n FROM #__menu AS a"
  52              . "\n WHERE a.link = " . $database->Quote( $temp[0] )
  53              ;
  54              $database->setQuery( $query );
  55              $components = $database->loadResult();
  56              $lists['components'] =  $components;
  57              $lists['components'] .= '<input type="hidden" name="link" value="'. $menu->link .'" />';
  58          } else {
  59              $query = "SELECT CONCAT( a.link, '&amp;Itemid=', a.id ) AS value, a.name AS text"
  60              . "\n FROM #__menu AS a"
  61              . "\n WHERE a.published = 1"
  62              . "\n AND a.type = 'components'"
  63              . "\n ORDER BY a.menutype, a.name"
  64              ;
  65              $database->setQuery( $query );
  66              $components = $database->loadObjectList( );
  67  
  68              //    Create a list of links
  69              $lists['components'] = mosHTML::selectList( $components, 'link', 'class="inputbox" size="10"', 'value', 'text', '' );
  70          }
  71  
  72          // build html select list for target window
  73          $lists['target']         = mosAdminMenus::Target( $menu );
  74  
  75          // build the html select list for ordering
  76          $lists['ordering']         = mosAdminMenus::Ordering( $menu, $uid );
  77          // build the html select list for the group access
  78          $lists['access']         = mosAdminMenus::Access( $menu );
  79          // build the html select list for paraent item
  80          $lists['parent']         = mosAdminMenus::Parent( $menu );
  81          // build published button option
  82          $lists['published']     = mosAdminMenus::Published( $menu );
  83          // build the url link output
  84          $lists['link']         = mosAdminMenus::Link( $menu, $uid, 1 );
  85  
  86          // get params definitions
  87          $params = new mosParameters( $menu->params, $mainframe->getPath( 'menu_xml', $menu->type ), 'menu' );
  88  
  89          component_item_link_menu_html::edit( $menu, $lists, $params, $option );
  90      }
  91  }
  92  ?>


Généré le : Wed Nov 21 14:43:32 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics