function thb_display_sidebar($sidebar, $type = 'main', $class = '')
 {
     if (!function_exists('dynamic_sidebar') || !is_active_sidebar($sidebar)) {
         return;
     }
     $sidebar_content = new THB_TemplateLoader('frontend/sidebar', array('sidebar' => $sidebar, 'sidebar_type' => $type, 'sidebar_class' => $class));
     $sidebar_content->render();
 }
 /**
  * Render the page.
  *
  * @return void
  */
 public function render()
 {
     $page_template = new THB_TemplateLoader($this->_template, array('page' => $this, 'theme' => thb_theme()));
     $page_template->render();
 }
 /**
  * Render the fields container.
  *
  * @return void
  */
 public function render()
 {
     $intro_text = new THB_TemplateLoader('admin/introtext', array('intro_text' => $this->getIntroText()));
     $fields_container_template = new THB_TemplateLoader($this->_template, array('fields_container' => $this, 'container_intro_text' => $intro_text->render(true)));
     $fields_container_template->render();
 }
 /**
  * Render the shortcode.
  *
  * @param array $atts The shortcode provided attributes.
  * @param string $content The shortcode enclosed content.
  * @return string
  */
 public function render($atts = array(), $content = '')
 {
     if (empty($this->_template)) {
         wp_die('Empty template path.');
     }
     self::$instance_number++;
     if (empty($atts)) {
         $atts = array();
     }
     $this->_userData['attributes'] = thb_array_asum($this->_defaultData['attributes'], $atts);
     $loopArgs = thb_array_asum($this->_defaultData['loop'], $this->resolveAliases($this->_userData['attributes']));
     if ($this->_dynamicLoopFunction) {
         $loopArgs += call_user_func($this->_dynamicLoopFunction);
     }
     foreach ($atts as $att) {
         if (in_array($att, $this->_classAttributes)) {
             $this->setUserClass($att);
         }
     }
     if (isset($atts['class']) && !empty($atts['class'])) {
         $this->setUserClass($atts['class']);
     }
     $this->_data['class'] = array_merge($this->_defaultData['class'], $this->_userData['class']);
     $this->_data['content'] = $content;
     $this->_data['items'] = array();
     if ($this->_loopable) {
         $this->_data['items'] = get_posts($loopArgs);
     }
     $template_data = $this->_userData['attributes'] + $this->_data + $loopArgs;
     if (!empty($this->_module)) {
         $shortcode_output = thb_return_module_template_part($this->_module, $this->_template, $template_data);
     } else {
         $output = new THB_TemplateLoader($this->_template, $template_data);
         $shortcode_output = $output->render(true);
     }
     $this->reset();
     return $shortcode_output;
 }
 function thb_partial_date($data)
 {
     $partial = new THB_TemplateLoader('admin/fields/partials/date', $data);
     $partial->render();
 }
Example #6
0
<?php

$sidebar = 'post-sidebar';
$sidebarTpl = new THB_TemplateLoader('frontend/sidebar', array('sidebar' => $sidebar));
$sidebarTpl->render();
 /**
  * Render the field.
  *
  * @return void
  */
 public function render()
 {
     $this->preRender();
     if (empty($this->_data)) {
         wp_die('Empty field data.');
     }
     $field_name = $this->calculateFieldName($this->_name);
     $field_label = new THB_TemplateLoader('admin/fields/label', array('label_text' => $this->_label, 'label_for' => $field_name));
     if (empty($this->_label)) {
         $this->addClass('no-label');
     }
     if ($this->isComplex()) {
         $this->addClass('complex');
     }
     $field_help = new THB_TemplateLoader('admin/fields/help', array('help_text' => $this->_help));
     // Optionally load a subtemplate
     $field_template = $this->_template;
     if (!empty($this->_meta['subtemplate'])) {
         $field_template .= '_' . $this->_meta['subtemplate'];
     }
     if (!$this->_specificTemplatePath) {
         $field_template_class = $this->_template;
         $field_content = new THB_TemplateLoader("admin/fields/field_{$field_template}", array('field_name' => $field_name, 'field' => $this) + $this->_data);
     } else {
         $field_template_class = basename($field_template);
         $field_content = new THB_Template($field_template, array('field_name' => $field_name, 'field' => $this) + $this->_data);
     }
     $field_container = new THB_TemplateLoader('admin/fields/field', array('field_template' => $this->_template, 'field_template_class' => $field_template_class, 'field_name' => $this->_name, 'field_label' => $field_label->render(true), 'field_help' => $field_help->render(true), 'field_content' => $field_content->render(true), 'is_duplicable' => $this->isDuplicable(), 'field_class' => implode(' ', $this->_classes)) + $this->_meta);
     $field_container->render();
 }
Example #8
0
 /**
  * Render the tab.
  *
  * @return void
  */
 public function render()
 {
     $tab_template = new THB_TemplateLoader($this->_template, array('tab' => $this));
     $tab_template->render();
 }
 /**
  * Render the metabox.
  *
  * @return void
  */
 public function render()
 {
     $metabox_template = new THB_TemplateLoader($this->_template, array('metabox' => $this, 'showing_conditions' => $this->parseMetaboxConditions()));
     $metabox_template->render();
 }
 function thb_ie($support = array())
 {
     $ie_template = new THB_TemplateLoader('frontend/components/ie', array('support' => $support));
     $ie_template->render();
 }
Example #11
0
 */
if (thb_system_is_development()) {
    include THB_CORE_WIDGETS_DIR . '/post_type.php';
    include THB_CORE_WIDGETS_DIR . '/utility.php';
    include THB_CORE_WIDGETS_DIR . '/social.php';
    include THB_CORE_WIDGETS_DIR . '/media.php';
}
/**
 * Customization controls loading
 */
if (thb_system_is_development()) {
    include THB_CORE_DIR . '/class.themecustomization.php';
    global $wp_customize;
    if (isset($wp_customize)) {
        include THB_CORE_CUSTOMIZATION_DIR . '/controls.php';
    }
}
/**
 * Template loader configuration
 */
$thb_templates_queue = array();
if (is_child_theme()) {
    $thb_templates_queue[] = get_stylesheet_directory() . '/' . THB_THEME_CONFIG . '/' . THB_TEMPLATES;
}
$thb_templates_queue[] = THB_THEME_TEMPLATES_DIR;
$thb_templates_queue[] = THB_TEMPLATES_DIR;
THB_TemplateLoader::$queue = $thb_templates_queue;
// Run -------------------------------------------------------------------------
if (!did_action('after_setup_theme')) {
    add_action('after_setup_theme', array($thb_theme, 'run'), 9999);
}