35 $GLOBALS[
'LANG']->includeLLFile(
'EXT:taskcenter/task/locallang.xlf');
40 $this->doc->setModuleTemplate(\
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath(
'taskcenter') .
'res/mod_template.html');
41 $this->doc->backPath =
$GLOBALS[
'BACK_PATH'];
42 $this->doc->getPageRenderer()->loadScriptaculous(
'effects,dragdrop');
43 $this->doc->addStyleSheet(
'tx_taskcenter',
'../' . \
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath(
'taskcenter') .
'res/mod_styles.css');
52 $this->MOD_MENU = array(
'mode' => array());
53 $this->MOD_MENU[
'mode'][
'information'] =
$GLOBALS[
'LANG']->sL(
'LLL:EXT:taskcenter/locallang.xlf:task_overview');
54 $this->MOD_MENU[
'mode'][
'tasks'] =
'Tasks';
67 $this->doc->postCode = $this->doc->wrapScriptTags(
'if (top.fsMod) { top.fsMod.recentIds["web"] = 0; }');
70 $mode = (string) $this->MOD_SETTINGS[
'mode'];
71 if ($mode ==
'information') {
80 $this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
82 $this->content = $this->doc->render(
$GLOBALS[
'LANG']->getLL(
'title'), $this->content);
100 $title = (
$content = ($actionContent =
''));
101 $chosenTask = (string) $this->MOD_SETTINGS[
'function'];
103 if (empty($chosenTask) || $chosenTask ==
'index') {
104 $chosenTask =
'taskcenter.tasks';
107 list($extKey, $taskClass) = explode(
'.', $chosenTask, 2);
108 $title =
$GLOBALS[
'LANG']->sL(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'taskcenter'][$extKey][$taskClass][
'title']);
109 if (class_exists($taskClass)) {
114 $actionContent .= $taskInstance->getTask();
117 $actionContent .= $flashMessage->render();
121 $flashMessage =
GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage', sprintf(
$GLOBALS[
'LANG']->getLL(
'error_no-instance', TRUE), $taskClass,
'TYPO3\\CMS\\Taskcenter\\TaskInterface'),
$GLOBALS[
'LANG']->getLL(
'error_header'), \
TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
122 $actionContent .= $flashMessage->render();
125 $flashMessage =
GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
$GLOBALS[
'LANG']->sL(
'LLL:EXT:taskcenter/task/locallang_mod.xlf:mlang_labels_tabdescr'),
$GLOBALS[
'LANG']->sL(
'LLL:EXT:taskcenter/task/locallang_mod.xlf:mlang_tabs_tab'), \
TYPO3\CMS\Core\Messaging\FlashMessage::INFO);
126 $actionContent .= $flashMessage->render();
128 $content =
'<div id="taskcenter-main"> 129 <div id="taskcenter-menu">' . $this->
indexAction() .
'</div> 130 <div id="taskcenter-item" class="' . htmlspecialchars(($extKey .
'-' . $taskClass)) .
'">' . $actionContent .
' 144 if (
$GLOBALS[
'BE_USER']->isAdmin()) {
158 if (!empty($description)) {
159 $description =
'<p class="description">' . nl2br(htmlspecialchars($description)) .
'</p><br />';
161 $content = $this->doc->section($title, $description, FALSE, TRUE);
185 $this->doc->getPageRenderer()->addJsFile(\
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath(
'taskcenter') .
'res/tasklist.js');
186 $userSorting = unserialize(
$GLOBALS[
'BE_USER']->uc[
'taskcenter'][
'sorting']);
187 if (is_array($userSorting)) {
188 $newSorting = array();
189 foreach ($userSorting as $item) {
190 if (isset($items[$item])) {
191 $newSorting[] = $items[$item];
192 unset($items[$item]);
195 $items = $newSorting + $items;
198 if (is_array($items) && count($items) > 0) {
199 foreach ($items as $item) {
200 $title = htmlspecialchars($item[
'title']);
201 $icon = ($additionalClass = ($collapsedStyle =
''));
203 if (!empty($item[
'icon'])) {
204 if (strpos($item[
'icon'],
'<img ') === FALSE) {
205 $absIconPath = GeneralUtility::getFileAbsFilename($item[
'icon']);
207 if (file_exists($absIconPath)) {
208 $icon =
$GLOBALS[
'BACK_PATH'] .
'../' . str_replace(PATH_site,
'', $absIconPath);
209 $icon =
'<img src="' . $icon .
'" title="' . $title .
'" alt="' . $title .
'" />';
211 if (@is_file($icon)) {
215 $icon = $item[
'icon'];
218 $description = $item[
'descriptionHtml'] ?:
'<p>' . nl2br(htmlspecialchars($item[
'description'])) .
'</p>';
221 if ($mainMenu && isset(
$GLOBALS[
'BE_USER']->uc[
'taskcenter'][
'states'][
$id]) &&
$GLOBALS[
'BE_USER']->uc[
'taskcenter'][
'states'][$id]) {
222 $collapsedStyle =
'style="display:none"';
223 $additionalClass =
'collapsed';
225 $additionalClass =
'expanded';
229 $additionalClass .=
' first-item';
230 } elseif ($count + 1 === count($items)) {
231 $additionalClass .=
' last-item';
234 $active = (string) $this->MOD_SETTINGS[
'function'] == $item[
'uid'] ?
' active-task' :
'';
238 $section =
'<div class="down"> </div> 239 <div class="drag">' . $dragIcon .
'</div>';
240 $backgroundClass =
't3-row-header ';
242 $content .=
'<li class="' . $additionalClass . $active .
'" id="el_' . $id .
'"> 244 <div class="image">' . $icon .
'</div> 245 <div class="' . $backgroundClass .
'link"><a href="' . $item[
'link'] .
'">' . $title .
'</a></div> 246 <div class="content " ' . $collapsedStyle .
'>' . $description .
'</div> 250 $navigationId = $mainMenu ?
'id="task-list"' :
'';
251 $content =
'<ul ' . $navigationId .
' class="task-list">' .
$content .
'</ul>';
266 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'taskcenter']) && count(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'taskcenter']) > 0) {
267 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'taskcenter'] as $extKey => $extensionReports) {
268 foreach ($extensionReports as $taskClass => $task) {
273 $taskTitle =
$GLOBALS[
'LANG']->sL($task[
'title']);
274 $taskDescriptionHtml =
'';
276 if (!empty($task[
'icon'])) {
277 $icon = GeneralUtility::getFileAbsFilename($task[
'icon']);
279 if (class_exists($taskClass)) {
282 $taskDescriptionHtml = $taskInstance->getOverview();
286 $uniqueKey = $this->
getUniqueKey($extKey .
'.' . $taskClass);
287 $tasks[$uniqueKey] = array(
288 'title' => $taskTitle,
289 'descriptionHtml' => $taskDescriptionHtml,
290 'description' =>
$GLOBALS[
'LANG']->sL($task[
'description']),
293 'uid' => $extKey .
'.' . $taskClass
300 $this->content .= $flashMessage->render();
318 if (
$GLOBALS[
'BE_USER']->mayMakeShortcut()) {
319 $buttons[
'shortcut'] = $this->doc->makeShortcutIcon(
'',
'function', $this->MCONF[
'name']);
336 $tsConfig =
$GLOBALS[
'BE_USER']->getTSConfig(
'taskcenter.' . $extKey .
'.' . $taskClass);
337 if (isset($tsConfig[
'value']) && (
int)$tsConfig[
'value'] === 0) {
341 if (
$GLOBALS[
'BE_USER']->isAdmin()) {
345 if ((
int)
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'taskcenter'][$extKey][$taskClass][
'admin'] === 1) {
359 $this->doc->JScodeArray[] =
'function resizeIframe(frame,max) { 360 var parent = $("typo3-docbody"); 361 var parentHeight = $(parent).getHeight() - 0; 362 var parentWidth = $(parent).getWidth() - $("taskcenter-menu").getWidth() - 50; 363 $("list_frame").setStyle({height: parentHeight+"px", width: parentWidth+"px"}); 366 Event.observe(window, "resize", resizeIframe, false);';
367 return '<iframe onload="resizeIframe(this,' . $max .
');" scrolling="auto" width="100%" src="' . $url .
'" name="list_frame" id="list_frame" frameborder="no" style="margin-top:-51px;border: none;"></iframe>';
378 $search = array(
'.',
'_');
379 $replace = array(
'-',
'');
380 return str_replace($search, $replace, $string);
390 $onClick =
'devlogWin=window.open(\'' . $url .
'\',\
'taskcenter\',\'width=790,status=0,menubar=1,resizable=1,location=0,scrollbars=1,toolbar=0\');return false;';
391 $content =
'<a href="#" onclick="' . htmlspecialchars($onClick) .
'">' .
'<img' .
\TYPO3\CMS\Backend\Utility\IconUtility::skinImg(
$GLOBALS[
'BACK_PATH'],
'gfx/open_in_new_window.gif',
'width="19" height="14"') .
' title="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.openInNewWindow', TRUE) .
'" class="absmiddle" alt="" />' .
'</a>';
renderInformationContent()
urlInIframe($url, $max=0)
static skinImg($backPath, $src, $wHattribs='', $outputMode=0)
static cshItem($table, $field, $BACK_PATH, $wrap='', $onlyIconMode=FALSE, $styleAttrib='')
static getIndpEnv($getEnvName)
static makeInstance($className)
checkAccess($extKey, $taskClass)
static getModuleUrl($moduleName, $urlParameters=array(), $backPathOverride=FALSE, $returnAbsoluteUrl=FALSE)
renderListMenu($items, $mainMenu=FALSE)
description($title, $description='')
static getFuncMenu($mainParams, $elementName, $currentValue, $menuItems, $script='', $addparams='')
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]