Documentation TYPO3 par Ameos

logomenu.php

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 2006 Kasper Skaarhoj (kasperYYYY@typo3.com)
00006 *  All rights reserved
00007 *
00008 *  This script is part of the TYPO3 project. The TYPO3 project is
00009 *  free software; you can redistribute it and/or modify
00010 *  it under the terms of the GNU General Public License as published by
00011 *  the Free Software Foundation; either version 2 of the License, or
00012 *  (at your option) any later version.
00013 *
00014 *  The GNU General Public License can be found at
00015 *  http://www.gnu.org/copyleft/gpl.html.
00016 *  A copy is found in the textfile GPL.txt and important notices to the license
00017 *  from the author is found in LICENSE.txt distributed with these scripts.
00018 *
00019 *
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
00038 require ('init.php');
00039 require ('template.php');
00040 
00041 require_once(PATH_t3lib.'class.t3lib_topmenubase.php');
00042 
00043 
00044 
00052 class SC_logomenu extends t3lib_topmenubase {
00053         
00054         var $id = '_logomenu';
00055         
00061         function main() {
00062                 switch((string)t3lib_div::_GET('cmd'))  {
00063                         case 'menuitem':
00064                                 echo '
00065                                 <img src="gfx/x_t3logo.png" width="61" height="16" hspace="3" alt="" />';
00066                                 
00067                                 $menuItems = array(
00068                                         array(
00069                                                 'title' => 'About TYPO3',
00070                                                 'xurl' => 'http://typo3.com/',
00071                                                 'subitems' => array(
00072                                                         array(
00073                                                                 'title' => 'License',
00074                                                                 'xurl' => 'http://typo3.com/License.1625.0.html',
00075                                                         ),
00076                                                         array(
00077                                                                 'title' => 'Support',
00078                                                                 'subitems' => array(
00079                                                                         array(
00080                                                                                 'title' => 'Mailing lists',
00081                                                                                 'xurl' => 'http://lists.netfielders.de/cgi-bin/mailman/listinfo',
00082                                                                         ),
00083                                                                         array(
00084                                                                                 'title' => 'Documentation',
00085                                                                                 'xurl' => 'http://typo3.org/documentation/',
00086                                                                         ),
00087                                                                         array(
00088                                                                                 'title' => 'Find consultancy',
00089                                                                                 'xurl' => 'http://typo3.com/Consultancies.1248.0.html',
00090                                                                         ),
00091                                                                 )
00092                                                         ),
00093                                                         array(
00094                                                                 'title' => 'Contribute',
00095                                                                 'xurl' => 'http://typo3.org/community/participate/'
00096                                                         ),
00097                                                         array(
00098                                                                 'title' => 'Donate',
00099                                                                 'xurl' => 'http://typo3.com/Donations.1261.0.html',
00100                                                                 'icon' => '1'
00101                                                         )
00102                                                 )
00103                                         ),
00104                                         array(
00105                                                 'title' => 'Extensions',
00106                                                 'url' => 'mod/tools/em/index.php'
00107                                         ),
00108                                         array(
00109                                                 'title' => 'Menu preferences and such things',
00110                                                 'onclick' => 'alert("A dialog is now shown which will allow user configuration of items in the menu");event.stopPropagation();',
00111                                                 'state' => 'checked'
00112                                         ),
00113                                         array(
00114                                                 'title' => '--div--'
00115                                         ),
00116                                         array(
00117                                                 'title' => 'Recent Items',
00118                                                 'id' => $this->id.'_recent',
00119                                                 'subitems' => array(),
00120                                                 'html' => $this->menuItemObject($this->id.'_recent','
00121                                                         fetched: false,
00122                                                         onActivate: function() {
00123 //                                                              if (!this.fetched)      {
00124                                                                         //Element.update("'.$this->id.'_recent-layer","asdfasdf");
00125                                                                         getElementContent("'.$this->id.'_recent-layer", 0, "logomenu.php?cmd=recent")
00126                                                                         this.fetched = true;
00127 //                                                              }
00128                                                         }
00129                                                 ')
00130                                         ),
00131                                         array(
00132                                                 'title' => '--div--'
00133                                         ),
00134                                         array(
00135                                                 'title' => 'View frontend',
00136                                                 'xurl' => t3lib_div::getIndpEnv('TYPO3_SITE_URL')
00137                                         ),
00138                                         array(
00139                                                 'title' => 'Log out',
00140                                                 'onclick' => "top.document.location='logout.php';"
00141                                         ),
00142                                 );
00143                                 
00144                                 echo $this->menuLayer($menuItems);
00145                         break;
00146                         case 'recent':
00147 
00148                                 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
00149                                                         'sys_log.*, MAX(sys_log.tstamp) AS tstamp_MAX', 
00150                                                         'sys_log,pages', 
00151                                                         'pages.uid=sys_log.event_pid AND sys_log.userid='.intval($GLOBALS['BE_USER']->user['uid']).
00152                                                                 ' AND sys_log.event_pid>0 AND sys_log.type=1 AND sys_log.action=2 AND sys_log.error=0',
00153                                                         'tablename,recuid',
00154                                                         'tstamp_MAX DESC',
00155                                                         20
00156                                                 );
00157                                         
00158                                 $items = array();
00159                                 
00160                                 while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))       {
00161                                         $elRow = t3lib_BEfunc::getRecord($row['tablename'],$row['recuid']);
00162                                         if (is_array($elRow))   {
00163                                                 $items[] = array(
00164                                                         'title' => t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle($row['tablename'],$elRow),$GLOBALS['BE_USER']->uc['titleLen']).' - '.t3lib_BEfunc::calcAge(time()-$row['tstamp_MAX']),
00165                                                         'icon' => array(t3lib_iconworks::getIcon($row['tablename'],$elRow),'width="18" height="16"'),
00166                                                         'onclick' => 'content.'.t3lib_BEfunc::editOnClick('&edit['.$row['tablename'].']['.$row['recuid'].']=edit','','dummy.php')
00167                                                 );
00168                                         }
00169                                 }
00170 
00171                                 echo $this->menuItems($items);
00172                         break;
00173                 }
00174         }
00175 }
00176 
00177 // Include extension?
00178 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/logomenu.php'])      {
00179         include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/logomenu.php']);
00180 }
00181 
00182 
00183 
00184 // Make instance:
00185 $SOBE = t3lib_div::makeInstance('SC_logomenu');
00186 $SOBE->main();
00187 ?>


Généré par Le spécialiste TYPO3 avec  doxygen 1.4.6