Source of file Embed.php
Size: 2,534 Bytes - Last Modified: 2021-12-24T06:50:02+00:00
/var/www/docs.ssmods.com/process/src/src/models/Embed.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 | <?php namespace gorriecoe\Embed\Models; use SilverStripe\Forms\Tab; use SilverStripe\Forms\TabSet; use SilverStripe\Forms\FieldList; use SilverStripe\ORM\DataObject; use gorriecoe\Embed\Extensions\Embeddable; /** * Embed **/ class Embed extends DataObject { /** * Defines the database table name * @var string */ private static $table_name = 'Embed'; /** * Singular name for CMS * @var string */ private static $singular_name = 'Embed'; /** * Plural name for CMS * @var string */ private static $plural_name = 'Embed'; /** * Defines summary fields commonly used in table columns * as a quick overview of the data for this dataobject * @var array */ private static $summary_fields = array( 'EmbedTitle' => 'Title', 'EmbedType' => 'Type', 'EmbedSourceURL' => 'URL' ); /** * Defines extension names and parameters to be applied * to this object upon construction. * @var array */ private static $extensions = array( Embeddable::class ); /** * List the allowed included embed types. If null all are allowed. * * @var array */ private static $allowed_embed_types = null; /** * Defines upload folder for embedded assets * * @var string */ private static $embed_folder = 'Embed'; /** * CMS Fields * @return FieldList */ public function getCMSFields() { $fields = FieldList::create( TabSet::create( "Root", Tab::create("Main") ) ->setTitle(_t('SiteTree.TABMAIN', "Main")) ); $this->extend('updateCMSFields', $fields); return $fields; } /** * Alias for EmbedTitle * This is used by CMS Title and breadcrumbs. * @return String */ public function getTitle() { return $this->EmbedTitle; } /** * Set CSS classes for templates * @param string $class CSS classes. * @return $this */ public function setClass($class) { $this->setEmbedClass($class); return $this; } /** * Returns the classes for this embed. * @return string */ public function getClass() { return $this->EmbedClass; } /** * Renders an HTML anchor tag for this link * @return HTML */ public function forTemplate() { return $this->Embed; } } |