‪TYPO3CMS  10.4
ShortcutRepository.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
37 
44 {
48  protected const ‪SUPERGLOBAL_GROUP = -100;
49 
53  protected ‪$shortcuts;
54 
58  protected ‪$shortcutGroups;
59 
63  protected ‪$iconFactory;
64 
68  protected ‪$moduleLoader;
69 
73  public function ‪__construct()
74  {
75  $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
76  $this->moduleLoader = GeneralUtility::makeInstance(ModuleLoader::class);
77  $this->moduleLoader->load(‪$GLOBALS['TBE_MODULES']);
78 
79  $this->shortcutGroups = $this->‪initShortcutGroups();
80  $this->shortcuts = $this->‪initShortcuts();
81  }
82 
89  public function ‪getShortcutById(int $shortcutId)
90  {
91  foreach ($this->shortcuts as $shortcut) {
92  if ($shortcut['raw']['uid'] === $shortcutId) {
93  return $shortcut;
94  }
95  }
96 
97  return false;
98  }
99 
106  public function ‪getShortcutsByGroup(int $groupId): array
107  {
108  ‪$shortcuts = [];
109 
110  foreach ($this->shortcuts as $shortcut) {
111  if ($shortcut['group'] === $groupId) {
112  ‪$shortcuts[] = $shortcut;
113  }
114  }
115 
116  return ‪$shortcuts;
117  }
118 
124  public function ‪getShortcutGroups(): array
125  {
127 
128  if (!$this->‪getBackendUser()->isAdmin()) {
129  foreach (‪$shortcutGroups as $groupId => $groupName) {
130  if ((int)$groupId < 0) {
131  unset(‪$shortcutGroups[$groupId]);
132  }
133  }
134  }
135 
136  return ‪$shortcutGroups;
137  }
138 
144  public function ‪getGroupsFromShortcuts(): array
145  {
146  $groups = [];
147 
148  foreach ($this->shortcuts as $shortcut) {
149  $groups[$shortcut['group']] = $this->shortcutGroups[$shortcut['group']];
150  }
151 
152  return array_unique($groups);
153  }
154 
161  public function ‪shortcutExists(string $url): bool
162  {
163  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
164  ->getQueryBuilderForTable('sys_be_shortcuts');
165  $queryBuilder->getRestrictions()->removeAll();
166 
167  $uid = $queryBuilder->select('uid')
168  ->from('sys_be_shortcuts')
169  ->where(
170  $queryBuilder->expr()->eq(
171  'userid',
172  $queryBuilder->createNamedParameter($this->getBackendUser()->user['uid'], \PDO::PARAM_INT)
173  ),
174  $queryBuilder->expr()->eq(
175  'url',
176  $queryBuilder->createNamedParameter($url, \PDO::PARAM_STR)
177  )
178  )
179  ->execute()
180  ->fetchColumn();
181 
182  return (bool)$uid;
183  }
184 
195  public function ‪addShortcut(string $url, string $module, string $parentModule = '', string $title = ''): bool
196  {
197  if (empty($url) || empty($module)) {
198  return false;
199  }
200 
201  $queryParts = parse_url($url);
202  $queryParameters = [];
203  parse_str($queryParts['query'] ?? '', $queryParameters);
204 
205  if (!empty($queryParameters['scheme'])) {
206  throw new \RuntimeException('Shortcut URLs must be relative', 1518785877);
207  }
208 
209  $languageService = $this->‪getLanguageService();
210  $title = $title ?: 'Shortcut';
211  $titlePrefix = '';
212  $type = 'other';
213  $table = '';
214  $recordId = 0;
215  $pageId = 0;
216 
217  if (is_array($queryParameters['edit'])) {
218  $table = (string)key($queryParameters['edit']);
219  $recordId = (int)key($queryParameters['edit'][$table]);
220  $pageId = (int)‪BackendUtility::getRecord($table, $recordId)['pid'];
221  $languageFile = 'LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf';
222  $action = $queryParameters['edit'][$table][$recordId];
223 
224  switch ($action) {
225  case 'edit':
226  $type = 'edit';
227  $titlePrefix = $languageService->sL($languageFile . ':shortcut_edit');
228  break;
229  case 'new':
230  $type = 'new';
231  $titlePrefix = $languageService->sL($languageFile . ':shortcut_create');
232  break;
233  }
234  }
235 
236  $moduleName = $module ?: $parentModule;
237  $id = $this->‪extractIdFromShortcutUrl($moduleName, $url);
238  if ($moduleName === 'file_FilelistList' && $id !== '') {
239  // If filelist module, check if the id is a valid module identifier
240  try {
241  $resourceFactory = GeneralUtility::makeInstance(ResourceFactory::class);
242  $resource = $resourceFactory->getObjectFromCombinedIdentifier($id);
243  $title = trim(sprintf(
244  '%s (%s)',
245  $titlePrefix,
246  $resource->getName()
247  ));
248  } catch (ResourceDoesNotExistException $e) {
249  }
250  } else {
251  // Lookup the title of this page and use it as default description
252  $pageId = $pageId ?: $recordId ?: (int)$id;
253  $page = $pageId ? ‪BackendUtility::getRecord('pages', $pageId) : null;
254 
255  if (!empty($page)) {
256  // Set the name to the title of the page
257  if ($type === 'other') {
258  $title = sprintf(
259  '%s (%s)',
260  $title,
261  $page['title']
262  );
263  } else {
264  $title = sprintf(
265  '%s %s (%s)',
266  $titlePrefix,
267  $languageService->sL(‪$GLOBALS['TCA'][$table]['ctrl']['title']),
268  $page['title']
269  );
270  }
271  } elseif (!empty($table)) {
272  $title = trim(sprintf(
273  '%s %s',
274  $titlePrefix,
275  $languageService->sL(‪$GLOBALS['TCA'][$table]['ctrl']['title'])
276  ));
277  }
278  }
279 
280  if ($title === 'Shortcut') {
281  $moduleLabels = $this->moduleLoader->getLabelsForModule($module);
282 
283  if (!empty($moduleLabels['shortdescription'])) {
284  $title = $this->‪getLanguageService()->‪sL($moduleLabels['shortdescription']);
285  }
286  }
287 
288  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
289  ->getQueryBuilderForTable('sys_be_shortcuts');
290  $affectedRows = $queryBuilder
291  ->insert('sys_be_shortcuts')
292  ->values([
293  'userid' => $this->‪getBackendUser()->user['uid'],
294  'module_name' => $module . '|' . $parentModule,
295  'url' => $url,
296  'description' => $title,
297  'sorting' => ‪$GLOBALS['EXEC_TIME'],
298  ])
299  ->execute();
300 
301  return $affectedRows === 1;
302  }
303 
312  public function ‪updateShortcut(int $id, string $title, int $groupId): bool
313  {
314  $backendUser = $this->‪getBackendUser();
315  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
316  ->getQueryBuilderForTable('sys_be_shortcuts');
317  $queryBuilder->update('sys_be_shortcuts')
318  ->where(
319  $queryBuilder->expr()->eq(
320  'uid',
321  $queryBuilder->createNamedParameter($id, \PDO::PARAM_INT)
322  )
323  )
324  ->set('description', $title)
325  ->set('sc_group', $groupId);
326 
327  if (!$backendUser->isAdmin()) {
328  // Users can only modify their own shortcuts
329  $queryBuilder->andWhere(
330  $queryBuilder->expr()->eq(
331  'userid',
332  $queryBuilder->createNamedParameter($backendUser->user['uid'], \PDO::PARAM_INT)
333  )
334  );
335 
336  if ($groupId < 0) {
337  $queryBuilder->set('sc_group', 0);
338  }
339  }
340 
341  $affectedRows = $queryBuilder->execute();
342 
343  return $affectedRows === 1;
344  }
345 
352  public function ‪removeShortcut(int $id): bool
353  {
354  $shortcut = $this->‪getShortcutById($id);
355  $success = false;
356 
357  if ($shortcut['raw']['userid'] == $this->‪getBackendUser()->user['uid']) {
358  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
359  ->getQueryBuilderForTable('sys_be_shortcuts');
360  $affectedRows = $queryBuilder->delete('sys_be_shortcuts')
361  ->where(
362  $queryBuilder->expr()->eq(
363  'uid',
364  $queryBuilder->createNamedParameter($id, \PDO::PARAM_INT)
365  )
366  )
367  ->execute();
368 
369  if ($affectedRows === 1) {
370  $success = true;
371  }
372  }
373 
374  return $success;
375  }
376 
382  protected function ‪initShortcutGroups(): array
383  {
384  $languageService = $this->‪getLanguageService();
385  $backendUser = $this->‪getBackendUser();
386  // By default, 5 groups are set
388  1 => '1',
389  2 => '1',
390  3 => '1',
391  4 => '1',
392  5 => '1',
393  ];
394 
395  // Groups from TSConfig
396  $bookmarkGroups = $backendUser->getTSConfig()['options.']['bookmarkGroups.'] ?? [];
397 
398  if (is_array($bookmarkGroups)) {
399  foreach ($bookmarkGroups as $groupId => $label) {
400  if (!empty($label)) {
401  ‪$shortcutGroups[$groupId] = (string)$label;
402  } elseif ($backendUser->isAdmin()) {
403  unset(‪$shortcutGroups[$groupId]);
404  }
405  }
406  }
407 
408  // Generate global groups, all global groups have negative IDs.
409  if (!empty(‪$shortcutGroups)) {
410  foreach (‪$shortcutGroups as $groupId => $groupLabel) {
411  ‪$shortcutGroups[$groupId * -1] = $groupLabel;
412  }
413  }
414 
415  // Group -100 is kind of superglobal and can't be changed.
417 
418  // Add labels
419  $languageFile = 'LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf';
420 
421  foreach (‪$shortcutGroups as $groupId => $groupLabel) {
422  $groupId = (int)$groupId;
423  $label = $groupLabel;
424 
425  if ($groupLabel === '1') {
426  $label = $languageService->sL($languageFile . ':bookmark_group_' . abs($groupId));
427 
428  if (empty($label)) {
429  // Fallback label
430  $label = $languageService->sL($languageFile . ':bookmark_group') . ' ' . abs($groupId);
431  }
432  }
433 
434  if ($groupId < 0) {
435  // Global group
436  $label = $languageService->sL($languageFile . ':bookmark_global') . ': ' . (!empty($label) ? $label : abs($groupId));
437 
438  if ($groupId === self::SUPERGLOBAL_GROUP) {
439  $label = $languageService->sL($languageFile . ':bookmark_global') . ': ' . $languageService->sL($languageFile . ':bookmark_all');
440  }
441  }
442 
443  ‪$shortcutGroups[$groupId] = htmlspecialchars($label);
444  }
445 
446  return ‪$shortcutGroups;
447  }
448 
454  protected function ‪initShortcuts(): array
455  {
456  $backendUser = $this->‪getBackendUser();
457  // Traverse shortcuts
458  $lastGroup = 0;
459  ‪$shortcuts = [];
460  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
461  ->getQueryBuilderForTable('sys_be_shortcuts');
462  $result = $queryBuilder->select('*')
463  ->from('sys_be_shortcuts')
464  ->where(
465  $queryBuilder->expr()->andX(
466  $queryBuilder->expr()->eq(
467  'userid',
468  $queryBuilder->createNamedParameter($backendUser->user['uid'], \PDO::PARAM_INT)
469  ),
470  $queryBuilder->expr()->gte(
471  'sc_group',
472  $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
473  )
474  )
475  )
476  ->orWhere(
477  $queryBuilder->expr()->in(
478  'sc_group',
479  $queryBuilder->createNamedParameter(
480  array_keys($this->‪getGlobalShortcutGroups()),
481  Connection::PARAM_INT_ARRAY
482  )
483  )
484  )
485  ->orderBy('sc_group')
486  ->addOrderBy('sorting')
487  ->execute();
488 
489  while ($row = $result->fetch()) {
490  $pageId = 0;
491  $shortcut = ['raw' => $row];
492 
493  [$row['module_name'], $row['M_module_name']] = explode('|', $row['module_name']);
494 
495  $queryParts = parse_url($row['url']);
496  // Explode GET vars recursively
497  $queryParameters = [];
498  parse_str($queryParts['query'] ?? '', $queryParameters);
499 
500  if ($row['module_name'] === 'xMOD_alt_doc.php' && is_array($queryParameters['edit'])) {
501  $shortcut['table'] = key($queryParameters['edit']);
502  $shortcut['recordid'] = key($queryParameters['edit'][$shortcut['table']]);
503 
504  if ($queryParameters['edit'][$shortcut['table']][$shortcut['recordid']] === 'edit') {
505  $shortcut['type'] = 'edit';
506  } elseif ($queryParameters['edit'][$shortcut['table']][$shortcut['recordid']] === 'new') {
507  $shortcut['type'] = 'new';
508  }
509 
510  if (substr((string)$shortcut['recordid'], -1) === ',') {
511  $shortcut['recordid'] = substr((string)$shortcut['recordid'], 0, -1);
512  }
513  } else {
514  $shortcut['type'] = 'other';
515  }
516 
517  // Check for module access
518  $moduleName = $row['M_module_name'] ?: $row['module_name'];
519 
520  // Check if the user has access to this module
521  // @todo Hack for EditDocumentController / FormEngine, see issues #91368 and #91210
522  if (!is_array($this->moduleLoader->checkMod($moduleName)) && $moduleName !== 'xMOD_alt_doc.php') {
523  continue;
524  }
525 
526  if ($moduleName === 'file_FilelistList') {
527  $combinedIdentifier = $this->‪extractIdFromShortcutUrl($moduleName, $row['url'] ?? '');
528  if ($combinedIdentifier !== '') {
529  try {
530  $resourceFactory = GeneralUtility::makeInstance(ResourceFactory::class);
531  $storage = $resourceFactory->getStorageObjectFromCombinedIdentifier($combinedIdentifier);
532  if ($storage === null || $storage->getUid() === 0) {
533  // Continue, if invalid storage or disallowed fallback storage
534  continue;
535  }
536  $folderIdentifier = substr($combinedIdentifier, strpos($combinedIdentifier, ':') + 1);
537  // By using $storage->getFolder() we implicitly check whether the folder
538  // still exists and the user has necessary permissions to access it.
539  $storage->getFolder($folderIdentifier);
540  } catch (InsufficientFolderAccessPermissionsException $e) {
541  // Continue, since current user does not have access to the folder
542  continue;
543  } catch (FolderDoesNotExistException $e) {
544  // Folder does not longer exists. However, the shortcut
545  // is still displayed, allowing the user to remove it.
546  }
547  }
548  } else {
549  if ($moduleName === 'xMOD_alt_doc.php' && isset($shortcut['table'], $shortcut['recordid'])) {
550  // Check if user is allowed to edit the requested record
551  if (!$backendUser->check('tables_modify', $shortcut['table'])) {
552  continue;
553  }
554  $record = ‪BackendUtility::getRecord($shortcut['table'], (int)$shortcut['recordid']);
555  // Check if requested record exists
556  if ($record === null || $record === []) {
557  continue;
558  }
559  // Store the page id of the record in question
560  $pageId = ($shortcut['table'] === 'pages' ? (int)($record['uid'] ?? 0) : (int)($record['pid']));
561  } else {
562  // In case this is no record edit shortcut, treat a possible "id" as page id
563  $pageId = (int)$this->‪extractIdFromShortcutUrl($moduleName, $row['url'] ?? '');
564  }
565  if ($pageId > 0 && !$backendUser->isAdmin()) {
566  // Check for webmount access
567  if ($backendUser->isInWebMount($pageId) === null) {
568  continue;
569  }
570  // Check for record access
571  $pageRow = ‪BackendUtility::getRecord('pages', $pageId);
572  if ($pageRow === null || !$backendUser->doesUserHaveAccess($pageRow, ‪Permission::PAGE_SHOW)) {
573  continue;
574  }
575  }
576  }
577 
578  $moduleParts = explode('_', $moduleName);
579  $shortcutGroup = (int)$row['sc_group'];
580 
581  if ($shortcutGroup && $lastGroup !== $shortcutGroup && $shortcutGroup !== self::SUPERGLOBAL_GROUP) {
582  $shortcut['groupLabel'] = $this->‪getShortcutGroupLabel($shortcutGroup);
583  }
584 
585  $lastGroup = $shortcutGroup;
586 
587  if ($row['description']) {
588  $shortcut['label'] = $row['description'];
589  } else {
590  $shortcut['label'] = GeneralUtility::fixed_lgd_cs(rawurldecode($queryParts['query']), 150);
591  }
592 
593  $shortcut['group'] = $shortcutGroup;
594  $shortcut['icon'] = $this->‪getShortcutIcon($row, $shortcut);
595  $shortcut['iconTitle'] = $this->‪getShortcutIconTitle($shortcut['label'], $row['module_name'], $row['M_module_name']);
596  $shortcut['action'] = 'jump(' . GeneralUtility::quoteJSvalue($this->‪getTokenUrl($row['url'])) . ',' . GeneralUtility::quoteJSvalue($moduleName) . ',' . GeneralUtility::quoteJSvalue($moduleParts[0]) . ', ' . $pageId . ');';
597 
598  ‪$shortcuts[] = $shortcut;
599  }
600 
601  return ‪$shortcuts;
602  }
603 
609  protected function ‪getGlobalShortcutGroups(): array
610  {
611  $globalGroups = [];
612 
613  foreach ($this->shortcutGroups as $groupId => $groupLabel) {
614  if ($groupId < 0) {
615  $globalGroups[$groupId] = $groupLabel;
616  }
617  }
618 
619  return $globalGroups;
620  }
621 
628  protected function ‪getShortcutGroupLabel(int $groupId): string
629  {
630  return $this->shortcutGroups[$groupId] ?? '';
631  }
632 
640  protected function ‪getShortcutIcon(array $row, array $shortcut): string
641  {
642  switch ($row['module_name']) {
643  case 'xMOD_alt_doc.php':
644  $table = $shortcut['table'];
645  $recordid = $shortcut['recordid'];
646  $icon = '';
647 
648  if ($shortcut['type'] === 'edit') {
649  $row = ‪BackendUtility::getRecordWSOL($table, $recordid) ?? [];
650  $icon = $this->iconFactory->getIconForRecord($table, $row, ‪Icon::SIZE_SMALL)->render();
651  } elseif ($shortcut['type'] === 'new') {
652  $icon = $this->iconFactory->getIconForRecord($table, [], ‪Icon::SIZE_SMALL)->render();
653  }
654  break;
655  case 'file_edit':
656  $icon = $this->iconFactory->getIcon('mimetypes-text-html', ‪Icon::SIZE_SMALL)->render();
657  break;
658  case 'wizard_rte':
659  $icon = $this->iconFactory->getIcon('mimetypes-word', ‪Icon::SIZE_SMALL)->render();
660  break;
661  default:
662  $iconIdentifier = '';
663  $moduleName = $row['module_name'];
664 
665  if (strpos($moduleName, '_') !== false) {
666  [$mainModule, $subModule] = explode('_', $moduleName, 2);
667  $iconIdentifier = $this->moduleLoader->modules[$mainModule]['sub'][$subModule]['iconIdentifier'];
668  } elseif (!empty($moduleName)) {
669  $iconIdentifier = $this->moduleLoader->modules[$moduleName]['iconIdentifier'];
670  }
671 
672  if (!$iconIdentifier) {
673  $iconIdentifier = 'empty-empty';
674  }
675 
676  $icon = $this->iconFactory->getIcon($iconIdentifier, ‪Icon::SIZE_SMALL)->render();
677  }
678 
679  return $icon;
680  }
681 
690  protected function ‪getShortcutIconTitle(string $shortcutLabel, string $moduleName, string $parentModuleName = ''): string
691  {
692  $languageService = $this->‪getLanguageService();
693 
694  if (strpos($moduleName, 'xMOD_') === 0) {
695  $title = substr($moduleName, 5);
696  } else {
697  [$mainModule, $subModule] = explode('_', $moduleName);
698  $mainModuleLabels = $this->moduleLoader->getLabelsForModule($mainModule);
699  $title = $languageService->sL($mainModuleLabels['title']);
700 
701  if (!empty($subModule)) {
702  $subModuleLabels = $this->moduleLoader->getLabelsForModule($moduleName);
703  $title .= '>' . $languageService->sL($subModuleLabels['title']);
704  }
705  }
706 
707  if ($parentModuleName) {
708  $title .= ' (' . $parentModuleName . ')';
709  }
710 
711  $title .= ': ' . $shortcutLabel;
712 
713  return $title;
714  }
715 
724  protected function ‪extractIdFromShortcutUrl(string $moduleName, string $shortcutUrl): string
725  {
726  $parsedUrl = parse_url($shortcutUrl);
727  $queryParams = [];
728  parse_str($parsedUrl['query'] ?? '', $queryParams);
729  $id = (string)($queryParams['id'] ?? '');
730 
731  if ($id === '' && $moduleName === 'xMOD_alt_doc.php' && ($queryParams['returnUrl'] ?? '') !== '') {
732  $parsedReturlUrl = parse_url($queryParams['returnUrl']);
733  $returnUrlQueryParams = [];
734  parse_str($parsedReturlUrl['query'] ?? '', $returnUrlQueryParams);
735  $id = (string)($returnUrlQueryParams['id'] ?? '');
736  }
737 
738  return $id;
739  }
740 
748  protected function ‪getTokenUrl(string $url): string
749  {
750  $parsedUrl = parse_url($url);
751  $parameters = [];
752  parse_str($parsedUrl['query'] ?? '', $parameters);
753 
754  $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
755  // parse the returnUrl and replace the module token of it
756  if (!empty($parameters['returnUrl'])) {
757  $parsedReturnUrl = parse_url($parameters['returnUrl']);
758  $returnUrlParameters = [];
759  parse_str($parsedReturnUrl['query'] ?? '', $returnUrlParameters);
760 
761  if (strpos($parsedReturnUrl['path'] ?? '', 'index.php') !== false && !empty($returnUrlParameters['route'])) {
762  $module = $returnUrlParameters['route'];
763  $parameters['returnUrl'] = (string)$uriBuilder->buildUriFromRoutePath($module, $returnUrlParameters);
764  $url = $parsedUrl['path'] . '?' . http_build_query($parameters, '', '&', PHP_QUERY_RFC3986);
765  }
766  }
767 
768  if (strpos($parsedUrl['path'], 'index.php') !== false && isset($parameters['route'])) {
769  $routePath = $parameters['route'];
771  $router = GeneralUtility::makeInstance(Router::class);
772 
773  try {
774  $route = $router->match($routePath);
775 
776  if ($route) {
777  $routeIdentifier = $route->getOption('_identifier');
778  unset($parameters['route']);
779  $url = (string)$uriBuilder->buildUriFromRoute($routeIdentifier, $parameters);
780  }
781  } catch (ResourceNotFoundException $e) {
782  $url = '';
783  }
784  }
785  return $url;
786  }
787 
793  protected function ‪getBackendUser(): BackendUserAuthentication
794  {
795  return ‪$GLOBALS['BE_USER'];
796  }
797 
801  protected function ‪getLanguageService(): ‪LanguageService
802  {
803  return ‪$GLOBALS['LANG'];
804  }
805 }
‪TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL
‪const SIZE_SMALL
Definition: Icon.php:30
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository
Definition: ShortcutRepository.php:44
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\extractIdFromShortcutUrl
‪string extractIdFromShortcutUrl(string $moduleName, string $shortcutUrl)
Definition: ShortcutRepository.php:720
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\$iconFactory
‪IconFactory $iconFactory
Definition: ShortcutRepository.php:60
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\initShortcutGroups
‪array initShortcutGroups()
Definition: ShortcutRepository.php:378
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\getShortcutIcon
‪string getShortcutIcon(array $row, array $shortcut)
Definition: ShortcutRepository.php:636
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\updateShortcut
‪bool updateShortcut(int $id, string $title, int $groupId)
Definition: ShortcutRepository.php:308
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\addShortcut
‪bool addShortcut(string $url, string $module, string $parentModule='', string $title='')
Definition: ShortcutRepository.php:191
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\initShortcuts
‪array initShortcuts()
Definition: ShortcutRepository.php:450
‪TYPO3\CMS\Core\Resource\Exception\InsufficientFolderAccessPermissionsException
Definition: InsufficientFolderAccessPermissionsException.php:24
‪TYPO3\CMS\Core\Imaging\Icon
Definition: Icon.php:26
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\$shortcuts
‪array $shortcuts
Definition: ShortcutRepository.php:52
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\getLanguageService
‪LanguageService getLanguageService()
Definition: ShortcutRepository.php:797
‪TYPO3\CMS\Core\Imaging\IconFactory
Definition: IconFactory.php:33
‪TYPO3\CMS\Backend\Backend\Shortcut
Definition: ShortcutRepository.php:18
‪TYPO3\CMS\Core\Localization\LanguageService\sL
‪string sL($input)
Definition: LanguageService.php:194
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\getGlobalShortcutGroups
‪array getGlobalShortcutGroups()
Definition: ShortcutRepository.php:605
‪TYPO3\CMS\Core\Type\Bitmask\Permission
Definition: Permission.php:24
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\getShortcutsByGroup
‪array getShortcutsByGroup(int $groupId)
Definition: ShortcutRepository.php:102
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\shortcutExists
‪bool shortcutExists(string $url)
Definition: ShortcutRepository.php:157
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\getShortcutIconTitle
‪string getShortcutIconTitle(string $shortcutLabel, string $moduleName, string $parentModuleName='')
Definition: ShortcutRepository.php:686
‪TYPO3\CMS\Backend\Routing\UriBuilder
Definition: UriBuilder.php:38
‪TYPO3\CMS\Core\Resource\ResourceFactory
Definition: ResourceFactory.php:41
‪TYPO3\CMS\Core\Resource\Exception\FolderDoesNotExistException
Definition: FolderDoesNotExistException.php:22
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\getShortcutById
‪mixed getShortcutById(int $shortcutId)
Definition: ShortcutRepository.php:85
‪TYPO3\CMS\Backend\Module\ModuleLoader
Definition: ModuleLoader.php:34
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\getGroupsFromShortcuts
‪array getGroupsFromShortcuts()
Definition: ShortcutRepository.php:140
‪TYPO3\CMS\Core\Resource\Exception\ResourceDoesNotExistException
Definition: ResourceDoesNotExistException.php:24
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\__construct
‪__construct()
Definition: ShortcutRepository.php:69
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\getBackendUser
‪BackendUserAuthentication getBackendUser()
Definition: ShortcutRepository.php:789
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:62
‪TYPO3\CMS\Core\Type\Bitmask\Permission\PAGE_SHOW
‪const PAGE_SHOW
Definition: Permission.php:33
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\removeShortcut
‪bool removeShortcut(int $id)
Definition: ShortcutRepository.php:348
‪TYPO3\CMS\Backend\Utility\BackendUtility
Definition: BackendUtility.php:75
‪TYPO3\CMS\Backend\Utility\BackendUtility\getRecordWSOL
‪static array getRecordWSOL( $table, $uid, $fields=' *', $where='', $useDeleteClause=true, $unsetMovePointers=false)
Definition: BackendUtility.php:139
‪TYPO3\CMS\Backend\Utility\BackendUtility\getRecord
‪static array null getRecord($table, $uid, $fields=' *', $where='', $useDeleteClause=true)
Definition: BackendUtility.php:95
‪TYPO3\CMS\Core\Database\Connection
Definition: Connection.php:36
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\getShortcutGroups
‪array getShortcutGroups()
Definition: ShortcutRepository.php:120
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\getTokenUrl
‪string getTokenUrl(string $url)
Definition: ShortcutRepository.php:744
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\SUPERGLOBAL_GROUP
‪const SUPERGLOBAL_GROUP
Definition: ShortcutRepository.php:48
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\getShortcutGroupLabel
‪string getShortcutGroupLabel(int $groupId)
Definition: ShortcutRepository.php:624
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Backend\Routing\Exception\ResourceNotFoundException
Definition: ResourceNotFoundException.php:24
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\$moduleLoader
‪ModuleLoader $moduleLoader
Definition: ShortcutRepository.php:64
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:42
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:46
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Backend\Routing\Router
Definition: Router.php:34
‪TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\$shortcutGroups
‪array $shortcutGroups
Definition: ShortcutRepository.php:56