-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Rootline now shown for storage selectors - Authors are now linked - Filtering and search improved - Styling improved - Icons shown for pages and storages - Entrypoints from setup to posts and comments Fixes: #107
- Loading branch information
1 parent
d17e2a4
commit 569c2ff
Showing
12 changed files
with
213 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?php | ||
declare(strict_types = 1); | ||
|
||
/* | ||
* This file is part of the package t3g/blog. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
namespace T3G\AgencyPack\Blog\ViewHelpers\Link\Be; | ||
|
||
use T3G\AgencyPack\Blog\Domain\Model\Author; | ||
use TYPO3\CMS\Backend\Routing\UriBuilder; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper; | ||
|
||
class AuthorViewHelper extends AbstractTagBasedViewHelper | ||
{ | ||
public function __construct() | ||
{ | ||
$this->tagName = 'a'; | ||
parent::__construct(); | ||
} | ||
|
||
/** | ||
* Arguments initialization. | ||
* | ||
* @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception | ||
* @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception | ||
*/ | ||
public function initializeArguments(): void | ||
{ | ||
parent::initializeArguments(); | ||
$this->registerUniversalTagAttributes(); | ||
$this->registerTagAttribute('target', 'string', 'Target of link'); | ||
$this->registerTagAttribute('itemprop', 'string', 'itemprop attribute'); | ||
$this->registerTagAttribute('rel', 'string', 'Specifies the relationship between the current document and the linked document'); | ||
|
||
$this->registerArgument('author', Author::class, 'The author to link to'); | ||
$this->registerArgument('returnUri', 'bool', 'return only uri', false, false); | ||
} | ||
|
||
/** | ||
* @return string Rendered page URI | ||
* | ||
* @throws \TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException | ||
* @throws \InvalidArgumentException | ||
*/ | ||
public function render(): string | ||
{ | ||
/** @var Author $author */ | ||
$author = $this->arguments['author']; | ||
$authorUid = $author !== null ? (int)$author->getUid() : 0; | ||
|
||
$routingUriBuilder = GeneralUtility::makeInstance(UriBuilder::class); | ||
$uri = $routingUriBuilder->buildUriFromRoute('record_edit', ['edit[tx_blog_domain_model_author][' . $authorUid . ']' => 'edit']); | ||
$arguments = GeneralUtility::_GET(); | ||
$route = $arguments['route']; | ||
unset($arguments['route'], $arguments['token']); | ||
$uri .= '&returnUrl=' . rawurlencode((string)GeneralUtility::makeInstance(UriBuilder::class)->buildUriFromRoutePath($route, $arguments)); | ||
if ($uri !== '') { | ||
if ($this->arguments['returnUri']) { | ||
return $uri; | ||
} | ||
$linkText = $this->renderChildren() ?: $author->getName(); | ||
$this->tag->addAttribute('href', $uri); | ||
$this->tag->setContent($linkText); | ||
$result = $this->tag->render(); | ||
} else { | ||
$result = $this->renderChildren(); | ||
} | ||
|
||
return $result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
<f:form class="form-inline" action="{action}"> | ||
<div class="form-group"> | ||
<label for="blogSetup"><f:translate key="label.blog" /></label> | ||
<f:form.select class="form-control" name="blogSetup" id="blogSetup" value="{activeBlogSetup}" options="{blogSetups}" optionLabelField="title" optionValueField="uid" prependOptionLabel="{f:translate(key: 'label.all')}" prependOptionValue="" /> | ||
<f:form.select | ||
class="form-control" | ||
name="blogSetup" | ||
id="blogSetup" | ||
value="{activeBlogSetup}" | ||
options="{blogSetups}" | ||
optionLabelField="path" | ||
optionValueField="uid" | ||
prependOptionLabel="{f:translate(key: 'label.all')}" | ||
prependOptionValue="" /> | ||
</div> | ||
<button type="submit" class="btn btn-default"><f:translate key="label.choose_blog" /></button> | ||
</f:form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.