/** @brief Return the link. @since 2015-12-27 13:13:20 **/ public function display_link() { $r = new \plainview\sdk_broadcast\html\div(); $r->tag = 'a'; if ($this->current) { $r->css_class('current'); } $r->set_attribute('href', $this->url); $text = $this->display_name(); if ($this->count > 0) { $text .= sprintf(' <span class="count">%s</span>', $this->count); } $r->title($this->title); $r->content($text); return $r . ''; }
public function __toString() { $div = new \plainview\sdk_broadcast\html\div(); $div->css_class('tablenav'); $div->css_class('top'); $size = 0; foreach ($this->left as $left) { $l = new \plainview\sdk_broadcast\html\div(); $l->css_class('alignleft'); $string = $left->__toString(); $l->content = $string . ' '; $size += strlen($string); $div->content .= $l; } // No real string to display? Don't display anything. if ($size < 1) { return ''; } return $div . ''; }
/** @brief Return an input container div. @return string A div HTML element with lots of helpful classes set. @since 20130815 **/ public function get_display_div() { $r = new \plainview\sdk_broadcast\html\div(); $r->css_class('form_item')->css_class('form_item_' . $this->make_id()); if (isset($this->type)) { $r->css_class('form_item_' . $this->type); } if (isset($this->tag)) { $r->css_class('form_item_' . $this->tag); } // Get all the css classes for this input and add them to the div $r->css_class($this->get_attribute('class')); // It would be a good idea if the container could include information about the status of the input. if ($this->has_validation_errors()) { $r->css_class('does_not_validate'); } if ($this->is_required()) { $r->css_class('required'); } // Hidden? if ($this->is_hidden()) { $r->hidden(); } return $r; }