Project

General

Profile

Actions

Feature #60794

closed

New type for ext_conf_template.txt

Added by Anonymous over 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2014-08-05
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

For some configurations it'll be handy to have textareas instead of only input fields to edit them in the extension manager.

I think this can be achieved by simply adding "textarea" to this ViewHelper: typo3/sysext/extensionmanager/Classes/ViewHelpers/Form/TypoScriptConstantsViewHelper.php

Actions #1

Updated by Stefan Froemken over 9 years ago

I just needed the same. I helped me that way (workaround):

in ext_conf_template.txt:

# cat=basic; type=user[JWeiland\Jwparking\Configuration\TextArea->render]; label = LLL:EXT:jwparking/Resources/Private/Language/ExtConf.xlf:parkingTitles
parkingTitles =

And my new Textarea-Object:

<?php
namespace JWeiland\Jwparking\Configuration;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extensionmanager\ViewHelpers\Form\TypoScriptConstantsViewHelper;

/**
 * @package jwparking
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
 *
 */
class TextArea {

    /**
     * Tag builder instance
     *
     * @var \TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder
     */
    protected $tag = NULL;

    /**
     * constructor of this class
     */
    public function __construct() {
        $this->tag = GeneralUtility::makeInstance('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\TagBuilder');
    }

    /**
     * render textarea for extConf
     *
     * @param array $parameter
     * @param TypoScriptConstantsViewHelper $parentObject
     * @return string
     */
    public function render(array $parameter = array(), TypoScriptConstantsViewHelper $parentObject) {
        $this->tag->setTagName('textarea');
        $this->tag->forceClosingTag(TRUE);
        $this->tag->addAttribute('cols', 45);
        $this->tag->addAttribute('rows', 7);
        $this->tag->addAttribute('name', $parameter['fieldName']);
        $this->tag->addAttribute('id', 'em-' . $parameter['fieldName']);
        if ($parameter['fieldValue'] !== NULL) {
            $this->tag->setContent(trim($parameter['fieldValue']));
        }
        return $this->tag->render();
    }

}

Stefan

Actions #2

Updated by Ben Walch about 9 years ago

Thanks alot Stefan for sharing your solution.

The type=textarea should definately taken into the core!

Actions #3

Updated by Wouter Wolters over 8 years ago

  • Status changed from New to Closed

a new ticket was created for this. Closed as duplicate of #69202
This patch has a patch in review.

Actions

Also available in: Atom PDF