Skip to:
Content

BuddyPress.org

Ticket #4956: wrc-classes.php

File wrc-classes.php, 5.1 KB (added by dconrad, 13 years ago)

Group Extensions

Line 
1<?php
2/**
3 * Implementation of Bulletin_Board
4 *
5 * Registers the group extension and provides a display method
6 *
7 * @since 1.0
8 */
9class Bulletin_Board extends BP_Group_Extension {
10
11        var $enable_create_step = false;
12        var $enable_nav_item = true;
13        var $enable_edit_item = false;
14
15        /**
16         * Constructor
17         *
18         * @since 1.0
19         * */
20        function __construct() {
21
22                // extension variables
23                $this->name = __( 'Bulletin Board' );
24                $this->slug = __( 'bulletin-board' );
25
26                $this->nav_item_position = 3;
27                //$this->template_file = 'wrc/templates/bulletin-board/home.php';
28
29        }
30
31        /**
32         * Display the content of the Bulletin Board tab
33         *
34         * @since 1.0
35         */
36        function display() {
37                        //locate_template( array( 'wrc/templates/bulletin-board/home.php'), true);
38                        //bp_get_template_part( 'wrc/templates/bulletin-board/home' );
39
40                echo "BULLETIN BOARD";
41
42        }
43}
44
45/**
46 * Implementation of eBin
47 *
48 * Registers the group extension and provides a display method
49 *
50 * @since 1.0
51 */
52class eBin extends BP_Group_Extension {
53
54        var $enable_create_step = false;
55        var $enable_nav_item = true;
56        var $enable_edit_item = false;
57
58        /**
59         * Constructor
60         *
61         * @since 1.0
62         * */
63        public function __construct() {
64
65                // extension variables
66                $this->name = __( 'eBin', 'wrc' );
67                $this->slug = __( 'ebin', 'wrc' );
68
69                $this->nav_item_position = 2;
70
71        }
72
73        /**
74         * Display the content of the eBin tab
75         *
76         * @since 1.0
77         */
78        public function display() {
79
80                locate_template( array( 'groups/single/ebin.php'), true );
81        }
82
83}
84
85/**
86 * Implementation of Help_Desk
87 *
88 * Registers the group extension and provides a display method
89 *
90 * @since 1.0
91 */
92class Help_Desk extends BP_Group_Extension {
93
94        var $enable_create_step = false;
95        var $enable_nav_item = true;
96        var $enable_edit_item = false;
97
98        /**
99         * Constructor
100         *
101         * @since 1.0
102         * */
103        public function __construct() {
104
105                // extension variables
106                $this->name = __( 'Help Desk', 'wrc' );
107                $this->slug = __( 'help-desk', 'wrc' );
108
109                $this->nav_item_position = 7;
110
111        }
112
113        /**
114         * Display the content of the Help Desk tab
115         *
116         * @since 1.0
117         */
118        public function display() {
119
120                locate_template( array( 'groups/single/help-desk.php'), true );
121        }
122
123}
124
125/**
126 * Implementation of Library
127 *
128 * Registers the group extension and provides a display method
129 *
130 * @since 1.0
131 */
132class Library extends BP_Group_Extension {
133
134        var $enable_create_step = false;
135        var $enable_nav_item = true;
136        var $enable_edit_item = false;
137
138        /**
139         * Constructor
140         *
141         * @since 1.0
142         * */
143        public function __construct() {
144
145                // extension variables
146                $this->name = __( 'Library', 'wrc' );
147                $this->slug = __( 'library', 'wrc' );
148
149                $this->nav_item_position = 5;
150
151        }
152
153        /**
154         * Display the content of the Library tab
155         *
156         * @since 1.0
157         */
158        public function display() {
159
160                locate_template( array( 'groups/single/library.php'), true );
161        }
162
163}
164
165/**
166 * Implementation of Mission_Control
167 *
168 * Registers the group extension and provides a display method
169 *
170 * @since 1.0
171 */
172class Mission_Control extends BP_Group_Extension {
173
174        var $enable_create_step = false;
175        var $enable_nav_item = true;
176        var $enable_edit_item = false;
177
178        /**
179         * Constructor
180         *
181         * @since 1.0
182         * */
183        public function __construct() {
184
185                // extension variables
186                $this->name = __( 'Mission Control', 'wrc' );
187                $this->slug = __( 'mission-control', 'wrc' );
188
189                $this->nav_item_position = 1;
190
191        }
192
193        /**
194         * Display the content of the Mission Control tab
195         *
196         * @since 1.0
197         */
198        public function display() {
199
200                ?>
201                Mission Control
202                <?php
203               
204        }
205
206}
207
208
209/**
210 * Implementation of Reports
211 *
212 * Registers the group extension and provides a display method
213 *
214 * @since 1.0
215 */
216class Reports extends BP_Group_Extension {
217
218        var $enable_create_step = false;
219        var $enable_nav_item = true;
220        var $enable_edit_item = false;
221
222        /**
223         * Constructor
224         *
225         * @since 1.0
226         * */
227        public function __construct() {
228
229                // extension variables
230                $this->name = __( 'Reports', 'wrc' );
231                $this->slug = __( 'reports', 'wrc' );
232
233                $this->nav_item_position = 4;
234
235        }
236
237        /**
238         * Display the content of the Reports tab
239         *
240         * @since 1.0
241         */
242        public function display() {
243
244                locate_template( array( 'groups/single/reports.php'), true );
245        }
246
247}
248
249/**
250 * Implementation of Training
251 *
252 * Registers the group extension and provides a display method
253 *
254 * @since 1.0
255 */
256class Training extends BP_Group_Extension {
257
258        var $enable_create_step = false;
259        var $enable_nav_item = true;
260        var $enable_edit_item = false;
261
262        /**
263         * Constructor
264         *
265         * @since 1.0
266         * */
267        public function __construct() {
268
269                // extension variables
270                $this->name = __( 'Training', 'wrc' );
271                $this->slug = __( 'training', 'wrc' );
272
273                $this->nav_item_position = 6;
274
275        }
276
277        /**
278         * Display the content of the Training tab
279         *
280         * @since 1.0
281         */
282        public function display() {
283
284                locate_template( array( 'groups/single/training.php'), true );
285        }
286
287}
288
289/**
290 * Bootstrap the WRC Components extension
291 */
292function wrc_bootstrap() {
293        bp_register_group_extension( 'Mission_Control' );
294        bp_register_group_extension( 'eBin' );
295        bp_register_group_extension( 'Bulletin_Board' );
296        bp_register_group_extension( 'Reports' );
297        bp_register_group_extension( 'Library' );
298        bp_register_group_extension( 'Training' );
299        bp_register_group_extension( 'Help_Desk' );
300}
301add_action( 'bp_init', 'wrc_bootstrap' );
302
303?>