addAttributesToRender() protected method

Adds attributes to renderer.
protected addAttributesToRender ( $writer )
Example #1
0
 /**
  * Adds attribute name-value pairs to renderer.
  * This method overrides the parent implementation with additional list box specific attributes.
  * @param THtmlWriter the writer used for the rendering purpose
  */
 protected function addAttributesToRender($writer)
 {
     $rows = $this->getRows();
     $writer->addAttribute('size', "{$rows}");
     if ($this->getSelectionMode() === TListSelectionMode::Multiple) {
         $writer->addAttribute('name', $this->getUniqueID() . '[]');
     } else {
         $writer->addAttribute('name', $this->getUniqueID());
     }
     parent::addAttributesToRender($writer);
 }
Example #2
0
 /**
  * Adds attributes to renderer.
  * @param THtmlWriter the renderer
  */
 protected function addAttributesToRender($writer)
 {
     $writer->addAttribute('name', $this->getUniqueID());
     parent::addAttributesToRender($writer);
 }
Example #3
0
 /**
  * Adds attribute name-value pairs to renderer.
  * This overrides the parent implementation with additional bulleted list specific attributes.
  * @param THtmlWriter the writer used for the rendering purpose
  */
 protected function addAttributesToRender($writer)
 {
     $needStart = false;
     switch ($this->getBulletStyle()) {
         case TBulletStyle::None:
             $writer->addStyleAttribute('list-style-type', 'none');
             $needStart = true;
             break;
         case TBulletStyle::Numbered:
             $writer->addStyleAttribute('list-style-type', 'decimal');
             $needStart = true;
             break;
         case TBulletStyle::LowerAlpha:
             $writer->addStyleAttribute('list-style-type', 'lower-alpha');
             $needStart = true;
             break;
         case TBulletStyle::UpperAlpha:
             $writer->addStyleAttribute('list-style-type', 'upper-alpha');
             $needStart = true;
             break;
         case TBulletStyle::LowerRoman:
             $writer->addStyleAttribute('list-style-type', 'lower-roman');
             $needStart = true;
             break;
         case TBulletStyle::UpperRoman:
             $writer->addStyleAttribute('list-style-type', 'upper-roman');
             $needStart = true;
             break;
         case TBulletStyle::Disc:
             $writer->addStyleAttribute('list-style-type', 'disc');
             break;
         case TBulletStyle::Circle:
             $writer->addStyleAttribute('list-style-type', 'circle');
             break;
         case TBulletStyle::Square:
             $writer->addStyleAttribute('list-style-type', 'square');
             break;
         case TBulletStyle::CustomImage:
             $url = $this->getBulletImageUrl();
             $writer->addStyleAttribute('list-style-image', "url({$url})");
             break;
     }
     if ($needStart && ($start = $this->getFirstBulletNumber()) != 1) {
         $writer->addAttribute('start', "{$start}");
     }
     parent::addAttributesToRender($writer);
 }