diff --git a/Classes/Controller/BackendController.php b/Classes/Controller/BackendController.php index 4bf0ffb94ac61222916f1fedcd0fef5a449bb47b..10526c49a5175c8edb7c33e58bc53a85cb4ac909 100644 --- a/Classes/Controller/BackendController.php +++ b/Classes/Controller/BackendController.php @@ -121,6 +121,11 @@ class BackendController extends ActionController { * @api */ protected function initializeView(ViewInterface $view) { + if (VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 8000000) { + $GLOBALS['LANG']->includeLLFile('EXT:lang/Resources/Private/Language/locallang_mod_web_list.xlf'); + } else { + $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_mod_web_list.xlf'); + } // create doc header component $this->pageUid = (int) GeneralUtility::_GP('id'); /** @var BackendUserAuthentication $backendUser */ @@ -139,9 +144,6 @@ class BackendController extends ActionController { foreach ($menuSettings as $key => $menuSetting) { $backendUser->pushModuleData('tools_beuser/index.php/web_SgNewsNews_' . $key, $menuSetting); } - $this->language = $backendUser->getModuleData( - 'tools_beuser/index.php/web_SgNewsNews_language', 'ses' - ) ?: 0; $this->docHeaderComponent->setMetaInformation($this->pageInfo); $this->makeButtons(); @@ -153,7 +155,15 @@ class BackendController extends ActionController { if (!LicensingService::checkKey()) { $this->view->assign('showLicenseBanner', TRUE); + } else { + $this->language = $backendUser->getModuleData( + 'tools_beuser/index.php/web_SgNewsNews_language', 'ses' + ) ?: 0; + $languageOptions = BackendNewsUtility::getAvailableLanguages($this->pageUid); + $currentLanguage = $languageOptions[$this->language] ?? NULL; + $this->view->assign('languageInfo', $currentLanguage); } + $this->view->assign('language', $this->language); } } diff --git a/Classes/Hooks/EditDocumentController.php b/Classes/Hooks/EditDocumentController.php index 20dde30e5c4adfd8e1422439933843e525923bfe..efa688139d415c7bf3009eec4064cab7fb96b0df 100644 --- a/Classes/Hooks/EditDocumentController.php +++ b/Classes/Hooks/EditDocumentController.php @@ -26,6 +26,7 @@ namespace SGalinski\SgNews\Hooks; ***************************************************************/ use SGalinski\SgNews\Utility\BackendNewsUtility; +use TYPO3\CMS\Backend\Controller\EditDocumentController as CoreEditDocumentController; use TYPO3\CMS\Backend\Utility\BackendUtility; /** @@ -37,25 +38,32 @@ class EditDocumentController { * Sets the default value for the pages author field * to the name of the logged-in user * - * @param \TYPO3\CMS\Backend\Controller\EditDocumentController $controller Default configuration + * @param CoreEditDocumentController $controller * @return void */ public function preInitAfter($controller) { - if (isset($controller->editconf['pages']) && $GLOBALS['BE_USER']->user['realName'] !== '') { + $tables = ['pages', 'pages_language_overlay']; + if ( + $GLOBALS['BE_USER']->user['realName'] !== '' + && (isset($controller->editconf[$tables[0]]) || isset($controller->editconf[$tables[1]])) + ) { $doktype = 0; - foreach ($controller->editconf['pages'] as $pageUid => $command) { + $userName = $GLOBALS['BE_USER']->user['realName']; + $tableName = isset($controller->editconf[$tables[0]]) ? $tables[0] : $tables[1]; + foreach ($controller->editconf[$tableName] as $pageUid => $command) { if ($command === 'edit') { - $pageRow = BackendUtility::getRecord('pages', (int) $pageUid); + $pageRow = BackendUtility::getRecord($tableName, (int) $pageUid); if ($pageRow && isset($pageRow['doktype'])) { $doktype = (int) $pageRow['doktype']; } - } elseif ($command === 'new' && isset($controller->overrideVals['pages']['doktype'])) { - $doktype = (int) $controller->overrideVals['pages']['doktype']; + } elseif ($command === 'new' && isset($controller->overrideVals[$tableName]['doktype'])) { + $doktype = (int) $controller->overrideVals[$tableName]['doktype']; } break; } if ($doktype === BackendNewsUtility::NEWS_DOKTYPE) { - $GLOBALS['BE_USER']->userTS['TCAdefaults.']['pages.']['author'] = $GLOBALS['BE_USER']->user['realName']; + $GLOBALS['BE_USER']->userTS['TCAdefaults.'][$tableName . '.']['author'] = $userName; + } } } diff --git a/Classes/Hooks/PageLayoutController.php b/Classes/Hooks/PageLayoutController.php new file mode 100644 index 0000000000000000000000000000000000000000..699e78b7c49d218a401d938f874daedf705f173b --- /dev/null +++ b/Classes/Hooks/PageLayoutController.php @@ -0,0 +1,116 @@ +<?php + +namespace SGalinski\SgNews\Hooks; + +/*************************************************************** + * Copyright notice + * + * (c) sgalinski Internet Services (https://www.sgalinski.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! + ***************************************************************/ + +use SGalinski\SgNews\Service\LicensingService; +use SGalinski\SgNews\Utility\BackendNewsUtility; +use TYPO3\CMS\Backend\Controller\PageLayoutController as CorePageLayoutController; +use TYPO3\CMS\Backend\Utility\BackendUtility; +use TYPO3\CMS\Core\Imaging\Icon; +use TYPO3\CMS\Core\Imaging\IconFactory; +use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Extbase\Utility\LocalizationUtility; + +/** + * Backend edid form hook + */ +class PageLayoutController { + + /** + * Sets the default value for the pages author field + * to the name of the logged-in user + * + * @param array $parameters + * @param CorePageLayoutController $controller + * @return string + * @throws \InvalidArgumentException + */ + public function addNewsModuleLink(array $parameters = [], $controller) { + $out = ''; + if (!(int) $controller->id || !LicensingService::checkKey()) { + return $out; + } + $pageRow = BackendUtility::getRecord('pages', $controller->id); + $acceptedDoktypes = [BackendNewsUtility::NEWS_DOKTYPE, BackendNewsUtility::CATEGORY_DOKTYPE]; + if ( + !is_array($pageRow) || !count($pageRow) || + !in_array((int) $pageRow['doktype'], $acceptedDoktypes, TRUE) + ) { + return $out; + } + $categoryRow = (int) $pageRow['doktype'] === BackendNewsUtility::CATEGORY_DOKTYPE ? $pageRow : + BackendUtility::getRecord('pages', (int) $pageRow['pid']); + if ( + !is_array($categoryRow) || !count($categoryRow) || + (int) $categoryRow['doktype'] !== BackendNewsUtility::CATEGORY_DOKTYPE + ) { + return $out; + } + $moduleTemplate = $controller->getModuleTemplate(); + $moduleTemplate->addJavaScriptCode( + 'newsModuleLink', ' + function newsModuleLinkGotToPageCallbackNoFollow(path){ + var callback = top.Ext.createDelegate(top.nav.mainTree.selectPath, top.nav.mainTree); + callback.apply(this, arguments); + } + + function sgNewsGoToNewsModule(uid, path) { + if (top.nav) { + top.nav.invokePageId(uid, newsModuleLinkGotToPageCallbackNoFollow); + } else { + var tree = top.Ext.getCmp(\'typo3-pagetree\'); + if (tree) { + tree.activeTree.selectPath(path); + } + } + parent.fsMod.recentIds[\'web\'] = uid; + parent.TYPO3.ModuleMenu.App.showModule(\'web_SgNewsNews\'); + return false; + } + ' + ); + /** @var IconFactory $iconFactory */ + $iconFactory = GeneralUtility::makeInstance(IconFactory::class); + $icon = $iconFactory->getIcon('sg_news-module-transparent', Icon::SIZE_DEFAULT); + $icon = '<span style="vertical-align: middle; display:inline-block;">' . $icon . '</span>'; + $buttonLabel = LocalizationUtility::translate('backend.button.goToNewsModule', 'SgNews'); + $buttonLabel = '<span style="vertical-align: middle;">' . $buttonLabel . '</span>'; + + $rootline = BackendUtility::BEgetRootLine($categoryRow['uid'], '', TRUE); + ksort($rootline); + $path = '/root'; + foreach ($rootline as $page) { + $path .= '/p' . dechex($page['uid']); + } + + $out = ' <div class="btn-group" role="group"> + <a href="#" onclick="return sgNewsGoToNewsModule(' . $categoryRow['uid'] . ', \'' . $path . '\');" class="btn btn-primary">' . + $icon . ' ' . $buttonLabel . + '</a> + </div>'; + return $out; + } +} diff --git a/Classes/Utility/BackendNewsUtility.php b/Classes/Utility/BackendNewsUtility.php index b4e71980a37c9567455489c4aa85489522f3de51..9a2d498a0cec28d5ef0c847d311e467c7bc259d2 100644 --- a/Classes/Utility/BackendNewsUtility.php +++ b/Classes/Utility/BackendNewsUtility.php @@ -26,6 +26,9 @@ namespace SGalinski\SgNews\Utility; * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ +use SGalinski\SgNews\Domain\Model\News; +use SGalinski\SgNews\Domain\Model\Tag; +use SGalinski\SgNews\Domain\Repository\NewsRepository; use SGalinski\SgNews\Domain\Repository\TagRepository; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; @@ -211,6 +214,50 @@ class BackendNewsUtility { return $tags; } + /** + * Get an array of all tags uids => titles for the specified news uid + * + * @param int $newsItemUid + * @param int $languageUid + * @return array + * @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException + * @throws \InvalidArgumentException + */ + public static function getTagsForNewsItem($newsItemUid, $languageUid = 0) { + $temporaryTSFEInstance = FALSE; + if (!isset($GLOBALS['TSFE'])) { + $temporaryTSFEInstance = TRUE; + $GLOBALS['TSFE'] = new \stdClass(); + $GLOBALS['TSFE']->gr_list = ''; + } + $newsItemUid = (int) $newsItemUid; + $languageUid = (int) $languageUid; + $tags = []; + $objectManager = GeneralUtility::makeInstance(ObjectManager::class); + $newsRepository = $objectManager->get(NewsRepository::class); + $query = $newsRepository->createQuery(); + $querySettings = $query->getQuerySettings(); + $querySettings->setLanguageUid($languageUid); + $querySettings->setLanguageOverlayMode(TRUE); + $querySettings->setLanguageMode('content_fallback'); + $query->setQuerySettings($querySettings); + if ($newsItemUid) { + $query->matching($query->equals('uid', $newsItemUid)); + } + /** @var News $newsItem */ + $newsItem = $query->execute()->getFirst(); + if ($temporaryTSFEInstance) { + unset($GLOBALS['TSFE']); + } + if ($newsItem) { + /** @var Tag $tag */ + foreach ($newsItem->getTags() as $tag) { + $tags[(int) $tag->getUid()] = trim($tag->getTitle()); + } + } + return $tags; + } + /** * Get all news for the given categories (all if filter is empty) * @@ -296,6 +343,7 @@ class BackendNewsUtility { ' AND `pages`.`doktype` = ' . self::NEWS_DOKTYPE; if ($languageUid) { $out[0] .= ', `translation`.`title` AS translation_title'; + $out[0] .= ', `translation`.`uid` AS translation_uid'; $out[1] .= ' LEFT JOIN `pages_language_overlay` AS `translation` ON `translation`.`pid` = `pages`.`uid` ' . BackendUtility::deleteClause('pages_language_overlay', 'translation') . ' AND `translation`.`sys_language_uid` = ' . $languageUid; diff --git a/Classes/ViewHelpers/Backend/ControlViewHelper.php b/Classes/ViewHelpers/Backend/ControlViewHelper.php index 3e7c5da4cbb726f50ddaefa60d3741d135b14ebd..2a9465afa9d537a096bb4180991b18d440c864a6 100644 --- a/Classes/ViewHelpers/Backend/ControlViewHelper.php +++ b/Classes/ViewHelpers/Backend/ControlViewHelper.php @@ -63,6 +63,9 @@ class ControlViewHelper extends AbstractViewHelper { $pageInfo = BackendUtility::readPageAccess($row['pid'], $backendUser->getPagePermsClause(1)); $databaseRecordList->calcPerms = $GLOBALS['BE_USER']->calcPerms($pageInfo); $databaseRecordList->currentTable = $sortingData; + if ($table === 'pages') { + $databaseRecordList->searchLevels = 1; + } $out = $databaseRecordList->makeControl($table, $row); if ($clipboard) { $databaseRecordList->MOD_SETTINGS['clipBoard'] = TRUE; @@ -81,11 +84,10 @@ class ControlViewHelper extends AbstractViewHelper { /** @var IconFactory $iconFactory */ $iconFactory = GeneralUtility::makeInstance(IconFactory::class); + $buttonLabel = LocalizationUtility::translate('backend.button.editPageContent', 'SgNews'); $out .= ' <div class="btn-group" role="group"> - <a href="#" onclick="return sgNewsGoToPageModule(' . $row['uid'] . ', \'' . $path . '\');" class="btn btn-default" title="' . LocalizationUtility::translate( - 'backend.button.editPageContent', 'SgNews' - ) . '">' . - $iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . + <a href="#" onclick="return sgNewsGoToPageModule(' . $row['uid'] . ', \'' . $path . '\');" class="btn btn-primary" title="' . $buttonLabel . '">' . + $iconFactory->getIcon('actions-document-open-white', Icon::SIZE_SMALL)->render() . ' ' . $buttonLabel . '</a> </div>'; } diff --git a/Classes/ViewHelpers/Backend/NewsItemTagsViewHelper.php b/Classes/ViewHelpers/Backend/NewsItemTagsViewHelper.php new file mode 100644 index 0000000000000000000000000000000000000000..376357f1614e9b5c3e048579f9b26d24b6e57994 --- /dev/null +++ b/Classes/ViewHelpers/Backend/NewsItemTagsViewHelper.php @@ -0,0 +1,55 @@ +<?php + +namespace SGalinski\SgNews\ViewHelpers\Backend; + +/*************************************************************** + * Copyright notice + * + * (c) sgalinski Internet Services (https://www.sgalinski.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 3 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 SGalinski\SgNews\Utility\BackendNewsUtility; +use SGalinski\SgNews\ViewHelpers\AbstractViewHelper; + +/** + * Class EditOnClickViewHelper + **/ +class NewsItemTagsViewHelper extends AbstractViewHelper { + /** + * Renders the tags for the specified news uid + * + * @param int $uid + * @param int $languageUid + * @return string + * @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException + * @throws \InvalidArgumentException + */ + public function render($uid = 0, $languageUid = 0) { + $out = ''; + $uid = (int) $uid; + $languageUid = (int) $languageUid; + if ($uid) { + $tags = BackendNewsUtility::getTagsForNewsItem($uid, $languageUid); + $out = implode(', ', $tags); + } + return $out; + } +} diff --git a/Classes/ViewHelpers/Backend/TranslationLinksViewHelper.php b/Classes/ViewHelpers/Backend/TranslationLinksViewHelper.php index d6708130743e0b8c499dd52164d645d937b90490..449333cdf49a711b4ed161241f6c26da6b88446d 100644 --- a/Classes/ViewHelpers/Backend/TranslationLinksViewHelper.php +++ b/Classes/ViewHelpers/Backend/TranslationLinksViewHelper.php @@ -32,6 +32,7 @@ use SGalinski\SgNews\ViewHelpers\AbstractViewHelper; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\IconFactory; +use TYPO3\CMS\Core\Type\Icon\IconState; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Utility\LocalizationUtility; @@ -113,8 +114,9 @@ class TranslationLinksViewHelper extends AbstractViewHelper { ) . ' return false;'; } $out .= ' <a href="#" onclick="' . $onClick . '" title="' . $language['title'] . ' [' . $newLabel . ']" >' . - $iconFactory->getIcon($language['flag'], Icon::SIZE_SMALL, 'overlay-new')->render() . - '</a>'; + $iconFactory->getIcon($language['flag'], Icon::SIZE_SMALL, 'overlay-new', + IconState::cast(IconState::STATE_DISABLED))->render() . + '</a>'; } } } diff --git a/Configuration/TCA/Overrides/pages.php b/Configuration/TCA/Overrides/pages.php index 0bc9887fd01cbac2f0550b89c5d87fd098c932a0..547366fd43a341e5f80f7254da013f840f9dcf96 100644 --- a/Configuration/TCA/Overrides/pages.php +++ b/Configuration/TCA/Overrides/pages.php @@ -165,7 +165,6 @@ $columns = array_merge( 'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_tags', 'config' => [ 'type' => 'select', - 'autoSizeMax' => 50, 'maxitems' => 9999, 'size' => 10, 'foreign_table' => 'sys_category', diff --git a/README.md b/README.md index 5ef85dddafb6a27209f9b6ec1910925b50042056..e184b35c38472cf8df6aaa1c606d1d1797235e25 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,14 @@ Repository: https://gitlab.sgalinski.de/typo3/sg_news Please report bugs here: https://gitlab.sgalinski.de/typo3/sg_news -TYPO3 version: >7.6 +TYPO3 version: >=7.6 + +**Note**: sg_news can be used for free or by buying a licence key from our <a href="https://shop.sgalinski.de/products/" target="_blank">online shop</a>. You can enter the licence key in the extension manager configuration of sg_news. + +Features excluded from the free version: +* Multilanguage News Administration +* Page Module link in News Module +* News Module link in Page Module ## About @@ -184,6 +191,7 @@ Plugin options: - **News Limit per Page**: The maximum amount of news to be shown. - **Categories**: Here you can select which categories you want to be included (If none are selected, all are shown). - **Tags**: Here you can select which tags the news entries need to have to be shown here (If none are selected, all are shown). + --- ###### News Single View @@ -247,3 +255,62 @@ You find the settings in the **Fontend/constants.txt** configuration file: Automatically adds an AJAX like button to each single news entry. Make sure, that the extension **sg_ajax** is installed, otherwise this feature will be disabled. If it should be like this, then make sure to remove this button from the sg_news default templates. + +## The Backend Module + +After a successful Installation, you have a new module in the "WEB" section of your TYPO3 Backend. + +Clicking on it loads the administration panel. Using the drop-down above you can switch between the different languages set up in your TYPO3 installation. +Once you have selected a language, the module will display the news records and tag filter corresponding to that language. + +If you have selected a root-page in the page-tree, the module will display a list of news pages corresponding to this root page, with respect to the current user permissions. Here you can filter the results by Category, Tags or by a search word. + +Selecting a News Category Page in the page-tree, will display the list of news pages in this Category. The same functionality as for the root page, but without the category filter. + +***Note*** : The search-word filter is language-sensitive. + +You can also use the '<img height="20px" width="20px" src="https://camo.githubusercontent.com/cd0d2f12f28169acfbafd1c8bf8f291155f3d210/68747470733a2f2f7261776769742e636f6d2f5459504f332f5459504f332e49636f6e732f6d61737465722f646973742f616374696f6e732f616374696f6e732d646f63756d656e742d6e65772e737667"> Add News Record' and the '<img height="20px" width="20px" src="https://camo.githubusercontent.com/cd0d2f12f28169acfbafd1c8bf8f291155f3d210/68747470733a2f2f7261776769742e636f6d2f5459504f332f5459504f332e49636f6e732f6d61737465722f646973742f616374696f6e732f616374696f6e732d646f63756d656e742d6e65772e737667"> Add News Category' buttons to add News/Cateogry pages under the currelty selected page where available. + + +### Options for your news list items + +For each news item in the paginated result list you have multiple editing/administration options, depending on the logged-in user's permissions. + +You can click a list item's title to edit it (language sensitive) or use the menu buttons: + +<img height="20px" width="20px" src="https://camo.githubusercontent.com/bcf1ba22efb779447495395e452154160e2b39ba/68747470733a2f2f7261776769742e636f6d2f5459504f332f5459504f332e49636f6e732f6d61737465722f646973742f616374696f6e732f616374696f6e732d76657273696f6e2d776f726b73706163652d707265766965772e737667"> Preview the frontend page +<br> +<img height="20px" width="20px" src="https://camo.githubusercontent.com/cf8d1359b3a6ef79ca3731f6f0e0e01bcf992dcb/68747470733a2f2f7261776769742e636f6d2f5459504f332f5459504f332e49636f6e732f6d61737465722f646973742f616374696f6e732f616374696f6e732d76657273696f6e2d706167652d6f70656e2e737667"> Edit +<br> +<img height="20px" width="20px" src="https://camo.githubusercontent.com/3c5e6daff1f31fd3c4bf0ac3e70520133d06441c/68747470733a2f2f7261776769742e636f6d2f5459504f332f5459504f332e49636f6e732f6d61737465722f646973742f616374696f6e732f616374696f6e732d656469742d686964652e737667"> Disable/Enable +<br> +<img height="20px" width="20px" src="https://camo.githubusercontent.com/7773a0fc11517dc70b81f9ba516991f3669493e1/68747470733a2f2f7261776769742e636f6d2f5459504f332f5459504f332e49636f6e732f6d61737465722f646973742f616374696f6e732f616374696f6e732d656469742d64656c6574652e737667"> Delete +<br> + .... Expand/Collapse the options menu +<br> +<img height="20px" width="20px" src="https://camo.githubusercontent.com/ee057cb37045beeccf8078f74e65e1774ec5e001/68747470733a2f2f7261776769742e636f6d2f5459504f332f5459504f332e49636f6e732f6d61737465722f646973742f616374696f6e732f616374696f6e732d646f63756d656e742d696e666f2e737667"> Show further information +<br> +<img height="20px" width="20px" src="https://camo.githubusercontent.com/b4980d61f65fdfca4853fbd240f88de2b6fcb893/68747470733a2f2f7261776769742e636f6d2f5459504f332f5459504f332e49636f6e732f6d61737465722f646973742f616374696f6e732f616374696f6e732d706167652d6d6f76652e737667"> Change the page's position in the page-tree +<br> +<img height="20px" width="20px" src="https://camo.githubusercontent.com/91c383d7beded93dbe6a62e2a1ae94bf82d1d783/68747470733a2f2f7261776769742e636f6d2f5459504f332f5459504f332e49636f6e732f6d61737465722f646973742f616374696f6e732f616374696f6e732d646f63756d656e742d686973746f72792d6f70656e2e737667"> Show history +<br> +<img height="20px" width="20px" src="https://camo.githubusercontent.com/78584763b0c5d3c1908183719f3b37508bd54620/68747470733a2f2f7261776769742e636f6d2f5459504f332f5459504f332e49636f6e732f6d61737465722f646973742f616374696f6e732f616374696f6e732d6c6f636b2e737667"> Change permissions +<br> +<img height="20px" width="20px" src="https://camo.githubusercontent.com/b51a6820d6b9322bc4ef419b827a423f9b7cc57c/68747470733a2f2f7261776769742e636f6d2f5459504f332f5459504f332e49636f6e732f6d61737465722f646973742f616374696f6e732f616374696f6e732d706167652d6e65772e737667"> Create new +<br> +<img height="20px" width="20px" src="https://camo.githubusercontent.com/1794befd17574f066d0b3513729d731c158b8b0a/68747470733a2f2f7261776769742e636f6d2f5459504f332f5459504f332e49636f6e732f6d61737465722f646973742f616374696f6e732f616374696f6e732d656469742d636f70792e737667"> Copy +<br> +<img height="20px" width="20px" src="https://camo.githubusercontent.com/1fc865a03039be5039e6069f2f53d1db2a8e3896/68747470733a2f2f7261776769742e636f6d2f5459504f332f5459504f332e49636f6e732f6d61737465722f646973742f616374696f6e732f616374696f6e732d656469742d6375742e737667"> Cut +<br> +<img height="20px" width="20px" src="https://camo.githubusercontent.com/4646af23ac205e052ac3addf238868e59c047111/68747470733a2f2f7261776769742e636f6d2f5459504f332f5459504f332e49636f6e732f6d61737465722f646973742f616374696f6e732f616374696f6e732d646f63756d656e742d70617374652d696e746f2e737667"> Paste into +<br> +<img height="20px" width="20px" src="https://camo.githubusercontent.com/7908ba1757d3b77ba3b9444c095bb0582e74a4af/68747470733a2f2f7261776769742e636f6d2f5459504f332f5459504f332e49636f6e732f6d61737465722f646973742f616374696f6e732f616374696f6e732d646f63756d656e742d70617374652d61667465722e737667"> Paste after +<br> +<img height="20px" width="20px" src="https://camo.githubusercontent.com/2ba239d52c48bbcdc9d059a8aeca2eb7eb41a07a/68747470733a2f2f7261776769742e636f6d2f5459504f332f5459504f332e49636f6e732f6d61737465722f646973742f616374696f6e732f616374696f6e732d646f63756d656e742d6f70656e2e737667"> Edit Page Content + +You can also handle the localisation of news pages for all the languages in your TYPO3 installation by using the localisation links under each record's title: + +- **full-opacity flag icon** : Edit the existing localisation record +- **half-transparent flag icon with <img height="14px" width="14px" src="https://camo.githubusercontent.com/b10f4d50dc21b152cde15cef5983c139e77b1c34/68747470733a2f2f7261776769742e636f6d2f5459504f332f5459504f332e49636f6e732f6d61737465722f646973742f6f7665726c61792f6f7665726c61792d6e65772e737667"/> overlay** : Create new localisation record + +***Note*** : The extension also adds a News Module link in the Page Module of News/Category pages \ No newline at end of file diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf index 4034187b922e097665e6bb0b3ee23a1749475303..90928d1348a4928c4faa15e7b350923c61b2fd35 100644 --- a/Resources/Private/Language/de.locallang.xlf +++ b/Resources/Private/Language/de.locallang.xlf @@ -26,8 +26,12 @@ <target>News-Eintrag hinzufügen</target> </trans-unit> <trans-unit id="backend.button.editPageContent" approved="yes"> - <source>Edit Page Content</source> - <target>Seiteninhalt bearbeiten</target> + <source>Go to News Content</source> + <target>Zum News-Content</target> + </trans-unit> + <trans-unit id="backend.button.goToNewsModule"> + <source>Go to News Module</source> + <target>Zum News-Modul</target> </trans-unit> <trans-unit id="backend.filter" approved="yes"> <source>Filter</source> @@ -70,8 +74,8 @@ <target>Bitte wählen Sie eine der Root- oder News-Kategorieseiten aus, um fortzufahren</target> </trans-unit> <trans-unit id="backend.selectPageOr" approved="yes"> - <source>, or</source> - <target>, oder</target> + <source>or</source> + <target>oder</target> </trans-unit> <trans-unit id="configuration.licenseKey" approved="yes"> <source>License Key</source> diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf index b30e02559fae366f99aee81fb5696e76383c625f..9f12bf56bcb87f29beecbb600b6b01147f7c05ea 100644 --- a/Resources/Private/Language/locallang.xlf +++ b/Resources/Private/Language/locallang.xlf @@ -22,7 +22,10 @@ <source>Add News Record</source> </trans-unit> <trans-unit id="backend.button.editPageContent"> - <source>Edit Page Content</source> + <source>Go to News Content</source> + </trans-unit> + <trans-unit id="backend.button.goToNewsModule"> + <source>Go to News Module</source> </trans-unit> <trans-unit id="backend.filter"> <source>Filter</source> @@ -55,7 +58,7 @@ <source>Please select one of the Root or News Category pages to continue</source> </trans-unit> <trans-unit id="backend.selectPageOr"> - <source>, or</source> + <source>or</source> </trans-unit> <trans-unit id="configuration.licenseKey"> <source>License Key</source> diff --git a/Resources/Private/Layouts/Backend.html b/Resources/Private/Layouts/Backend.html index 093b539027a23e4a66a8fb23fcb97a5cbd73d27f..97ec922903dafc0762ae5689236dd64f4085f458 100644 --- a/Resources/Private/Layouts/Backend.html +++ b/Resources/Private/Layouts/Backend.html @@ -5,7 +5,8 @@ includeRequireJsModules="{ 0: 'TYPO3/CMS/Backend/AjaxDataHandler', 1: '{f:if(condition: \'{typo3Version} < 8000000 \', then: \'TYPO3/CMS/Backend/ClickMenu\', else: \'TYPO3/CMS/Backend/ContextMenu\')}', - 2: 'TYPO3/CMS/Backend/Tooltip'}"> + 2: 'TYPO3/CMS/Backend/Tooltip', + 2: 'TYPO3/CMS/Recordlist/Tooltip'}"> <sg:addJavaScriptFile javaScriptFile="{f:uri.resource(path: 'Scripts/Backend.js')}" /> <div class="module" data-module-id="" data-module-name=""> diff --git a/Resources/Private/Partials/Backend/Filter.html b/Resources/Private/Partials/Backend/Filter.html index 8392b2d5b1617bc03d7e56e07566bac8ab844162..aa5afbe004132b7d515fdc31309ab56449a8564b 100644 --- a/Resources/Private/Partials/Backend/Filter.html +++ b/Resources/Private/Partials/Backend/Filter.html @@ -1,7 +1,7 @@ <f:form action="index" controller="Backend" method="post" objectName="filters" object="{filters}"> <div class="row"> <f:if condition="{showCategoryFilter}"> - <div class="col-xs-6"> + <div class="col-xs-4"> <div class="form-group"> <label for="filter-categories"> <f:translate key="backend.filters.categories" /> @@ -11,7 +11,7 @@ </div> </div> </f:if> - <div class="col-xs-{f:if(condition: showCategoryFilter, then: '6', else: '5')}"> + <div class="col-xs-{f:if(condition: showCategoryFilter, then: '4', else: '6')}"> <div class="form-group"> <label for="filter-tags"> <f:translate key="backend.filters.tags" /> @@ -20,21 +20,13 @@ <small><f:format.raw><f:translate key="backend.filters.tags.description" /></f:format.raw></small> </div> </div> - <div class="col-xs-7 pull-right"> - <div class="row"> - <div class="col-xs-7"> - <div class="form-group"> - <label for="filter-search"><f:translate key="backend.filters.search" /></label> - <f:form.textfield class="form-control" property="search" id="filter-search" /> - </div> - </div> - <div class="col-xs-5"> - <div class="form-group"> - <label> </label><br /> - <f:form.button class="btn btn-success form-group col-xs-12" type="submit"><f:translate key="backend.filter" /></f:form.button> - </div> - </div> + <div class="col-xs-{f:if(condition: showCategoryFilter, then: '4', else: '6')}"> + <div class="form-group"> + <label for="filter-search"><f:translate key="backend.filters.search" /></label> + <f:form.textfield class="form-control" property="search" id="filter-search" /> </div> + + <f:form.button class="btn btn-success pull-right" type="submit"><f:translate key="backend.filter" /></f:form.button> </div> </div> </f:form> diff --git a/Resources/Private/Templates/Backend/Index.html b/Resources/Private/Templates/Backend/Index.html index 902f0f018799c08954b2cc596891c71a6c377295..850801f8170cb1101fe62cb44aad3a0a1c030d93 100644 --- a/Resources/Private/Templates/Backend/Index.html +++ b/Resources/Private/Templates/Backend/Index.html @@ -13,6 +13,14 @@ </p> <f:if condition="{showNewsList}"> <f:then> + <f:if condition="{languageInfo}"> + <h3> + <f:if condition="{languageInfo.flag}"> + <span><sg:backend.icon id="{languageInfo.flag}" /></span> + </f:if> + <span>{languageInfo.title}</span> + </h3> + </f:if> <f:render partial="Backend/Filter" arguments="{categories: categories, tags: tags, showCategoryFilter: showCategoryFilter, filters: filters}" /> @@ -47,18 +55,34 @@ </f:format.raw> </td> <td nowrap="nowrap"> - <a href="#" onclick="{sg:backend.editOnClick(table: 'pages', uid: singleNews.uid)}"> - <span> - <f:if condition="{singleNews.translation_title}"> - <f:then> - {singleNews.translation_title} - </f:then> - <f:else> - {singleNews.title} - </f:else> - </f:if> - </span> - </a> <br /> + <f:alias map="{newsItemTags: '{sg:backend.newsItemTags(uid: singleNews.uid, languageUid: language)}'}"> + <f:if condition="{singleNews.translation_uid}"> + <f:then> + <a href="#" onclick="{sg:backend.editOnClick(table: 'pages_language_overlay', uid: singleNews.translation_uid)}"> + <span> + <f:if condition="{singleNews.translation_title}"> + <f:then> + {singleNews.translation_title} + </f:then> + <f:else> + {singleNews.title} + </f:else> + </f:if> + <f:if condition="{newsItemTags}">({newsItemTags})</f:if> + </span> + </a> + </f:then> + <f:else> + <a href="#" onclick="{sg:backend.editOnClick(table: 'pages', uid: singleNews.uid)}"> + <span> + {singleNews.title} + <f:if condition="{newsItemTags}">({newsItemTags})</f:if> + </span> + </a> + </f:else> + </f:if> + </f:alias> + <br /> <sg:backend.translationLinks pageUid="{pageUid}" table="pages" uid="{singleNews.uid}" /> </td> <td nowrap="nowrap" class="col-control"> diff --git a/Resources/Public/Icons/actions-document-open-white.svg b/Resources/Public/Icons/actions-document-open-white.svg new file mode 100644 index 0000000000000000000000000000000000000000..1ee556a6bcc9c22b698b846eb52f66354b07064f --- /dev/null +++ b/Resources/Public/Icons/actions-document-open-white.svg @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> + <g class="icon-color"> + <path d="M13 5H3V3h10v2zm-1 1H3v1h8l1-1zm-6 6H3v1h2l1-1zm4-4H3v1h6l1-1zm-2 2H3v1h4l1-1zM14 14h-1l-1 1h2.5c.3 0 .5-.2.5-.5V12l-1 1v1z" style="fill: rgb(255, 255, 255);"/> + <path d="M 5 14 L 2 14 L 2 2 L 14 2 L 14 5 L 15 5 L 15 1.5 C 15 1.2 14.8 1 14.5 1 L 5.255 1 L 1.5 1 C 1.2 1 1 1.2 1 1.5 L 1 14.5 C 1 14.8 1.2 15 1.5 15 L 5 15 L 5 14 Z M 14.2 7.2 L 15.8 8.8 C 15.9 8.9 15.9 9.1 15.8 9.2 L 14.5 10.5 L 12.5 8.5 L 13.8 7.2 C 13.9 7.1 14.1 7.1 14.2 7.2 L 14.2 7.2 Z M 7.1 13.9 L 12 9 L 14 11 L 9.1 15.9 C 9 16 9 16 8.9 16 L 7 16 L 7 14.1 C 7 14 7 14 7.1 13.9 Z" style="fill: rgb(255, 255, 255);"/> + </g> +</svg> \ No newline at end of file diff --git a/Resources/Public/Icons/module-sgnews-transparent.svg b/Resources/Public/Icons/module-sgnews-transparent.svg new file mode 100644 index 0000000000000000000000000000000000000000..9b14aff038a45c6a774d597052d5b5fb893dd95f --- /dev/null +++ b/Resources/Public/Icons/module-sgnews-transparent.svg @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<svg version="1.1" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xmlns="http://www.w3.org/2000/svg" xmlns:bx="https://boxy-svg.com"> + <defs> + <bx:grid x="0" y="0" width="42.062" height="47.126"/> + </defs> + <path d="M 0 0 L 1000 0 L 1000 1000 L 0 1000 Z" style="fill: rgba(0, 119, 230, 0);"/> + <path d="M 281.601 769.903 L 281.601 350.053 L 214.469 350.053 L 214.186 769.903 C 214.186 811.607 281.601 811.608 281.601 769.903 Z M 766.932 829.882 L 233.068 829.882 C 233.068 829.882 184.535 829.882 184.535 769.903 L 184.535 290.075 L 281.601 290.075 L 281.601 170.118 L 815.465 170.118 L 815.465 769.903 C 815.465 829.882 766.932 829.882 766.932 829.882 Z M 772.869 780.662 L 772.869 734.116 L 330.966 734.116 L 330.966 780.662 Z M 772.869 222.11 L 330.966 222.11 L 330.966 408.294 L 772.869 408.294 Z M 734.596 361.748 L 367.544 361.748 L 367.958 268.656 L 734.596 268.656 Z M 543.234 594.478 L 772.869 594.478 L 772.869 454.84 L 543.234 454.84 Z M 581.506 547.932 L 581.506 501.385 L 734.596 501.385 L 734.596 547.932 Z M 330.966 501.385 L 504.961 501.386 L 504.961 454.84 L 330.966 454.84 Z M 330.966 594.294 L 504.961 594.478 L 504.961 547.932 L 330.966 547.932 Z M 330.966 687.57 L 772.869 687.57 L 772.869 641.024 L 330.966 641.024 Z" style="fill: rgb(255, 255, 255);"/> +</svg> \ No newline at end of file diff --git a/Resources/Public/Icons/module-sgnews.svg b/Resources/Public/Icons/module-sgnews.svg index 0cfe412d7293248e670a14ec19342512cee0527d..a2ff32c64e9b0335939ecfea32e0c7523d824030 100644 --- a/Resources/Public/Icons/module-sgnews.svg +++ b/Resources/Public/Icons/module-sgnews.svg @@ -1,11 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> -<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"> - <path fill="#335056" d="M0 0h18v18H0z"/> - <circle fill="#59F" cx="9" cy="9" r="8"/> - <path fill="#AAD400" d="M 15.973 8.378 C 15.762 6.08 14.437 4.033 12.428 2.898 C 12.336 2.995 12.311 2.938 12.311 3.035 C 12.034 3.132 11.665 2.938 11.388 2.841 C 10.712 2.57 9.964 2.536 9.266 2.744 C 8.989 2.841 8.344 2.938 8.62 3.52 C 8.804 3.812 9.265 4.103 9.727 3.715 C 9.911 3.521 10.097 3.23 10.372 3.521 C 10.465 3.619 10.465 3.716 10.465 3.813 C 10.372 4.103 10.095 4.201 9.819 4.201 C 9.449 4.298 9.079 4.201 8.711 4.298 C 8.341 4.395 7.788 4.492 7.788 4.978 C 7.788 5.558 7.603 5.656 7.141 5.753 C 6.771 5.753 6.588 5.947 6.771 6.335 C 6.864 6.625 7.141 6.625 7.326 6.529 C 8.064 6.141 8.71 5.171 9.54 6.335 L 9.724 6.238 C 9.909 5.462 10.094 5.948 10.278 6.238 L 10.555 6.528 C 11.662 5.462 11.385 7.014 11.755 7.304 C 11.015 7.11 10.185 7.886 9.54 7.401 C 8.433 6.529 7.695 6.917 6.68 7.789 C 5.85 8.469 5.665 9.341 5.85 10.117 C 6.126 11.087 7.14 11.184 7.972 10.99 C 8.248 10.892 8.802 10.892 8.802 11.086 C 8.617 11.959 9.632 12.541 9.262 13.51 C 8.986 14.286 9.448 15.256 10.092 15.547 C 10.739 15.837 11.292 15.062 11.57 14.383 C 11.662 14.286 11.57 14.093 11.662 13.995 C 12.4 13.025 12.308 11.571 13.23 10.601 C 13.507 10.311 14.43 9.244 13.69 8.371 C 15.444 7.886 14.8 9.631 15.168 10.408 C 15.444 9.826 15.628 9.244 15.813 8.758 C 15.905 8.468 15.973 8.378 15.973 8.378 Z M 5.948 3.21 C 6.238 2.904 6.251 2.854 6.542 2.445 C 5.845 2.703 5.195 3.074 4.619 3.544 L 4.787 3.721 L 5.66 3.721 C 5.66 3.721 5.757 3.721 5.757 3.621 L 5.854 3.518 C 5.854 3.518 5.951 3.518 5.951 3.416 L 6.047 3.314 L 6.144 3.211 C 5.854 3.416 5.854 3.314 5.95 3.211 C 5.95 3.314 5.95 3.314 5.95 3.211 C 5.95 3.314 5.95 3.211 5.95 3.211 L 5.948 3.21 Z M 4.666 12.65 C 4.666 12.65 4.57 12.558 4.666 12.65 C 4.57 12.558 4.57 12.558 4.666 12.65 L 4.666 12.374 L 4.57 12.282 C 4.475 12.282 4.475 12.189 4.38 12.189 C 4.285 12.189 4.19 12.096 4.094 12.096 L 3.903 12.096 C 3.903 12.096 3.808 12.096 3.808 12.004 C 3.14 11.634 2.855 10.989 2.664 10.252 C 2.664 10.067 2.569 9.882 2.569 9.698 C 2.475 9.605 2.475 9.513 2.379 9.42 C 2.189 9.236 2.285 8.867 2.475 8.498 L 2.475 8.314 C 2.475 8.221 2.475 8.221 2.57 8.129 C 2.57 8.039 2.57 8.039 2.666 7.946 C 2.856 7.576 3.238 7.3 3.428 7.023 C 3.523 6.931 3.523 6.931 3.523 6.839 L 3.523 6.747 C 3.618 6.655 3.618 6.47 3.713 6.377 C 3.713 6.287 3.809 6.101 3.809 6.009 C 3.809 5.824 3.809 5.732 3.713 5.549 C 3.617 5.271 3.559 5.031 3.369 4.846 C 2.511 6.046 1.999 7.392 1.999 8.959 C 1.999 11.082 2.902 12.965 4.413 14.283 C 4.413 14.283 4.474 14.309 4.474 14.219 L 4.474 14.125 C 4.474 14.033 4.569 14.033 4.569 13.941 C 4.665 13.571 4.665 13.019 4.666 12.65 Z"/> - <path opacity=".2" d="M 9 17 C 4.589 17 1 13.411 1 9 C 1 4.589 4.589 1 9 1 C 13.411 1 17 4.589 17 9 C 17 13.411 13.411 17 9 17 Z M 9 2 C 5.14 2 2 5.14 2 9 C 2 12.859 5.14 16 9 16 C 12.859 16 16 12.859 16 9 C 16 5.14 12.859 2 9 2 Z"/> - <path fill="#FFF" d="M 14 7 L 4 7 L 4 13.894 C 5.314 15.242 7.117 16.001 9 16 C 10.96 16 12.729 15.192 14 13.894 L 14 7 Z"/> - <path fill="#666" d="M 14 7 L 4 7 L 4 13.894 C 4.306 14.206 4.641 14.489 5 14.74 L 5 8 L 13 8 L 13 14.74 C 13.359 14.49 13.694 14.207 14 13.894 L 14 7 Z"/> - <path fill="#333" d="M 6 9 L 12 9 L 12 11 L 6 11 Z"/> - <path fill="#B9B9B9" d="M 6 12 L 12 12 L 12 13 L 6 13 Z M 6 14 L 12 14 L 12 15 L 6 15 Z"/> +<svg version="1.1" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xmlns="http://www.w3.org/2000/svg" xmlns:bx="https://boxy-svg.com"> + <defs> + <bx:grid x="0" y="0" width="42.062" height="47.126"/> + </defs> + <path d="M 0 0 L 1000 0 L 1000 1000 L 0 1000 Z" style="fill: rgb(0, 120, 230);"/> + <path d="M 281.601 769.903 L 281.601 350.053 L 214.469 350.053 L 214.186 769.903 C 214.186 811.607 281.601 811.608 281.601 769.903 Z M 766.932 829.882 L 233.068 829.882 C 233.068 829.882 184.535 829.882 184.535 769.903 L 184.535 290.075 L 281.601 290.075 L 281.601 170.118 L 815.465 170.118 L 815.465 769.903 C 815.465 829.882 766.932 829.882 766.932 829.882 Z M 772.869 780.662 L 772.869 734.116 L 330.966 734.116 L 330.966 780.662 Z M 772.869 222.11 L 330.966 222.11 L 330.966 408.294 L 772.869 408.294 Z M 734.596 361.748 L 367.544 361.748 L 367.958 268.656 L 734.596 268.656 Z M 543.234 594.478 L 772.869 594.478 L 772.869 454.84 L 543.234 454.84 Z M 581.506 547.932 L 581.506 501.385 L 734.596 501.385 L 734.596 547.932 Z M 330.966 501.385 L 504.961 501.386 L 504.961 454.84 L 330.966 454.84 Z M 330.966 594.294 L 504.961 594.478 L 504.961 547.932 L 330.966 547.932 Z M 330.966 687.57 L 772.869 687.57 L 772.869 641.024 L 330.966 641.024 Z" style="fill: rgb(255, 255, 255);"/> </svg> \ No newline at end of file diff --git a/Resources/Public/Scripts/Backend.js b/Resources/Public/Scripts/Backend.js index 620eff05f9bcaccb06bf0a8c73fe0c0647c989d2..164aba38537fa77cf89b9c6ad1df66b89daea2f7 100644 --- a/Resources/Public/Scripts/Backend.js +++ b/Resources/Public/Scripts/Backend.js @@ -62,6 +62,7 @@ function sgNewsGoToPage(uid, path, selectOnly) { top.currentSubScript + separator + 'id=' + uid ); } + parent.fsMod.recentIds['web'] = uid; } @@ -86,22 +87,8 @@ function gotToPageCallback(path){ } } -/** - * opens the selected category edit form - * - * @return {boolean} - */ -function editSelectedCategory(){ - var selected = TYPO3.jQuery('#filter-categories').val(); - if(selected && CategoryEditLinks[selected[0]]) { - jumpToUrl(CategoryEditLinks[selected[0]] + '&returnUrl=' + T3_THIS_LOCATION); - } - return false; -} - function sgNewsGoToPageModule(uid, path) { sgNewsGoToPage(uid, path, true); - parent.fsMod.recentIds['web'] = uid; parent.TYPO3.ModuleMenu.App.showModule('web_layout'); return false; } diff --git a/ext_localconf.php b/ext_localconf.php index 2686473c8aa5b18333d7d276e2c177e37c5d11b5..82df56e9e70c191461b3e0f98147bdab46cb1e09 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -92,4 +92,10 @@ $signalSlotDispatcher->connect( 'preInitAfter', \SGalinski\SgNews\Hooks\EditDocumentController::class, 'preInitAfter' -); \ No newline at end of file +); + +if(!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/db_layout.php']['drawHeaderHook'])) { + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/db_layout.php']['drawHeaderHook'] = []; +} +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/db_layout.php']['drawHeaderHook'][] = + \SGalinski\SgNews\Hooks\PageLayoutController::class . '->addNewsModuleLink'; \ No newline at end of file diff --git a/ext_tables.php b/ext_tables.php index 2ebfed203c51c5eeca7bf553eb63cd64162a3c33..8b9a4f60a6621be434eb87d8ebeb34ca33c6fbad 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -147,6 +147,21 @@ $iconRegistry->registerIcon( \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class, ['source' => 'EXT:sg_news/Resources/Public/Images/News.png'] ); +$iconRegistry->registerIcon( + 'actions-document-open-white', + \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, + ['source' => 'EXT:sg_news/Resources/Public/Icons/actions-document-open-white.svg'] +); +$iconRegistry->registerIcon( + 'sg_news-module', + \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, + ['source' => 'EXT:sg_news/Resources/Public/Icons/module-sgnews.svg'] +); +$iconRegistry->registerIcon( + 'sg_news-module-transparent', + \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, + ['source' => 'EXT:sg_news/Resources/Public/Icons/module-sgnews-transparent.svg'] +); $GLOBALS['TCA']['pages']['ctrl']['typeicon_classes'][$customPageDoktype] = 'tcarecords-pages-' . $customPageDoktype; // add the new doktype to the list of types available from the new page menu at the top of the page tree