Feature #66620
closedFE Edit viewhelper
0%
Description
I wrote a viewhelper for fe edit, it would be nice to have some kind of this functionallity in the core.
I dont know the typo3 coding guidelines and didnt work with gerrit before, so i thought i share those lines here.
Also i didnt know how to get the raw query result from the persistence manager to avoid the query...
<?php namespace TYPO3\CMS\Feedit\ViewHelpers; use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Database\DatabaseConnection; use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; /** * @author Philipp Wrann <philippwrann@gmail.com> * @package TYPO3.CMS * @subpackage Feedit */ class EditPanelViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper { /** * @var ContentObjectRenderer */ protected static $contentObjectRenderer = NULL; /** * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface * @inject */ protected $configurationManager; /** * @param \TYPO3\CMS\Extbase\DomainObject\AbstractEntity $for * @return string */ public function render(AbstractEntity $for) { if ($GLOBALS['TSFE']->beUserLogin) { $settings = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK,$this->controllerContext->getRequest()->getControllerExtensionName()); $config = $settings['admPanel']; $table = $settings['persistence']['classes'][get_class($for)]['mapping']['tableName']; $currentRecord = $table.':'.$for->getUid(); $dataArray = $this->getDatabase()->exec_SELECTgetSingleRow('*',$table,'uid='.$for->getUid()); return self::getContentObjectRenderer()->editPanel('', $config, $currentRecord, $dataArray); } } /** * @return ContentObjectRenderer */ protected static function getContentObjectRenderer() { if (self::$contentObjectRenderer === NULL) { self::$contentObjectRenderer = GeneralUtility::makeInstance(ContentObjectRenderer::class); } return self::$contentObjectRenderer; } /** * @return DatabaseConnection */ protected function getDatabase() { return $GLOBALS['TYPO3_DB']; } }
So basically you have to add the admPanel configuration to your extensions typoscript and place this viewHelper:
<feedit:editPanel for="{yourEntity}"/>
It is very limited that way but would be a start :)
Updated by Benni Mack almost 9 years ago
- Target version changed from 7.2 (Frontend) to 7.4 (Backend)
Updated by Susanne Moog almost 9 years ago
- Target version changed from 7.4 (Backend) to 7.5
Updated by Claus Due over 8 years ago
- Status changed from New to Accepted
Recommended location for this ViewHelper is as part of the system extension "feedit"; using standard ViewHelper approach. Aside from needing a bit of dusting off which we can do during review, I'd say "go ahead and create a merge request" ;)
Updated by Gerrit Code Review over 8 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/44086
Updated by Gerrit Code Review over 8 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/44086
Updated by Gerrit Code Review over 8 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/44086
Updated by Gerrit Code Review over 8 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/44086
Updated by Wouter Wolters over 7 years ago
- Status changed from Under Review to New
Patch was abandoned in February 2016
Updated by Riccardo De Contardi about 7 years ago
- Related to Feature #79633: Integrate next generation of Frontend Editing based on CKEditor added
Updated by Riccardo De Contardi about 7 years ago
- Status changed from New to Closed
I guess that this can be safely closed (next-gen frontend editing feature is now under development).
If you think that this is the wrong decision please reopen it or open a new issue with a reference to this one. Thank you!