<?php
/**
 * Meta box options view
 *
 * @package wp-video-attention
 * @author InstaProduct
 * @link http://insta-product.com/
 */
?>
<div id="ipvisc-metabox" class="ipvisc-wrap">
  <div class="container-fluid container ipvisc-form">
    <div class="ipvisc-fields">

      <?php
      /*
       * Widget
       */
      ?>
      <!-- start: .ipvisc-field-row -->
      <div class="ipvisc-field-row ipvisc-field-x">
        <div class="ipvisc-form-label col-lg-3 col-md-4 col-sm-12">
          <label for="ipvisc-input-widget"><?php _e( 'Widget', IPVISC_SLUG ); ?></label>
        </div>

        <!-- start: .ipvisc-field -->
        <div class="ipvisc-field col-lg-9 col-md-8 col-sm-12">

          <select name="ipvisc_widget" id="ipvisc-input-widget">
              <option value="0"><?php _e( 'None', IPVISC_SLUG ); ?></option>
              <?php
              $current = get_post_meta( $this->post->ID, '__ipvisc_page_widget', true );

              if ( ! empty( $this->widgets ))
              {
                  foreach( $this->widgets as $widget )
                  {
                      $sltd = '';
                      if ( $widget->ID == $current ) {
                          $sltd = ' selected="selected"';
                      }
                      echo '<option value="' . $widget->ID . '"' . $sltd . '>' . $widget->post_title . '</option>';
                  }
              }
              ?>
          </select>
        </div>
        <!-- end: .ipvisc-field -->
      </div>
      <!-- end: .ipvisc-field-row -->

    </div>
  </div>
  <?php wp_nonce_field( plugin_basename( __FILE__ ), 'ipvisc_mbox_nonce' ); ?>
</div>
