TYPO3  7.6
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ActionTask Class Reference
Inheritance diagram for ActionTask:
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)
 
 getLanguageService ()
 
 getBackendUser ()
 
 getDatabaseConnection ()
 

Protected Attributes

 $taskObject
 
 $hookObjects = array()
 
 $moduleUrl
 
 $iconFactory
 

Detailed Description

This class provides a task for the taskcenter

Definition at line 26 of file ActionTask.php.

Constructor & Destructor Documentation

Member Function Documentation

action_createDir (   $uid)
protected

Create a user directory if defined

Parameters
int$uidId of the user record
Returns
void

Definition at line 601 of file ActionTask.php.

References ActionTask\action_getUserMainDir(), and GeneralUtility\mkdir().

Referenced by ActionTask\saveNewBackendUser().

action_getUserMainDir ( )
protected

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

Returns
string Path

Definition at line 615 of file ActionTask.php.

References $GLOBALS, and GeneralUtility\isFirstPartOfStr().

Referenced by ActionTask\action_createDir().

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 419 of file ActionTask.php.

References ActionTask\getLanguageService(), and Icon\SIZE_SMALL.

Referenced by ActionTask\getCreatedUsers().

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 582 of file ActionTask.php.

References BackendUtility\BEgetRootLine(), and ActionTask\getBackendUser().

Referenced by ActionTask\fixDbMount().

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 351 of file ActionTask.php.

References $GLOBALS, and ActionTask\getDatabaseConnection().

Referenced by ActionTask\viewNewBackendUser().

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 555 of file ActionTask.php.

References ActionTask\checkRootline(), ActionTask\getBackendUser(), BackendUtility\getRecord(), and GeneralUtility\trimExplode().

Referenced by ActionTask\saveNewBackendUser().

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 532 of file ActionTask.php.

Referenced by ActionTask\saveNewBackendUser().

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 516 of file ActionTask.php.

Referenced by ActionTask\saveNewBackendUser().

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 158 of file ActionTask.php.

References ActionTask\getBackendUser(), ActionTask\getDatabaseConnection(), GeneralUtility\getIndpEnv(), ActionTask\getLanguageService(), and Icon\SIZE_SMALL.

Referenced by ActionTask\getOverview(), and ActionTask\renderActionList().

getBackendUser ( )
protected
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 386 of file ActionTask.php.

References ActionTask\action_linkUserName(), BackendUtility\deleteClause(), ActionTask\getBackendUser(), ActionTask\getDatabaseConnection(), ActionTask\getLanguageService(), and Icon\SIZE_SMALL.

Referenced by ActionTask\viewNewBackendUser().

getDatabaseConnection ( )
protected

Returns the database connection

Returns

Definition at line 931 of file ActionTask.php.

References $GLOBALS.

Referenced by ActionTask\deleteUser(), ActionTask\getActions(), ActionTask\getCreatedUsers(), and ActionTask\viewSqlQuery().

getLanguageService ( )
protected
getOverview ( )

General overview over the task in the taskcenter menu

Returns
string Overview as HTML

Implements TaskInterface.

Definition at line 133 of file ActionTask.php.

References GeneralUtility\_GP(), ActionTask\getActions(), and ActionTask\getLanguageService().

getTask ( )
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 631 of file ActionTask.php.

References BackendUtility\getRecord(), GeneralUtility\inList(), and GeneralUtility\trimExplode().

Referenced by ActionTask\viewNewBackendUser().

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 369 of file ActionTask.php.

References ActionTask\getBackendUser(), and BackendUtility\getRecord().

Referenced by ActionTask\viewNewBackendUser().

renderActionList ( )
protected

Render the menu of sys_actions

Returns
string List of sys_actions as HTML

Definition at line 204 of file ActionTask.php.

References ActionTask\getActions(), ActionTask\getBackendUser(), ActionTask\getLanguageService(), GeneralUtility\makeInstance(), and Icon\SIZE_SMALL.

Referenced by ActionTask\getTask().

saveNewBackendUser (   $record,
  $vars 
)
protected

Save/Update a BE user

Parameters
array$recordCurrent action record
array$varsPOST vars
Returns
int Id of the new/updated user

Definition at line 442 of file ActionTask.php.

References $GLOBALS, ActionTask\action_createDir(), ActionTask\fixDbMount(), ActionTask\fixUserGroup(), ActionTask\fixUsername(), ActionTask\getBackendUser(), BackendUtility\getRecord(), if, and GeneralUtility\makeInstance().

Referenced by ActionTask\viewNewBackendUser().

viewEditRecord (   $record)
protected

Action to edit records

Parameters
array$recordsys_action record
Returns
string list of records

Definition at line 676 of file ActionTask.php.

References $GLOBALS, BackendUtility\dateTimeAge(), ActionTask\getLanguageService(), BackendUtility\getRecord(), BackendUtility\getRecordPath(), BackendUtility\getRecordTitle(), GeneralUtility\makeInstance(), and Icon\SIZE_SMALL.

Referenced by ActionTask\getTask().

viewNewBackendUser (   $record)
protected
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 656 of file ActionTask.php.

Referenced by ActionTask\getTask().

viewRecordList (   $record)
protected

Action to create a list of records of a specific table and pid

Parameters
array$recordsys_action record
Returns
string list of records

Definition at line 794 of file ActionTask.php.

References $GLOBALS, GeneralUtility\_GP(), ActionTask\getBackendUser(), GeneralUtility\getIndpEnv(), ActionTask\getLanguageService(), if, GeneralUtility\makeInstance(), GeneralUtility\quoteJSvalue(), and BackendUtility\readPageAccess().

Referenced by ActionTask\getTask().

viewSqlQuery (   $record)
protected

Action to view the result of a SQL query

Parameters
array$recordsys_action record
Returns
string Result of the query

Definition at line 722 of file ActionTask.php.

References $GLOBALS, ActionTask\getBackendUser(), ActionTask\getDatabaseConnection(), GeneralUtility\getIndpEnv(), ActionTask\getLanguageService(), GeneralUtility\makeInstance(), and Icon\SIZE_SMALL.

Referenced by ActionTask\getTask().

Member Data Documentation

$hookObjects = array()
protected

Definition at line 38 of file ActionTask.php.

$iconFactory
protected

Definition at line 50 of file ActionTask.php.

$moduleUrl
protected

Definition at line 45 of file ActionTask.php.

$taskObject
protected

Definition at line 31 of file ActionTask.php.

Referenced by ActionTask\__construct().