Commit 39e743ec authored by Dirk Wildt's avatar Dirk Wildt
Browse files

Initial Git Release

parents
Pipeline #16 skipped
.git.local/**
.svn/**
nbproject/**
tmp/**
6.2.1
16-01-14
Bugfix
* #i0014: linkhandler 2.0.dev will installed proper
6.2.0
15-12-28
Improvement
* #i0013: linkhandler is moved from 1.1.0 to 2.0.dev
See:
* Initialisation/Extensions/linkhandler
* #i0012: ext_emconf.php: 'linkhandler' => '2.0.0-'
6.1.2
15-12-17
Improvement
* #i0011: ext_emconf.php: 'linkhandler' => '1.1.0-2.9.99'
6.1.1
15-05-09
Improvement
* #i0010: news system (news)
6.1.0
15-05-09
Feature
* #i0009: Configuration for news system (news)
Effected files:
* see #i0008
* #i0008: Configuration for sf_event_mgt
Thanks to Carsten Hager / Munich
Effected files:
* ext_conf_template.txt
* ext_tables.php
* static
* constants.txt
* setup.txt
* tsConfig
* tx_news_domain_model_news.php
* tx_sfeventmgt_domain_model_event.php
6.0.1
14-12-06
Improvement
* #i0007: Providing linkhandler 1.1.0 for TYPO3 6.2
6.0.0
14-09-16
Major Feature
* #61650: Upgrade TYPO3 6.2
2.0.0
14-04-29
Feature
* #58341: Fit it into TYPO3 6.1
1.0.2
13-09-16
Improvement
* #i0006: Updating the manual
1.0.1
13-07-30
Feature
* #i0005: Out-of-the-box template for tt_products
Manual
* #i0004: Remove section "Conflict tt_news and AOE linkhandler"
Improvement
* #i0003: URL of calender base doesn't need any time value.
* Constant Additional parameters
is moved from
* &tx_cal_controller[view]=event&tx_cal_controller[type]=tx_cal_phpicalendar&tx_cal_controller[uid]={field:uid}&tx_cal_controller[getdate]={field:start_date}
to
* &tx_cal_controller[view]=event&tx_cal_controller[type]=tx_cal_phpicalendar&tx_cal_controller[uid]={field:uid}
1.0.0
13-07-29
Manual
* #i0002: Finishing the manual
Development
* #i0001: Improve calendar base
0.0.1
13-07-28
Dirk Wildt <http://wildt.at.die-netzmacher.de>
* Initial Release
2013-04-23 Bernhard Kraft <kraft@webconsulting.at>
* Fixed bug #47505: double ampersands in link-browse popup
2013-03-12 Francois Suter (Cobweb) <typo3@cobweb.ch>
* Heavily patched for TYPO3 6.0 compatibility.
* Commented out all code in ext_localconf.php related to older versions of TYPO3. This is better for performance.
09-11-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Remove URL verification, just force "header" redirect because of problems if the requested pages is protected by HTTP authentication.
09-11-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Keep attention on the languagevisibility XCLASS
* Change default value for "options.saveDocView.tt_news"
03-11-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Make the t3lib_softrefproc XCLASS optional during the extension manager.
* Fixed bug #5199: Replace "t3lib_div::makeInstanceClassName()"
02-11-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Add feature #5191: Provide XCLASS to enable bug fix #10827: Hide "Save and View"-button when editing a content-element
* Add some "conflicts" constraints to the ext_emconf.php
* Add support to add an XCLASS for alt_doc.php if allready an XCLASS exists.
29-10-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Fixed Bug #3928: Referenced records won't show up in Refindex
22-10-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Fixed Bug #5034: URL length of tab links causes errors in IE7
21-10-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Fixed Bug #3926: Omit Overlay-Records within Linkhandler-DB List
* Fixed furhter link params in linkhandler link processing
25-09-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Fixed Bug #4479: allow recursive onlyPids - Thanks to Stefano Cecere for providing the patch.
11-08-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Minnor code changes
10-08-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Add some comments
* Update documentation
* Minnor code changes
09-08-2009 Daniel Pötzinger
* New configurations for recordTab:
noAttributesForm=1
linkClassName=footnote
07-08-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Fix bug #3784: Tabs in Linkview are jumping
* Add feature #4183: Add parameter overwriteHandler to the tab configuration
* Minnor code changes
* Add feature #4184: Show only the "onlyPids" configured pages in the pagetree
03-08-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Minnor code changes
* Make the tx_linkhandler_handler::getCurrentRecord more robustness
16-07-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Refactor the tx_linkhandler_handler
16-07-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Minnor code changes
* Add support for WS preview link generation
* Add support to view records from different language
* Increase version number
* Fix bug #3927: tx_linkhandler_handler should check for the l18n_parent and fix the recordRow
12-07-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Optimize Feature #3414: Use linkhandler for backend record "view" button
11-07-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Fix bug #3867: tslib_cObj::getTypoLink_URL - Return just empty string
10-07-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Fix bug #3675: typolink.returnLast not working with record links?
03-07-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Minor code change
30-06-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Improve added feature #3800
* Minor code change
* Update documentation
29-06-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Add Feature #3800: Change the "applyPatch" from ext_conf_template to version_compare in ext_localconf.php
27-06-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Add Feature #3414: Use linkhandler for backend record "view" button
05-06-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Fix bug #3452: link handler should respect blindLinkOptions configuration of TCA
* Minor code indention
21-04-2009 Michael Klapper <michael.klapper@aoemedia.de>
* fix Bug #3143
17-04-2009 Michael Klapper <michael.klapper@aoemedia.de>
* Update Documentation
08-04-2009 Michael Klapper <michael.klapper@aoemedia.de>
* fix Bug #2626, #3057, #3058, #1488, #1244, #2675
* Add some PHPDoc
* Code indention
23-01-2009 Stefano Cecere <stefano.cecere@krur.com>
* fix Bug #1342 (rtehtmlarea hook name has changed)
07-09-17 Daniel Pötzinger <poetzinger@aoemedia.de>
* Initial release
<?php
namespace AOE\Linkhandler;
/***************************************************************
* Copyright notice
*
* Copyright (c) 2008, Daniel Pötzinger <daniel.poetzinger@aoe.com>
* 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.
*
* 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!
***************************************************************/
/**
* Linkhandler to process custom linking to any kind of configured record
*
* @author Daniel Poetzinger <daniel.poetzinger@aoe.com>
* @author Michael Klapper <michael.klapper@aoe.com>
* @package Linkhandler
*/
class Handler {
/**
* @var \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
*/
protected $localContentObject = NULL;
/**
* Process the link generation
*
* @param string $linkText
* @param array $typoLinkConfiguration TypoLink Configuration array
* @param string $linkHandlerKeyword Define the identifier that an record is given
* @param string $linkHandlerValue Table and uid of the requested record like "tt_news:2"
* @param string $linkParameters Full link params like "record:tt_news:2"
* @param \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $contentObjectRenderer
* @return string
*/
public function main($linkText, array $typoLinkConfiguration, $linkHandlerKeyword, $linkHandlerValue, $linkParameters, \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $contentObjectRenderer) {
$typoScriptConfiguration = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_linkhandler.'];
$generatedLink = $linkText;
// extract link params like "target", "css-class" or "title"
$additionalLinkParameters = str_replace($linkHandlerKeyword . ':' . $linkHandlerValue, '', $linkParameters);
list ($recordTableName, $recordUid) = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(':', $linkHandlerValue);
$recordArray = $this->getCurrentRecord($recordTableName, $recordUid);
if ($this->isRecordLinkable($recordTableName, $typoScriptConfiguration, $recordArray)) {
$this->localContentObject = clone $contentObjectRenderer;
$this->localContentObject->start($recordArray, '');
$typoScriptConfiguration[$recordTableName . '.']['parameter'] .= $additionalLinkParameters;
$currentLinkConfigurationArray = $this->mergeTypoScript($typoScriptConfiguration, $typoLinkConfiguration, $recordTableName);
// build the full link to the record
$generatedLink = $this->localContentObject->typoLink($linkText, $currentLinkConfigurationArray);
$this->updateParentLastTypoLinkMember($contentObjectRenderer);
}
return $generatedLink;
}
/**
* Indicate that the requested link can be created or not.
*
* @param string $recordTableName The name of database table
* @param array $typoScriptConfiguration Global defined TypoScript configuration for the linkHandler
* @param array $recordArray Requested record to link to it
* @access protected
* @return bool
*/
protected function isRecordLinkable($recordTableName, array $typoScriptConfiguration, array $recordArray) {
$isLinkable = FALSE;
// record type link configuration available
if (is_array($typoScriptConfiguration) && array_key_exists($recordTableName . '.', $typoScriptConfiguration)) {
if (
(is_array($recordArray) && !empty($recordArray)) // record available
||
((int) $typoScriptConfiguration[$recordTableName . '.']['forceLink'] === 1) // if the record are hidden ore something else, force link generation
) {
$isLinkable = TRUE;
}
}
return $isLinkable;
}
/**
* Find the current record to work with.
*
* This method keeps attention on the l18n_parent field and retrieve the original record.
*
* @param string $recordTableName The name of database table.
* @param integer $recordUid ID of the record.
* @access protected
* @return array
*/
protected function getCurrentRecord($recordTableName, $recordUid) {
static $cache = array();
$parameterHash = $recordTableName . intval($recordUid);
if (isset($cache[$parameterHash])) {
$currentRecord = $cache[$parameterHash];
} else {
$record = $GLOBALS['TSFE']->sys_page->getRawRecord($recordTableName, $recordUid);
if (is_array($record)) {
// check for l18n_parent and fix the recordRow
$l18nPointer = array_key_exists('transOrigPointerField', $GLOBALS['TCA'][$recordTableName]['ctrl'])
? $GLOBALS['TCA'][$recordTableName]['ctrl']['transOrigPointerField']
: '';
if (isset($record[$l18nPointer]) && intval($record[$l18nPointer]) > 0 && intval($record['sys_language_uid']) > 0) {
$record = $GLOBALS['TSFE']->sys_page->getRawRecord($recordTableName, $record[$l18nPointer]);
}
}
$currentRecord = is_array($record) ? $record : array();
$cache[$parameterHash] = $currentRecord;
}
return $currentRecord;
}
/**
* Update the lastTypoLink* member of the contentObjectRenderer
* @param \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $contentObjectRenderer
* @access public
* @return void
*/
protected function updateParentLastTypoLinkMember(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $contentObjectRenderer) {
$contentObjectRenderer->lastTypoLinkUrl = $this->localContentObject->lastTypoLinkUrl;
$contentObjectRenderer->lastTypoLinkTarget = $this->localContentObject->lastTypoLinkTarget;
$contentObjectRenderer->lastTypoLinkLD = $this->localContentObject->lastTypoLinkLD;
}
/**
* Merge all TypoScript for the typoLink from the global and local defined settings.
*
* @param array $linkConfigurationArray Global defined TypoScript cofiguration for the linkHandler
* @param array $typoLinkConfigurationArray Local typolink TypoScript configuration for current link
* @param string $recordTableName The name of database table
* @access protected
* @return array
*/
protected function mergeTypoScript(array $linkConfigurationArray , array $typoLinkConfigurationArray, $recordTableName) {
// pre-compile the "additionalParams"
$linkConfigurationArray[$recordTableName . '.']['additionalParams'] = $this->localContentObject->stdWrap($linkConfigurationArray[$recordTableName . '.']['additionalParams'], $linkConfigurationArray[$recordTableName . '.']['additionalParams.']);
unset($linkConfigurationArray[$recordTableName . '.']['additionalParams.']);
// merge recursive the "additionalParams" from "$typoScriptConfiguration" with the "$typoLinkConfigurationArray"
if ( array_key_exists('additionalParams', $typoLinkConfigurationArray) ) {
$typoLinkConfigurationArray['additionalParams'] = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl(
'',
\TYPO3\CMS\Core\Utility\GeneralUtility::array_merge_recursive_overrule(
\TYPO3\CMS\Core\Utility\GeneralUtility::explodeUrl2Array($linkConfigurationArray[$recordTableName . '.']['additionalParams']),
\TYPO3\CMS\Core\Utility\GeneralUtility::explodeUrl2Array($typoLinkConfigurationArray['additionalParams'])
)
);
}
/**
* @internal Merge the linkhandler configuration from $typoScriptConfiguration with the current $typoLinkConfiguration.
*/
if (is_array($typoLinkConfigurationArray) && !empty($typoLinkConfigurationArray)) {
if (array_key_exists('parameter.', $typoLinkConfigurationArray)) {
unset($typoLinkConfigurationArray['parameter.']);
}
$linkConfigurationArray[$recordTableName . '.'] = array_merge($linkConfigurationArray[$recordTableName . '.'], $typoLinkConfigurationArray);
}
return $linkConfigurationArray[$recordTableName . '.'];
}
}
<?php
namespace AOE\Linkhandler\Hooks;
/***************************************************************
* Copyright notice
*
* Copyright (c) 2009, AOE GmbH <dev@aoe.com>
* 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.
*
* 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!
***************************************************************/
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Class BackendUtility
*
* @package AOE\Linkhandler\Hooks
* @author Chetan Thapliyal <chetan.thapliyal@aoe.com>
*/
class BackendUtility {
/**
* Restores link handler generated preview link on save-n-preview event. This link is overwritten by the workspace module.
*
* @param integer $pageUid
* @param string $backPath
* @param array $rootLine
* @param string $anchorSection
* @param string $viewScript
* @param array $additionalGetVars
* @param boolean $switchFocus
*/
public function preProcess($pageUid, $backPath, $rootLine, $anchorSection, &$viewScript, $additionalGetVars, $switchFocus) {
if ($GLOBALS['BE_USER']->workspace != 0) {
$additionalGetVars = GeneralUtility::explodeUrl2Array($additionalGetVars);
if (isset($additionalGetVars['eID'])
&& ($additionalGetVars['eID'] === 'linkhandlerPreview')
&& isset($GLOBALS['_POST']['viewUrl'])) {
$viewScript = $GLOBALS['_POST']['viewUrl'];
}
}
}
}
<?php
namespace AOE\Linkhandler\Hooks;
/***************************************************************
* Copyright notice
*
* Copyright (c) 2008, Daniel P�tzinger <daniel.poetzinger@aoemedia.de>
* 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.
*
* 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!
***************************************************************/
/**
* hook to adjust link wizard (linkbrowser)
*
* @author Daniel Poetzinger (AOE media GmbH)
* @package Linkhandler
*/
class ElementBrowser implements \TYPO3\CMS\Core\ElementBrowser\ElementBrowserHookInterface {
/**
* the browse_links object
*/
protected $pObj;
protected $allAvailableTabHandlers = array();
/**
* TCA configuration of "blindLinkOptions" for the current field
*
* @var string OPTIONAL Comma separated list
*/
protected $blindLinkOptions = '';
/**
* initializes the hook object
*
* @param \TYPO3\CMS\Recordlist\Browser\ElementBrowser $pObj
* @param array $params
* @return void
*/
public function init($pObj, $params) {
$this->pObj = $pObj;
if ((is_array($this->pObj->P['params'])) && (array_key_exists('blindLinkOptions', $this->pObj->P['params']))) {
$this->blindLinkOptions = $this->pObj->P['params']['blindLinkOptions'];
}
$this->_checkConfigAndGetDefault();
$tabs = $this->getTabsConfig();
foreach ($tabs as $key => $tabConfig) {
if ($this->isRTE()) {
/** @todo this line had a comment "for 4.3". is it still required with 6.x? */
$this->pObj->anchorTypes[] = $key;
}
}
$this->allAvailableTabHandlers = $this->getAllRegisteredTabHandlerClassnames();
}
/**
* modifies the menu definition and returns it
*
* @param array $menuDef menu definition
* @return array modified menu definition
*/
public function modifyMenuDefinition($menuDef) {
$tabs = $this->getTabsConfig();
foreach ($tabs as $key => $tabConfig) {
$menuDef[$key]['isActive'] = $this->pObj->act == $key;
$menuDef[$key]['label'] = $tabConfig['label'];
$menuDef[$key]['url'] = '#';
$addPassOnParams = $this->getaddPassOnParams();
$addPassOnParams = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl('', \TYPO3\CMS\Core\Utility\GeneralUtility::explodeUrl2Array($addPassOnParams), '', TRUE);
$menuDef[$key]['addParams'] = 'onclick="jumpToUrl(\'?act=' . $key .
'&editorNo=' . $this->pObj->editorNo .
'&contentTypo3Language=' . $this->pObj->contentTypo3Language .
'&contentTypo3Charset=' . $this->pObj->contentTypo3Charset .
$addPassOnParams .
'\');return false;"';
}
return $menuDef;
}
/**
* returns a new tab for the browse links wizard
*
* @param string current link selector action
* @return string a tab for the selected link action
*/
public function getTab($act) {
if (!$this->_isOneOfLinkhandlerTabs($act))
return FALSE;
if ($this->isRTE()) {
if (isset($this->pObj->classesAnchorJSOptions)) {
// works for 4.1.x patch, in 4.2 they make this property protected! -> to enable classselector in 4.2 easoiest is to path rte.
$this->pObj->classesAnchorJSOptions[$act] = @$this->pObj->classesAnchorJSOptions['page'];
}
}
$configuration = $this->getTabConfig($act);
// get current href value (diffrent for RTE and normal browselinks)
if ($this->isRTE()) {
$currentValue = $this->pObj->curUrlInfo['value'];
} else {
$currentValue = $this->pObj->P['currentValue'];
}
// get the tabHandler
$tabHandlerClass = 'AOE\Linkhandler\RecordTab';
if (class_exists($configuration['tabHandler'])) {
$tabHandlerClass = $configuration['tabHandler'];
}
$tabHandler = new $tabHandlerClass($this->pObj,$this->getaddPassOnParams,$configuration,$currentValue,$this->isRTE(), $this->getCurrentPageId());
$content = $tabHandler->getTabContent();
return $content;
}
/**
* adds new items to the currently allowed ones and returns them
*
* @param array $allowedItems currently allowed items
* @return array currently allowed items plus added items