Displays the content of this tag

If {@link SwatHtmlTag::content} is set then the content is displayed.

@see SwatHtmlTag::display()
480727
public function displayContent()
    {
        if ($this->content !== null) {
            if ($this->content_type === 'text/plain') {
                echo SwatString::minimizeEntities($this->content);
            } else {
                echo $this->content;
            }
        }
    }
1087000
protected function displayNext()
    {
        if ($this->next_page > 0) {
            $link = $this->getLink();

            $anchor = new SwatHtmlTag('a');
            $anchor->href = sprintf($link, (string) $this->next_page);
            // this is a non-breaking space
            $anchor->setContent($this->next_label);
            $anchor->class = 'swat-pagination-nextprev';
            $anchor->display();
        } else {
            $span = new SwatHtmlTag('span');
            $span->class = 'swat-pagination-nextprev';
            // this is a non-breaking space
            $span->setContent($this->next_label);
            $span->display();
        }
    }
336452
public function display()
    {
        if (!$this->visible) {
            return;
        }

        SwatWidget::display();

        // tree is copied for display so we can add a blank node if show_blank
        // is true
        $display_tree = $this->getDisplayTree();
        $count = count($display_tree) - 1;

        // only show a select if there is more than one option
        if ($count > 1) {
            $select_tag = new SwatHtmlTag('select');
            $select_tag->name = $this->id;
            $select_tag->id = $this->id;
            $select_tag->class = $this->getCSSClassString();

            if (!$this->isSensitive()) {
                $select_tag->disabled = 'disabled';
            }

            $select_tag->open();

            foreach ($display_tree->getChildren() as $child) {
                $this->displayNode($child, 1);
            }

            $select_tag->close();
        } elseif ($count === 1) {
            // get first and only element
            $children = $display_tree->getChildren();
            $option = reset($children)->getOption();
            $this->displaySingle($option);
        }
    }
1192814
public function display()
    {
        if (!$this->visible) {
            return;
        }

        // Do not have a maxlength on the XHTML input tag. This relies on
        // internal knowledge of the parent::display() method.
        $old_maxlength = $this->maxlength;
        $this->maxlength = null;

        parent::display();

        $this->maxlength = $old_maxlength;
    }
1269896
protected function displayText()
    {
        if ($this->text === null) {
            // still show an empty span if there is no text for this
            // progress bar
            $text = '';
        } else {
            if ($this->text_value === null) {
                $text = $this->text;
            } elseif (is_array($this->text_value)) {
                $text = vsprintf($this->text, $this->text_value);
            } else {
                $text = sprintf($this->text, $this->text_value);
            }
        }

        $span_tag = new SwatHtmlTag('span');
        $span_tag->id = $this->id . '_text';
        $span_tag->class = 'swat-progress-bar-text';
        $span_tag->setContent($text, $this->content_type);
        $span_tag->display();
    }
1072797
public function display()
    {
        if (!$this->visible) {
            return;
        }

        parent::display();

        $table_tag = new SwatHtmlTag('table');
        $table_tag->id = $this->id;
        $table_tag->class = $this->getCSSClassString();

        $table_tag->open();
        $this->displayContent();
        $table_tag->close();

        Swat::displayInlineJavaScript($this->getInlineJavaScript());
    }
1344709
public function display()
    {
        if (!$this->visible) {
            return;
        }

        parent::display();

        $input_tag = $this->getInputTag();
        $input_tag->display();

        if (!$this->autocomplete) {
            $nonce_tag = new SwatHtmlTag('input');
            $nonce_tag->type = 'hidden';
            $nonce_tag->name = $this->id . '_nonce';
            $nonce_tag->value = $this->getNonce();
            $nonce_tag->display();
        }
    }
947150
protected function displayInternal($uri_prefix = '', $tag = null)
    {
        $link = new SwatHtmlTag('link');
        $link->title = $this->title;
        $link->rel = $this->relationship;
        $link->type = $this->type;
        $link->href = $this->link_uri;
        $link->display();
    }
825600
public function display()
    {
        $options = $this->getOptions();

        if (!$this->visible || count($options) === 0) {
            return;
        }

        parent::display();

        // outer div is required because the check-all widget is outside the
        // unordered list
        $div_tag = new SwatHtmlTag('div');
        $div_tag->id = $this->id;
        $div_tag->class = $this->getCSSClassString();
        $div_tag->open();

        $current_column = 1;
        $current_option = 0;
        $columns = is_array($this->columns)
            ? $this->columns
            : array(
                ceil(
                    count($options) / ($this->columns > 0 ? $this->columns : 1)
                )
            );

        $multiple_columns = count($options) > $columns[0];
        $maximum_options = array_shift($columns);

        $ul_tag = new SwatHtmlTag('ul');
        if ($multiple_columns) {
            $ul_tag->id = sprintf('%s_column_%s', $this->id, $current_column);
            $ul_tag->class = 'swat-checkbox-list-column';
        }
        $ul_tag->open();

        foreach ($options as $index => $option) {
            if ($current_option == $maximum_options) {
                $ul_tag->close();

                $current_column++;
                $current_option = 0;
                $maximum_options =
                    count($columns) > 0
                        ? array_shift($columns)
                        : $maximum_options;

                $ul_tag->id = sprintf(
                    '%s_column_%s',
                    $this->id,
                    $current_column
                );

                $ul_tag->class = 'swat-checkbox-list-column';

                $ul_tag->open();
            }

            $current_option++;
            $this->displayOption($option, $index);
        }

        $ul_tag->close();

        // Show clear div if columns are used
        if ($multiple_columns) {
            echo '<div class="swat-clear"></div>';
        }

        // Show the check all if more than one checkable item is displayed.
        $check_all = $this->getCompositeWidget('check_all');
        $check_all->visible = $this->show_check_all && count($options) > 1;
        $check_all->display();

        $div_tag->close();

        Swat::displayInlineJavaScript($this->getInlineJavaScript());
    }
276290
public function displayHeaderCell()
    {
        if (!$this->visible) {
            return;
        }

        $th_tag = new SwatHtmlTag('th', $this->getThAttributes());
        $th_tag->scope = 'col';

        $colspan = $this->getXhtmlColspan();
        if ($colspan > 1) {
            $th_tag->colspan = $colspan;
        }

        $th_tag->open();
        $this->displayHeader();
        $th_tag->close();
    }
620027
public function display()
    {
        if (!$this->visible) {
            return;
        }

        SwatWidget::display();

        if ($this->alt == '') {
            throw new SwatException(
                'The $alt property of SwatImageButton must be set to an ' .
                    'appropriate value. The "alt" attribute is required in ' .
                    'HTML5 and can not be an empty string.'
            );
        }

        $input_tag = new SwatHtmlTag('input');
        $input_tag->type = 'image';
        $input_tag->id = $this->id;
        $input_tag->name = $this->id;
        $input_tag->value = $this->title;
        $input_tag->alt = $this->alt;
        $input_tag->class = $this->getCSSClassString();

        if (count($this->values)) {
            $input_tag->src = vsprintf($this->image, $this->values);
        } else {
            $input_tag->src = $this->image;
        }

        $input_tag->tabindex = $this->tab_index;
        $input_tag->accesskey = $this->access_key;

        if (!$this->isSensitive()) {
            $input_tag->disabled = 'disabled';
        }

        $input_tag->display();

        if (
            $this->show_processing_throbber ||
            $this->confirmation_message !== null
        ) {
            Swat::displayInlineJavaScript($this->getInlineJavaScript());
        }
    }
94907
public function display()
    {
        if (!$this->visible) {
            return;
        }

        parent::display();

        $tr_tag = new SwatHtmlTag('tr');
        $tr_tag->id = $this->id;
        $tr_tag->class = $this->getCSSClassString();

        $colspan = $this->view->getXhtmlColspan();
        $td_tag = new SwatHtmlTag('td');

        $tr_tag->open();

        if ($this->offset > 0 && $this->position === self::POSITION_LEFT) {
            $this->displayOffsetCell($this->offset);
        }

        $this->displayWidgetCell();

        if ($this->offset > 0 && $this->position === self::POSITION_RIGHT) {
            $this->displayOffsetCell($this->offset);
        }

        $tr_tag->close();
    }
730466
public function display()
    {
        if (!$this->visible) {
            return;
        }

        $actual_value = $this->value;
        if (count($this->path) === 0 && $this->value !== null) {
            // If there is a value but not a path, assume the value is the
            // first element in the path.
            $this->value = array($this->value);
        } else {
            // temporarily set the value to the path for parent::display()
            $this->value = $this->path;
        }

        parent::display();

        // set value back to actual value after parent::display()
        $this->value = $actual_value;
    }
962803
public function display()
    {
        parent::display();

        if (!$this->visible) {
            return;
        }

        $flydown = $this->getCompositeWidget('flydown');
        $flydown->value = (string) $this->value;

        $div = new SwatHtmlTag('div');
        $div->id = $this->id;
        $div->class = $this->getCSSClassString();
        if (!$this->isSensitive()) {
            $div->class .= ' swat-insensitive';
        }
        $div->open();
        $flydown->display();
        $div->close();

        Swat::displayInlineJavaScript($this->getInlineJavaScript());
    }
426910
public function render()
    {
        if (!$this->visible || $this->image == '') {
            return;
        }

        parent::render();

        $image_tag = new SwatHtmlTag('img');

        if ($this->value === null) {
            $image_tag->src = $this->image;
        } elseif (is_array($this->value)) {
            $image_tag->src = vsprintf($this->image, $this->value);
        } else {
            $image_tag->src = sprintf($this->image, $this->value);
        }

        $image_tag->height = $this->height;
        $image_tag->width = $this->width;
        $image_tag->title = $this->title;

        $margin_x = 0;
        $margin_y = 0;

        if (
            $this->occupy_width !== null &&
            $this->occupy_width > $this->width
        ) {
            $margin_x = intval($this->occupy_width - $this->width);
        }

        if (
            $this->occupy_height !== null &&
            $this->occupy_height > $this->height
        ) {
            $margin_y = intval($this->occupy_height - $this->height);
        }

        if ($margin_x > 0 || $margin_y > 0) {
            $image_tag->style = sprintf(
                $margin_x % 2 === 0 && $margin_y % 2 === 0
                    ? 'margin: %dpx %dpx'
                    : 'margin: %dpx %dpx %dpx %dpx;',
                floor(((float) $margin_y) / 2),
                ceil(((float) $margin_x) / 2),
                ceil(((float) $margin_y) / 2),
                floor(((float) $margin_x) / 2)
            );
        }

        // alt is a required XHTML attribute. We should always display it even
        // if it is not specified.
        $image_tag->alt = $this->alt === null ? '' : $this->alt;

        $image_tag->class = $this->getCSSClassString();

        $image_tag->display();
    }
1184068
protected function displayMessages()
    {
        if (!$this->display_messages || !$this->hasMessage()) {
            return;
        }

        $messages = $this->getMessages();

        $message_ul = new SwatHtmlTag('ul');
        $message_ul->class = 'swat-form-field-messages';
        $message_li = new SwatHtmlTag('li');

        $message_ul->open();

        foreach ($messages as $message) {
            $message_li->class = $message->getCSSClassString();
            $message_li->setContent(
                $message->primary_content,
                $message->content_type
            );

            if ($message->secondary_content !== null) {
                $secondary_span = new SwatHtmlTag('span');
                $secondary_span->setContent(
                    $message->secondary_content,
                    $message->content_type
                );

                $message_li->open();
                $message_li->displayContent();
                echo ' ';
                $secondary_span->display();
                $message_li->close();
            } else {
                $message_li->display();
            }
        }

        $message_ul->close();
    }
654789
public function display()
    {
        if (!$this->visible) {
            return;
        }

        SwatWidget::display();

        // default header level is h2
        $level = 2;
        $ancestor = $this->parent;

        // get appropriate header level, limit to h6
        while ($ancestor !== null && $level < 6) {
            if ($ancestor instanceof SwatFrame) {
                $level++;
            }

            $ancestor = $ancestor->parent;
        }

        $header_tag = new SwatHtmlTag('h' . $level);
        $header_tag->class = 'swat-frame-title';

        $control_div = $this->getControlDivTag();
        $span_tag = $this->getSpanTag();
        $input_tag = $this->getInputTag();
        $container_div = $this->getContainerDivTag();
        $container_div->class .= ' swat-frame-contents';
        $animate_div = $this->getAnimateDivTag();

        $control_div->open();

        $header_tag->open();
        $span_tag->display();
        $header_tag->close();

        $input_tag->display();

        $animate_div->open();
        echo '<div>';
        $container_div->open();
        $this->displayChildren();
        $container_div->close();
        echo '</div>';
        $animate_div->close();

        Swat::displayInlineJavaScript($this->getInlineJavascript());

        $control_div->close();
    }