/** * Renders additional body content. * This method overrides parent implementation by adding * additional color picker button. * @param THtmlWriter writer */ public function renderEndTag($writer) { parent::renderEndTag($writer); $color = $this->getText(); $writer->addAttribute('class', 'TColorPicker_button'); $writer->renderBeginTag('span'); $writer->addAttribute('id', $this->getClientID() . '_button'); $writer->addAttribute('src', $this->getAssetUrl('button.gif')); if ($color !== '') { $writer->addAttribute('style', "background-color:{$color};"); } $writer->addAttribute('width', '20'); $writer->addAttribute('height', '20'); $writer->addAttribute('alt', ''); $writer->renderBeginTag('img'); $writer->renderEndTag(); $writer->renderEndTag(); }