protected function _prepareDomainsTable() { $table = new Table(); $table->addClass('table', 'table-striped', 'tablesorter'); $row = new TableRow(); $row->setContent([TableHeading::create('Domain'), TableHeading::create('Price'), TableHeading::create('Source'), TableHeading::create('Month'), TableHeading::create('Year'), TableHeading::create('Status')]); $thead = new TableHead(); $thead->setContent($row); $tbody = new TableBody(); foreach ($this->_domains as $item) { $month = $item->month; $domain = strtolower(trim($item->domain, '')); if (is_numeric($item->month)) { $dateObj = \DateTime::createFromFormat('!m', (int) ltrim($item->month, 0)); $month = $dateObj->format('F'); } $whois = Span::create('Check')->addClass('btn', 'btn-success', 'btn-xs'); $whois->setAttribute('data-sendretrieve', '/domains/whois/' . $domain); $domainLink = new Link('http://www.' . $domain, $domain); $row = TableRow::create(); $row->appendContent([TableCell::create($domainLink), TableCell::create(Encoding::toUTF8($item->price)), TableCell::create($this->_filterSource($item->source)), TableCell::create($month), TableCell::create($item->year), TableCell::create($whois)]); $tbody->appendContent($row); } $table->prependContent($thead); $table->appendContent($tbody); return Div::create([GoogleAdsense::leaderboard(), $table]); }
public function __construct($date = null) { if (is_int($date)) { $this->_timestamp = $date; } else { $this->_timestamp = strtotime($date); } $carbon = Carbon::createFromTimestamp($this->_timestamp); parent::__construct($carbon->diffForHumans()); $this->setAttribute('title', gmdate("Y-m-d H:i:s", $this->_timestamp)); $this->addClass('f-txt-rel-date'); }
protected function _editable($key, $value, $barcode) { $editable = Span::create($value); if ($this->_canEdit) { $url = $this->_path . '/update'; $url .= '?k=' . $key; $url .= '&b=' . $barcode; $editable->addClass('smly-editable'); $editable->setAttribute('data-update-url', $url); } else { if ($this->_canAdd) { $url = $this->_path . '/add'; $url .= '?k=' . $key; $editable->addClass('smly-editable'); $editable->setAttribute('data-insert-url', $url); } } return $editable; }
public function addAction($link = null, Icon $icon, $highlight = false, $tooltip = '') { if (count($this->_actions) > 2) { throw new \RuntimeException("Only 3 actions can be added to object list cards"); } if (!$link instanceof Link) { $link = Span::create(); } if (!empty($tooltip)) { $link->setAttribute('data-toggle', 'tooltip'); $link->setAttribute('title', $tooltip); } $this->_actions[] = [$link->setContent($icon), $highlight]; $this->_actionCount = count($this->_actions); return $this; }
/** * @return Div */ protected function _produceHtml() { $div = Div::create([BoldText::create($this->_property), Span::create($this->_value)]); return $div->addClass('f-prop-value'); }
/** * * * @param string $text * @param null $url * @param string $style * * @return $this */ public function setStatus($text = self::STATUS_OPEN, $url = null, $style = Ui::LABEL_SUCCESS) { switch ($text) { case self::STATUS_CLOSED: $style = Ui::LABEL_DANGER; break; case self::STATUS_HELD: $style = Ui::LABEL_WARNING; break; case self::STATUS_OPEN: $style = Ui::LABEL_SUCCESS; break; } $status = $url ? new Link($url, $text) : Span::create($text); $status->addClass('heading-status', Ui::FLOAT_RIGHT, Ui::MARGIN_MEDIUM_LEFT, 'label ' . $style . ' ' . Ui::LABEL_AS_BADGE); $this->_status = $status; return $this; }
private function _renderItem($key, $value) { return Paragraph::create([BoldText::create($key . ': ')->addClass('whois-key'), Span::create($value)->addClass('whois-value')]); }