MetaModels\DcGeneral\Events\Table\InputScreens\Subscriber::drawLegend PHP Метод

drawLegend() защищенный Метод

Draw a legend.
protected drawLegend ( ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\ModelToLabelEvent $event ) : void
$event ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\ModelToLabelEvent The event.
Результат void
    protected function drawLegend(ModelToLabelEvent $event)
    {
        $model = $event->getModel();
        $arrLegend = deserialize($model->getProperty('legendtitle'));
        if (is_array($arrLegend)) {
            $strLegend = $arrLegend[$GLOBALS['TL_LANGUAGE']];
            if (!$strLegend) {
                // TODO: Get the fallback language here.
                $strLegend = 'legend';
            }
        } else {
            $strLegend = $model->getProperty('legendtitle') ? $model->getProperty('legendtitle') : 'legend';
        }
        $event->setLabel('<div class="field_heading cte_type %s"><strong>%s</strong></div>
                <div class="dca_palette">%s%s</div>')->setArgs(array($model->getProperty('published') ? 'published' : 'unpublished', $GLOBALS['TL_LANG']['tl_metamodel_dcasetting']['dcatypes']['legend'], $strLegend, $model->getProperty('legendhide') ? ':hide' : ''));
    }