Skip to content

Instantly share code, notes, and snippets.

@cedricziel
Created November 9, 2013 11:40
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cedricziel/7384595 to your computer and use it in GitHub Desktop.
Save cedricziel/7384595 to your computer and use it in GitHub Desktop.
FluxForm Provider for Plugin forms - with fluid.
<?php
/**
* @package dlrg_seminare
* @subpackage Provider/Configuration
*/
namespace DLRG\DlrgSeminare\Provider\Configuration;
class DlrgSeminareConfigurationProvider
extends \Tx_Flux_Provider_AbstractProvider
implements \Tx_Flux_Provider_ProviderInterface {
/**
* @var string
*/
protected $tableName = 'tt_content';
/**
* @var string
*/
protected $fieldName = 'pi_flexform';
/**
* @var string
*/
protected $extensionKey = 'dlrg_seminare';
/**
* @var string
*/
protected $listType = 'dlrgseminare_pi1';
protected $templatePaths = array(
'layoutRootPath' => 'EXT:dlrg_seminare/Resources/Private/Layouts/',
'templateRootPath' => 'EXT:dlrg_seminare/Resources/Private/Templates/',
'partialRootPath' => 'EXT:dlrg_seminare/Resources/Private/Partials/',
);
/**
* @var string
*/
protected $templatePathAndFilename = 'EXT:dlrg_seminare/Configuration/FlexForms/flexform_pi1.html';
}
<?php
if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'DLRG.' . $_EXTKEY,
'Pi1',
array(
'Seminare' => 'show,suchen',
),
// non-cacheable actions (oben auch angeben)
array(
'Seminare' => 'suchen',
)
);
?>
<?php
if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
$extensionName = t3lib_div::underscoredToUpperCamelCase($_EXTKEY);
$pluginSignature = strtolower($extensionName) . '_pi1';
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
$_EXTKEY,
'Pi1',
'DLRG Lehrgänge'
);
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
\Tx_Flux_Core::registerConfigurationProvider('DLRG\\DlrgSeminare\\Provider\\Configuration\\DlrgSeminareConfigurationProvider');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'DLRG Seminare');
if (TYPO3_MODE == 'BE') {
$TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses'][$pluginSignature . '_wizicon'] = t3lib_extMgm::extPath($_EXTKEY) . 'Resources/Private/Wizicon/class.' . $pluginSignature . '_wizicon.php';
}
?>
{namespace flux=Tx_Flux_ViewHelpers}
{namespace dlrg=DLRG\DlrgZusatz\ViewHelpers}
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
xmlns:flux="http://fedext.net/ns/flux/ViewHelpers">
<f:layout name="Default"/>
<f:section name="Configuration">
<flux:flexform id="dlrgseminare">
<flux:flexform.sheet name="sShow>" label="Ansicht">
<flux:flexform.field.select name="settings.displayType" label="Typ:"
items="{list: 'Standard/Listansicht',
teaser: 'Teaseransicht',
box: 'Boxansicht'}"/>
<flux:flexform.field.input name="settings.detailPage" label="Detailseite:" transform="">
<flux:flexform.field.wizard.suggest table="pages"/>
</flux:flexform.field.input>
<flux:flexform.field.input name="settings.anzSeminar" label="Anzahl der anzuzeigenden Lehrgänge:" />
</flux:flexform.sheet>
<flux:flexform.sheet name="sFilter>" label="Filter">
<flux:flexform.field.select name="settings.area" label="Fachbereiche:"
multiple="TRUE" size="6" maxItems="99" items="{dlrg:items(table:'tbl_fachbereich', keyCol:'id', nameCol:'fachbereich')}" />
<flux:flexform.field.select name="settings.organizer" label="Veranstalter:"
multiple="TRUE" size="6" maxItems="99" items="{dlrg:items(table:'tbl_ortsgruppen', keyCol:'id', nameCol:'og')}" />
<flux:flexform.field.select name="settings.veranstaltungsTypFilter" label="Filter für Veranstaltungstyp:"
items="{all: 'Alle Typen',
1: 'Aus- und Fortbildungen',
2: 'Veranstaltungen'}"/>
</flux:flexform.sheet>
</flux:flexform>
</f:section>
<f:section name="Preview">
<p>Blah-Text: {settings.blah}</p>
</f:section>
</div>
<?php
class Foo extends ActionController {
// here you have access to $this->settings just as usual
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment