Fixed bug #14996: htmlArea RTE: Clicking in drop down boxes should mark text
[Packages/TYPO3.CMS.git] / typo3 / logomenu.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2006-2010 Kasper Skaarhoj (kasperYYYY@typo3.com)
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 * A copy is found in the textfile GPL.txt and important notices to the license
17 * from the author is found in LICENSE.txt distributed with these scripts.
18 *
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27 /**
28 * Logo menu
29 *
30 * $Id$
31 *
32 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
33 */
34 /**
35 * [CLASS/FUNCTION INDEX of SCRIPT]
36 *
37 */
38
39
40 require ('init.php');
41 require ('template.php');
42
43
44 /**
45 * Script Class for rendering logo menu
46 *
47 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
48 * @package TYPO3
49 * @subpackage core
50 */
51 class SC_logomenu extends t3lib_topmenubase {
52
53 var $id = '_logomenu';
54
55 /**
56 * Main function
57 *
58 * @return void
59 */
60 function main() {
61 switch((string)t3lib_div::_GET('cmd')) {
62 case 'menuitem':
63 echo '
64 <img src="gfx/x_t3logo.png" width="61" height="16" hspace="3" alt="" />';
65
66 $menuItems = array(
67 array(
68 'title' => 'About TYPO3',
69 'xurl' => 'http://typo3.com/',
70 'subitems' => array(
71 array(
72 'title' => 'License',
73 'xurl' => 'http://typo3.com/License.1625.0.html',
74 ),
75 array(
76 'title' => 'Support',
77 'subitems' => array(
78 array(
79 'title' => 'Mailing lists',
80 'xurl' => 'http://lists.netfielders.de/cgi-bin/mailman/listinfo',
81 ),
82 array(
83 'title' => 'Documentation',
84 'xurl' => 'http://typo3.org/documentation/',
85 ),
86 array(
87 'title' => 'Find consultancy',
88 'xurl' => 'http://typo3.com/Consultancies.1248.0.html',
89 ),
90 )
91 ),
92 array(
93 'title' => 'Contribute',
94 'xurl' => 'http://typo3.org/community/participate/'
95 ),
96 array(
97 'title' => 'Donate',
98 'xurl' => 'http://typo3.com/Donations.1261.0.html',
99 'icon' => '1'
100 )
101 )
102 ),
103 array(
104 'title' => 'Extensions',
105 'url' => 'mod/tools/em/index.php'
106 ),
107 array(
108 'title' => 'Menu preferences and such things',
109 'onclick' => 'alert("A dialog is now shown which will allow user configuration of items in the menu");event.stopPropagation();',
110 'state' => 'checked'
111 ),
112 array(
113 'title' => '--div--'
114 ),
115 array(
116 'title' => 'Recent Items',
117 'id' => $this->id.'_recent',
118 'subitems' => array(),
119 'html' => $this->menuItemObject($this->id.'_recent','
120 fetched: false,
121 onActivate: function() {
122 // if (!this.fetched) {
123 //Element.update("'.$this->id.'_recent-layer","asdfasdf");
124 getElementContent("'.$this->id.'_recent-layer", 0, "logomenu.php?cmd=recent")
125 this.fetched = true;
126 // }
127 }
128 ')
129 ),
130 array(
131 'title' => '--div--'
132 ),
133 array(
134 'title' => 'View frontend',
135 'xurl' => t3lib_div::getIndpEnv('TYPO3_SITE_URL')
136 ),
137 array(
138 'title' => 'Log out',
139 'onclick' => "top.document.location='logout.php';"
140 ),
141 );
142
143 echo $this->menuLayer($menuItems);
144 break;
145 case 'recent':
146
147 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
148 'sys_log.*, MAX(sys_log.tstamp) AS tstamp_MAX',
149 'sys_log,pages',
150 'pages.uid=sys_log.event_pid AND sys_log.userid='.intval($GLOBALS['BE_USER']->user['uid']).
151 ' AND sys_log.event_pid>0 AND sys_log.type=1 AND sys_log.action=2 AND sys_log.error=0',
152 'tablename,recuid',
153 'tstamp_MAX DESC',
154 20
155 );
156
157 $items = array();
158
159 while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
160 $elRow = t3lib_BEfunc::getRecord($row['tablename'],$row['recuid']);
161 if (is_array($elRow)) {
162 $items[] = array(
163 'title' => t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle($row['tablename'], $elRow), $GLOBALS['BE_USER']->uc['titleLen']) . ' - ' . t3lib_BEfunc::calcAge($GLOBALS['EXEC_TIME'] - $row['tstamp_MAX']),
164 'icon' => array(t3lib_iconworks::getIcon($row['tablename'],$elRow),'width="18" height="16"'),
165 'onclick' => 'content.'.t3lib_BEfunc::editOnClick('&edit['.$row['tablename'].']['.$row['recuid'].']=edit','','dummy.php')
166 );
167 }
168 }
169
170 echo $this->menuItems($items);
171 break;
172 }
173 }
174 }
175
176
177 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/logomenu.php']) {
178 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/logomenu.php']);
179 }
180
181
182
183 // Make instance:
184 $SOBE = t3lib_div::makeInstance('SC_logomenu');
185 $SOBE->main();
186
187 ?>