<?php
/**
 * Building form for selecting Border related
 * css styles, the final output is
 * an array that is suitable for CSSBuilder_Rules_Border
 *
 * You can use the CSSBuilder_Factory for building the
 * final CSS for the border.
 *
 * @author jason.xie@victheme.com
 *
 */
class VTCore_Wordpress_Form_WpBorder
extends VTCore_Bootstrap_Form_Base
implements VTCore_Form_Interface {

  protected $context = array(
    'text' => false,
    'description' => false,
    'required' => false,

    'name' => false,
    'id' =>  false,
    'class' => array('form-control'),
    'label' => true,

    'type' => 'div',

    // Wrapper Element
    'type' => 'div',
    'attributes' => array(
      'class' => array(
        'form-group',
        'wp-border',
      ),
    ),

    'value' => array(
      'border' => array(
        'width' => '',
        'style' => '',
        'color' => '',
        'radius' => '',
      ),
    ),
  );


  public function buildElement() {

    parent::buildElement();

    $this
      ->BsText(array(
        'text' => __('Width', VTCORE_LANGUAGE),
        'name' => $this->getContext('name') . '[border][width]',
        'value' => $this->getContext('value.border.width'),
        'grids' => array(
          'columns' => array(
            'mobile' => 3,
            'tablet' => 3,
            'small' => 3,
            'large' => 3,
          )
        ),
      ))
      ->BsText(array(
        'text' => __('Style', VTCORE_LANGUAGE),
        'name' => $this->getContext('name') . '[border][style]',
        'value' => $this->getContext('value.border.style'),
        'grids' => array(
          'columns' => array(
            'mobile' => 3,
            'tablet' => 3,
            'small' => 3,
            'large' => 3,
          )
        ),
      ))
      ->BsText(array(
        'text' => __('Color', VTCORE_LANGUAGE),
        'name' => $this->getContext('name') . '[border][color]',
        'value' => $this->getContext('value.border.color'),
        'grids' => array(
          'columns' => array(
            'mobile' => 3,
            'tablet' => 3,
            'small' => 3,
            'large' => 3,
          )
        ),
      ))
      ->BsText(array(
        'text' => __('Radius', VTCORE_LANGUAGE),
        'name' => $this->getContext('name') . '[border][radius]',
        'value' => $this->getContext('value.border.radius'),
        'grids' => array(
          'columns' => array(
            'mobile' => 3,
            'tablet' => 3,
            'small' => 3,
            'large' => 3,
          )
        ),
      ));
  }
}