wir möchten die backend formular editor um eine „mail header“ feld erweitern, daher: [list] [*] wie erweitert man die backend formular editor?[/*] [*] wie erweitert man die formular email?[/*][/list] ich hab mit hinweisen von hier und da was basteln können, was ein datenbank feld addiert und in die backend formular editor ein feld addiert. es speichert aber die werte von backend editor nicht… Backend/HolabeFormMailHeader/Bootstrap.php [code]<?php class Shopware_Plugins_Backend_HolabeFormMailHeader_Bootstrap
extends Shopware_Components_Plugin_Bootstrap
{
public function getVersion()
{
return ‚0.0.1‘;
}
public function getLabel()
{
return 'Form Mail Header';
}
public function install()
{
$this->createAttributes(); $this-\>subscribeEvent( "Enlight\_Controller\_Action\_PostDispatch\_Backend\_Form", "onLoadForm" ); return true; } public function uninstall() { $this-\>removeAttributes(); return true; } protected function getEntityManager() { return Shopware()-\>Models(); } private function createAttributes() { $this-\>Application()-\>Models()-\>addAttribute( 's\_cms\_support\_attributes', 'holabe', 'mail\_header', 'varchar(100)', true, null ); $this-\>getEntityManager()-\>generateAttributeModels(['s\_cms\_support\_attributes']); } private function removeAttributes() { $this-\>Application()-\>Models()-\>removeAttribute( 's\_cms\_support\_attributes', 'holabe', 'mail\_header' ); $this-\>getEntityManager()-\>generateAttributeModels(['s\_cms\_support\_attributes']); } public function onLoadForm(Enlight\_Event\_EventArgs $args) { $view = $args-\>getSubject()-\>View(); $view-\>addTemplateDir($this-\>Path().'Views/'); $view-\>extendsTemplate('backend/model.js'); $view-\>extendsTemplate('backend/view.js'); } } [/code] Backend/HolabeFormMailHeader/Views/backend/model.js [code] //{block name="backend/form/model/form/fields" append} { name: 'holabeMailHeader', type: 'string' }, //{/block} [/code] Backend/HolabeFormMailHeader/Views/backend/view.js [code] //{block name="backend/form/view/main/formpanel" append} Ext.override(Shopware.apps.Form.view.main.Formpanel, { getItems: function() { var me = this; var elements = me.callParent(arguments); elements = Ext.Array.insert(elements, 1, [{ xtype:'textfield', name: 'holabeMailHeader', anchor: '98%', fieldLabel:'eMail Header', translatable: true, helpText: 'Additional e-mail headers' }]); return elements; } }); //{/block} [/code]