[ Index ]
 

Code source de Joomla 1.0.13

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

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

   1  <?php
   2  /**
   3  * @version $Id: contact_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  * Contact item link class
  20  * @package Joomla
  21  * @subpackage Menus
  22  */
  23  class contact_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         = 'contact_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( 'contact_id=', $menu->link );
  50              $query = "SELECT *"
  51              . "\n FROM #__contact_details AS a"
  52              . "\n WHERE a.id = " . (int) $temp[1]
  53              ;
  54              $database->setQuery( $query );
  55              $contact = $database->loadObjectlist();
  56              // outputs item name, category & section instead of the select list
  57              $lists['contact'] = '
  58              <table width="100%">
  59              <tr>
  60                  <td width="10%">
  61                  Name:
  62                  </td>
  63                  <td>
  64                  '. $contact[0]->name .'
  65                  </td>
  66              </tr>
  67              <tr>
  68                  <td width="10%">
  69                  Position:
  70                  </td>
  71                  <td>
  72                  '. $contact[0]->con_position .'
  73                  </td>
  74              </tr>
  75              </table>';
  76              $lists['contact'] .= '<input type="hidden" name="contact_item_link" value="'. $temp[1] .'" />';
  77              $contacts = '';
  78          } else {
  79              $query = "SELECT a.id AS value, CONCAT( a.name, ' - ',a.con_position ) AS text, a.catid "
  80              . "\n FROM #__contact_details AS a"
  81              . "\n INNER JOIN #__categories AS c ON a.catid = c.id"
  82              . "\n WHERE a.published = 1"
  83              . "\n ORDER BY a.catid, a.name"
  84              ;
  85              $database->setQuery( $query );
  86              $contacts = $database->loadObjectList( );
  87  
  88              //    Create a list of links
  89              $lists['contact'] = mosHTML::selectList( $contacts, 'contact_item_link', 'class="inputbox" size="10"', 'value', 'text', '' );
  90          }
  91  
  92          // build html select list for target window
  93          $lists['target']         = mosAdminMenus::Target( $menu );
  94  
  95          // build the html select list for ordering
  96          $lists['ordering']         = mosAdminMenus::Ordering( $menu, $uid );
  97          // build the html select list for the group access
  98          $lists['access']         = mosAdminMenus::Access( $menu );
  99          // build the html select list for paraent item
 100          $lists['parent']         = mosAdminMenus::Parent( $menu );
 101          // build published button option
 102          $lists['published']     = mosAdminMenus::Published( $menu );
 103          // build the url link output
 104          $lists['link']         = mosAdminMenus::Link( $menu, $uid );
 105  
 106          // get params definitions
 107          $params = new mosParameters( $menu->params, $mainframe->getPath( 'menu_xml', $menu->type ), 'menu' );
 108  
 109          contact_item_link_menu_html::edit( $menu, $lists, $params, $option, $contacts );
 110      }
 111  }
 112  ?>


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