Project

General

Profile

Bug #19646 ยป 9845_dividers.diff

Administrator Admin, 2008-11-26 03:15

View differences:

t3lib/class.t3lib_extmgm.php (working copy)
if (is_array($types)) {
// Iterate through all types and search for the field that defines the palette to be extended:
foreach (array_keys($types) as $type) {
$fields = self::getFieldsOfFieldList($types[$type]['showitem']);
$fields = self::getFieldsFromFieldList($types[$type]['showitem']);
if (isset($fields[$field])) {
// If the field already has a palette, extend it:
if ($fields[$field]['details']['palette']) {
......
// Insert data before or after insertion points:
} else {
$positions = t3lib_div::trimExplode(',', $insertionPosition, true);
$fields = self::getFieldsOfFieldList($list);
$fields = self::getFieldsFromFieldList($list);
$isInserted = false;
// Iterate through all fields an check whether it's possible to inserte there:
foreach ($fields as $field => &$fieldDetails) {
......
* @see executePositionedStringInsertion
* @param string $field: The name of the field/item
* @param array $fieldDetails: Additional details of the field like e.g. palette information
* (this array gets created by the function getFieldsOfFieldList())
* (this array gets created by the function getFieldsFromFieldList())
* @return array The needled to be used for inserting content before or after existing fields/items
*/
protected static function getInsertionNeedles($field, array $fieldDetails) {
......
* (this mostly reflects the data in $TCA[<table>]['types'][<type>]['showitem'])
* @return array An array with the names of the fields as keys and additional information
*/
protected static function getFieldsOfFieldList($fieldList) {
protected static function getFieldsFromFieldList($fieldList) {
$fields = array();
$fieldParts = t3lib_div::trimExplode(',', $fieldList, true);
foreach ($fieldParts as $fieldPart) {
$fieldDetails = t3lib_div::trimExplode(';', $fieldPart, false, 5);
if (!isset($fields[$fieldDetails[0]])) {
if ($fieldDetails[0] != '--div--' && !isset($fields[$fieldDetails[0]])) {
$fields[$fieldDetails[0]] = array(
'rawData' => $fieldPart,
'details' => array(
'field' => $fieldDetails[0],
'label' => $fieldDetails[1],
'field' => $fieldDetails[0],
'label' => $fieldDetails[1],
'palette' => $fieldDetails[2],
'special' => $fieldDetails[3],
'styles' => $fieldDetails[4],
'styles' => $fieldDetails[4],
),
);
} elseif ($fieldDetails[0] == '--div--') {
$fields[$fieldDetails[0] . ';' . $fieldDetails[1]] = array(
'rawData' => $fieldPart,
'details' => array(
'field' => $fieldDetails[0],
'label' => $fieldDetails[1],
'palette' => '',
'special' => '',
'styles' => ''
),
);
}
......
}
/**
* Generates a list of fields/items out of an array provided by the function getFieldsOfFieldList().
* Generates a list of fields/items out of an array provided by the function getFieldsFromFieldList().
*
* @see getFieldsOfFieldList
* @see getFieldsFromFieldList
* @param array $fields: The array of fields with optional additional information
* @param boolean $useRawData: Use raw data instead of building by using the details (default: false)
* @return string The list of fields/items which gets used for $TCA[<table>]['types'][<type>]['showitem']
    (1-1/1)