2 namespace TYPO3\CMS\Taskcenter\Controller;
61 $this->
getLanguageService()->includeLLFile(
'EXT:taskcenter/Resources/Private/Language/locallang_task.xlf');
63 'name' => $this->moduleName
75 $this->MOD_MENU = array(
'mode' => array());
76 $this->MOD_MENU[
'mode'][
'information'] = $this->
getLanguageService()->sL(
'LLL:EXT:taskcenter/Resources/Private/Language/locallang.xlf:task_overview');
77 $this->MOD_MENU[
'mode'][
'tasks'] = $this->
getLanguageService()->sL(
'LLL:EXT:taskcenter/Resources/Private/Language/locallang.xlf:task_tasks');
84 $this->MOD_MENU[
'mode'] = $this->
mergeExternalItems($this->MCONF[
'name'],
'mode', $this->MOD_MENU[
'mode']);
96 $menu = $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
97 $menu->setIdentifier(
'WebFuncJumpMenu');
98 foreach ($this->MOD_MENU[
'mode'] as $controller => $title) {
102 BackendUtility::getModuleUrl(
107 'mode' => $controller
113 if ($controller === $this->MOD_SETTINGS[
'mode']) {
114 $item->setActive(
true);
116 $menu->addMenuItem($item);
118 $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->addMenu($menu);
134 $this->moduleTemplate->setContent($this->content);
136 $response->
getBody()->write($this->moduleTemplate->renderContent());
150 $this->moduleTemplate->addJavaScriptCode(
151 'TaskCenterInlineJavascript',
152 'if (top.fsMod) { top.fsMod.recentIds["web"] = 0; }'
156 $mode = (string)$this->MOD_SETTINGS[
'mode'];
157 if ($mode ===
'information') {
183 $chosenTask = (string)$this->MOD_SETTINGS[
'function'];
185 if (empty($chosenTask) || $chosenTask ==
'index') {
186 $chosenTask =
'taskcenter.tasks';
190 list($extKey, $taskClass) = explode(
'.', $chosenTask, 2);
191 if (class_exists($taskClass)) {
196 $actionContent .= $taskInstance->getTask();
204 $actionContent .= $flashMessage->render();
210 sprintf($this->
getLanguageService()->getLL(
'error_no-instance',
true), $taskClass, TaskInterface::class),
214 $actionContent .= $flashMessage->render();
219 $this->
getLanguageService()->sL(
'LLL:EXT:taskcenter/Resources/Private/Language/locallang_mod.xlf:mlang_labels_tabdescr'),
220 $this->
getLanguageService()->sL(
'LLL:EXT:taskcenter/Resources/Private/Language/locallang_mod.xlf:mlang_tabs_tab'),
223 $actionContent .= $flashMessage->render();
225 $content =
'<div id="taskcenter-main">
226 <div id="taskcenter-menu">' . $this->
indexAction() .
'</div>
227 <div id="taskcenter-item" class="' . htmlspecialchars(($extKey .
'-' . $taskClass)) .
'">' . $actionContent .
'
257 $content =
'<h1>' . nl2br(htmlspecialchars($title)) .
'</h1>';
258 if (!empty($description)) {
259 $content .=
'<p class="description">' . nl2br(htmlspecialchars($description)) .
'</p>';
285 $this->
getPageRenderer()->loadRequireJsModule(
'TYPO3/CMS/Taskcenter/Taskcenter');
286 $userSorting = unserialize($this->
getBackendUser()->uc[
'taskcenter'][
'sorting']);
287 if (is_array($userSorting)) {
288 $newSorting = array();
289 foreach ($userSorting as $item) {
290 if (isset($items[$item])) {
291 $newSorting[] = $items[$item];
292 unset($items[$item]);
295 $items = $newSorting + $items;
298 if (is_array($items) && !empty($items)) {
299 foreach ($items as $item) {
300 $title = htmlspecialchars($item[
'title']);
301 $icon = ($additionalClass = ($collapsedStyle =
''));
303 if (!empty($item[
'icon'])) {
304 if (strpos($item[
'icon'],
'<img ') ===
false) {
307 if (file_exists($absIconPath)) {
308 $icon =
'../' . str_replace(PATH_site,
'', $absIconPath);
309 $icon =
'<img src="' . $icon .
'" title="' . $title .
'" alt="' . $title .
'" />';
311 if (@is_file($icon)) {
315 $icon = $item[
'icon'];
318 $description = $item[
'descriptionHtml'] ?:
'<p>' . nl2br(htmlspecialchars($item[
'description'])) .
'</p>';
322 $collapsedStyle =
'style="display:none"';
323 $additionalClass =
'collapsed';
325 $additionalClass =
'expanded';
329 $additionalClass .=
' first-item';
330 }
elseif ($count + 1 === count($items)) {
331 $additionalClass .=
' last-item';
334 $active = (string)$this->MOD_SETTINGS[
'function'] == $item[
'uid'] ?
' active-task' :
'';
337 $section =
'<div class="down"><i class="fa fa-caret-down fa-fw"></i></div>
338 <div class="drag"><i class="fa fa-arrows"></i></div>';
339 $backgroundClass =
't3-row-header ';
341 $backgroundClass =
'';
343 $content .=
'<li class="' . $additionalClass . $active .
'" id="el_' . $id .
'">
345 <div class="image">' . $icon .
'</div>
346 <div class="' . $backgroundClass .
'link"><a href="' . $item[
'link'] .
'">' . $title .
'</a></div>
347 <div class="content " ' . $collapsedStyle .
'>' . $description .
'</div>
351 $navigationId = $mainMenu ?
'id="task-list"' :
'';
352 $content =
'<ul ' . $navigationId .
' class="task-list">' .
$content .
'</ul>';
368 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'taskcenter']) && !empty(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'taskcenter'])) {
369 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'taskcenter'] as $extKey => $extensionReports) {
370 foreach ($extensionReports as $taskClass => $task) {
374 $link = BackendUtility::getModuleUrl(
'user_task') .
'&SET[function]=' . $extKey .
'.' . $taskClass;
376 $taskDescriptionHtml =
'';
378 if (!empty($task[
'icon'])) {
381 if (class_exists($taskClass)) {
384 $taskDescriptionHtml = $taskInstance->getOverview();
388 $uniqueKey = $this->
getUniqueKey($extKey .
'.' . $taskClass);
389 $tasks[$uniqueKey] = array(
390 'title' => $taskTitle,
391 'descriptionHtml' => $taskDescriptionHtml,
395 'uid' => $extKey .
'.' . $taskClass
407 $this->content .= $flashMessage->render();
420 $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
424 $onClick =
'devlogWin=window.open(' .
GeneralUtility::quoteJSvalue(
$url) .
',\'taskcenter\',\'width=790,status=0,menubar=1,resizable=1,location=0,scrollbars=1,toolbar=0\');return false;';
425 $fullscreenButton = $buttonBar->makeLinkButton()
426 ->setTitle($this->
getLanguageService()->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.openInNewWindow',
true))
427 ->setOnClick($onClick)
429 ->setIcon($this->moduleTemplate->getIconFactory()->getIcon(
'actions-window-open',
Icon::SIZE_SMALL))
434 $shortcutButton = $buttonBar->makeShortcutButton()
435 ->setModuleName($this->moduleName)
436 ->setSetVariables([
'function']);
437 $buttonBar->addButton($shortcutButton);
453 $tsConfig = $this->
getBackendUser()->getTSConfig(
'taskcenter.' . $extKey .
'.' . $taskClass);
454 if (isset($tsConfig[
'value']) && (
int)$tsConfig[
'value'] === 0) {
462 if ((
int)
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'taskcenter'][$extKey][$taskClass][
'admin'] === 1) {
476 return '<iframe scrolling="auto" width="100%" src="' .
$url .
'" name="list_frame" id="list_frame" frameborder="no"></iframe>';
488 $search = array(
'.',
'_');
489 $replace = array(
'-',
'');
490 return str_replace($search, $replace, $string);
501 $onClick =
'devlogWin=window.open(' .
GeneralUtility::quoteJSvalue(
$url) .
',\'taskcenter\',\'width=790,status=0,menubar=1,resizable=1,location=0,scrollbars=1,toolbar=0\');return false;';
502 $content =
'<a href="#" onclick="' . htmlspecialchars($onClick) .
'" title="' . $this->
getLanguageService()->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.openInNewWindow',
true) .
'">'
503 . $this->moduleTemplate->getIconFactory()->getIcon(
'actions-window-open',
Icon::SIZE_SMALL)->render()