/**
  * Render property html.
  */
 public function html()
 {
     $properties = $this->get_settings_properties();
     echo '<div class="papi-property-multiple">';
     papi_render_properties($properties);
     echo '</div>';
 }
 /**
  * Render property html.
  */
 public function html()
 {
     $properties = $this->get_settings_properties();
     $properties = $this->prepare_properties($properties);
     // Fix so group is not render over the title and description.
     if ($this->get_option('layout') === 'vertical') {
         echo '<br />';
     }
     echo '<div class="papi-property-group">';
     papi_render_properties($properties);
     echo '</div>';
 }
 /**
  * Render the meta box
  *
  * @param array $post
  * @param array $args
  */
 public function render_meta_box($post, $args)
 {
     if (!is_array($args) || !isset($args['args'])) {
         return;
     }
     // Render the properties.
     papi_render_properties($args['args']);
 }
    /**
     * Generate html for tabs and properties.
     */
    private function html()
    {
        ?>
		<div class="papi-tabs-wrapper">
			<div class="papi-tabs-table-back"></div>
			<div class="papi-tabs-back"></div>
			<ul class="papi-tabs">
				<?php 
        foreach ($this->tabs as $tab) {
            ?>
					<li class="<?php 
            echo $this->tabs[0] === $tab ? 'active' : '';
            ?>
">
						<a href="#" data-papi-tab="<?php 
            echo $tab->options->_name;
            ?>
">
							<?php 
            if (!empty($tab->options->icon)) {
                ?>
								<img src="<?php 
                echo $tab->options->icon;
                ?>
" alt="<?php 
                echo $tab->options->title;
                ?>
"/>
							<?php 
            }
            echo $tab->options->title;
            ?>
						</a>
					</li>
				<?php 
        }
        ?>
			</ul>
			<div class="papi-tabs-content">
				<?php 
        foreach ($this->tabs as $tab) {
            ?>
					<div class="<?php 
            echo $this->tabs[0] === $tab ? 'active' : '';
            ?>
"
					     data-papi-tab="<?php 
            echo $tab->options->_name;
            ?>
">
						<?php 
            $properties = papi_populate_properties($tab->properties);
            $properties = array_map(function ($property) {
                // While in a tab the sidebar is required.
                $property->sidebar = true;
                return $property;
            }, $properties);
            papi_render_properties($properties);
            ?>
					</div>
				<?php 
        }
        ?>
			</div>
		</div>
		<div class="papi-clear"></div>
	<?php 
    }
    /**
     * Generate html for tabs and properties.
     */
    protected function html()
    {
        ?>
		<div class="papi-tabs-wrapper">
			<div class="papi-tabs-table-back"></div>
			<div class="papi-tabs-back"></div>
			<ul class="papi-tabs">
				<?php 
        foreach ($this->tabs as $tab) {
            $css_classes = $this->tabs[0] === $tab ? 'active ' : '';
            if (empty($tab->background)) {
                // Find out if the first property has a sidebar or not. If the first property
                // don't have a sidebar the tab background should be white since it looks better.
                $no_sidebar = empty($tab->properties) ? false : $tab->properties[0]->sidebar;
                $css_classes .= !empty($tab->properties) && $no_sidebar ? '' : 'white-tab';
            } else {
                $css_classes .= $tab->background === 'white' ? 'white-tab' : '';
            }
            ?>
					<li class="<?php 
            echo esc_attr($css_classes);
            ?>
">
						<a href="#" data-papi-tab="<?php 
            echo esc_attr($tab->id);
            ?>
">
							<?php 
            if (!empty($tab->icon)) {
                ?>
								<img src="<?php 
                echo esc_attr($tab->icon);
                ?>
" alt="<?php 
                echo esc_attr($tab->title);
                ?>
"/>
							<?php 
            }
            echo esc_html($tab->title);
            ?>
						</a>
					</li>
				<?php 
        }
        ?>
			</ul>
			<div class="papi-tabs-content">
				<?php 
        foreach ($this->tabs as $tab) {
            ?>
					<div class="<?php 
            echo $this->tabs[0] === $tab ? 'active' : '';
            ?>
" data-papi-tab="<?php 
            echo esc_attr($tab->id);
            ?>
">
						<?php 
            papi_render_properties($tab->properties);
            ?>
					</div>
				<?php 
        }
        ?>
			</div>
		</div>
		<div class="papi-clear"></div>
	<?php 
    }
 /**
  * Render the meta box
  *
  * @param array $post
  * @param array $args
  */
 public function render_meta_box($post, array $args)
 {
     if (!isset($args['args'])) {
         return;
     }
     // Do a last check before all properties is rendered.
     $args['args'] = array_filter($args['args'], 'papi_is_property');
     // Inherit options from the box.
     foreach ($args['args'] as $index => $property) {
         if ($property->layout === 'horizontal') {
             $args['args'][$index]->layout = $this->box->layout;
         }
     }
     // Render the properties.
     papi_render_properties($args['args']);
 }