TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\SysAction\ActionTask Class Reference
Inheritance diagram for TYPO3\CMS\SysAction\ActionTask:
TYPO3\CMS\Taskcenter\TaskInterface

Public Member Functions

 __construct (\TYPO3\CMS\Taskcenter\Controller\TaskModuleController $taskObject)
 
 getTask ()
 
 getOverview ()
 

Protected Member Functions

 getActions ()
 
 renderActionList ()
 
 viewNewBackendUser ($record)
 
 deleteUser ($userId, $actionId)
 
 isCreatedByUser ($id, $action)
 
 getCreatedUsers ($action, $selectedUser)
 
 action_linkUserName ($username, $realName, $sysActionUid, $userId)
 
 saveNewBackendUser ($record, $vars)
 
 fixUsername ($username, $prefix)
 
 fixUserGroup ($appliedUsergroups, $actionRecord)
 
 fixDbMount ($appliedDbMounts)
 
 checkRootline ($pageId)
 
 action_createDir ($uid)
 
 action_getUserMainDir ()
 
 getUsergroups ($record, $vars)
 
 viewNewRecord ($record)
 
 viewEditRecord ($record)
 
 viewSqlQuery ($record)
 
 viewRecordList ($record)
 
 addMessage ($message, $title='', $severity=FlashMessage::OK)
 
 renderFlashMessages ()
 
 getLanguageService ()
 
 getBackendUser ()
 
 getDatabaseConnection ()
 

Protected Attributes

 $taskObject
 
 $hookObjects = []
 
 $moduleUrl
 
 $iconFactory
 

Detailed Description

This class provides a task for the taskcenter

Definition at line 28 of file ActionTask.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ action_createDir()

TYPO3\CMS\SysAction\ActionTask::action_createDir (   $uid)
protected

Create a user directory if defined

Parameters
int$uidId of the user record
Returns
void

Definition at line 621 of file ActionTask.php.

References $uid, TYPO3\CMS\SysAction\ActionTask\action_getUserMainDir(), and TYPO3\CMS\Core\Utility\GeneralUtility\mkdir().

Referenced by TYPO3\CMS\SysAction\ActionTask\saveNewBackendUser().

◆ action_getUserMainDir()

TYPO3\CMS\SysAction\ActionTask::action_getUserMainDir ( )
protected

Get the path to the user home directory which is set in the localconf.php

Returns
string Path

Definition at line 635 of file ActionTask.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\isFirstPartOfStr().

Referenced by TYPO3\CMS\SysAction\ActionTask\action_createDir().

◆ action_linkUserName()

TYPO3\CMS\SysAction\ActionTask::action_linkUserName (   $username,
  $realName,
  $sysActionUid,
  $userId 
)
protected

Create a link to edit a user

Parameters
string$usernameUsername
string$realNameReal name of the user
int$sysActionUidId of the sys_action record
int$userIdId of the user
Returns
string html link

Definition at line 439 of file ActionTask.php.

References TYPO3\CMS\SysAction\ActionTask\getLanguageService(), and TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL.

Referenced by TYPO3\CMS\SysAction\ActionTask\getCreatedUsers().

◆ addMessage()

TYPO3\CMS\SysAction\ActionTask::addMessage (   $message,
  $title = '',
  $severity = FlashMessage::OK 
)
protected

◆ checkRootline()

TYPO3\CMS\SysAction\ActionTask::checkRootline (   $pageId)
protected

Check if a page is inside the rootline the current user can see

Parameters
int$pageIdId of the the page to be checked
Returns
bool Access to the page

Definition at line 602 of file ActionTask.php.

References TYPO3\CMS\Backend\Utility\BackendUtility\BEgetRootLine(), and TYPO3\CMS\SysAction\ActionTask\getBackendUser().

Referenced by TYPO3\CMS\SysAction\ActionTask\fixDbMount().

◆ deleteUser()

TYPO3\CMS\SysAction\ActionTask::deleteUser (   $userId,
  $actionId 
)
protected

Delete a BE user and redirect to the action by its id

Parameters
int$userIdId of the BE user
int$actionIdId of the action
Returns
void

Definition at line 371 of file ActionTask.php.

References $GLOBALS, TYPO3\CMS\SysAction\ActionTask\getDatabaseConnection(), and TYPO3\CMS\Core\Utility\HttpUtility\redirect().

Referenced by TYPO3\CMS\SysAction\ActionTask\viewNewBackendUser().

◆ fixDbMount()

TYPO3\CMS\SysAction\ActionTask::fixDbMount (   $appliedDbMounts)
protected

Clean the to be applied DB-Mounts from not allowed ones

Parameters
string$appliedDbMountsList of pages like pages_123,pages456
Returns
string Cleaned list

Definition at line 575 of file ActionTask.php.

References $uid, TYPO3\CMS\SysAction\ActionTask\checkRootline(), TYPO3\CMS\SysAction\ActionTask\getBackendUser(), TYPO3\CMS\Backend\Utility\BackendUtility\getRecord(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\SysAction\ActionTask\saveNewBackendUser().

◆ fixUserGroup()

TYPO3\CMS\SysAction\ActionTask::fixUserGroup (   $appliedUsergroups,
  $actionRecord 
)
protected

Clean the to be applied usergroups from not allowed ones

Parameters
array$appliedUsergroupsArray of to be applied user groups
array$actionRecordThe action record
Returns
array Cleaned array

Definition at line 552 of file ActionTask.php.

Referenced by TYPO3\CMS\SysAction\ActionTask\saveNewBackendUser().

◆ fixUsername()

TYPO3\CMS\SysAction\ActionTask::fixUsername (   $username,
  $prefix 
)
protected

Create the username based on the given username and the prefix

Parameters
string$usernameUsername
string$prefixPrefix
Returns
string Combined username

Definition at line 536 of file ActionTask.php.

Referenced by TYPO3\CMS\SysAction\ActionTask\saveNewBackendUser().

◆ getActions()

TYPO3\CMS\SysAction\ActionTask::getActions ( )
protected

Get all actions of an user. Admins can see any action, all others only those which are allowed in sys_action record itself.

Returns
array Array holding every needed information of a sys_action

Definition at line 162 of file ActionTask.php.

References TYPO3\CMS\SysAction\ActionTask\getBackendUser(), TYPO3\CMS\SysAction\ActionTask\getDatabaseConnection(), TYPO3\CMS\Core\Utility\GeneralUtility\getIndpEnv(), TYPO3\CMS\SysAction\ActionTask\getLanguageService(), and TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL.

Referenced by TYPO3\CMS\SysAction\ActionTask\getOverview(), and TYPO3\CMS\SysAction\ActionTask\renderActionList().

◆ getBackendUser()

◆ getCreatedUsers()

TYPO3\CMS\SysAction\ActionTask::getCreatedUsers (   $action,
  $selectedUser 
)
protected

Render all users who are created by the current BE user including a link to edit the record

Parameters
array$actionsys_action record.
int$selectedUserId of a selected user
Returns
string html list of users

Definition at line 406 of file ActionTask.php.

References TYPO3\CMS\SysAction\ActionTask\action_linkUserName(), TYPO3\CMS\Backend\Utility\BackendUtility\deleteClause(), TYPO3\CMS\SysAction\ActionTask\getBackendUser(), TYPO3\CMS\SysAction\ActionTask\getDatabaseConnection(), TYPO3\CMS\SysAction\ActionTask\getLanguageService(), and TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL.

Referenced by TYPO3\CMS\SysAction\ActionTask\viewNewBackendUser().

◆ getDatabaseConnection()

TYPO3\CMS\SysAction\ActionTask::getDatabaseConnection ( )
protected

◆ getLanguageService()

◆ getOverview()

TYPO3\CMS\SysAction\ActionTask::getOverview ( )

General overview over the task in the taskcenter menu

Returns
string Overview as HTML

Implements TYPO3\CMS\Taskcenter\TaskInterface.

Definition at line 137 of file ActionTask.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\_GP(), TYPO3\CMS\SysAction\ActionTask\getActions(), and TYPO3\CMS\SysAction\ActionTask\getLanguageService().

◆ getTask()

◆ getUsergroups()

TYPO3\CMS\SysAction\ActionTask::getUsergroups (   $record,
  $vars 
)
protected

Get all allowed usergroups which can be applied to a user record

Parameters
array$recordsys_action record
array$varsSelected be_user record
Returns
string Rendered user groups

Definition at line 651 of file ActionTask.php.

References TYPO3\CMS\Backend\Utility\BackendUtility\getRecord(), TYPO3\CMS\Core\Utility\GeneralUtility\inList(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\SysAction\ActionTask\viewNewBackendUser().

◆ isCreatedByUser()

TYPO3\CMS\SysAction\ActionTask::isCreatedByUser (   $id,
  $action 
)
protected

Check if a BE user is created by the current user

Parameters
int$idId of the BE user
array$actionsys_action record.
Returns
mixed The record of the BE user if found, otherwise FALSE

Definition at line 389 of file ActionTask.php.

References TYPO3\CMS\SysAction\ActionTask\getBackendUser(), and TYPO3\CMS\Backend\Utility\BackendUtility\getRecord().

Referenced by TYPO3\CMS\SysAction\ActionTask\viewNewBackendUser().

◆ renderActionList()

◆ renderFlashMessages()

TYPO3\CMS\SysAction\ActionTask::renderFlashMessages ( )
protected

◆ saveNewBackendUser()

TYPO3\CMS\SysAction\ActionTask::saveNewBackendUser (   $record,
  $vars 
)
protected

◆ viewEditRecord()

◆ viewNewBackendUser()

◆ viewNewRecord()

TYPO3\CMS\SysAction\ActionTask::viewNewRecord (   $record)
protected

Action to create a new record

Parameters
array$recordsys_action record
Returns
void Redirect to form to create a record

Definition at line 676 of file ActionTask.php.

References TYPO3\CMS\Core\Utility\HttpUtility\redirect().

Referenced by TYPO3\CMS\SysAction\ActionTask\getTask().

◆ viewRecordList()

◆ viewSqlQuery()

Member Data Documentation

◆ $hookObjects

TYPO3\CMS\SysAction\ActionTask::$hookObjects = []
protected

Definition at line 40 of file ActionTask.php.

◆ $iconFactory

TYPO3\CMS\SysAction\ActionTask::$iconFactory
protected

Definition at line 52 of file ActionTask.php.

◆ $moduleUrl

TYPO3\CMS\SysAction\ActionTask::$moduleUrl
protected

Definition at line 47 of file ActionTask.php.

◆ $taskObject

TYPO3\CMS\SysAction\ActionTask::$taskObject
protected

Definition at line 33 of file ActionTask.php.

Referenced by TYPO3\CMS\SysAction\ActionTask\__construct().