logomenu.php

Go to the documentation of this file.
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 ***************************************************************/
00027 /**
00028  * Logo menu
00029  *
00030  * $Id: logomenu.php 4433 2008-11-07 04:13:12Z flyguide $
00031  *
00032  * @author  Kasper Skaarhoj <kasperYYYY@typo3.com>
00033  */
00034 /**
00035  * [CLASS/FUNCTION INDEX of SCRIPT]
00036  *
00037  */
00038 
00039 
00040 require ('init.php');
00041 require ('template.php');
00042 
00043 require_once(PATH_t3lib.'class.t3lib_topmenubase.php');
00044 
00045 
00046 
00047 /**
00048  * Script Class for rendering logo menu
00049  *
00050  * @author  Kasper Skaarhoj <kasperYYYY@typo3.com>
00051  * @package TYPO3
00052  * @subpackage core
00053  */
00054 class SC_logomenu extends t3lib_topmenubase {
00055 
00056     var $id = '_logomenu';
00057 
00058     /**
00059      * Main function
00060      *
00061      * @return  void
00062      */
00063     function main() {
00064         switch((string)t3lib_div::_GET('cmd'))  {
00065             case 'menuitem':
00066                 echo '
00067                 <img src="gfx/x_t3logo.png" width="61" height="16" hspace="3" alt="" />';
00068 
00069                 $menuItems = array(
00070                     array(
00071                         'title' => 'About TYPO3',
00072                         'xurl' => 'http://typo3.com/',
00073                         'subitems' => array(
00074                             array(
00075                                 'title' => 'License',
00076                                 'xurl' => 'http://typo3.com/License.1625.0.html',
00077                             ),
00078                             array(
00079                                 'title' => 'Support',
00080                                 'subitems' => array(
00081                                     array(
00082                                         'title' => 'Mailing lists',
00083                                         'xurl' => 'http://lists.netfielders.de/cgi-bin/mailman/listinfo',
00084                                     ),
00085                                     array(
00086                                         'title' => 'Documentation',
00087                                         'xurl' => 'http://typo3.org/documentation/',
00088                                     ),
00089                                     array(
00090                                         'title' => 'Find consultancy',
00091                                         'xurl' => 'http://typo3.com/Consultancies.1248.0.html',
00092                                     ),
00093                                 )
00094                             ),
00095                             array(
00096                                 'title' => 'Contribute',
00097                                 'xurl' => 'http://typo3.org/community/participate/'
00098                             ),
00099                             array(
00100                                 'title' => 'Donate',
00101                                 'xurl' => 'http://typo3.com/Donations.1261.0.html',
00102                                 'icon' => '1'
00103                             )
00104                         )
00105                     ),
00106                     array(
00107                         'title' => 'Extensions',
00108                         'url' => 'mod/tools/em/index.php'
00109                     ),
00110                     array(
00111                         'title' => 'Menu preferences and such things',
00112                         'onclick' => 'alert("A dialog is now shown which will allow user configuration of items in the menu");event.stopPropagation();',
00113                         'state' => 'checked'
00114                     ),
00115                     array(
00116                         'title' => '--div--'
00117                     ),
00118                     array(
00119                         'title' => 'Recent Items',
00120                         'id' => $this->id.'_recent',
00121                         'subitems' => array(),
00122                         'html' => $this->menuItemObject($this->id.'_recent','
00123                             fetched: false,
00124                             onActivate: function() {
00125 //                              if (!this.fetched)  {
00126                                     //Element.update("'.$this->id.'_recent-layer","asdfasdf");
00127                                     getElementContent("'.$this->id.'_recent-layer", 0, "logomenu.php?cmd=recent")
00128                                     this.fetched = true;
00129 //                              }
00130                             }
00131                         ')
00132                     ),
00133                     array(
00134                         'title' => '--div--'
00135                     ),
00136                     array(
00137                         'title' => 'View frontend',
00138                         'xurl' => t3lib_div::getIndpEnv('TYPO3_SITE_URL')
00139                     ),
00140                     array(
00141                         'title' => 'Log out',
00142                         'onclick' => "top.document.location='logout.php';"
00143                     ),
00144                 );
00145 
00146                 echo $this->menuLayer($menuItems);
00147             break;
00148             case 'recent':
00149 
00150                 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
00151                             'sys_log.*, MAX(sys_log.tstamp) AS tstamp_MAX',
00152                             'sys_log,pages',
00153                             'pages.uid=sys_log.event_pid AND sys_log.userid='.intval($GLOBALS['BE_USER']->user['uid']).
00154                                 ' AND sys_log.event_pid>0 AND sys_log.type=1 AND sys_log.action=2 AND sys_log.error=0',
00155                             'tablename,recuid',
00156                             'tstamp_MAX DESC',
00157                             20
00158                         );
00159 
00160                 $items = array();
00161 
00162                 while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))   {
00163                     $elRow = t3lib_BEfunc::getRecord($row['tablename'],$row['recuid']);
00164                     if (is_array($elRow))   {
00165                         $items[] = array(
00166                             'title' => t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle($row['tablename'],$elRow),$GLOBALS['BE_USER']->uc['titleLen']).' - '.t3lib_BEfunc::calcAge(time()-$row['tstamp_MAX']),
00167                             'icon' => array(t3lib_iconworks::getIcon($row['tablename'],$elRow),'width="18" height="16"'),
00168                             'onclick' => 'content.'.t3lib_BEfunc::editOnClick('&edit['.$row['tablename'].']['.$row['recuid'].']=edit','','dummy.php')
00169                         );
00170                     }
00171                 }
00172 
00173                 echo $this->menuItems($items);
00174             break;
00175         }
00176     }
00177 }
00178 
00179 
00180 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/logomenu.php'])  {
00181     include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/logomenu.php']);
00182 }
00183 
00184 
00185 
00186 // Make instance:
00187 $SOBE = t3lib_div::makeInstance('SC_logomenu');
00188 $SOBE->main();
00189 
00190 ?>

Generated on Sat Jan 3 04:23:29 2009 for TYPO3 API by  doxygen 1.4.7