00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
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
00049
00050
00051
00052
00053
00054 class SC_logomenu extends t3lib_topmenubase {
00055
00056 var $id = '_logomenu';
00057
00058
00059
00060
00061
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:
00073 'subitems' => array(
00074 array(
00075 'title' => 'License',
00076 'xurl' => 'http:
00077 ),
00078 array(
00079 'title' => 'Support',
00080 'subitems' => array(
00081 array(
00082 'title' => 'Mailing lists',
00083 'xurl' => 'http:
00084 ),
00085 array(
00086 'title' => 'Documentation',
00087 'xurl' => 'http:
00088 ),
00089 array(
00090 'title' => 'Find consultancy',
00091 'xurl' => 'http:
00092 ),
00093 )
00094 ),
00095 array(
00096 'title' => 'Contribute',
00097 'xurl' => 'http:
00098 ),
00099 array(
00100 'title' => 'Donate',
00101 'xurl' => 'http:
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
00126
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
00187 $SOBE = t3lib_div::makeInstance('SC_logomenu');
00188 $SOBE->main();
00189
00190 ?>