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 if(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX) {
00029 require_once('interfaces/interface.backend_toolbaritem.php');
00030 require_once(PATH_t3lib.'class.t3lib_loadmodules.php');
00031
00032 $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_misc.xml');
00033
00034
00035 $loadModules = t3lib_div::makeInstance('t3lib_loadModules');
00036 $loadModules->load($GLOBALS['TBE_MODULES']);
00037 }
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 class ShortcutMenu implements backend_toolbarItem {
00050
00051 protected $shortcutGroups;
00052
00053
00054
00055
00056
00057
00058 protected $shortcuts;
00059
00060
00061
00062
00063
00064
00065
00066 protected $groupLabels;
00067
00068
00069
00070
00071
00072
00073 protected $backendReference;
00074
00075
00076
00077
00078
00079
00080
00081 public function __construct(TYPO3backend &$backendReference = null) {
00082 $this->backendReference = $backendReference;
00083 $this->shortcuts = array();
00084
00085
00086 $this->shortcutGroups = array(
00087 1 => '1',
00088 2 => '1',
00089 3 => '1',
00090 4 => '1',
00091 5 => '1',
00092 );
00093
00094 $this->shortcutGroups = $this->initShortcutGroups();
00095 $this->shortcuts = $this->initShortcuts();
00096 }
00097
00098
00099
00100
00101
00102
00103 public function checkAccess() {
00104
00105 return true;
00106 }
00107
00108
00109
00110
00111
00112
00113 public function render() {
00114 $title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:toolbarItems.shortcuts', true);
00115 $this->addJavascriptToBackend();
00116
00117 $shortcutMenu = array();
00118
00119 $shortcutMenu[] = '<a href="#" class="toolbar-item"><img'.t3lib_iconWorks::skinImg($this->backPath, 'gfx/toolbar_shortcut.png', 'width="16" height="16"').' title="'.$title.'" alt="'.$title.'" /></a>';
00120 $shortcutMenu[] = '<div class="toolbar-item-menu" style="display: none;">';
00121 $shortcutMenu[] = $this->renderMenu();
00122 $shortcutMenu[] = '</div>';
00123
00124 return implode("\n", $shortcutMenu);
00125 }
00126
00127
00128
00129
00130
00131
00132 public function renderMenu() {
00133
00134 $shortcutGroup = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:toolbarItems.shortcutsGroup', true);
00135 $shortcutEdit = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:toolbarItems.shortcutsEdit', true);
00136 $shortcutDelete = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:toolbarItems.shortcutsDelete', true);
00137
00138 $groupIcon = '<img'.t3lib_iconWorks::skinImg($this->backPath, 'gfx/i/sysf.gif', 'width="18" height="16"').' title="'.$shortcutGroup.'" alt="'.$shortcutGroup.'" />';
00139 $editIcon = '<img'.t3lib_iconWorks::skinImg($this->backPath, 'gfx/edit2.gif', 'width="11" height="12"').' title="'.$shortcutEdit.'" alt="'.$shortcutEdit.'"';
00140 $deleteIcon = '<img'.t3lib_iconWorks::skinImg($this->backPath, 'gfx/garbage.gif', 'width="11" height="12"').' title="'.$shortcutDelete.'" alt="'.$shortcutDelete.'" />';
00141
00142 $shortcutMenu[] = '<table border="0" cellspacing="0" cellpadding="0" class="shortcut-list">';
00143
00144
00145 $noGroupShortcuts = $this->getShortcutsByGroup(0);
00146 foreach($noGroupShortcuts as $shortcut) {
00147 $shortcutMenu[] = '
00148 <tr id="shortcut-'.$shortcut['raw']['uid'].'" class="shortcut">
00149 <td class="shortcut-icon">'.$shortcut['icon'].'</td>
00150 <td class="shortcut-label">
00151 <a id="shortcut-label-'.$shortcut['raw']['uid'].'" href="" onclick="'.$shortcut['action'].'">'.$shortcut['label'].'</a>
00152 </td>
00153 <td class="shortcut-edit">'.$editIcon.' id="shortcut-edit-'.$shortcut['raw']['uid'].'" /></td>
00154 <td class="shortcut-delete">'.$deleteIcon.'</td>
00155 </tr>';
00156 }
00157
00158
00159 $groups = $this->getGroupsFromShortcuts();
00160 krsort($groups, SORT_NUMERIC);
00161 foreach($groups as $groupId => $groupLabel) {
00162 if($groupId != 0 ) {
00163 $shortcutGroup = '
00164 <tr class="shortcut-group" id="shortcut-group-'.$groupId.'">
00165 <td class="shortcut-group-icon">'.$groupIcon.'</td>
00166 <td class="shortcut-group-label">'.$groupLabel.'</td>
00167 <td colspan="2"> </td>
00168 </tr>';
00169
00170 $shortcuts = $this->getShortcutsByGroup($groupId);
00171 $i = 0;
00172 foreach($shortcuts as $shortcut) {
00173 $i++;
00174
00175 $firstRow = '';
00176 if($i == 1) {
00177 $firstRow = ' first-row';
00178 }
00179
00180 $shortcutGroup .= '
00181 <tr id="shortcut-'.$shortcut['raw']['uid'].'" class="shortcut'.$firstRow.'">
00182 <td class="shortcut-icon">'.$shortcut['icon'].'</td>
00183 <td class="shortcut-label">
00184 <a id="shortcut-label-'.$shortcut['raw']['uid'].'" href="" onclick="'.$shortcut['action'].'">'.$shortcut['label'].'</a>
00185 </td>
00186 <td class="shortcut-edit">'.$editIcon.' id="shortcut-edit-'.$shortcut['raw']['uid'].'" /></td>
00187 <td class="shortcut-delete">'.$deleteIcon.'</td>
00188 </tr>';
00189 }
00190
00191 $shortcutMenu[] = $shortcutGroup;
00192 }
00193 }
00194
00195 if(count($shortcutMenu) == 1) {
00196
00197 $title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:toolbarItems.shortcuts', true);
00198 $icon = '<img'.t3lib_iconWorks::skinImg($backPath,'gfx/shortcut.gif','width="14" height="14"').' title="'.$title.'" alt="'.$title.'" />';
00199 $label = str_replace('%icon%', $icon, $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_misc.php:shortcutDescription'));
00200
00201 $shortcutMenu[] = '<tr><td style="padding:1px 2px; color: #838383;">'.$label.'</td></tr>';
00202 }
00203
00204 $shortcutMenu[] = '</table>';
00205
00206 $compiledShortcutMenu = implode("\n", $shortcutMenu);
00207
00208 return $compiledShortcutMenu;
00209 }
00210
00211
00212
00213
00214
00215
00216
00217
00218 public function renderAjax($params = array(), TYPO3AJAX &$ajaxObj = null) {
00219 $menuContent = $this->renderMenu();
00220
00221 $ajaxObj->addContent('shortcutMenu', $menuContent);
00222 }
00223
00224
00225
00226
00227
00228
00229 protected function addJavascriptToBackend() {
00230 $this->backendReference->addJavascriptFile('js/shortcutmenu.js');
00231 }
00232
00233
00234
00235
00236
00237
00238 public function getAdditionalAttributes() {
00239 return ' id="shortcut-menu"';
00240 }
00241
00242
00243
00244
00245
00246
00247 protected function initShortcuts() {
00248 $shortcuts = array();
00249 $globalGroups = $this->getGlobalShortcutGroups();
00250
00251 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
00252 '*',
00253 'sys_be_shortcuts',
00254 '((userid = '.$GLOBALS['BE_USER']->user['uid'].' AND sc_group>=0) OR sc_group IN ('.implode(',', array_keys($globalGroups)).'))',
00255 '',
00256 'sc_group,sorting'
00257 );
00258
00259
00260 while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
00261 $shortcut = array('raw' => $row);
00262 $moduleParts = explode('|', $row['module_name']);
00263 $row['module_name'] = $moduleParts[0];
00264 $row['M_module_name'] = $moduleParts[1];
00265 $moduleParts = explode('_', $row['M_module_name'] ?
00266 $row['M_module_name'] :
00267 $row['module_name']
00268 );
00269 $queryParts = parse_url($row['url']);
00270 $queryParameters = t3lib_div::explodeUrl2Array($queryParts['query'], 1);
00271
00272 if($row['module_name'] == 'xMOD_alt_doc.php' && is_array($queryParameters['edit'])) {
00273 $shortcut['table'] = key($queryParameters['edit']);
00274 $shortcut['recordid'] = key($queryParameters['edit'][$shortcut['table']]);
00275
00276 if($queryParameters['edit'][$shortcut['table']][$shortcut['recordid']] == 'edit') {
00277 $shortcut['type'] = 'edit';
00278 } elseif($queryParameters['edit'][$shortcut['table']][$shortcut['recordid']] == 'new') {
00279 $shortcut['type'] = 'new';
00280 }
00281
00282 if(substr($shortcut['recordid'], -1) == ',') {
00283 $shortcut['recordid'] = substr($shortcut['recordid'], 0, -1);
00284 }
00285 } else {
00286 $shortcut['type'] = 'other';
00287 }
00288
00289
00290 if(!$GLOBALS['BE_USER']->isAdmin()) {
00291 if(!isset($GLOBALS['LANG']->moduleLabels['tabs_images'][implode('_', $moduleParts).'_tab'])) {
00292
00293
00294 continue;
00295 }
00296
00297 $pageId = $this->getLinkedPageId($row['url']);
00298 if(t3lib_div::testInt($pageId)) {
00299
00300 if(!$GLOBALS['BE_USER']->isInWebMount($pageId)) {
00301 continue;
00302 }
00303
00304
00305 $pageRow = t3lib_BEfunc::getRecord('pages', $pageId);
00306 if(!$GLOBALS['BE_USER']->doesUserHaveAccess($pageRow, $perms = 1)) {
00307 continue;
00308 }
00309 }
00310 }
00311
00312 $shortcutGroup = $row['sc_group'];
00313 if($shortcutGroup && strcmp($lastGroup, $shortcutGroup) && ($shortcutGroup != -100)) {
00314 $shortcut['groupLabel'] = $this->getShortcutGroupLabel($shortcutGroup);
00315 }
00316
00317 if($row['description']) {
00318 $shortcut['label'] = $row['description'];
00319 } else {
00320 $shortcut['label'] = t3lib_div::fixed_lgd(rawurldecode($queryParts['query']), 150);
00321 }
00322
00323 $shortcut['group'] = $shortcutGroup;
00324 $shortcut['icon'] = $this->getShortcutIcon($row, $shortcut);
00325 $shortcut['iconTitle'] = $this->getShortcutIconTitle($shortcutLabel, $row['module_name'], $row['M_module_name']);
00326 $shortcut['action'] = 'jump(unescape(\''.rawurlencode($row['url']).'\'),\''.implode('_',$moduleParts).'\',\''.$moduleParts[0].'\');';
00327
00328 $lastGroup = $row['sc_group'];
00329 $shortcuts[] = $shortcut;
00330 }
00331
00332 return $shortcuts;
00333 }
00334
00335
00336
00337
00338
00339
00340
00341 protected function getShortcutsByGroup($groupId) {
00342 $shortcuts = array();
00343
00344 foreach($this->shortcuts as $shortcut) {
00345 if($shortcut['group'] == $groupId) {
00346 $shortcuts[] = $shortcut;
00347 }
00348 }
00349
00350 return $shortcuts;
00351 }
00352
00353
00354
00355
00356
00357
00358
00359 protected function getShortcutById($shortcutId) {
00360 $returnShortcut = false;
00361
00362 foreach($this->shortcuts as $shortcut) {
00363 if($shortcut['raw']['uid'] == (int) $shortcutId) {
00364 $returnShortcut = $shortcut;
00365 continue;
00366 }
00367 }
00368
00369 return $returnShortcut;
00370 }
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380 protected function initShortcutGroups($params = array(), TYPO3AJAX &$ajaxObj = null) {
00381
00382 $userShortcutGroups = $GLOBALS['BE_USER']->getTSConfig('options.shortcutGroups');
00383
00384 if(is_array($userShortcutGroups['properties']) && count($userShortcutGroups['properties'])) {
00385 foreach($userShortcutGroups['properties'] as $groupId => $label) {
00386 if(strcmp('', $label) && strcmp('0', $label)) {
00387 $this->shortcutGroups[$groupId] = (string) $label;
00388 } elseif($GLOBALS['BE_USER']->isAdmin()) {
00389 unset($this->shortcutGroups[$groupId]);
00390 }
00391 }
00392 }
00393
00394
00395 if(count($this->shortcutGroups)) {
00396 $groups = $this->shortcutGroups;
00397 foreach($groups as $groupId => $groupLabel) {
00398 $this->shortcutGroups[($groupId * -1)] = $groupLabel;
00399 }
00400 }
00401
00402
00403 $this->shortcutGroups[-100] = 1;
00404
00405
00406 foreach($this->shortcutGroups as $groupId => $groupLabel) {
00407 $label = $groupLabel;
00408
00409 if($groupLabel == '1') {
00410 $label = $GLOBALS['LANG']->getLL('shortcut_group_'.abs($groupId), 1);
00411
00412 if(empty($label)) {
00413
00414 $label = $GLOBALS['LANG']->getLL('shortcut_group', 1).' '.abs($groupId);
00415 }
00416 }
00417
00418 if($groupId < 0) {
00419
00420 $label = $GLOBALS['LANG']->getLL('shortcut_global', 1).': '.
00421 (!empty($label) ?
00422 $label :
00423 abs($groupId)
00424 );
00425
00426 if($groupId == -100) {
00427 $label = $GLOBALS['LANG']->getLL('shortcut_global', 1).': '.$GLOBALS['LANG']->getLL('shortcut_all', 1);
00428 }
00429 }
00430
00431 $this->shortcutGroups[$groupId] = $label;
00432 }
00433
00434 return $this->shortcutGroups;
00435 }
00436
00437
00438
00439
00440
00441
00442
00443
00444 public function getAjaxShortcutGroups($params = array(), TYPO3AJAX &$ajaxObj = null) {
00445 $shortcutGroups = $this->shortcutGroups;
00446
00447 if(!$GLOBALS['BE_USER']->isAdmin()) {
00448 foreach($shortcutGroups as $groupId => $groupName) {
00449 if(intval($groupId) < 0) {
00450 unset($shortcutGroups[$groupId]);
00451 }
00452 }
00453 }
00454
00455 $ajaxObj->addContent('shortcutGroups', $shortcutGroups);
00456 $ajaxObj->setContentFormat('json');
00457 }
00458
00459
00460
00461
00462
00463
00464
00465
00466 public function deleteAjaxShortcut($params = array(), TYPO3AJAX &$ajaxObj = null) {
00467 $shortcutId = (int) t3lib_div::_POST('shortcutId');
00468 $fullShortcut = $this->getShortcutById($shortcutId);
00469 $ajaxReturn = 'failed';
00470
00471 if($fullShortcut['raw']['userid'] == $GLOBALS['BE_USER']->user['uid']) {
00472 $GLOBALS['TYPO3_DB']->exec_DELETEquery(
00473 'sys_be_shortcuts',
00474 'uid = '.$shortcutId
00475 );
00476
00477 if($GLOBALS['TYPO3_DB']->sql_affected_rows() == 1) {
00478 $ajaxReturn = 'deleted';
00479 }
00480 }
00481
00482 $ajaxObj->addContent('delete', $ajaxReturn);
00483 }
00484
00485
00486
00487
00488
00489
00490
00491
00492 public function createAjaxShortcut($params = array(), TYPO3AJAX &$ajaxObj = null) {
00493 global $TCA, $LANG;
00494
00495 $shortcutCreated = 'failed';
00496 $shortcutName = 'Shortcut';
00497 $shortcutNamePrepend = '';
00498
00499 $url = t3lib_div::_POST('url');
00500 $module = t3lib_div::_POST('module');
00501 $motherModule = t3lib_div::_POST('motherModName');
00502
00503
00504 $queryParts = parse_url($url);
00505 $queryParameters = t3lib_div::explodeUrl2Array($queryParts['query'], 1);
00506
00507 if(is_array($queryParameters['edit'])) {
00508 $shortcut['table'] = key($queryParameters['edit']);
00509 $shortcut['recordid'] = key($queryParameters['edit'][$shortcut['table']]);
00510
00511 if($queryParameters['edit'][$shortcut['table']][$shortcut['recordid']] == 'edit') {
00512 $shortcut['type'] = 'edit';
00513 $shortcutNamePrepend = $GLOBALS['LANG']->getLL('shortcut_edit', 1);
00514 } elseif($queryParameters['edit'][$shortcut['table']][$shortcut['recordid']] == 'new') {
00515 $shortcut['type'] = 'new';
00516 $shortcutNamePrepend = $GLOBALS['LANG']->getLL('shortcut_create', 1);
00517 }
00518 } else {
00519 $shortcut['type'] = 'other';
00520 }
00521
00522
00523 $pageId = $shortcut['recordid'] ? $shortcut['recordid'] : $this->getLinkedPageId($url);
00524
00525 if(t3lib_div::testInt($pageId)) {
00526 $page = t3lib_BEfunc::getRecord('pages', $pageId);
00527 if(count($page)) {
00528
00529 if($shortcut['type'] == 'other') {
00530 $shortcutName = $page['title'];
00531 } else {
00532 $shortcutName = $shortcutNamePrepend.' '.$LANG->sL($TCA[$shortcut['table']]['ctrl']['title']).' ('.$page['title'].')';
00533 }
00534 }
00535 } else {
00536 $dirName = urldecode($pageId);
00537 if (preg_match('/\/$/', $dirName)) {
00538
00539
00540
00541 $shortcutName .= ' ' . basename($dirName);
00542 }
00543 }
00544
00545
00546 if($module && $url) {
00547 $fieldValues = array(
00548 'userid' => $GLOBALS['BE_USER']->user['uid'],
00549 'module_name' => $module.'|'.$motherModule,
00550 'url' => $url,
00551 'description' => $shortcutName,
00552 'sorting' => time(),
00553 );
00554 $GLOBALS['TYPO3_DB']->exec_INSERTquery('sys_be_shortcuts', $fieldValues);
00555
00556 if($GLOBALS['TYPO3_DB']->sql_affected_rows() == 1) {
00557 $shortcutCreated = 'success';
00558 }
00559 }
00560
00561 $ajaxObj->addContent('create', $shortcutCreated);
00562 }
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572 public function setAjaxShortcut($params = array(), TYPO3AJAX &$ajaxObj = null) {
00573
00574 $shortcutId = (int) t3lib_div::_POST('shortcutId');
00575 $shortcutName = strip_tags(t3lib_div::_POST('value'));
00576 $shortcutGroupId = (int) t3lib_div::_POST('shortcut-group');
00577
00578 if($shortcutGroupId > 0 || $GLOBALS['BE_USER']->isAdmin()) {
00579
00580 $addUserWhere = (!$GLOBALS['BE_USER']->isAdmin() ?
00581 ' AND userid='.intval($GLOBALS['BE_USER']->user['uid'])
00582 : ''
00583 );
00584
00585 $fieldValues = array(
00586 'description' => $shortcutName,
00587 'sc_group' => $shortcutGroupId
00588 );
00589
00590 if($fieldValues['sc_group'] < 0 && !$GLOBALS['BE_USER']->isAdmin()) {
00591 $fieldValues['sc_group'] = 0;
00592 }
00593
00594 $GLOBALS['TYPO3_DB']->exec_UPDATEquery(
00595 'sys_be_shortcuts',
00596 'uid='.$shortcutId.$addUserWhere,
00597 $fieldValues
00598 );
00599
00600 $affectedRows = $GLOBALS['TYPO3_DB']->sql_affected_rows();
00601 if($affectedRows == 1) {
00602 $ajaxObj->addContent('shortcut', $shortcutName);
00603 } else {
00604 $ajaxObj->addContent('shortcut', 'failed');
00605 }
00606 }
00607
00608 $ajaxObj->setContentFormat('plain');
00609 }
00610
00611
00612
00613
00614
00615
00616
00617 protected function getShortcutGroupLabel($groupId) {
00618 $label = '';
00619
00620 if($this->shortcutGroups[$groupId]) {
00621 $label = $this->shortcutGroups[$groupId];
00622 }
00623
00624 return $label;
00625 }
00626
00627
00628
00629
00630
00631
00632 protected function getGlobalShortcutGroups() {
00633 $globalGroups = array();
00634
00635 foreach($this->shortcutGroups as $groupId => $groupLabel) {
00636 if($groupId < 0) {
00637 $globalGroups[$groupId] = $groupLabel;
00638 }
00639 }
00640
00641 return $globalGroups;
00642 }
00643
00644
00645
00646
00647
00648
00649 protected function getGroupsFromShortcuts() {
00650 $groups = array();
00651
00652 foreach($this->shortcuts as $shortcut) {
00653 $groups[$shortcut['group']] = $this->shortcutGroups[$shortcut['group']];
00654 }
00655
00656 return array_unique($groups);
00657 }
00658
00659
00660
00661
00662
00663
00664
00665 protected function getShortcutIcon($row, $shortcut) {
00666 global $TCA;
00667
00668 switch($row['module_name']) {
00669 case 'xMOD_alt_doc.php':
00670 $table = $shortcut['table'];
00671 $recordid = $shortcut['recordid'];
00672
00673 if($shortcut['type'] == 'edit') {
00674
00675 $selectFields = $this->fieldArray;
00676 $selectFields[] = 'uid';
00677 $selectFields[] = 'pid';
00678
00679 if($table=='pages') {
00680 if(t3lib_extMgm::isLoaded('cms')) {
00681 $selectFields[] = 'module';
00682 $selectFields[] = 'extendToSubpages';
00683 }
00684 $selectFields[] = 'doktype';
00685 }
00686
00687 if(is_array($TCA[$table]['ctrl']['enablecolumns'])) {
00688 $selectFields = array_merge($selectFields,$TCA[$table]['ctrl']['enablecolumns']);
00689 }
00690
00691 if($TCA[$table]['ctrl']['type']) {
00692 $selectFields[] = $TCA[$table]['ctrl']['type'];
00693 }
00694
00695 if($TCA[$table]['ctrl']['typeicon_column']) {
00696 $selectFields[] = $TCA[$table]['ctrl']['typeicon_column'];
00697 }
00698
00699 if($TCA[$table]['ctrl']['versioningWS']) {
00700 $selectFields[] = 't3ver_state';
00701 }
00702
00703 $selectFields = array_unique($selectFields);
00704 $permissionClause = ($table=='pages' && $this->perms_clause) ?
00705 ' AND '.$this->perms_clause :
00706 '';
00707
00708 $sqlQueryParts = array(
00709 'SELECT' => implode(',', $selectFields),
00710 'FROM' => $table,
00711 'WHERE' => 'uid IN ('.$recordid.') '.$permissionClause.
00712 t3lib_BEfunc::deleteClause($table).
00713 t3lib_BEfunc::versioningPlaceholderClause($table)
00714 );
00715 $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($sqlQueryParts);
00716 $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
00717
00718 $icon = t3lib_iconWorks::getIcon($table, $row, $this->backPath);
00719 } elseif($shortcut['type'] == 'new') {
00720 $icon = t3lib_iconWorks::getIcon($table, '', $this->backPath);
00721 }
00722
00723 $icon = t3lib_iconWorks::skinImg($this->backPath, $icon, '', 1);
00724 break;
00725 case 'xMOD_file_edit.php':
00726 $icon = 'gfx/edit_file.gif';
00727 break;
00728 case 'xMOD_wizard_rte.php':
00729 $icon = 'gfx/edit_rtewiz.gif';
00730 break;
00731 default:
00732 if($GLOBALS['LANG']->moduleLabels['tabs_images'][$row['module_name'].'_tab']) {
00733 $icon = $GLOBALS['LANG']->moduleLabels['tabs_images'][$row['module_name'].'_tab'];
00734
00735
00736 $icon = str_replace('mod/file/list/list.gif', 'mod/file/file.gif', $icon);
00737
00738 if(t3lib_div::isAbsPath($icon)) {
00739 $icon = '../'.substr($icon, strlen(PATH_site));
00740 }
00741 } else {
00742 $icon = 'gfx/dummy_module.gif';
00743 }
00744 }
00745
00746 return '<img src="' . $icon . '" alt="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:toolbarItems.shortcut', true) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:toolbarItems.shortcut', true) . '" />';
00747 }
00748
00749
00750
00751
00752
00753
00754
00755
00756
00757 protected function getShortcutIconTitle($shortcutLabel, $moduleName, $parentModuleName = '') {
00758 $title = '';
00759
00760 if(substr($moduleName, 0, 5) == 'xMOD_') {
00761 $title = substr($moduleName, 5);
00762 } else {
00763 $splitModuleName = explode('_', $moduleName);
00764 $title = $GLOBALS['LANG']->moduleLabels['tabs'][$splitModuleName[0].'_tab'];
00765
00766 if(count($splitModuleName) > 1) {
00767 $title .= '>'.$GLOBALS['LANG']->moduleLabels['tabs'][$moduleName.'_tab'];
00768 }
00769 }
00770
00771 if($parentModuleName) {
00772 $title .= ' ('.$parentModuleName.')';
00773 }
00774
00775 $title .= ': '.$shortcutLabel;
00776
00777 return $title;
00778 }
00779
00780
00781
00782
00783
00784
00785
00786 protected function getLinkedPageId($url) {
00787 return preg_replace('/.*[\?&]id=([^&]+).*/', '$1', $url);
00788 }
00789
00790 }
00791
00792
00793 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/classes/class.shortcutmenu.php']) {
00794 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/classes/class.shortcutmenu.php']);
00795 }
00796
00797 ?>