1 | <?php |
||
13 | abstract class View{ |
||
14 | |||
15 | /** |
||
16 | * title |
||
17 | * Title of the tab. |
||
18 | * |
||
19 | * @var string |
||
20 | * @access protected |
||
21 | */ |
||
22 | protected $title; |
||
23 | |||
24 | /** |
||
25 | * type |
||
26 | * Type of objects we'll be dealing with i.e.: post or term. |
||
27 | * |
||
28 | * @var string |
||
29 | * @access protected |
||
30 | */ |
||
31 | protected $type; |
||
32 | |||
33 | /** |
||
34 | * priority |
||
35 | * SPriority to pass into the actions. |
||
36 | * |
||
37 | * @var int |
||
38 | * @access protected |
||
39 | */ |
||
40 | protected $priority; |
||
41 | |||
42 | /** |
||
43 | * Registers our view with appropriate actions. |
||
44 | * |
||
45 | * @see tab, view |
||
46 | */ |
||
47 | public function register_view(){ |
||
53 | |||
54 | |||
55 | /** |
||
56 | * Builf the HTML for our tab navigation item. |
||
57 | * |
||
58 | * Each view has a tab and tab navigation - this function compiles our |
||
59 | * navigation tab. Rarely extended. |
||
60 | */ |
||
61 | public function tab(){ |
||
71 | |||
72 | |||
73 | /** |
||
74 | * Build the HTML for the actual tab content. |
||
75 | * |
||
76 | * Each view has a tab and tab navigation - this function compiles our |
||
77 | * tab content. Rarely extended |
||
78 | * |
||
79 | * @see actions_section, options_section |
||
80 | */ |
||
81 | public function view(){ |
||
92 | |||
93 | |||
94 | /** |
||
95 | * Holder function to build the tab main content. Extend this with your content. |
||
96 | * |
||
97 | * @access protected |
||
98 | * |
||
99 | * @return string HTML content. |
||
100 | */ |
||
101 | protected function actions_section(){ |
||
105 | |||
106 | |||
107 | /** |
||
108 | * Starter for an options section for the view. |
||
109 | * |
||
110 | * Options are where you could add various options and triggers such as author, |
||
111 | * quantity, or any other customization of the created/deleted data. |
||
112 | * |
||
113 | * @access protected |
||
114 | * |
||
115 | * @param string $html Existing HTML content. |
||
116 | * @return string HTML section content. |
||
117 | */ |
||
118 | protected function options_section( $html = '' ){ |
||
130 | |||
131 | |||
132 | /** |
||
133 | * Builds action buttons for creating or deleting content. |
||
134 | * |
||
135 | * @access protected |
||
136 | * |
||
137 | * @param string $action Type of action to take - i.e.: create or delete. |
||
138 | * @param string $slug Slug ID of the object to create i.e.: page or category. |
||
139 | * @param string $text Text to display in the button. |
||
140 | * @return string HTML. |
||
141 | */ |
||
142 | protected function build_button( $action, $slug, $text ){ |
||
164 | |||
165 | } |
||
166 |