Skip to content

Commit

Permalink
* compatibility TYPO3 7.5, deprecation 69057: replace \TYPO3\CMS\Back…
Browse files Browse the repository at this point in the history
…end\Utility\IconUtility::skinImg by TYPO3\CMS\Core\Imaging\IconFactory

* deprecation 79259: EXT:t3skin removed
  • Loading branch information
franzholz committed Jan 4, 2020
1 parent 96192f5 commit 7d1a5dd
Show file tree
Hide file tree
Showing 12 changed files with 436 additions and 351 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

2020-01-04 Franz Holzinger <franz@ttproducts.de>
* compatibility TYPO3 7.5, deprecation 69057: replace \TYPO3\CMS\Backend\Utility\IconUtility::skinImg by TYPO3\CMS\Core\Imaging\IconFactory
* deprecation 79259: EXT:t3skin removed

2019-12-14 Franz Holzinger <franz@ttproducts.de>
* compatibility TYPO3 9: Add a flexform conversion tool to migration the flexform sheet names in a way where a leading s_ is added.

Expand Down
2 changes: 1 addition & 1 deletion Classes/Backend/TsparserExtensionUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function checkConfig()
return false;
}
}
return TRUE;
return true;
}
}

10 changes: 6 additions & 4 deletions Classes/Hooks/CmsBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,16 @@ class CmsBackend
* @param object $pObj A reference to calling object
* @return string Information about pi1 plugin
*/
public function getExtensionSummary($params, &$pObj)
public function getExtensionSummary ($params, &$pObj)
{
if ($params['row']['list_type'] == 'jfmulticontent_pi1') {
$data = GeneralUtility::xml2array($params['row']['pi_flexform']);
if (is_array($data) && $data['data']['general']['lDEF']['style']['vDEF']) {
$result = sprintf($GLOBALS['LANG']->sL('LLL:EXT:jfmulticontent/locallang.xml:cms_layout.style'), '<strong>' . $data['data']['general']['lDEF']['style']['vDEF'] . '</strong><br/>');

if (is_array($data) && $data['data']['s_general']['lDEF']['style']['vDEF']) {
$result = sprintf($GLOBALS['LANG']->sL('LLL:EXT:jfmulticontent/locallang.xml:cms_layout.style'), '<strong>' . $data['data']['s_general']['lDEF']['style']['vDEF'] . '</strong><br/>');
}
if (!$result) {
$result = $GLOBALS['LANG']->sL('LLL:EXT:jfmulticontent/locallang.xml:cms_layout.not_configured').'<br/>';
$result = $GLOBALS['LANG']->sL('LLL:EXT:jfmulticontent/locallang.xml:cms_layout.not_configured') . '<br/>';
}
}

Expand All @@ -67,3 +68,4 @@ public function getExtensionSummary($params, &$pObj)
}
}


34 changes: 20 additions & 14 deletions Classes/Hooks/ElementBrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ElementBrowser implements \TYPO3\CMS\Core\ElementBrowser\ElementBrowserHoo
* @param array additional parameters
* @return void
*/
public function init($parentObject, $additionalParameters) {
public function init ($parentObject, $additionalParameters) {
$invokingObjectClass = get_class($parentObject);
$this->invokingObject =& $parentObject;
$this->mode =& $this->invokingObject->mode;
Expand All @@ -67,7 +67,7 @@ public function init($parentObject, $additionalParameters) {
* @param array currently allowed items
* @return array currently allowed items plus added items
*/
public function addAllowedItems($currentlyAllowedItems) {
public function addAllowedItems ($currentlyAllowedItems) {
$currentlyAllowedItems['jfmulticontent'] = 'jfmulticontent';
return $currentlyAllowedItems;
}
Expand All @@ -79,12 +79,12 @@ public function addAllowedItems($currentlyAllowedItems) {
* @param array menu definition
* @return array modified menu definition
*/
public function modifyMenuDefinition($menuDefinition) {
public function modifyMenuDefinition ($menuDefinition) {
$menuDef =& $menuDefinition;
$menuDef['jfmulticontent']['isActive'] = $this->invokingObject->act == 'jfmulticontent';
$menuDef['jfmulticontent']['label'] = $GLOBALS['LANG']->sL('LLL:EXT:jfmulticontent/locallang_db.xml:browserlink_tab',1);
$menuDef['jfmulticontent']['url'] = '#';
$menuDef['jfmulticontent']['addParams'] = 'onclick="jumpToUrl(\''.htmlspecialchars('?act=jfmulticontent&editorNo='.$this->invokingObject->editorNo.'&contentTypo3Language='.$this->invokingObject->contentTypo3Language.'&contentTypo3Charset='.$this->invokingObject->contentTypo3Charset).'\');return false;"';
$menuDef['jfmulticontent']['addParams'] = 'onclick="jumpToUrl(\'' . htmlspecialchars('?act=jfmulticontent&editorNo=' . $this->invokingObject->editorNo . '&contentTypo3Language=' . $this->invokingObject->contentTypo3Language . '&contentTypo3Charset=' . $this->invokingObject->contentTypo3Charset) . '\');return false;"';
return $menuDef;
}

Expand All @@ -95,10 +95,10 @@ public function modifyMenuDefinition($menuDefinition) {
* @param string current link selector action
* @return string a tab for the selected link action
*/
public function getTab($linkSelectorAction) {
public function getTab ($linkSelectorAction) {
// Only return content if the media tab was called.
if ($linkSelectorAction !== 'jfmulticontent') {
return FALSE;
return false;
}

$this->browseLinks = GeneralUtility::makeInstance('tx_rtehtmlarea_browse_links');
Expand All @@ -117,7 +117,7 @@ public function getTab($linkSelectorAction) {
// Outputting Temporary DB mount notice:
if (intval($GLOBALS['BE_USER']->getSessionData('pageTree_temporaryMountPoint'))) {
$link = '<a href="' . htmlspecialchars(GeneralUtility::linkThisScript(array('setTempDBmount' => 0))) . '">' .
$GLOBALS['LANG']->sl('LLL:EXT:lang/locallang_core.xml:labels.temporaryDBmount', 1) .
$GLOBALS['LANG']->sl('LLL:EXT:lang/locallang_core.xml:labels.temporaryDBmount', 1) .
'</a>';
$flashMessage = GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
Expand Down Expand Up @@ -152,7 +152,7 @@ public function getTab($linkSelectorAction) {
* @param array $info
* @return array
*/
public function parseCurrentUrl($href, $siteUrl, $info) {
public function parseCurrentUrl ($href, $siteUrl, $info) {
$info['act'] = 'jfmulticontent';
return $info;
}
Expand All @@ -162,7 +162,7 @@ public function parseCurrentUrl($href, $siteUrl, $info) {
*
* @return string HTML output. Returns content only if the ->expandPage value is set (pointing to a page uid to show tt_content records from ...)
*/
public function expandPage() {
public function expandPage () {
$out='';
$expPageId = $this->browseLinks->expandPage; // Set page id (if any) to expand

Expand All @@ -181,7 +181,7 @@ public function expandPage() {
$titleLen=intval($GLOBALS['BE_USER']->uc['titleLen']);
$mainPageRec = /**/\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordWSOL('pages',$expPageId);
$picon = IconUtility::getSpriteIconForRecord('pages', $mainPageRec);
$picon .= \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages', $mainPageRec, TRUE);
$picon .= \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages', $mainPageRec, true);
$out .= $picon.'<br />';

// Look up tt_content elements from the expanded page:
Expand All @@ -200,7 +200,13 @@ public function expandPage() {
$c = 0;
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$c++;
$icon = IconUtility::getSpriteIconForRecord('tt_content', $row);
hier ++++
if (
version_compare(TYPO3_version, '8.0.0', '>=')
) {
} else {
$icon = IconUtility::getSpriteIconForRecord('tt_content', $row);
}
if ($this->browseLinks->curUrlInfo['act'] == 'page' && $this->browseLinks->curUrlInfo['cElement'] == $row['uid']) {
$arrCol='<img' . IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/blinkarrow_left.gif', 'width="5" height="9"') . ' class="c-blinkArrowL" alt="" />';
} else {
Expand All @@ -211,7 +217,7 @@ public function expandPage() {
$arrCol .
'<a href="#" onclick="return link_typo3Page(\'' . $expPageId . '\',\'#' . $row['uid'] . '\');">'.
$icon .
\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('tt_content', $row, TRUE) .
\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('tt_content', $row, true) .
'</a><br />';

$contents = array();
Expand All @@ -226,7 +232,7 @@ public function expandPage() {
break;
}
case 'irre' : {
$resIrre = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_content', 'tx_jfmulticontent_irre_parentid='.intval($row['uid']).' AND deleted = 0 AND hidden = 0', '', '');
$resIrre = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_content', 'tx_jfmulticontent_irre_parentid=' . intval($row['uid']) . ' AND deleted = 0 AND hidden = 0', '', '');
while ($rowIrre = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resIrre)) {
$contents[] = $rowIrre['uid'];
}
Expand All @@ -239,7 +245,7 @@ public function expandPage() {
$out .= '<img' . IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/ol/line.gif', 'width="18" height="16"') . ' alt="" />' .
'<img' . IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/ol/blank.gif' , 'width="18" height="16"') . ' alt="" />';
foreach ($contents as $key => $content) {
$out .= '<a href="#" onclick="return link_typo3Page(\''.$expPageId.'\',\'#jfmulticontent_c'.$row['uid'].'-'.($key+1).'\');">'.
$out .= '<a href="#" onclick="return link_typo3Page(\''.$expPageId . '\',\'#jfmulticontent_c' . $row['uid'] . '-' . ($key + 1) . '\');">'.
'&nbsp;' . ($key + 1) . '&nbsp;' .
'</a>';
}
Expand Down
14 changes: 5 additions & 9 deletions Configuration/TCA/Overrides/sys_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
define('JFMULTICONTENT_EXT', 'jfmulticontent');
}

if (
TYPO3_MODE == 'BE'
) {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
JFMULTICONTENT_EXT,
'Configuration/TypoScript/PluginSetup/',
'Multi content'
);
}
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
JFMULTICONTENT_EXT,
'Configuration/TypoScript/PluginSetup/',
'Multi content'
);
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
# TYPO3 extension jfmulticontent

I have developed the existing jfmulticontent extension for the TYPO3 version 8.7. I am continuing the work for TYPO3 9 now.
I have developed the existing jfmulticontent extension for the TYPO3 version 8.7. TYPO3 9 is working.

## Flexform Migration

The upgrade script must be executed in the Install Tool or in the Extension Manager once. All the flexform sheet names must have a leading 's_'. This transformation is done in the update script. Older versions of this extension require some more modifications, which the Extension Manager update script will perform.

The extension t3jquery seems not to exist any more and TYPO3 10 will provide jQuery for extensions. Any support for t3jquery will therefore be dropped soon.


Any contributions are welcome. Just create an issue or write a pull request.

TYPO3 8 and later require the extension patchlayout to be installed.

## TSConfig Requirement

In TYPO3 > 7.4 you must set TSConfig like this:
### example:
```
TCEFORM.tt_content.tx_jfmulticontent_contents.PAGE_TSCONFIG_ID = 17
```

The starting point page record in the plugin is not used any more.


Loading

0 comments on commit 7d1a5dd

Please sign in to comment.