EXT: Taskcenter

Extension Key: taskcenter

Language: en

Keywords: forDevelopers, forIntermediates

Copyright 2000-2010, Georg Ringer, <typo3@ringerge.org>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.org

Table of Contents

EXT: Taskcenter	1

Introduction	3

What does it do?	3

Screenshots	3

Administration	4

Developer's Guide	5

Creating a new task	5

Taskcenter API	5

Known problems	7

To-Do list	8

ChangeLog	9

Introduction

What does it do?

The Taskcenter is designed to be a place to manage all kind of tasks. It is especially useful for editors to have a central place of common activities in the TYPO3 backend. The tasks need to be implemented by other extensions, for example the system extension sys_actions & impexp.

Screenshots

This is a view of the BE module's main screen. 5 different tasks are implemented in this example.

Administration

As this extensions needs to be implemented by other extensions, it doesn't provide any additional information except the rendering of tasks.

Hide tasks

It is possible to hide tasks from users by using the following TsConfig (User TsConfig):

taskcenter {

<extension-key>.<task-class>= 0

}

Be aware that the parts between the < & > need to be replace by the actual extension key and class name.

Developer's Guide

The Taskcenter makes it very easy to create a new task item. Furthermore the implementations in the extensions sys_action and impexp but also in other extensions in the TER provide a good basis to learn by example.

Creating a new task

Creating the task class

This is the heart of a task. It is the code that actually does what the task is supposed to do. A task is represented by a PHP class that implements the interface which can be found in typo3/sysext/taskcenter/interfaces/interface.tx_taskcenter_task.php:

class tx_myext_mytask implements tx_taskcenter_Task {
public function getTask() {
...
}

public function getOverview() {
...
}
}

The 2 mentioned method must be implemented!

getTask()

The function getTask() is expected to perform the task logic and returns the content of the task.

getOverview()

The function getOverview() creates an optional menu of items or description which is rendered in the menu of tasks.

Autoloading

The Taskcenter expects all task classes to be available with the TYPO3 autoloader. They thus must be declared in the ext_autoload.php file of the extension that provides these classes. Again the ext_autoload.php file of sys_action can be used as an example.

Declaring the task class

As a last step, the task class must be declared so the Taskcenter knows of its existence. The declaration must be placed in the ext_localconf.php file of the extension that provides the task. Let's look at the declaration of sys_action as an example:

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter']['sys_action']['tx_sysaction_task'] = array(

'title' => 'LLL:EXT:sys_action/locallang_tca.xml:sys_action',

'description' => 'LLL:EXT:sys_action/locallang_csh_sysaction.xml:.description',

'icon'	=> 'EXT:sys_action/sys_action.gif'

);

The registration is made in the array $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter']. A key is then used that corresponds to the task class (in bold above). Then come 3 parameters:

extension: the key of the extension that provides the class. This is used for informational purposes.

title: the name of the task. May use localized labels.

description: a text describing the task. It is displayed in the information screen of the BE module. May use localized labels.

icon: Path to an icon for the task.

Taskcenter API

It is possible to refer to the Taskcenter from other extensions. Once a SC_mod_user_task_index object has been instantiated all of its public methods can be used. The PHPdoc of the methods should be enough to understand what each is to be used for. It would be excessive to describe them all here.

However a few deserve a special mention:

description(): This method is used to render a description including title and description.

renderListMenu(): This method is used to render a menu of sub items by a given array holding the following information: Title, Link, Path to an icon, description and a special description which is not using htmlspecialchars()

Known problems

Currently there are no known problems.

Problems should be reported to the TYPO3 bug tracker (http://bugs.typo3.org/) in the “TYPO3 Core” project and “tx_taskcenter” sub-project.

To-Do list

Here are a few ideas for possible evolutions:

Provide a better way to display the tasks

Improve the icons

Feature ideas or wishes can be entered into the TYPO3 bug tracker (http://bugs.typo3.org/) in the “TYPO3 Core” project and “tx_taskcenter” sub-project.

ChangeLog

Version	Changes:
1.0.0	Integration into the TYPO3 core
2.0.0	Complete renewal including the manual

EXT: Taskcenter - taskcenter	ChangeLog

9

EXT: Taskcenter

taskcenter

forDevelopers forIntermediates

2010-02-18T17:33:18