2 /***************************************************************
5 * (c) 1999-2003 Kasper Skaarhoj (kasper@typo3.com)
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.
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.
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.
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
30 * The script is called in the top frame of the backend typically by a click on an icon for which a context menu should appear.
31 * Either this script displays the context menu horizontally in the top frame or alternatively (default in MSIE, Mozilla) it writes the output to a <div>-layer in the calling document (which then appears as a layer/context sensitive menu)
32 * Writing content back into a <div>-layer is necessary if we want individualized context menus with any specific content for any specific element.
33 * Context menus can appear for either database elements or files
34 * The input to this script is basically the "&init" var which is divided by "|" - each part is a reference to table|uid|listframe-flag.
36 * If you want to integrate a context menu in your scripts, please see template::getContextMenuCode()
39 * Revised for TYPO3 3.6 2/2003 by Kasper Skaarhoj
42 * @author Kasper Skaarhoj <kasper@typo3.com>
45 * [CLASS/FUNCTION INDEX of SCRIPT]
49 * 123: class clickMenu
50 * 154: function init($item)
51 * 194: function doDisplayTopFrameCM()
54 * 222: function printDBClickMenu($table,$uid)
55 * 309: function printNewDBLevel($table,$uid)
56 * 346: function externalProcessingOfDBMenuItems($menuItems)
57 * 358: function processingByExtClassArray($menuItems,$table,$uid)
58 * 377: function urlRefForCM($url,$retUrl='',$hideCM=1)
59 * 394: function DB_copycut($table,$uid,$type)
60 * 417: function DB_paste($table,$uid,$type,$elInfo)
61 * 438: function DB_info($table,$uid)
62 * 454: function DB_history($table,$uid)
63 * 473: function DB_perms($table,$uid,$rec)
64 * 492: function DB_db_list($table,$uid,$rec)
65 * 511: function DB_moveWizard($table,$uid,$rec)
66 * 532: function DB_newWizard($table,$uid,$rec)
67 * 550: function DB_editAccess($table,$uid)
68 * 568: function DB_editPageHeader($uid)
69 * 586: function DB_edit($table,$uid)
70 * 625: function DB_new($table,$uid)
71 * 650: function DB_hideUnhide($table,$rec,$hideField)
72 * 674: function DB_delete($table,$uid,$elInfo)
73 * 695: function DB_view($id,$anchor='')
76 * 724: function printFileClickMenu($path)
77 * 788: function externalProcessingOfFileMenuItems($menuItems)
78 * 802: function FILE_launch($path,$script,$type,$image)
79 * 821: function FILE_copycut($path,$type)
80 * 841: function FILE_delete($path)
81 * 863: function FILE_paste($path,$target,$elInfo)
84 * 903: function printItems($menuItems,$item)
85 * 945: function printLayerJScode($menuItems)
86 * 980: function wrapColorTableCM($str)
87 * 995: function menuItemsForTopFrame($menuItems)
88 * 1012: function menuItemsForClickMenu($menuItems)
89 * 1047: function linkItem($str,$icon,$onClick,$onlyCM=0,$dontHide=0)
90 * 1071: function excludeIcon($iconCode)
91 * 1081: function label($label)
92 * 1090: function isCMlayers()
93 * 1100: function frameLocation($str)
96 * 1125: class SC_alt_clickmenu
97 * 1143: function init()
98 * 1226: function main()
99 * 1266: function printContent()
101 * TOTAL FUNCTIONS: 41
102 * (This index is automatically created/updated by the extension "extdeveval")
107 require ('init.php');
108 require ('template.php');
109 require_once (PATH_t3lib
.'class.t3lib_clipboard.php');
110 $LANG->includeLLFile('EXT:lang/locallang_misc.php');
116 * Class for generating the click menu
118 * @author Kasper Skaarhoj <kasper@typo3.com>
125 // Internal, static: GPvar:
126 var $cmLevel=0; // Defines if the click menu is first level or second. Second means the click menu is triggered from another menu.
127 var $CB; // Clipboard array (submitted by eg. pressing the paste button)
130 var $backPath=''; // Backpath for scripts/images.
131 var $listFrame=0; // If set, the calling document should be in the listframe of a frameset.
132 var $isDBmenu=0; // If set, the menu is about database records, not files. (set if part 2 [1] of the item-var is NOT blank)
133 var $alwaysContentFrame=0; // If true, the "content" frame is always used for reference (when condensed mode is enabled)
134 var $iParts=array(); // Stores the parts of the input $item string, splitted by "|"
135 var $disabledItems=array(); // Contains list of keywords of items to disable in the menu
136 var $dontDisplayTopFrameCM=0; // If true, the context sensitive menu will not appear in the top frame, only as a layer.
137 var $leftIcons=0; // If true, Show icons on the left.
138 var $extClassArray=array(); // Array of classes to be used for user processing of the menu content. This is for the API of adding items to the menu from outside.
140 // Internal, dynamic:
141 var $elCount=0; // Counter for elements in the menu. Used to number the name / id of the mouse-over icon.
142 var $editPageIconSet=0; // Set, when edit icon is drawn.
143 var $editOK=0; // Set to true, if editing of the element is OK.
149 * Initialize click menu
151 * @param string Input "item" GET var.
152 * @return string The clickmenu HTML content
154 function init($item) {
157 $this->cmLevel
= intval(t3lib_div
::GPvar('cmLevel'));
158 $this->CB
= t3lib_div
::GPvar('CB');
161 // Explode the incoming command:
162 $this->iParts
= explode('|',$item);
165 if ($this->iParts
[2]) $this->listFrame
=1;
166 if ($GLOBALS['BE_USER']->uc
['condensedMode']) $this->alwaysContentFrame
=1;
167 if (strcmp($this->iParts
[1],'')) $this->isDBmenu
=1;
169 $TSkey =($this->isDBmenu?
'page':'folder').($this->listFrame?
'List':'Tree');
170 $this->disabledItems
= t3lib_div
::trimExplode(',',$GLOBALS['BE_USER']->getTSConfigVal('options.contextMenu.'.$TSkey.'.disableItems'),1);
171 $this->leftIcons
= $GLOBALS['BE_USER']->getTSConfigVal('options.contextMenu.options.leftIcons');
173 // &cmLevel flag detected (2nd level menu)
174 if (!$this->cmLevel
) {
175 // Make 1st level clickmenu:
176 if ($this->isDBmenu
) {
177 return $this->printDBClickMenu($this->iParts
[0],$this->iParts
[1]);
179 return $this->printFileClickMenu($this->iParts
[0]);
182 // Make 2nd level clickmenu (only for DBmenus)
183 if ($this->isDBmenu
) {
184 return $this->printNewDBLevel($this->iParts
[0],$this->iParts
[1]);
190 * Returns true if the menu should (also?) be displayed in topframe, not just <div>-layers
194 function doDisplayTopFrameCM() {
195 return !$GLOBALS['SOBE']->doc
->isCMlayers() ||
!$this->dontDisplayTopFrameCM
;
209 /***************************************
213 ***************************************/
216 * Make 1st level clickmenu:
218 * @param string Table name
219 * @param integer UID for the current record.
220 * @return string HTML content
222 function printDBClickMenu($table,$uid) {
223 global $TCA, $BE_USER;
226 $this->rec
= t3lib_BEfunc
::getRecord($table,$uid);
229 if ($table=='pages' && !strcmp($uid,'0')) { // Rootlevel
233 // If record found (or root), go ahead and fill the $menuItems array which will contain data for the elements to render.
234 if (is_array($this->rec
) ||
$root) {
236 $lCP = $BE_USER->calcPerms(t3lib_BEfunc
::getRecord('pages',($table=='pages'?
$this->rec
['uid']:$this->rec
['pid'])));
239 if (!in_array('view',$this->disabledItems
)) {
240 if ($table=='pages') $menuItems['view']=$this->DB_view($uid);
241 if ($table==$GLOBALS['TYPO3_CONF_VARS']['SYS']['contentTable']) $menuItems['view']=$this->DB_view($this->rec
['pid'],'#'.$uid);
245 if(!$root && ($BE_USER->isPSet($lCP,$table,'edit')||
$BE_USER->isPSet($lCP,$table,'editcontent'))) {
246 if (!in_array('edit',$this->disabledItems
)) $menuItems['edit']=$this->DB_edit($table,$uid);
251 if (!in_array('new',$this->disabledItems
) && $BE_USER->isPSet($lCP,$table,'new')) $menuItems['new']=$this->DB_new($table,$uid);
254 if(!in_array('info',$this->disabledItems
) && !$root) $menuItems['info']=$this->DB_info($table,$uid);
256 $menuItems[]='spacer';
259 if(!in_array('copy',$this->disabledItems
) && !$root) $menuItems['copy']=$this->DB_copycut($table,$uid,'copy');
261 if(!in_array('cut',$this->disabledItems
) && !$root) $menuItems['cut']=$this->DB_copycut($table,$uid,'cut');
264 $elFromAllTables = count($this->clipObj
->elFromTable(''));
265 if (!in_array('paste',$this->disabledItems
) && $elFromAllTables) {
266 $selItem = $this->clipObj
->getSelectedRecord();
268 $selItem['_RECORD_TITLE'],
269 ($root?
$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']:t3lib_div
::fixed_lgd(t3lib_BEfunc
::getRecordTitle($table,$this->rec
),$GLOBALS['BE_USER']->uc
['titleLen'])),
270 $this->clipObj
->currentMode()
272 if ($table=='pages' && ($lCP & 8)) {
273 if ($elFromAllTables) $menuItems['pasteinto']=$this->DB_paste('',$uid,'into',$elInfo);
276 $elFromTable = count($this->clipObj
->elFromTable($table));
277 if (!$root && $elFromTable && $TCA[$table]['ctrl']['sortby']) $menuItems['pasteafter']=$this->DB_paste($table,-$uid,'after',$elInfo);
281 $elInfo=array(t3lib_div
::fixed_lgd(t3lib_BEfunc
::getRecordTitle($table,$this->rec
),$GLOBALS['BE_USER']->uc
['titleLen']));
282 if(!in_array('delete',$this->disabledItems
) && !$root && $BE_USER->isPSet($lCP,$table,'delete')) {
283 $menuItems[]='spacer';
284 $menuItems['delete']=$this->DB_delete($table,$uid,$elInfo);
288 // Adding external elements to the menuItems array
289 $menuItems = $this->processingByExtClassArray($menuItems,$table,$uid);
291 // Processing by external functions?
292 $menuItems = $this->externalProcessingOfDBMenuItems($menuItems);
294 // Return the printed elements:
295 return $this->printItems($menuItems,
297 '<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/i/_icon_website.gif','width="18" height="16"').' class="absmiddle" alt="" />'.htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']):
298 t3lib_iconWorks
::getIconImage($table,$this->rec
,$this->backPath
,' class="absmiddle" title="'.htmlspecialchars(t3lib_BEfunc
::getRecordIconAltText($this->rec
,$table)).'"').t3lib_BEfunc
::getRecordTitle($table,$this->rec
,1)
303 * Make 2nd level clickmenu (only for DBmenus)
305 * @param string Table name
306 * @param integer UID for the current record.
307 * @return string HTML content
309 function printNewDBLevel($table,$uid) {
310 global $TCA, $BE_USER;
312 // Setting internal record to the table/uid :
313 $this->rec
= t3lib_BEfunc
::getRecord($table,$uid);
316 if ($table=='pages' && !strcmp($uid,'0')) { // Rootlevel
320 // If record was found, check permissions and get menu items.
321 if (is_array($this->rec
) ||
$root) {
322 $lCP = $BE_USER->calcPerms(t3lib_BEfunc
::getRecord('pages',($table=='pages'?
$this->rec
['uid']:$this->rec
['pid'])));
324 if(!$root && ($BE_USER->isPSet($lCP,$table,'edit')||
$BE_USER->isPSet($lCP,$table,'editcontent'))) {
328 $menuItems = $this->processingByExtClassArray($menuItems,$table,$uid);
331 // Return the printed elements:
332 if (!is_array($menuItems)) $menuItems=array();
333 return $this->printItems($menuItems,
335 '<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/i/_icon_website.gif','width="18" height="16"').' class="absmiddle" alt="" />'.htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']):
336 t3lib_iconWorks
::getIconImage($table,$this->rec
,$this->backPath
,' class="absmiddle" title="'.htmlspecialchars(t3lib_BEfunc
::getRecordIconAltText($this->rec
,$table)).'"').t3lib_BEfunc
::getRecordTitle($table,$this->rec
,1)
341 * Processing the $menuItems array (for extension classes) (DATABASE RECORDS)
343 * @param array $menuItems array for manipulation.
344 * @return array Processed $menuItems array
346 function externalProcessingOfDBMenuItems($menuItems) {
351 * Processing the $menuItems array by external classes (typ. adding items)
353 * @param array $menuItems array for manipulation.
354 * @param string Table name
355 * @param integer UID for the current record.
356 * @return array Processed $menuItems array
358 function processingByExtClassArray($menuItems,$table,$uid) {
359 if (is_array($this->extClassArray
)) {
360 reset($this->extClassArray
);
361 while(list(,$conf)=each($this->extClassArray
)) {
362 $obj=t3lib_div
::makeInstance($conf['name']);
363 $menuItems = $obj->main($this,$menuItems,$table,$uid);
370 * Returning JavaScript for the onClick event linking to the input URL.
372 * @param string The URL relative to TYPO3_mainDir
373 * @param string The return_url-parameter
374 * @param boolean If set, the "hideCM()" will be called
375 * @return string JavaScript for an onClick event.
377 function urlRefForCM($url,$retUrl='',$hideCM=1) {
378 $loc='top.content'.($this->listFrame
&& !$this->alwaysContentFrame ?
'.list_frame':'');
379 $editOnClick='var docRef=(top.content.list_frame)?top.content.list_frame:'.$loc.'; docRef.document.location=top.TS.PATH_typo3+\''.$url.'\''.
380 ($retUrl?
"+'&".$retUrl."='+top.rawurlencode(".$this->frameLocation('docRef.document').')':'').';'.
381 ($hideCM?
'return hideCM();':'');
386 * Adding CM element for Clipboard "copy" and "cut"
388 * @param string Table name
389 * @param integer UID for the current record.
390 * @param string Type: "copy" or "cut"
391 * @return array Item array, element in $menuItems
394 function DB_copycut($table,$uid,$type) {
395 if ($this->clipObj
->current
=='normal') {
396 $isSel = $this->clipObj
->isSelected($table,$uid);
398 return $this->linkItem(
400 $this->excludeIcon('<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/clip_'.$type.($isSel==$type?
'_h':'').'.gif','width="12" height="12"').' alt="" />'),
401 "top.loadTopMenu('".$this->clipObj
->selUrlDB($table,$uid,($type=='copy'?
1:0),($isSel==$type))."');return false;"
406 * Adding CM element for Clipboard "paste into"/"paste after"
407 * NOTICE: $table and $uid should follow the special syntax for paste, see clipboard-class :: pasteUrl();
409 * @param string Table name
410 * @param integer UID for the current record. NOTICE: Special syntax!
411 * @param string Type: "into" or "after"
412 * @param array Contains instructions about whether to copy or cut an element.
413 * @return array Item array, element in $menuItems
414 * @see t3lib_clipboard::pasteUrl()
417 function DB_paste($table,$uid,$type,$elInfo) {
419 $loc='top.content'.($this->listFrame
&& !$this->alwaysContentFrame ?
'.list_frame':'');
420 $conf=$loc.' && confirm('.$GLOBALS['LANG']->JScharCode(sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:mess.'.($elInfo[2]=='copy'?
'copy':'move').'_'.$type),$elInfo[0],$elInfo[1])).')';
421 $editOnClick='if('.$conf.'){'.$loc.'.document.location=top.TS.PATH_typo3+\''.$this->clipObj
->pasteUrl($table,$uid,0).'&redirect=\'+top.rawurlencode('.$this->frameLocation($loc.'.document').'); hideCM();}';
423 return $this->linkItem(
424 $this->label('paste'.$type),
425 $this->excludeIcon('<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/clip_paste'.$type.'.gif','width="12" height="12"').' alt="" />'),
426 $editOnClick.'return false;'
431 * Adding CM element for Info
433 * @param string Table name
434 * @param integer UID for the current record.
435 * @return array Item array, element in $menuItems
438 function DB_info($table,$uid) {
439 return $this->linkItem(
440 $this->label('info'),
441 $this->excludeIcon('<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/zoom2.gif','width="12" height="12"').' alt="" />'),
442 "top.launchView('".$table."', '".$uid."'); return hideCM();"
447 * Adding CM element for History
449 * @param string Table name
450 * @param integer UID for the current record.
451 * @return array Item array, element in $menuItems
454 function DB_history($table,$uid) {
455 $url = 'show_rechis.php?element='.rawurlencode($table.':'.$uid);
456 return $this->linkItem(
457 $GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLL('CM_history')),
458 $this->excludeIcon('<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/history2.gif','width="13" height="12"').' alt="" />'),
459 $this->urlRefForCM($url,'returnUrl'),
465 * Adding CM element for Permission setting
467 * @param string Table name
468 * @param integer UID for the current record.
469 * @param array The "pages" record with "perms_*" fields inside.
470 * @return array Item array, element in $menuItems
473 function DB_perms($table,$uid,$rec) {
474 $url = 'mod/web/perm/index.php?id='.$uid.($rec['perms_userid']==$GLOBALS['BE_USER']->user
['uid']||
$GLOBALS['BE_USER']->isAdmin()?
'&return_id='.$uid.'&edit=1':'');
475 return $this->linkItem(
476 $GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLL('CM_perms')),
477 $this->excludeIcon('<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/perm.gif','width="7" height="12"').' alt="" />'),
478 $this->urlRefForCM($url),
484 * Adding CM element for DBlist
486 * @param string Table name
487 * @param integer UID for the current record.
488 * @param array Record of the element (needs "pid" field if not pages-record)
489 * @return array Item array, element in $menuItems
492 function DB_db_list($table,$uid,$rec) {
493 $url = t3lib_div
::getIndpEnv('TYPO3_REQUEST_DIR').'db_list.php?table='.($table=='pages'?
'':$table).'&id='.($table=='pages'?
$uid:$rec['pid']);
494 return $this->linkItem(
495 $GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLL('CM_db_list')),
496 $this->excludeIcon('<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/list.gif','width="11" height="11"').' alt="" />'),
497 "top.nextLoadModuleUrl='".$url."';top.goToModule('web_list',1);",
503 * Adding CM element for Moving wizard
505 * @param string Table name
506 * @param integer UID for the current record.
507 * @param array Record. Needed for tt-content elements which will have the sys_language_uid sent
508 * @return array Item array, element in $menuItems
511 function DB_moveWizard($table,$uid,$rec) {
512 $url = 'move_el.php?table='.$table.'&uid='.$uid.
513 ($table=='tt_content'?
'&sys_language_uid='.intval($rec['sys_language_uid']):''); // Hardcoded field for tt_content elements.
515 return $this->linkItem(
516 $GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLL('CM_moveWizard'.($table=='pages'?
'_page':''))),
517 $this->excludeIcon('<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/move_'.($table=='pages'?
'page':'record').'.gif','width="11" height="12"').' alt="" />'),
518 $this->urlRefForCM($url,'returnUrl'),
524 * Adding CM element for Create new wizard (either db_new.php or sysext/cms/layout/db_new_content_el.php)
526 * @param string Table name
527 * @param integer UID for the current record.
528 * @param array Record.
529 * @return array Item array, element in $menuItems
532 function DB_newWizard($table,$uid,$rec) {
533 $url = ($table=='pages' ||
!t3lib_extMgm
::isLoaded('cms')) ?
'db_new.php?id='.$uid.'&pagesOnly=1' : 'sysext/cms/layout/db_new_content_el.php?id='.$rec['pid'].'&sys_language_uid='.intval($rec['sys_language_uid']);
534 return $this->linkItem(
535 $GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLL('CM_newWizard')),
536 $this->excludeIcon('<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/new_'.($table=='pages'?
'page':'record').'.gif','width="'.($table=='pages'?
'13':'16').'" height="12"').' alt="" />'),
537 $this->urlRefForCM($url,'returnUrl'),
543 * Adding CM element for Editing of the access related fields of a table (disable, starttime, endtime, fe_groups)
545 * @param string Table name
546 * @param integer UID for the current record.
547 * @return array Item array, element in $menuItems
550 function DB_editAccess($table,$uid) {
551 $addParam='&columnsOnly='.implode(',',$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']);
552 $url = 'alt_doc.php?edit['.$table.']['.$uid.']=edit'.$addParam;
553 return $this->linkItem(
554 $GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLL('CM_editAccess')),
555 $this->excludeIcon('<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/editaccess.gif','width="12" height="12"').' alt="" />'),
556 $this->urlRefForCM($url,'returnUrl'),
557 1 // no top frame CM!
562 * Adding CM element for edit page header
564 * @param integer page uid to edit (PID)
565 * @return array Item array, element in $menuItems
568 function DB_editPageHeader($uid) {
569 $url = 'alt_doc.php?edit[pages]['.$uid.']=edit';
570 return $this->linkItem(
571 $GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->getLL('CM_editPageHeader')),
572 $this->excludeIcon('<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/edit2.gif','width="11" height="12"').' alt="" />'),
573 $this->urlRefForCM($url,'returnUrl'),
574 1 // no top frame CM!
579 * Adding CM element for regular editing of the element!
581 * @param string Table name
582 * @param integer UID for the current record.
583 * @return array Item array, element in $menuItems
586 function DB_edit($table,$uid) {
588 // If another module was specified, replace the default Page module with the new one
589 $newPageModule = trim($GLOBALS['BE_USER']->getTSConfigVal('options.overridePageModule'));
590 $pageModule = t3lib_BEfunc
::isModuleSetInTBE_MODULES($newPageModule) ?
$newPageModule : 'web_layout';
593 $loc='top.content'.($this->listFrame
&& !$this->alwaysContentFrame ?
'.list_frame':'');
595 $theIcon = t3lib_iconWorks
::skinImg($this->backPath
,'gfx/edit2.gif','width="11" height="12"');
597 $this->iParts
[0]=='pages' &&
599 $GLOBALS['BE_USER']->check('modules', $pageModule)
601 $theIcon = t3lib_iconWorks
::skinImg($this->backPath
,'gfx/edit_page.gif','width="12" height="12"');
602 $this->editPageIconSet
=1;
603 if ($BE_USER->uc
['classicPageEditMode'] ||
!t3lib_extMgm
::isLoaded('cms')) {
604 $addParam='&editRegularContentFromId='.intval($this->iParts
[1]);
606 $editOnClick="top.fsMod.recentIds['web']=".intval($this->iParts
[1]).";top.goToModule('".$pageModule."',1);";
610 $editOnClick="if(".$loc."){".$loc.".document.location=top.TS.PATH_typo3+'alt_doc.php?returnUrl='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'&edit[".$table."][".$uid."]=edit".$addParam."';}";
613 return $this->linkItem(
614 $this->label('edit'),
615 $this->excludeIcon('<img'.$theIcon.' alt="" />'),
616 $editOnClick.'return hideCM();'
621 * Adding CM element for regular Create new element
623 * @param string Table name
624 * @param integer UID for the current record.
625 * @return array Item array, element in $menuItems
628 function DB_new($table,$uid) {
630 $loc='top.content'.(!$this->alwaysContentFrame?
'.list_frame':'');
631 $editOnClick='if('.$loc.'){'.$loc.".document.location=top.TS.PATH_typo3+'".
633 $this->backPath
."alt_doc.php?returnUrl='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'&edit[".$table."][-".$uid."]=new'":
634 $this->backPath
.'db_new.php?id='.intval($uid)."'").
637 return $this->linkItem(
639 $this->excludeIcon('<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/new_'.($table=='pages'&&$this->listFrame?
'page':'el').'.gif','width="'.($table=='pages'?
'13':'11').'" height="12"').' alt="" />'),
640 $editOnClick.'return hideCM();'
645 * Adding CM element for hide/unhide of the input record
647 * @param string Table name
648 * @param array Record array
649 * @param string Name of the hide field
650 * @return array Item array, element in $menuItems
653 function DB_hideUnhide($table,$rec,$hideField) {
656 $loc='top.content'.($this->listFrame
&& !$this->alwaysContentFrame ?
'.list_frame':'');
657 $editOnClick='if('.$loc.'){'.$loc.".document.location=top.TS.PATH_typo3+'tce_db.php?redirect='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'".
658 "&data[".$table.']['.$uid.']['.$hideField.']='.($rec[$hideField]?
0:1).'&prErr=1&vC='.$GLOBALS['BE_USER']->veriCode()."';hideCM();}";
660 return $this->linkItem(
661 $this->label(($rec[$hideField]?
'un':'').'hide'),
662 $this->excludeIcon('<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/button_'.($rec[$hideField]?
'un':'').'hide.gif','width="11" height="10"').' alt="" />'),
663 $editOnClick.'return false;',
669 * Adding CM element for Delete
671 * @param string Table name
672 * @param integer UID for the current record.
673 * @param array Label for including in the confirmation message, EXT:lang/locallang_core.php:mess.delete
674 * @return array Item array, element in $menuItems
677 function DB_delete($table,$uid,$elInfo) {
679 $loc='top.content'.($this->listFrame
&& !$this->alwaysContentFrame ?
'.list_frame':'');
680 $editOnClick='if('.$loc." && confirm(".$GLOBALS['LANG']->JScharCode(sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:mess.delete'),$elInfo[0])).")){".$loc.".document.location=top.TS.PATH_typo3+'tce_db.php?redirect='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'".
681 "&cmd[".$table.']['.$uid.'][delete]=1&prErr=1&vC='.$GLOBALS['BE_USER']->veriCode()."';hideCM();}";
683 return $this->linkItem(
684 $this->label('delete'),
685 $this->excludeIcon('<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/garbage.gif','width="11" height="12"').' alt="" />'),
686 $editOnClick.'return false;'
691 * Adding CM element for View Page
693 * @param integer Page uid (PID)
694 * @param string Anchor, if any
695 * @return array Item array, element in $menuItems
698 function DB_view($id,$anchor='') {
699 return $this->linkItem(
700 $this->label('view'),
701 $this->excludeIcon('<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/zoom.gif','width="12" height="12"').' alt="" />'),
702 t3lib_BEfunc
::viewOnClick($id,$this->backPath
,t3lib_BEfunc
::BEgetRootLine($id),$anchor).'return hideCM();'
715 /***************************************
719 ***************************************/
722 * Make 1st level clickmenu:
724 * @param string The absolute path
725 * @return string HTML content
727 function printFileClickMenu($path) {
730 if (@file_exists
($path) && t3lib_div
::isAllowedAbsPath($path)) {
731 $fI = pathinfo($path);
732 $icon = is_dir($path) ?
'folder.gif' : t3lib_BEfunc
::getFileIcon(strtolower($fI['extension']));
733 $size=' ('.t3lib_div
::formatSize(filesize($path)).'bytes)';
734 $icon = '<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/fileicons/'.$icon,'width="18" height="16"').' class="absmiddle" title="'.htmlspecialchars($fI['basename'].$size).'" alt="" />';
737 if (!in_array('edit',$this->disabledItems
) && is_file($path) && t3lib_div
::inList($GLOBALS['TYPO3_CONF_VARS']['SYS']['textfile_ext'],$fI['extension'])) $menuItems['edit']=$this->FILE_launch($path,'file_edit.php','edit','edit_file.gif');
739 if (!in_array('rename',$this->disabledItems
)) $menuItems['rename']=$this->FILE_launch($path,'file_rename.php','rename','rename.gif');
741 if (!in_array('upload',$this->disabledItems
) && is_dir($path)) $menuItems['upload']=$this->FILE_launch($path,'file_upload.php','upload','upload.gif');
743 if (!in_array('new',$this->disabledItems
) && is_dir($path)) $menuItems['new']=$this->FILE_launch($path,'file_newfolder.php','new','new_file.gif');
745 if (!in_array('info',$this->disabledItems
)) $menuItems['info']=$this->DB_info($path,'');
747 $menuItems[]='spacer';
750 if (!in_array('copy',$this->disabledItems
)) $menuItems['copy']=$this->FILE_copycut($path,'copy');
752 if (!in_array('cut',$this->disabledItems
)) $menuItems['cut']=$this->FILE_copycut($path,'cut');
755 $elFromAllTables = count($this->clipObj
->elFromTable('_FILE'));
756 if (!in_array('paste',$this->disabledItems
) && $elFromAllTables && is_dir($path)) {
757 $elArr = $this->clipObj
->elFromTable('_FILE');
759 $selItem = current($elArr);
763 $this->clipObj
->currentMode()
765 $menuItems['pasteinto']=$this->FILE_paste($path,$selItem,$elInfo);
768 $menuItems[]='spacer';
771 if (!in_array('delete',$this->disabledItems
)) $menuItems['delete']=$this->FILE_delete($path);
774 // Adding external elements to the menuItems array
775 $menuItems = $this->processingByExtClassArray($menuItems,$path,0);
777 // Processing by external functions?
778 $menuItems = $this->externalProcessingOfFileMenuItems($menuItems);
780 // Return the printed elements:
781 return $this->printItems($menuItems,$icon.basename($path));
786 * Processing the $menuItems array (for extension classes) (FILES)
788 * @param array $menuItems array for manipulation.
789 * @return array Processed $menuItems array
791 function externalProcessingOfFileMenuItems($menuItems) {
796 * Multi-function for adding an entry to the $menuItems array
798 * @param string Path to the file/directory (target)
799 * @param string Script (eg. file_edit.php) to pass &target= to
800 * @param string "type" is the code which fetches the correct label for the element from "cm."
801 * @param string icon image-filename from "gfx/" (12x12 icon)
802 * @return array Item array, element in $menuItems
805 function FILE_launch($path,$script,$type,$image) {
806 $loc='top.content'.(!$this->alwaysContentFrame?
'.list_frame':'');
807 $editOnClick='if('.$loc.'){'.$loc.".document.location=top.TS.PATH_typo3+'".$script.'?target='.rawurlencode($path)."';}";
809 return $this->linkItem(
811 $this->excludeIcon('<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/'.$image,'width="12" height="12"').' alt="" />'),
812 $editOnClick.'return hideCM();'
817 * Returns element for copy or cut of files.
819 * @param string Path to the file/directory (target)
820 * @param string Type: "copy" or "cut"
821 * @return array Item array, element in $menuItems
824 function FILE_copycut($path,$type) {
825 $table='_FILE'; // Pseudo table name for use in the clipboard.
826 $uid = t3lib_div
::shortmd5($path);
827 if ($this->clipObj
->current
=='normal') {
828 $isSel = $this->clipObj
->isSelected($table,$uid);
830 return $this->linkItem(
832 $this->excludeIcon('<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/clip_'.$type.($isSel==$type?
'_h':'').'.gif','width="12" height="12"').' alt="" />'),
833 "top.loadTopMenu('".$this->clipObj
->selUrlFile($path,($type=='copy'?
1:0),($isSel==$type))."');return false;"
838 * Creates element for deleting of target
840 * @param string Path to the file/directory (target)
841 * @return array Item array, element in $menuItems
844 function FILE_delete($path) {
846 $loc='top.content'.($this->listFrame
&& !$this->alwaysContentFrame ?
'.list_frame':'');
847 $editOnClick='if('.$loc." && confirm(".$GLOBALS['LANG']->JScharCode(sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:mess.delete'),basename($path))).")){".$loc.".document.location=top.TS.PATH_typo3+'tce_file.php?redirect='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'".
848 "&file[delete][0][data]=".rawurlencode($path).'&vC='.$GLOBALS['BE_USER']->veriCode()."';hideCM();}";
850 return $this->linkItem(
851 $this->label('delete'),
852 $this->excludeIcon('<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/garbage.gif','width="11" height="12"').' alt="" />'),
853 $editOnClick.'return false;'
858 * Creates element for pasting files.
860 * @param string Path to the file/directory (target)
861 * @param string target - NOT USED.
862 * @param array Various values for the labels.
863 * @return array Item array, element in $menuItems
866 function FILE_paste($path,$target,$elInfo) {
868 $loc='top.content'.($this->listFrame
&& !$this->alwaysContentFrame ?
'.list_frame':'');
869 $conf=$loc." && confirm(".$GLOBALS['LANG']->JScharCode(sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:mess'.($elInfo[2]=='copy'?
'copy':'move').'_into'),$elInfo[0],$elInfo[1])).")";
870 $editOnClick='if('.$conf.'){'.$loc.".document.location=top.TS.PATH_typo3+'".$this->clipObj
->pasteUrl('_FILE',$path,0).
871 "&redirect='+top.rawurlencode(".$this->frameLocation($loc.'.document').'); hideCM();}';
873 return $this->linkItem(
874 $this->label('pasteinto'),
875 $this->excludeIcon('<img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/clip_pasteinto.gif','width="12" height="12"').' alt="" />'),
876 $editOnClick.'return false;'
892 /***************************************
896 **************************************/
899 * Prints the items from input $menuItems array - both as topframe menu AND the JS section for writing to the div-layers.
900 * Of course the topframe menu will appear only if $this->doDisplayTopFrameCM() returns true
902 * @param array $menuItems array
903 * @param string HTML code for the element which was clicked - shown in the end of the horizontal menu in topframe after the close-button.
904 * @return string HTML code
906 function printItems($menuItems,$item) {
909 // Adding topframe part (horizontal clickmenu)
910 if ($this->doDisplayTopFrameCM()) {
914 Table, which contains the click menu when shown in the top frame of the backend:
916 <table border="0" cellpadding="0" cellspacing="0" id="typo3-CSM-top">
920 <td class="c-item">'.
922 <td><img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/acm_spacer2.gif','width="8" height="12"').' alt="" /></td>
923 <td class="c-item">',$this->menuItemsForTopFrame($menuItems)).
926 <!-- Close button: -->
927 <td class="c-closebutton"><a href="#" onclick="hideCM();return false;"><img'.t3lib_iconWorks
::skinImg($this->backPath
,'gfx/close_12h.gif','width="11" height="12"').' title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.close',1).'" alt="" /></a></td>
929 <!-- The item of the clickmenu: -->
930 <td class="c-itemicon">'.$item.'</td>
936 $out.=$this->printLayerJScode($menuItems);
938 // Return the content
943 * Create the JavaScript section
945 * @param array The $menuItems array to print
946 * @return string The JavaScript section which will print the content of the CM to the div-layer in the target frame.
948 function printLayerJScode($menuItems) {
950 if ($this->isCMlayers()) { // Clipboard must not be submitted - then it's probably a copy/cut situation.
951 $frameName = '.'.($this->listFrame ?
'list_frame' : 'nav_frame');
952 if ($this->alwaysContentFrame
) $frameName='';
954 // Create the table displayed in the clickmenu layer:
956 <table border="0" cellpadding="0" cellspacing="0" class="typo3-CSM bgColor4">
957 '.implode('',$this->menuItemsForClickMenu($menuItems)).'
960 // Wrap the inner table in another table to create outer border:
961 $CMtable = $this->wrapColorTableCM($CMtable);
963 // Create JavaScript section:
964 $script=$GLOBALS['TBE_TEMPLATE']->wrapScriptTags('
966 if (top.content && top.content'.$frameName.' && top.content'.$frameName.'.setLayerObj) {
967 top.content'.$frameName.'.setLayerObj(unescape("'.t3lib_div
::rawurlencodeJS($CMtable).'"),'.$this->cmLevel
.');
969 '.(!$this->doDisplayTopFrameCM()?
'hideCM();':'')
977 * Wrapping the input string in a table with background color 4 and a black border style.
978 * For the pop-up menu
980 * @param string HTML content to wrap in table.
983 function wrapColorTableCM($str) {
984 $str = '<table border="0" cellspacing="0" class="typo3-CSM-wrapperCM">
985 <tr><td class="c-aa">'.$str.'</td><td class="c-ab"></td></tr>
986 <tr><td class="c-ba"></td><td class="c-bb"></td></tr>
992 * Traverses the menuItems and generates an output array for implosion in the topframe horizontal menu
994 * @param array $menuItem array
995 * @param array Array with HTML content to be imploded between <td>-tags
996 * @return array Array of menu items for top frame.
998 function menuItemsForTopFrame($menuItems) {
1001 while(list(,$i)=each($menuItems)) {
1002 if ($i[4]==1 && !$GLOBALS['SOBE']->doc
->isCMlayers()) $i[4]=0; // IF the topbar is the ONLY means of the click menu, then items normally disabled from the top menu will appear anyways IF they are disabled with a "1" (2+ will still disallow them in the topbar)
1003 if (is_array($i) && !$i[4]) $out[]=$i[0];
1009 * Traverses the menuItems and generates an output array for implosion in the CM div-layers table.
1011 * @param array $menuItem array
1012 * @param array Array with HTML content to be imploded between <td>-tags
1013 * @return array array for implosion in the CM div-layers table.
1015 function menuItemsForClickMenu($menuItems) {
1018 while(list($cc,$i)=each($menuItems)) {
1019 if (is_string($i) && $i=='spacer') { // MAKE horizontal spacer
1021 <tr class="bgColor2">
1022 <td colspan="2"><img src="clear.gif" width="1" height="1" alt="" /></td>
1024 } else { // Just make normal element:
1026 $onClick=eregi_replace('return[[:space:]]+hideCM\(\)[[:space:]]*;','',$onClick);
1027 $onClick=eregi_replace('return[[:space:]]+false[[:space:]]*;','',$onClick);
1028 $onClick=eregi_replace('hideCM\(\);','',$onClick);
1029 if (!$i[5]) $onClick.='hideEmpty();';
1032 <tr class="typo3-CSM-itemRow" onclick="'.htmlspecialchars($onClick).'" onmouseover="this.bgColor=\''.$GLOBALS['TBE_TEMPLATE']->bgColor5
.'\';" onmouseout="this.bgColor=\'\';">
1033 '.(!$this->leftIcons?
'<td class="typo3-CSM-item">'.$i[1].'</td><td align="center">'.$i[2].'</td>' : '<td align="center">'.$i[2].'</td><td class="typo3-CSM-item">'.$i[1].'</td>').'
1041 * Creating an array with various elements for the clickmenu entry
1043 * @param string The label, htmlspecialchar'ed already
1044 * @param string <img>-tag for the icon
1045 * @param string JavaScript onclick event for label/icon
1046 * @param boolean ==1 and the element will NOT appear in clickmenus in the topframe (unless clickmenu is totally unavailable)! ==2 and the item will NEVER appear in top frame. (This is mostly for "less important" options since the top frame is not capable of holding so many elements horizontally)
1047 * @param boolean If set, the clickmenu layer will not hide itself onclick - used for secondary menus to appear...
1048 * @return array $menuItem entry with 6 numerical entries: [0] is the HTML for display of the element with link and icon an mouseover etc., [1]-[5] is simply the input params passed through!
1050 function linkItem($str,$icon,$onClick,$onlyCM=0,$dontHide=0) {
1053 $WHattribs = t3lib_iconWorks
::skinImg($BACK_PATH,'gfx/content_client.gif','width="7" height="10"',2);
1056 '<img src="clear.gif" '.$WHattribs.' class="c-roimg" name="roimg_'.$this->elCount
.'" alt="" />'.
1057 '<a href="#" onclick="'.htmlspecialchars($onClick).'" onmouseover="mo('.$this->elCount
.');" onmouseout="mout('.$this->elCount
.');">'.
1069 * Returns the input string IF not a user setting has disabled display of icons.
1071 * @param string The icon-image tag
1072 * @return string The icon-image tag prefixed with space char IF the icon should be printed at all due to user settings
1074 function excludeIcon($iconCode) {
1075 return ($GLOBALS['BE_USER']->uc
['noMenuMode'] && strcmp($GLOBALS['BE_USER']->uc
['noMenuMode'],'icons')) ?
'' : ' '.$iconCode;
1079 * Get label from locallang_core.php:cm.*
1081 * @param string The "cm."-suffix to get.
1084 function label($label) {
1085 return $GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:cm.'.$label,1));
1089 * Returns true if there should be writing to the div-layers (commands sent to clipboard MUST NOT write to div-layers)
1093 function isCMlayers() {
1094 return $GLOBALS['SOBE']->doc
->isCMlayers() && !$this->CB
;
1098 * Appends ".location" to input string
1100 * @param string Input string, probably a JavaScript document reference
1103 function frameLocation($str) {
1104 return $str.'.location';
1121 * Script Class for the Context Sensitive Menu in TYPO3 (rendered in top frame, normally writing content dynamically to list frames).
1123 * @author Kasper Skaarhoj <kasper@typo3.com>
1126 * @see template::getContextMenuCode()
1128 class SC_alt_clickmenu
{
1130 // Internal, static: GPvar:
1131 var $backPath; // Back path.
1132 var $item; // Definition of which item the click menu should be made for.
1135 var $content=''; // Content accumulation
1136 var $doc; // Template object
1137 var $include_once=array(); // Files to include_once() - set in init() function
1138 var $extClassArray=array(); // Internal array of classes for extending the clickmenu
1139 var $dontDisplayTopFrameCM=0; // If set, then the clickmenu will NOT display in the top frame.
1142 * Constructor function for script class.
1147 global $BE_USER,$BACK_PATH;
1150 $this->backPath
= t3lib_div
::GPvar('backPath');
1151 $this->item
= t3lib_div
::GPvar('item');
1153 // Setting pseudo module name
1154 $this->MCONF
['name']='xMOD_alt_clickmenu.php';
1156 // Takes the backPath as a parameter BUT since we are worried about someone forging a backPath (XSS security hole) we will check with sent md5 hash:
1157 $inputBP = explode('|',$this->backPath
);
1158 if (count($inputBP)==2 && $inputBP[1]==t3lib_div
::shortMD5($inputBP[0].'|'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'])) {
1159 $this->backPath
= $inputBP[0];
1161 $this->backPath
= $BACK_PATH;
1164 // Setting internal array of classes for extending the clickmenu:
1165 $this->extClassArray
= $GLOBALS['TBE_MODULES_EXT']['xMOD_alt_clickmenu']['extendCMclasses'];
1167 // Traversing that array and setting files for inclusion:
1168 if (is_array($this->extClassArray
)) {
1169 foreach($this->extClassArray
as $extClassConf) {
1170 if ($extClassConf['path']) $this->include_once[]=$extClassConf['path'];
1174 // Initialize template object
1175 $this->doc
= t3lib_div
::makeInstance('template');
1176 $this->doc
->docType
='xhtml_trans';
1177 $this->doc
->backPath
= $BACK_PATH;
1179 // Setting mode for display and background image in the top frame
1180 $this->dontDisplayTopFrameCM
= $this->doc
->isCMlayers() && !$GLOBALS['BE_USER']->getTSConfigVal('options.contextMenu.options.alwaysShowClickMenuInTopFrame');
1181 if ($this->dontDisplayTopFrameCM
) {
1182 $this->doc
->bodyTagId
.= '-notop';
1185 // Setting clickmenu timeout
1186 $secs = t3lib_div
::intInRange($BE_USER->getTSConfigVal('options.contextMenu.options.clickMenuTimeOut'),1,100,5); // default is 5
1188 // Setting the JavaScript controlling the timer on the page
1189 $this->doc
->JScode
.=$this->doc
->wrapScriptTags('
1190 var date = new Date();
1191 var mo_timeout = Math.floor(date.getTime()/1000);
1194 roImg.src = "'.t3lib_iconWorks
::skinImg($BACK_PATH,'gfx/content_client.gif','width="7" height="10"',1).'";
1196 routImg =new Image();
1197 routImg.src = "clear.gif";
1200 var name="roimg_"+c;
1201 document[name].src = roImg.src;
1204 function mout(c) { //
1205 var name="roimg_"+c;
1206 document[name].src = routImg.src;
1209 function updateTime() { //
1211 mo_timeout = Math.floor(date.getTime()/1000);
1213 function timeout_func() { //
1215 if (Math.floor(date.getTime()/1000)-mo_timeout > '.$secs.') {
1219 window.setTimeout("timeout_func();",1*1000);
1222 function hideCM() { //
1223 document.location="alt_topmenu_dummy.php";
1233 * Main function - generating the click menu in whatever form it has.
1238 global $HTTP_GET_VARS;
1240 // Initialize Clipboard object:
1241 $clipObj = t3lib_div
::makeInstance('t3lib_clipboard');
1242 $clipObj->initializeClipboard();
1243 $clipObj->lockToNormal(); // This locks the clipboard to the Normal for this request.
1245 // Update clipboard if some actions are sent.
1246 $CB = $HTTP_GET_VARS['CB'];
1247 $clipObj->setCmd($CB);
1248 $clipObj->cleanCurrent();
1249 $clipObj->endClipboard(); // Saves
1251 // Create clickmenu object
1252 $clickMenu = t3lib_div
::makeInstance('clickMenu');
1254 // Set internal vars in clickmenu object:
1255 $clickMenu->clipObj
= $clipObj;
1256 $clickMenu->extClassArray
= $this->extClassArray
;
1257 $clickMenu->dontDisplayTopFrameCM
= $this->dontDisplayTopFrameCM
;
1258 $clickMenu->backPath
= $this->backPath
;
1260 // Takes the backPath as a parameter BUT since we are worried about someone forging a backPath (XSS security hole) we will check with sent md5 hash:
1261 $inputBP = explode('|',$this->backPath
);
1262 if (count($inputBP)==2 && $inputBP[1]==md5($inputBP[0].'|'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'])) {
1263 $clickMenu->backPath
= $inputBP[0];
1267 $this->content
.=$this->doc
->startPage('Context Sensitive Menu');
1269 // Set content of the clickmenu with the incoming var, "item"
1270 $this->content
.= $clickMenu->init($this->item
);
1274 * End page and output content.
1278 function printContent() {
1279 $this->content
.= $this->doc
->endPage();
1280 echo $this->content
;
1284 // Include extension?
1285 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE
]['XCLASS']['typo3/alt_clickmenu.php']) {
1286 include_once($TYPO3_CONF_VARS[TYPO3_MODE
]['XCLASS']['typo3/alt_clickmenu.php']);
1299 $SOBE = t3lib_div
::makeInstance('SC_alt_clickmenu');
1303 foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);
1306 $SOBE->printContent();