Forms example

if ($this->form === null) {
            throw new RuntimeException('Plugin form was not initialized correctly');
        }

        return $this->form;
    }

    final public function hasForm(): bool
    {
        if ($this->form === null && $this->getName() !== null) {
            $formRepository = $this->Forms();
            $form = $formRepository->findOneBy(['name' => $this->getName()]);
            $this->form = $form;
        }
        if ($this->form === null && $this->getId() !== null) {
            $formRepository = $this->Forms();
            $form = $formRepository->findOneBy(['pluginId' => $this->getId()]);
            $this->form = $form;
        }

        return $this->form !== null;
    }

    
/** * Install config-form * * @return void */
    public function installForm()
    {
        $form = $this->Form();

        /** @var Form $parent */
        $parent = $this->Forms()->findOneBy(['name' => 'Core']);

        $form->setParent($parent);
        $form->setElement('textarea', 'cacheControllers', [
            'label' => 'Cache-Controller / Zeiten',
            'value' => "frontend/listing 3600\r\n" .
            "frontend/index 3600\r\n" .
            "frontend/detail 3600\r\n" .
            "frontend/campaign 14400\r\n" .
            "widgets/listing 14400\r\n" .
            "frontend/custom 14400\r\n" .
            "frontend/forms 14400\r\n" .
            
if (Shopware()->Container()->get('auth')->hasIdentity() === true) {
                return true;
            }
        }

        return false;
    }

    private function createForm(): void
    {
        $form = $this->Form();
        $parent = $this->Forms()->findOneBy(['name' => 'Other']);
        $form->setParent($parent);
        $form->setName('CronSecurity');
        $form->setLabel('Cron-Sicherheit');

        $form->setElement('text', 'cronSecureAllowedKey', [
            'label' => 'Gültiger Schlüssel',
            'description' => 'Hinterlegen Sie hier einen Key zum Ausführen der Cronjobs.',
            'required' => false,
            'value' => '',
        ]);
        $form->setElement('text', 'cronSecureAllowedIp', [
            
/** * Register shopware auth resource * create pre-dispatch hook to check backend permissions */
    public function install()
    {
        $this->subscribeEvent('Enlight_Bootstrap_InitResource_Auth', 'onInitResourceAuth');
        $this->subscribeEvent('Enlight_Controller_Action_PreDispatch', 'onPreDispatchBackend');
        $this->subscribeEvent('Enlight_Bootstrap_InitResource_BackendSession', 'onInitResourceBackendSession');

        $form = $this->Form();
        $parent = $this->Forms()->findOneBy(['name' => 'Core']);
        $form->setParent($parent);
        $form->setLabel('Backend');
        $form->setElement('select', 'backendLocales', [
            'store' => 'base.Locale',
            'label' => 'Auswählbare Sprachen',
            'value' => [1, 2],
            'required' => true,
            'multiSelect' => true,
        ]);
        $form->setElement('interval', 'backendTimeout', [
            'label' => 'Timeout',
            
if (strpos($config->controller, $request->getControllerName()) !== false) {
            $view->sCloudShow = true;
        }
    }

    /** * Translates the plugin form */
    private function addForm(): void
    {
        $form = $this->Form();
        $parent = $this->Forms()->findOneBy(['name' => 'Frontend']);
        $form->setParent($parent);
        $form->setElement('checkbox', 'show', [
            'label' => 'Tag-Cloud anzeigen',
            'value' => true,
            'scope' => Element::SCOPE_SHOP,
        ]);
        $form->setElement('text', 'controller', [
            'label' => 'Controller-Auswahl',
            'value' => 'index, listing',
            'scope' => Element::SCOPE_SHOP,
        ]);
        
public function install()
    {
        $this->subscribeEvent(
            'Enlight_Controller_Front_RouteShutdown',
            'onRouteShutdown',
            -100
        );

        $form = $this->Form();
        /** @var \Shopware\Models\Config\Form $parent */
        $parent = $this->Forms()->findOneBy(['name' => 'Core']);
        $form->setParent($parent);

        $form->setElement('boolean', 'sql_protection', ['label' => 'SQL-Injection-Schutz aktivieren', 'value' => true]);
        $form->setElement('boolean', 'xss_protection', ['label' => 'XSS-Schutz aktivieren', 'value' => true]);
        $form->setElement('boolean', 'rfi_protection', ['label' => 'RemoteFileInclusion-Schutz aktivieren', 'value' => true]);
        $form->setElement('boolean', 'strip_tags', ['label' => 'Global strip_tags verwenden', 'value' => true]);
        $form->setElement('textarea', 'own_filter', ['label' => 'Eigener Filter', 'value' => null]);

        return true;
    }

    
class Shopware_Plugins_Frontend_Statistics_Bootstrap extends Shopware_Components_Plugin_Bootstrap
{
    /** * Install plugin method * * @return bool */
    public function install()
    {
        $form = $this->Form();

        $parent = $this->Forms()->findOneBy(['name' => 'Core']);
        $form->setParent($parent);

        $form->setElement('text', 'blockIp', [
            'label' => 'IP von Statistiken ausschließen', 'value' => null,
            'scope' => Element::SCOPE_SHOP,
        ]);

        $form->setElement('textarea', 'botBlackList', [
            'label' => 'Bot-Liste',
            'value' => 'antibot;appie;architext;bjaaland;digout4u;echo;fast-webcrawler;ferret;googlebot; gulliver;harvest;htdig;ia_archiver;jeeves;jennybot;linkwalker;lycos;mercator;moget;muscatferret; myweb;netcraft;nomad;petersnews;scooter;slurp;unlost_web_crawler;voila;voyager;webbase;weblayers; wget;wisenutbot;acme.spider;ahoythehomepagefinder;alkaline;arachnophilia;aretha;ariadne;arks; aspider;atn.txt;atomz;auresys;backrub;bigbrother;blackwidow;blindekuh;bloodhound;brightnet;bspider; cactvschemistryspider;cassandra;cgireader;checkbot;churl;cmc;collective;combine;conceptbot;coolbot; core;cosmos;cruiser;cusco;cyberspyder;deweb;dienstspider;digger;diibot;directhit;dnabot; download_express;dragonbot;dwcp;e-collector;ebiness;eit;elfinbot;emacs;emcspider;esther; evliyacelebi;nzexplorer;fdse;felix;fetchrover;fido;finnish;fireball;fouineur;francoroute; freecrawl;funnelweb;gama;gazz;gcreep;getbot;geturl;golem;grapnel;griffon;gromit;hambot; havindex;hometown;htmlgobble;hyperdecontextualizer;iajabot;ibm;iconoclast;ilse;imagelock; incywincy;informant;infoseek;infoseeksidewinder;infospider;inspectorwww;intelliagent;irobot; israelisearch;javabee;jbot;jcrawler;jobo;jobot;joebot;jubii;jumpstation;katipo;kdd;kilroy; ko_yappo_robot;labelgrabber.txt;larbin;linkidator;linkscan;lockon;logo_gif;macworm; magpie;marvin;mattie;mediafox;merzscope;meshexplorer;mindcrawler;momspider;monster; mwdsearch;netcarta;netmechanic;netscoop;newscan-online;nhse;northstar;occam;octopus;openfind; orb_search;packrat;pageboy;parasite;patric;pegasus;perignator;perlcrawler;phantom;piltdownman; pimptrain;pioneer;pitkow;pjspider;pka;plumtreewebaccessor;poppi;portalb;puu;python;raven;rbse; resumerobot;rhcs;roadrunner;robbie;robi;robofox;robozilla;roverbot;rules;safetynetrobot;search_au; searchprocess;senrigan;sgscout;shaggy;shaihulud;sift;simbot;site-valet;sitegrabber;sitetech; slcrawler;smartspider;snooper;solbot;spanner;speedy;spider_monkey;spiderbot;spiderline; spiderman;spiderview;spry;ssearcher;suke;suntek;sven;tach_bw;tarantula;tarspider;techbot; templeton;teoma_agent1;titin;titan;tkwww;tlspider;ucsd;udmsearch;urlck;valkyrie;victoria; visionsearch;vwbot;w3index;w3m2;wallpaper;wanderer;wapspider;webbandit;webcatcher;webcopy; webfetcher;webfoot;weblinker;webmirror;webmoose;webquest;webreader;webreaper;websnarf;webspider; webvac;webwalk;webwalker;webwatch;whatuseek;whowhere;wired-digital;wmir;wolp;wombat;worm;wwwc; wz101;xget;awbot;bobby;boris;bumblebee;cscrawler;daviesbot;ezresult;gigabot;gnodspider;internetseer; justview;linkbot;linkchecker;nederland.zoek;perman;pompos;pooodle;redalert;shoutcast;slysearch; ultraseek;webcompass;yandex;robot;yahoo;bot;psbot;crawl;RSS;larbin;ichiro;Slurp;msnbot;bot;Googlebot; ShopWiki;Bot;WebAlta;abachobot;architext;ask jeeves;frooglebot;googlebot;lycos;spider;HTTPClient',
$form->setElement('number', 'argon2Threads', [
            'description' => 'Anzahl paralleler Threads zur Erzeugung nutzen.',
            'label' => 'Argon2-Threads',
            'minValue' => 1,
            'maxValue' => 32,
            'required' => true,
            'value' => PASSWORD_ARGON2_DEFAULT_THREADS,
        ]);

        $form->setLabel('Passwörter');
        $parent = $this->Forms()->findOneBy(['name' => 'Core']);
        $form->setParent($parent);
    }

    /** * Registers all necessary events and hooks. */
    private function subscribeEvents(): void
    {
        $this->subscribeEvent(
            'Enlight_Bootstrap_InitResource_PasswordEncoder',
            'onInitResourcePasswordEncoder'
        );
$this->subscribeEvent(
            'Enlight_Controller_Action_PostDispatchSecure_Frontend',
            'onPostDispatch'
        );
    }

    private function createForm(): void
    {
        $form = $this->Form();

        $parent = $this->Forms()->findOneBy(['name' => 'Frontend']);
        $form->setParent($parent);

        $form->setElement('checkbox', 'show', [
            'label' => 'Menü anzeigen',
            'value' => 1,
            'scope' => Element::SCOPE_SHOP,
        ]);

        $form->setElement('number', 'hoverDelay', [
            'label' => 'Hover Verzögerung (ms)',
            'value' => 250,
            
Home | Imprint | This part of the site doesn't use cookies.