Esempio n. 1
0
 protected function onWidget(array $args, \Drone\HTML &$html)
 {
     $html = \Drone\HTML::div()->style("height: {$this->wo('height')}px;")->add($html = \Drone\HTML::div()->class('fb-like-box')->data('href', $this->wo('href'))->data('height', $this->wo('height'))->data('header', \Drone\Func::boolToString($this->wo('header')))->data('stream', \Drone\Func::boolToString($this->wo('stream')))->data('show-faces', \Drone\Func::boolToString($this->wo('show_faces')))->data('show-border', \Drone\Func::boolToString($this->wo('border'))));
 }
Esempio n. 2
0
 /**
  * Paginate links
  *
  * @since 1.0
  *
  * @param  string   $name
  * @param  WP_Query $query
  * @return string
  */
 public static function getPaginateLinks($name, $query = null)
 {
     if (!apply_filters('everything_pagination_display', true, $name)) {
         return '';
     }
     // Paginate links
     switch ($name) {
         // Page
         case 'page':
             if (!is_singular()) {
                 return '';
             }
             $pagination = wp_link_pages(array('before' => ' ', 'after' => ' ', 'next_or_number' => rtrim(Everything::to('site/page_pagination'), 's'), 'previouspagelink' => '<i class="icon-left-open"></i><span>' . __('Previous page', 'everything') . '</span>', 'nextpagelink' => '<span>' . __('Next page', 'everything') . '</span><i class="icon-right-open"></i>', 'echo' => false));
             $pagination = str_replace('<a ', '<a class="button small" ', $pagination);
             $pagination = preg_replace('/ ([0-9]+) /', ' <span class="button small active">\\1</span> ', $pagination);
             break;
             // Comment
         // Comment
         case 'comments':
             if (!is_singular()) {
                 return '';
             }
             $pagination = paginate_comments_links(array('prev_next' => Everything::to('site/comments/pagination') == 'numbers_navigation', 'prev_text' => '<i class="icon-left-open"></i>', 'next_text' => '<i class="icon-right-open"></i>', 'echo' => false));
             $pagination = str_replace(array('page-numbers', 'current'), array('button small', 'active'), $pagination);
             break;
             // Default
         // Default
         default:
             $args = array('prev_next' => Everything::to('site/pagination') == 'numbers_navigation', 'prev_text' => '<i class="icon-left-open"></i>', 'next_text' => '<i class="icon-right-open"></i>', 'end_size' => 1, 'mid_size' => 2);
             if ($name == 'woocommerce') {
                 $args['base'] = esc_url(str_replace('99999999', '%#%', remove_query_arg('add-to-cart', htmlspecialchars_decode(get_pagenum_link(99999999)))));
             }
             $pagination = \Drone\Func::wpPaginateLinks($args, $query);
             $pagination = preg_replace_callback('/class=[\'"](?P<dir>prev |next )?page-numbers(?P<current> current)?[\'"]()/i', function ($m) {
                 return "class=\"{$m['dir']}button small" . str_replace('current', 'active', $m['current']) . '"';
             }, $pagination);
     }
     if (!$pagination) {
         return '';
     }
     return \Drone\HTML::div()->class('pagination')->add($pagination)->html();
 }
Esempio n. 3
0
 protected function _html()
 {
     $html = HTML::div()->class($this->getCSSClass(__CLASS__))->add($this->family->html());
     if (isset($this->color)) {
         $html->add(' ', $this->color->html());
     }
     if (isset($this->size)) {
         $html->add(' ', $this->size->html());
     }
     if (isset($this->line_height)) {
         $html->add(isset($this->size) ? ' / ' : ' ', $this->line_height->html());
     }
     if (isset($this->styles)) {
         $html->add('<br />', $this->styles->html());
     }
     return $html;
 }
Esempio n. 4
0
 protected function _html()
 {
     $html = HTML::div()->class($this->getCSSClass(__CLASS__));
     $html->add($this->icon->html(), HTML::div()->style('margin: 0 0 4px 36px;')->add($this->title->html()), $this->url->html());
     return $html;
 }
Esempio n. 5
0
 protected function getBricks($query)
 {
     // HTML
     $html = HTML::div()->class('bricks')->data('bricks-columns', $this->so('columns'))->data('bricks-filter', Func::boolToString($this->so('filter')));
     while (have_posts()) {
         the_post();
         $GLOBALS['more'] = 0;
         $brick = $html->addNew('div')->add(\Drone\Func::functionGetOutputBuffer('get_template_part', 'parts/post'));
         if ($this->so('filter')) {
             $terms = \Drone\Func::wpPostTermsList(get_the_ID(), $this->so('filter'));
             if (is_category() && ($term_id = array_search(single_cat_title('', false), $terms)) !== false) {
                 unset($terms[$term_id]);
             }
             $brick->data('bricks-terms', json_encode(array_values($terms)));
         }
     }
     wp_reset_query();
     // Paginate links
     if ($this->so('pagination') && ($pagination = \Everything::getPaginateLinks('blog', $query))) {
         $html = HTML::make()->add($html, $pagination);
     }
     return $html;
 }