/** * @return mixed */ public function getContent() { $content = new \HtmlObject\Element('div'); $content->setChild(new \HtmlObject\Element('p', $this->content)); if ($this->link) { $content->setChild(id(new \HtmlObject\Link($this->link, t('Learn More')))->target('blank')); } if ($this->guide) { $button = new \HtmlObject\Link($this->link, t('Launch Guide')); $button->addClass('btn btn-info btn-sm')->href('#')->setAttribute('data-launch-guide', $this->guide); $content->setChild($button); } return $content; }
public function testGetSelectOptions() { $select = $this->former->select('foo')->options($this->options); foreach ($this->options as $key => $option) { $options[$key] = HtmlObject\Element::create('option', $option, array('value' => $key)); } $this->assertEquals($select->getOptions(), $options); }
public function view() { $list = $this->list; $nh = Loader::helper('navigation'); $this->set('nh', $nh); if ($this->pfID) { $this->requireAsset('css', 'font-awesome'); $feed = Feed::getByID($this->pfID); if (is_object($feed)) { $this->set('rssUrl', $feed->getFeedURL()); $link = new \HtmlObject\Element('link'); $link->href($feed->getFeedURL()); $link->rel('alternate'); $link->type('application/rss+xml'); $link->title($feed->getTitle()); $this->addHeaderItem($link); } } //Pagination... $showPagination = false; if ($this->num > 0) { $list->setItemsPerPage($this->num); $pagination = $list->getPagination(); $pages = $pagination->getCurrentPageResults(); if ($pagination->getTotalPages() > 1 && $this->paginate) { $showPagination = true; $pagination = $pagination->renderDefaultView(); $this->set('pagination', $pagination); } } else { $pages = $list->getResults(); } if ($showPagination) { $this->requireAsset('css', 'core/frontend/pagination'); } $this->set('pages', $pages); $this->set('list', $list); $this->set('showPagination', $showPagination); }
public function view() { $list = $this->list; $nh = Core::make('helper/navigation'); $this->set('nh', $nh); if ($this->pfID) { $this->requireAsset('css', 'font-awesome'); $feed = Feed::getByID($this->pfID); if (is_object($feed)) { $this->set('rssUrl', $feed->getFeedURL()); $link = new \HtmlObject\Element('link'); $link->href($feed->getFeedURL()); $link->rel('alternate'); $link->type('application/rss+xml'); $link->title($feed->getTitle()); $this->addHeaderItem($link); } } //Pagination... $showPagination = false; if ($this->num > 0) { $list->setItemsPerPage($this->num); $pagination = $list->getPagination(); $pages = $pagination->getCurrentPageResults(); if ($pagination->getTotalPages() > 1 && $this->paginate) { $showPagination = true; $pagination = $pagination->renderDefaultView(); $this->set('pagination', $pagination); } } else { $pages = $list->getResults(); } if ($showPagination) { $this->requireAsset('css', 'core/frontend/pagination'); } $this->set('pages', $pages); $this->set('list', $list); $this->set('showPagination', $showPagination); $this->set('display', $this->get_display_options()); // Thumbnail Attribute if ($this->image_attribute == 0) { $this->set('thumbnail_attribute', 'thumbnail'); } else { $this->set('thumbnail_attribute', CollectionAttributeKey::getByID($this->image_attribute)->getAttributeKeyHandle()); } }
public function getPresetContainerHtmlObject() { $column = new \HtmlObject\Element('div'); $column->addClass('foo'); return $column; }
foreach ($files as $f) { if ($f->inFileSet($fileset)) { ++$found; } } if ($found == 0) { // nothing } elseif ($found == count($files)) { $checkbox->checked('checked'); $input->value(2); } else { $checkbox->indeterminate(1); $checkbox->class('tristate'); $input->value(1); } $span = new HtmlObject\Element('span'); $span->appendChild($checkbox)->appendChild($input); return $span; })); ?> <script type="text/javascript"> $(function() { $('#ccm-file-set-list input.tristate').tristate({ change: function(state, value) { var $input = $('input[data-set-input=' + $(this).attr('data-set') + ']'); if (state === null) { $input.val(1); } else if (state === true) { $input.val(2); } else if (state !== true) {