Source of file IframeElement.php
Size: 1,014 Bytes - Last Modified: 2021-12-24T06:45:11+00:00
/var/www/docs.ssmods.com/process/src/src/IframeElement.php
123456789101112131415161718192021222324252627282930313233343536 | <?php namespace DorsetDigital\Elements; use DNADesign\Elemental\Models\BaseElement; use SilverStripe\Forms\TextField; use SilverStripe\ORM\FieldType\DBField; class IframeElement extends BaseElement { private static $singular_name = 'Iframe Block'; private static $plural_name = 'Iframe Blocks'; private static $description = 'Embeds an Iframe into the page'; private static $table_name = 'DorsetDigital_Elements_Iframe'; private static $db = [ 'EmbedLink' => 'Varchar(1024)' ]; public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab('Root.Main', TextField::create('EmbedLink')->setTitle('Iframe link')->setDescription('The full Iframe code as supplied by the site to be embedded.')); return $fields; } public function getType() { return 'Iframe block'; } public function getEmbedCode() { return DBField::create_field('HTMLFragment', $this->EmbedLink); } } |