Project

General

Profile

Bug #24121 » 16426_v3.diff

Administrator Admin, 2011-01-18 20:09

View differences:

typo3/class.browse_links.php (working copy)
// CurrentUrl - the current link url must be passed around if it exists
if ($this->mode == 'wizard') {
$currentLinkParts = t3lib_div::unQuoteFilenames($this->P['currentValue'], TRUE);
$currentValues = t3lib_div::trimExplode(chr(10), trim($this->P['currentValue']));
if (count($currentValues) > 0) {
$currentValue = array_pop($currentValues);
} else {
$currentValue = '';
}
$currentLinkParts = t3lib_div::unQuoteFilenames($currentValue, TRUE);
$initialCurUrlArray = array (
'href' => $currentLinkParts[0],
'target' => $currentLinkParts[1],
......
cur_params = cur_params.replace(/\bid\=.*?(\&|$)/, "");
}
input = input + " " + cur_target + " " + cur_class + " " + cur_title + " " + cur_params;
field.value = input;
if(field.value && field.className.search(/textarea/) != -1) {
field.value += "\n" + input;
} else {
field.value = input;
}
'.$update.'
}
}
typo3/sysext/cms/ext_tables.sql (working copy)
fe_group varchar(100) DEFAULT '0' NOT NULL,
header_link varchar(255) DEFAULT '' NOT NULL,
imagecaption_position varchar(6) DEFAULT '' NOT NULL,
image_link varchar(255) DEFAULT '' NOT NULL,
image_link text,
image_zoom tinyint(3) unsigned DEFAULT '0' NOT NULL,
image_noRows tinyint(3) unsigned DEFAULT '0' NOT NULL,
image_effects tinyint(3) unsigned DEFAULT '0' NOT NULL,
typo3/sysext/cms/locallang_ttc.xml (working copy)
<label index="image_noRows.I.0">Deactivate</label>
<label index="image_noRows_formlabel">Display as Rows</label>
<label index="image_link">Link:</label>
<label index="image_link_formlabel">Links (separate with commas, one link per image)</label>
<label index="image_link_formlabel">Links (One per Line, One Link per Image)</label>
<label index="image_zoom">Click-enlarge:</label>
<label index="image_zoom_formlabel">Enlarge on Click</label>
<label index="image_effects">Effects:</label>
typo3/sysext/cms/tbl_tt_content.php (working copy)
'exclude' => 1,
'label' => 'LLL:EXT:cms/locallang_ttc.xml:image_link',
'config' => array(
'type' => 'input',
'size' => '50',
'max' => '51200',
'eval' => 'trim',
'type' => 'text',
'cols' => '30',
'rows' => '3',
'wizards' => array(
'_PADDING' => 2,
'link' => array(
typo3/sysext/install/mod/class.tx_install.php (working copy)
require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_migrateworkspaces.php');
require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_flagsfromsprite.php');
require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_addflexformstoacl.php');
require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_imagelink.php');
/**
* Install Tool module
typo3/sysext/install/updates/class.tx_coreupdates_imagelink.php (revision 0)
<?php
/***************************************************************
* Copyright notice
*
* (c) 2011 Christian Kuhn <lolli@schwarzbu.ch>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Contains the update class to split existing image_link field by comma and
* switch to newlines.
*
* @author Christian Kuhn <lolli@schwarzbu.ch>
*/
class tx_coreupdates_imagelink extends Tx_Install_Updates_Base {
protected $title = 'Update Existing image links';
/**
* Checks if an update is needed
*
* @param string &$description: The description for the update
* @return boolean True if an update is needed, false otherwise
*/
public function checkForUpdate(&$description) {
$description = 'Since TYPO3 4.5 links to images of "Image" and "Text with image" content elements are separated by newline and not by comma anymore. This update converts existing comma separated links to the new form.';
$result = FALSE;
if ($this->versionNumber >= 4005000) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'uid',
'tt_content',
'image_link!="" AND image_link LIKE "%,%" AND image_link NOT LIKE "%\\n%"',
'',
'',
'1'
);
if($GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
$result = TRUE;
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
}
return $result;
}
/**
* Performs the database update.
*
* @param array &$dbQueries: queries done in this update
* @param mixed &$customMessages: custom messages
* @return boolean True on success, false on error
*/
public function performUpdate(&$dbQueries, &$customMessages) {
$result = TRUE;
if($this->versionNumber >= 4005000) {
$affectedRows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
'uid, image_link',
'tt_content',
'image_link!="" AND image_link LIKE "%,%" AND image_link NOT LIKE "%\\n%"'
);
foreach ($affectedRows as $row) {
$newImageLink = t3lib_div::trimExplode(',', $row['image_link']);
$newImageLink = implode(chr(10), $newImageLink);
$GLOBALS['TYPO3_DB']->exec_UPDATEquery('tt_content', 'uid=' . $row['uid'], array('image_link' => $newImageLink));
$dbQueries[] = str_replace(chr(10), ' ', $GLOBALS['TYPO3_DB']->debug_lastBuiltQuery);
if ($GLOBALS['TYPO3_DB']->sql_error()) {
$customMessages = 'SQL-ERROR: ' . htmlspecialchars($GLOBALS['TYPO3_DB']->sql_error());
$result = $result & FALSE;
}
}
}
return $result;
}
}
?>
typo3/sysext/install/ext_localconf.php (working copy)
// Version 4.5: Adds excludeable FlexForm fields to Backend group access lists (ACL)
$TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['update']['addFlexformsToAcl'] = 'tx_coreupdates_addflexformstoacl';
?>
// Version 4.5: Split tt_content image_link to newline by comma
$TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['update']['imagelink'] = 'tx_coreupdates_imagelink';
?>
typo3/sysext/css_styled_content/static/setup.txt (working copy)
enable.field = image_zoom
enable.ifEmpty.typolink.parameter.field = image_link
enable.ifEmpty.typolink.parameter.listNum.splitChar = 10
enable.ifEmpty.typolink.parameter.listNum.stdWrap.data = register : IMAGE_NUM_CURRENT
enable.ifEmpty.typolink.returnLast = url
typolink.parameter.field = image_link
typolink.parameter.listNum.splitChar = 10
typolink.parameter.listNum.stdWrap.data = register : IMAGE_NUM_CURRENT
typolink.target = {$styles.content.links.target}
typolink.extTarget = {$styles.content.links.extTarget}
(5-5/5)