EventAction::toHtml PHP Method

toHtml() public method

public toHtml ( )
    public function toHtml()
    {
        $this->htmlOptions['class'] .= ' ' . $this->options['level'];
        $this->htmlOptions['class'] .= ' event-action';
        $label = CHtml::encode($this->label);
        if ($this->options['level'] === 'save') {
            $this->htmlOptions['class'] .= ' button secondary small';
        }
        if ($this->options['level'] === 'delete') {
            $content = '<span class="icon-button-small-trash-can"></span>';
            $content .= '<span class="hide-offscreen">' . $label . '</span>';
            $label = $content;
            $this->htmlOptions['class'] .= ' button button-icon small';
        }
        if ($this->options['level'] === 'cancel') {
            $this->htmlOptions['class'] .= ' button small';
        }
        if ($this->options['disabled']) {
            $this->htmlOptions['class'] .= ' disabled';
            $this->htmlOptions['disabled'] = 'disabled';
        }
        if ($this->type == 'button') {
            return CHtml::htmlButton($label, $this->htmlOptions);
        } elseif ($this->type == 'link') {
            return CHtml::link($label, $this->href, $this->htmlOptions);
        }
    }