1 | <?php |
||
14 | abstract class Carbon_Breadcrumb_Admin_Settings_Field extends Carbon_Breadcrumb_Factory { |
||
15 | |||
16 | /** |
||
17 | * Field title. |
||
18 | * |
||
19 | * @access protected |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $title; |
||
23 | |||
24 | /** |
||
25 | * Field ID. |
||
26 | * |
||
27 | * @access protected |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $id; |
||
31 | |||
32 | |||
33 | /** |
||
34 | * Constructor. |
||
35 | * |
||
36 | * Register an administration breadcrumb settings field. |
||
37 | * |
||
38 | * @access public |
||
39 | * |
||
40 | * @param string $id The ID of the field. |
||
41 | * @param string $title The title of the field. |
||
42 | * @param string $section The name of the section. |
||
43 | * @param array $args Additional args. |
||
44 | */ |
||
45 | public function __construct( $id, $title, $section = '', $args = array() ) { |
||
61 | |||
62 | /** |
||
63 | * Register a new administration breadcrumb settings field of a certain type. |
||
64 | * |
||
65 | * @static |
||
66 | * @access public |
||
67 | * |
||
68 | * @param string $type Type of the field. |
||
69 | * @param string $id The ID of the field. |
||
70 | * @param string $title The title of the field. |
||
71 | * @param string $section The name of the section. |
||
72 | * @param array $args Additional args. |
||
73 | * @return Carbon_Breadcrumb_Admin_Settings_Field $field |
||
74 | */ |
||
75 | public static function factory( $type, $id, $title, $section = '', $args = array() ) { |
||
81 | |||
82 | /** |
||
83 | * Retrieve the field title. |
||
84 | * |
||
85 | * @access public |
||
86 | * |
||
87 | * @return string $title The title of this field. |
||
88 | */ |
||
89 | public function get_title() { |
||
92 | |||
93 | /** |
||
94 | * Modify the title of this field. |
||
95 | * |
||
96 | * @access public |
||
97 | * |
||
98 | * @param string $title The new title. |
||
99 | */ |
||
100 | public function set_title( $title ) { |
||
103 | |||
104 | /** |
||
105 | * Retrieve the field ID. |
||
106 | * |
||
107 | * @access public |
||
108 | * |
||
109 | * @return string $id The ID of this field. |
||
110 | */ |
||
111 | public function get_id() { |
||
114 | |||
115 | /** |
||
116 | * Modify the ID of this field. |
||
117 | * |
||
118 | * @access public |
||
119 | * |
||
120 | * @param string $id The new ID. |
||
121 | */ |
||
122 | public function set_id( $id ) { |
||
125 | |||
126 | /** |
||
127 | * Retrieve the field value. If there is no value, use the default one. |
||
128 | * |
||
129 | * @access public |
||
130 | * |
||
131 | * @return mixed $value The value of this field. |
||
132 | */ |
||
133 | public function get_value() { |
||
145 | |||
146 | /** |
||
147 | * Render the help description of this field. |
||
148 | * |
||
149 | * @access public |
||
150 | */ |
||
151 | public function render_help() { |
||
162 | |||
163 | /** |
||
164 | * Render this field. |
||
165 | * |
||
166 | * @access public |
||
167 | * @abstract |
||
168 | */ |
||
169 | abstract public function render(); |
||
170 | |||
171 | } |
||
172 |