TYPO3 API  SVNRelease
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
t3lib_frontendedit Class Reference

List of all members.

Public Member Functions

 initConfigOptions ()
 displayEditPanel ($content, array $conf, $currentRecord, array $dataArray)
 displayEditIcons ($content, $params, array $conf=array(), $currentRecord= '', array $dataArray=array(), $addUrlParamStr= '')
 isEditAction ()
 isEditFormShown ()
 editAction ()
 doHide ($table, $uid)
 doUnhide ($table, $uid)
 doUp ($table, $uid)
 doDown ($table, $uid)
 doMoveAfter ($table, $uid)
 doDelete ($table, $uid)
 doSave ($table, $uid)
 doSaveAndClose ($table, $uid)
 doClose ($table, $uid)
 getJavascriptIncludes ()
 getHiddenFields (array $dataArray)

Public Attributes

 $TSFE_EDIT

Protected Member Functions

 move ($table, $uid, $direction= '', $afterUID=0)
 allowedToEditLanguage ($table, array $currentRecord)
 allowedToEdit ($table, array $dataArray, array $conf, $checkEditAccessInternals=TRUE)
 getAllowedEditActions ($table, array $conf, $pid, $allow= '')
 initializeTceMain ()

Protected Attributes

 $tce

Detailed Description

Definition at line 38 of file class.t3lib_frontendedit.php.


Member Function Documentation

t3lib_frontendedit::allowedToEdit ( table,
array $  dataArray,
array $  conf,
checkEditAccessInternals = TRUE 
) [protected]

Checks whether the user is allowed to edit the requested table.

Parameters:
stringThe name of the table.
arrayThe data array.
arrayThe configuration array for the edit panel.
booleanBoolean indicating whether recordEditAccessInternals should not be checked. Defaults to true but doesn't makes sense when creating new records on a page.
Returns:
boolean

Definition at line 506 of file class.t3lib_frontendedit.php.

References $GLOBALS, getAllowedEditActions(), t3lib_BEfunc\getRecord(), t3lib_div\strtolower(), and t3lib_div\trimExplode().

Referenced by displayEditIcons(), and displayEditPanel().

t3lib_frontendedit::allowedToEditLanguage ( table,
array $  currentRecord 
) [protected]

Checks whether the user has access to edit the language for the requested record.

Parameters:
stringThe name of the table.
arrayThe record.
Returns:
boolean

Definition at line 475 of file class.t3lib_frontendedit.php.

References $GLOBALS.

Referenced by displayEditIcons(), and displayEditPanel().

t3lib_frontendedit::displayEditIcons ( content,
params,
array $  conf = array(),
currentRecord = '',
array $  dataArray = array(),
addUrlParamStr = '' 
)

Adds an edit icon to the content string. The edit icon links to alt_doc.php with proper parameters for editing the table/fields of the context. This implements TYPO3 context sensitive editing facilities. Only backend users will have access (if properly configured as well).

Parameters:
stringThe content to which the edit icons should be appended
stringThe parameters defining which table and fields to edit. Syntax is [tablename]:[fieldname],[fieldname],[fieldname],... OR [fieldname],[fieldname],[fieldname],... (basically "[tablename]:" is optional, default table is the one of the "current record" used in the function). The fieldlist is sent as "&columnsOnly=" parameter to alt_doc.php
arrayTypoScript properties for configuring the edit icons.
stringThe "table:uid" of the record being shown. If empty string then $this->currentRecord is used. For new records (set by $conf['newRecordFromTable']) it's auto-generated to "[tablename]:NEW"
arrayAlternative data array to use. Default is $this->data
stringAdditional URL parameters for the link pointing to alt_doc.php
Returns:
string The input content string, possibly with edit icons added (not necessarily in the end but just after the last string of normal content.

Definition at line 137 of file class.t3lib_frontendedit.php.

References $content, $GLOBALS, allowedToEdit(), allowedToEditLanguage(), t3lib_div\getUserObj(), and t3lib_div\trimExplode().

Referenced by displayEditPanel().

t3lib_frontendedit::displayEditPanel ( content,
array $  conf,
currentRecord,
array $  dataArray 
)

Generates the "edit panels" which can be shown for a page or records on a page when the Admin Panel is enabled for a backend users surfing the frontend. With the "edit panel" the user will see buttons with links to editing, moving, hiding, deleting the element This function is used for the cObject EDITPANEL and the stdWrap property ".editPanel"

Parameters:
stringA content string containing the content related to the edit panel. For cObject "EDITPANEL" this is empty but not so for the stdWrap property. The edit panel is appended to this string and returned.
arrayTypoScript configuration properties for the editPanel
stringThe "table:uid" of the record being shown. If empty string then $this->currentRecord is used. For new records (set by $conf['newRecordFromTable']) it's auto-generated to "[tablename]:NEW"
arrayAlternative data array to use. Default is $this->data
Returns:
string The input content string with the editPanel appended. This function returns only an edit panel appended to the content string if a backend user is logged in (and has the correct permissions). Otherwise the content string is directly returned.

Definition at line 82 of file class.t3lib_frontendedit.php.

References $content, $GLOBALS, allowedToEdit(), allowedToEditLanguage(), displayEditIcons(), getAllowedEditActions(), getHiddenFields(), and t3lib_div\getUserObj().

t3lib_frontendedit::doClose ( table,
uid 
)

Stub for closing a record. No real functionality needed since content element rendering will take care of everything.

Parameters:
stringThe table name for the record to close.
integerThe UID for the record to close.
Returns:
void

Definition at line 463 of file class.t3lib_frontendedit.php.

t3lib_frontendedit::doDelete ( table,
uid 
)

Deletes a specific record.

Parameters:
stringThe table name for the record to delete.
integerThe UID for the record to delete.
Returns:
void

Definition at line 404 of file class.t3lib_frontendedit.php.

References initializeTceMain().

t3lib_frontendedit::doDown ( table,
uid 
)

Moves a record down.

Parameters:
stringThe table name for the record to move.
integerThe UID for the record to move.
Returns:
void

Definition at line 307 of file class.t3lib_frontendedit.php.

References move().

t3lib_frontendedit::doHide ( table,
uid 
)

Hides a specific record.

Parameters:
stringThe table name for the record to hide.
integerThe UID for the record to hide.
Returns:
void

Definition at line 258 of file class.t3lib_frontendedit.php.

References $GLOBALS, and initializeTceMain().

t3lib_frontendedit::doMoveAfter ( table,
uid 
)

Moves a record after a given element. Used for drag.

Parameters:
stringThe table name for the record to move.
integerThe UID for the record to move.
Returns:
void

Definition at line 318 of file class.t3lib_frontendedit.php.

References $GLOBALS, and move().

t3lib_frontendedit::doSave ( table,
uid 
)

Saves a record based on its data array.

Parameters:
stringThe table name for the record to save.
integerThe UID for the record to save.
Returns:
void

Definition at line 420 of file class.t3lib_frontendedit.php.

References $GLOBALS, and initializeTceMain().

Referenced by doSaveAndClose().

t3lib_frontendedit::doSaveAndClose ( table,
uid 
)

Saves a record based on its data array and closes it.

Parameters:
stringThe table name for the record to save.
integerThe UID for the record to save.
Returns:
void
Note:
This method is only a wrapper for doSave() but is needed so that frontend editing views can handle "save" differently from "save and close". Example: When editing a page record, "save" reloads the same editing form. "Save and close" reloads the entire page at the appropriate URL.

Definition at line 450 of file class.t3lib_frontendedit.php.

References doSave().

t3lib_frontendedit::doUnhide ( table,
uid 
)

Unhides (shows) a specific record.

Parameters:
stringThe table name for the record to unhide.
integerThe UID for the record to unhide.
Returns:
void

Definition at line 277 of file class.t3lib_frontendedit.php.

References $GLOBALS, and initializeTceMain().

t3lib_frontendedit::doUp ( table,
uid 
)

Moves a record up.

Parameters:
stringThe table name for the record to move.
integerThe UID for the record to hide.
Returns:
void

Definition at line 296 of file class.t3lib_frontendedit.php.

References move().

t3lib_frontendedit::editAction ( )

Management of the on-page frontend editing forms and edit panels. Basically taking in the data and commands and passes them on to the proper classes as they should be.

Returns:
void
Exceptions:
UnexpectedValueExceptionif TSFE_EDIT[cmd] is not a valid command
See also:
index_ts.php

Definition at line 218 of file class.t3lib_frontendedit.php.

References $GLOBALS, and t3lib_div\callUserFunction().

Referenced by initConfigOptions().

t3lib_frontendedit::getAllowedEditActions ( table,
array $  conf,
pid,
allow = '' 
) [protected]

Takes an array of generally allowed actions and filters that list based on page and content permissions.

Parameters:
stringThe name of the table.
arrayThe configuration array.
integerThe PID where editing will occur.
stringComma-separated list of actions that are allowed in general.
Returns:
array

Definition at line 561 of file class.t3lib_frontendedit.php.

References $GLOBALS, $pid, t3lib_div\strtolower(), and t3lib_div\trimExplode().

Referenced by allowedToEdit(), and displayEditPanel().

t3lib_frontendedit::getHiddenFields ( array $  dataArray)

Gets the hidden fields (array key=field name, value=field value) to be used in the edit panel for a particular content element. In the normal case, no hidden fields are needed but special controllers such as TemplaVoila need to track flexform pointers, etc.

Parameters:
arrayThe data array for a specific content element.
Returns:
array

Definition at line 616 of file class.t3lib_frontendedit.php.

Referenced by displayEditPanel().

t3lib_frontendedit::getJavascriptIncludes ( )

Adds any extra Javascript includes needed for Front-end editing

Parameters:
none
Returns:
string

Definition at line 604 of file class.t3lib_frontendedit.php.

t3lib_frontendedit::initConfigOptions ( )

Initializes configuration options.

Returns:
void

Definition at line 59 of file class.t3lib_frontendedit.php.

References $GLOBALS, t3lib_div\_GP(), editAction(), and isEditAction().

t3lib_frontendedit::initializeTceMain ( ) [protected]

Initializes t3lib_TCEmain since it is used on modification actions.

Returns:
void

Definition at line 626 of file class.t3lib_frontendedit.php.

References t3lib_div\makeInstance().

Referenced by doDelete(), doHide(), doSave(), doUnhide(), and move().

t3lib_frontendedit::isEditAction ( )

Returns true if an edit-action is sent from the Admin Panel

Returns:
boolean
See also:
index_ts.php

Definition at line 179 of file class.t3lib_frontendedit.php.

Referenced by initConfigOptions().

t3lib_frontendedit::isEditFormShown ( )

Returns true if an edit form is shown on the page. Used from index_ts.php where a true return-value will result in classes etc. being included.

Returns:
boolean
See also:
index_ts.php

Definition at line 201 of file class.t3lib_frontendedit.php.

t3lib_frontendedit::move ( table,
uid,
direction = '',
afterUID = 0 
) [protected]

Moves a record

Parameters:
stringThe table name for the record to move.
integerThe UID for the record to move.
stringThe direction to move, either 'up' or 'down'.
integerThe UID of record to move after. This is specified for dragging only.
Returns:
void

Definition at line 332 of file class.t3lib_frontendedit.php.

References $GLOBALS, $res, $row, initializeTceMain(), and t3lib_div\trimExplode().

Referenced by doDown(), doMoveAfter(), and doUp().


Member Data Documentation

t3lib_frontendedit::$tce [protected]

Definition at line 52 of file class.t3lib_frontendedit.php.

t3lib_frontendedit::$TSFE_EDIT

Definition at line 45 of file class.t3lib_frontendedit.php.


The documentation for this class was generated from the following file: