1 <?php
2 /**
3 * UIX Controls
4 *
5 * @package controls
6 * @author David Cramer
7 * @license GPL-2.0+
8 * @link
9 * @copyright 2016 David Cramer
10 */
11 namespace uix\ui\control;
12
13 /**
14 * <hr> separator. Mainly used for formatting
15 *
16 * @since 1.0.0
17 */
18 class separator extends \uix\ui\control{
19
20 /**
21 * The type of object
22 *
23 * @since 1.0.0
24 * @access public
25 * @var string
26 */
27 public $type = 'separator';
28
29 /**
30 * Enqueues specific tabs assets for the active pages
31 *
32 * @since 1.0.0
33 * @access protected
34 */
35 protected function enqueue_active_assets(){
36 parent::enqueue_active_assets();
37 ?><style type="text/css">
38 #control-<?php echo $this->id(); ?> {
39 border-color: <?php echo $this->base_color(); ?>;
40 }
41 #<?php echo $this->id(); ?> span.uix-control-label {
42 color: <?php echo $this->base_color(); ?>;
43 }
44 </style>
45 <?php
46 }
47
48 /**
49 * Return null alwasy since a separator should not show up as an input.
50 * @since 1.0.0
51 * @access public
52 * @return mixed $data
53 */
54 public function get_data(){
55 return null;
56 }
57
58 /**
59 * Returns the main input field for rendering
60 *
61 * @since 1.0.0
62 * @see \uix\ui\uix
63 * @access public
64 * @return string
65 */
66 public function input(){
67
68 return '<hr class="uix-separator" id="control-' . esc_attr( $this->id() ) . '" />';
69
70 }
71
72 }