Example #1
0
 public function pageContent()
 {
     $table = (new Table())->addClass('table', 'table-striped', 'tablesorter');
     $thead = new TableHead();
     $tbody = new TableBody();
     $noTitle = [];
     $thead->setContent([new TableHeading('Qty'), new TableHeading('Title')]);
     $table->setContent($thead);
     foreach ($this->_dvds as $key => $item) {
         if ($key === 0 && $this->_canAdd) {
             $tr = new TableRow();
             $tr->appendContent([new TableCell(1), new TableCell($this->_editable('title', 'title', ''))]);
             $tbody->prependContent($tr);
         }
         if (!$item->title) {
             $noTitleRow = new TableRow();
             $noTitleRow->appendContent([new TableCell($item->count), new TableCell($this->_editable('title', 'no title', $item->barcode))]);
             $this->_count--;
             $noTitle[] = $noTitleRow;
         } else {
             $tr = new TableRow();
             $tr->appendContent([new TableCell($item->count), new TableCell($this->_editable('title', $item->title, $item->barcode))]);
             $tbody->appendContent($tr);
             $this->_count++;
         }
     }
     //$tbody->appendContent($noTitle);
     return Div::create([HeadingTwo::create(['Dvd Library ', Span::create('count ' . $this->_count)->setAttribute('style', 'font-size: 16px; color: #ccc;')]), $table->appendContent($tbody)]);
 }
Example #2
0
 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]);
 }
Example #3
0
 protected function _produceHtml()
 {
     $div = Div::create([Div::create($this->_frontContent)->addClass('front'), Div::create($this->_backContent)->addClass('back')]);
     $div->addClass('flip-container')->setAttribute('ontouchstart', 'this.classList.toggle(\'hover\')')->setAttribute('style', 'width:' . $this->_width . ';height:' . $this->_height);
     if ($this->_vertical) {
         $div->addClass('vertical');
     }
     return $div;
 }
Example #4
0
 /**
  * @return Div
  */
 protected function _produceHtml()
 {
     $panel = Div::create($this->getContent())->addClass('f-alert', 'alert', $this->getStyle());
     foreach ($this->_classes as $class) {
         $panel->addClass($class);
     }
     foreach ($this->_attributes as $key => $value) {
         $panel->setAttribute($key, $value);
     }
     return $panel;
 }
Example #5
0
 /**
  * @return SafeHtml|SafeHtml[]
  */
 protected function _produceHtml()
 {
     $div = Div::create('Query Builder Placeholder');
     if ($this->_classes) {
         $div->addClass(...$this->_classes);
     }
     if ($this->_definitionsUrl) {
         $div->setAttribute('data-definitions', $this->_definitionsUrl);
     }
     if ($this->_rulesUrl) {
         $div->setAttribute('data-rules', $this->_rulesUrl);
     }
     return $div;
 }
Example #6
0
 /**
  * @return ISafeHtmlProducer
  */
 public function render()
 {
     $output = new Div();
     $groups = $this->getMethods();
     foreach ($groups as $group => $methods) {
         $output->appendContent(Div::create(new HeadingOne(Strings::titleize($group)))->addClass('content-container'));
         foreach ($methods as $method) {
             $reflect = new \ReflectionMethod($this, $method);
             $parsed = DocBlockParser::fromMethod($this, $method);
             $code = $this->_getCode($reflect);
             $id = Strings::randomString(4);
             $toggledCode = new Div();
             $toggledCode->appendContent(new HeadingFour((new Link('#', Strings::titleize($method)))->setAttribute('onclick', '$(\'#code-' . $id . '\')' . '.toggleClass(\'' . Ui::HIDE . '\');' . 'return false;')));
             $code = new SafeHtml(str_replace('<span style="color: #0000BB">&lt;?php&nbsp;</span>', '', highlight_string('<?php ' . $code, true)));
             $toggledCode->appendContent(Div::create()->appendContent(HtmlTag::createTag('pre', [], $code))->addClass(Ui::HIDE)->setId('code-' . $id));
             $methRow = Div::create()->addClass('content-container');
             $methRow->appendContent($toggledCode);
             $methRow->appendContent(new Paragraph($parsed->getSummary()));
             $methRow->appendContent($this->{$method}());
             $output->appendContent($methRow);
         }
     }
     return $output;
 }
Example #7
0
 protected function _produceHtml()
 {
     return Div::create([$this->getIcon(), $this->_renderTitle(), $this->_renderActions(), $this->getStatus()])->addClass('f-panel-heading', 'panel-heading', $this->getBgColour(), Ui::CLEARFIX);
 }
Example #8
0
 public function getContent()
 {
     return Div::create($this->_content)->addClass('panel-body');
 }
Example #9
0
 protected function _arrayBuilder(array $values = [])
 {
     $arrayBuilder = Div::create()->addClass('arrayBuilder');
     $arrayBuilderValues = HtmlTag::createTag('input', ['type' => 'text', 'class' => 'arrayBuilder-values', 'value' => json_encode($values, JSON_FORCE_OBJECT)]);
     return Div::create($arrayBuilder->appendContent($arrayBuilderValues))->addClass('col-xs-6');
 }
Example #10
0
 public function render()
 {
     $output = Div::create()->addClass($this->_pageType);
     $output->appendContent([$this->pageContent()]);
     return $output;
 }
Example #11
0
 /**
  * @group Basic Query Builder
  */
 public final function queryBuilder()
 {
     $div = Div::create([QueryBuilder::create('/querybuilder/definition', '/querybuilder/policy'), HtmlTag::create()->setTag('pre')->setId('values')])->addClass(Ui::BG_INFO, Ui::PADDING_LARGE);
     AssetManager::sourceType()->requireInlineJs("\n        \$('.query-builder').QueryBuilder();\n        \$(document).on('change.querybuilder', function(e, data) {\n          \$('#values').text(\n            JSON.stringify(data, null, 2)\n          );\n        });\n      ");
     return $div;
 }
Example #12
0
 public function getFullDetails()
 {
     $output = Div::create([$this->_renderItem('Domain Name', $this->getDomainName()), $this->_renderItem('Registrant', $this->getRegistrant()), $this->_renderItem('Registrant Type', $this->getRegistrantType()), $this->_renderItem('Registrant Addresss', $this->getRegistrantAddress()), $this->_renderItem('Registrar', $this->getRegistrar()), $this->_renderItem('Relevant Dates', $this->getRelevantDates()), $this->_renderItem('Registration Status', $this->getRegistrationStatus()), $this->_renderItem('Name Servers', $this->getNameServers())]);
     return $output;
 }
Example #13
0
 protected function _salesByChars()
 {
     $output = Div::create(HeadingTwo::create('Sales by Domain Character Length'));
     $data = [];
     foreach ($this->_domains as $item) {
         $domain = str_replace(['.co.uk', '.org.uk'], '', $item->domain);
         $data[strlen($domain)][] = $domain;
     }
     $domains = [['Char Length', 'Count']];
     foreach ($data as $length => $domain) {
         $domains[$length] = ["{$length}", count($domain)];
     }
     ksort($domains);
     $chart = ChartPanel::i($domains);
     $chart->setChartType($chart::CHART_TYPE_COLUMN);
     $output->appendContent($chart);
     return $output->addClass('col-md-12');
 }
Example #14
0
 /**
  * @group Flipper
  */
 public final function verticalFlipper()
 {
     return Flipper::create(Div::create('front')->setAttribute('style', 'width:100%;height:100%;background-color:red'), Div::create('back')->setAttribute('style', 'width:100%;height:100%;background-color:black'), 100, 100)->setVertical();
 }
Example #15
0
 /**
  * @return Div
  */
 protected function _produceHtml()
 {
     $div = Div::create([BoldText::create($this->_property), Span::create($this->_value)]);
     return $div->addClass('f-prop-value');
 }
Example #16
0
 /**
  * @return SafeHtml|SafeHtml[]
  */
 protected function _produceHtml()
 {
     $card = ListItem::create('');
     $card->addClass('f-obj-lst-itm');
     $card->addClass('f-obj-lst-itm-' . $this->_colour);
     $frame = Div::create('')->addClass('f-obj-lst-itm-frm');
     $card->appendContent($frame);
     $actionCount = $this->_actionCount;
     if ($actionCount > 0) {
         $actions = UnorderedList::create();
         $actions->addClass('f-obj-lst-itm-act');
         $frame->appendContent($actions);
         $card->addClass('f-obj-lst-itm-w-act-' . $actionCount);
         foreach ($this->_actions as $action) {
             $li = ListItem::create($action[0]);
             if ($action[1]) {
                 $li->addClass('highlight');
             }
             $actions->addItem($li);
         }
     }
     $content = Div::create('');
     $content->addClass('f-obj-lst-itm-cntr');
     $frame->appendContent($content);
     $table = Div::create('');
     $table->addClass('f-obj-lst-itm-tbl');
     $content->appendContent($table);
     $row = Div::create('');
     $row->addClass('f-obj-lst-itm-cntr-row');
     $table->appendContent($row);
     $col1 = Div::create('');
     $col1->addClass('f-obj-lst-itm-cntr-col');
     $row->appendContent($col1);
     foreach ($this->_midColumns as $column) {
         $midCol = Div::create($column);
         $midCol->addClass('f-obj-lst-itm-cntr-col');
         $row->appendContent($midCol);
     }
     if (!empty($this->_rightContent)) {
         $col2 = Div::create($this->_rightContent);
         $col2->addClass('f-obj-lst-itm-cntr-col');
         $col2->addClass('f-obj-lst-itm-cntr-right');
         $row->appendContent($col2);
     }
     $title = Div::create($this->_title);
     $title->addClass('f-obj-lst-itm-title');
     $col1->appendContent($title);
     if (!empty($this->_subTitle)) {
         $subTitle = Div::create($this->_subTitle);
         $subTitle->addClass('f-obj-lst-itm-sub-title');
         $col1->appendContent($subTitle);
     }
     $this->_applyDataAttributes($card);
     $this->_applyId($card);
     return $card;
 }
Example #17
0
 /**
  * @group GradientColours
  */
 public final function gradientBackground()
 {
     $out1 = Div::create()->setAttribute('style', 'width:100%;height:17px;display:table;table-layout:fixed');
     for ($i = 0; $i <= 100; $i++) {
         $div = (new Div())->setAttribute('style', 'display:table-cell;background:' . ColourHelper::rgbGradient($i, 100));
         $out1->appendContent($div);
     }
     $out2 = Div::create()->setAttribute('style', 'width:100%;height:17px;display:table;table-layout:fixed');
     for ($i = 0; $i <= 100; $i++) {
         $div = (new Div())->setAttribute('style', 'display:table-cell;background:' . ColourHelper::rgbGradient($i, 100, true));
         $out2->appendContent($div);
     }
     return ['Regular', $out1, 'Inverted', $out2];
 }