Source of file TemplateOverrideExtension.php
Size: 1,064 Bytes - Last Modified: 2021-12-23T10:59:08+00:00
/var/www/docs.ssmods.com/process/src/code/TemplateOverrideExtension.php
12345678910111213141516171819202122232425262728 | <?php /* Template override extension for the model 1) Adds an AlternativeTemplate field 2) Ability to edit that */ class TemplateOverrideExtension extends DataExtension { private static $db = array('AlternativeTemplate' => 'Varchar'); public function updateCMSFields(FieldList $fields) { $templatei18n = _t('TemplateOverride.TEMPLATE', 'Template'); $fields->addFieldToTab('Root.'.$templatei18n, new TextField('AlternativeTemplate', _t('TemplateOverride.ALTERNATIVE_TEMPLATE_NAME', 'Alternative template name'))); $info_field = new LiteralField( $name = 'infofield', $content = '<p class="message">'._t('TemplateOverride.INFO', 'If you wish to change'. ' the default template, type the name of the template here. Otherwise '. ' the normal default template will be used. Normally this will not '. ' require changing.').'</p>' ); $fields->addFieldToTab('Root.'.$templatei18n, $info_field); } } |