Skip to content
Snippets Groups Projects
Commit ba370752 authored by Paul Ilea's avatar Paul Ilea
Browse files

[TASK] Post-review updates

- TCA tags field fix
- Module buttons/links updated
- New Module icons
- Added tags to list items
- News Module link in Page Module
- Labels updated
- Selected Language header
- pages_language_overlay author default value
- Module documentation
parent fe37537a
No related branches found
No related tags found
1 merge request!2Feature be module
Showing
with 428 additions and 77 deletions
......@@ -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);
}
}
......
......@@ -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;
}
}
}
......
<?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;
}
}
......@@ -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;
......
......@@ -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>';
}
......
<?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;
}
}
......@@ -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>';
}
}
}
......
......@@ -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',
......
......@@ -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
......@@ -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>
......
......@@ -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>
......
......@@ -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="">
......
<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>&nbsp;</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>
......@@ -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">
......
<?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
<?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
<?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
......@@ -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;
}
......@@ -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
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment