]>
src.bluestatic.org Git - bugdar.git/blob - includes/class_admin_navigation.php
2 /*=====================================================================*\
3 || ###################################################################
5 || # Copyright (c)2002-2007 Blue Static
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version 2 of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
23 * Navigation Link System
25 * A static class whose methods are called to generate the common navigation
26 * links for the Admin CP.
29 * @copyright Copyright (c)2002 - 2007, Blue Static
36 // ###################################################################
38 * All the different locations under the "Options" tab
42 function optionsPages()
46 $navigator->add_component('section', 'options-pages', 'options', T('Options'), null);
47 $navigator->add_component('link', 'options-pages-home', 'options-pages', T('Home'), 'index.php');
48 $navigator->add_component('link', 'options-pages-settings', 'options-pages', T('Bugdar Settings'), 'setting.php');
49 $navigator->add_component('link', 'options-pages-languages', 'options-pages', T('Languages'), 'language.php');
50 $navigator->add_component('link', 'options-pages-userhelp', 'options-pages', T('User Help Items'), 'userhelp.php');
53 // ###################################################################
55 * Adding a new language
59 function languagesAdd()
63 $navigator->add_component('section', 'options-languages', 'options', T('Languages'), null);
64 $navigator->add_component('link', 'options-languages-add', 'options-languages', T('Add New Language'), 'language.php?do=add');
67 // ###################################################################
73 * @param integer Language ID
75 function languagesEdit($id)
79 NavLinks
::languagesAdd();
80 $navigator->add_component('link', 'options-languages-edit', 'options-languages', T('Edit Language'), 'language.php?do=edit&languageid=' . $id);
81 $navigator->add_component('link', 'options-languages-delete', 'options-languages', T('Delete'), 'language.php?do=delete&languageid=' . $id);
84 // ###################################################################
86 * Adding a new user help item
90 function userhelpAdd()
94 $navigator->add_component('section', 'options-userhelp', 'options', T('User Help Items'), null);
95 $navigator->add_component('link', 'options-userhelp-add', 'options-userhelp', T('Add New Item'), 'userhelp.php?do=add');
98 // ###################################################################
100 * Adding a new product
104 function productsAdd()
108 $navigator->add_component('section', 'products', 'products', T('Products'), null);
109 $navigator->add_component('link', 'products-manage', 'products', T('Manage Products'), 'product.php');
110 $navigator->add_component('link', 'products-add', 'products', T('Add New Product'), 'product.php?do=addproduct');
113 // ###################################################################
119 * @param integer Product ID
121 function productsEdit($id)
125 NavLinks
::productsAdd();
126 $navigator->add_component('section', 'products-edit', 'products', T('Edit Product'), null);
127 $navigator->add_component('link', 'products-edit', 'products-edit', T('Edit Product'), 'product.php?do=editproduct&productid=' . $id);
128 $navigator->add_component('link', 'products-edit-version', 'products-edit', T('Add New Version'), 'product.php?do=addversion&productid=' . $id);
129 $navigator->add_component('link', 'products-edit-delete', 'products-edit', T('Delete Product'), 'product.php?do=deleteproduct&productid=' . $id);
132 // ###################################################################
138 function fieldsPages()
142 $navigator->add_component('section', 'fields-pages', 'fields', T('Fields'), null);
143 $navigator->add_component('link', 'fields-pages-fields', 'fields-pages', T('Custom Fields'), 'field.php');
144 $navigator->add_component('link', 'fields-pages-priorities', 'fields-pages', T('Priorities'), 'priority.php');
145 $navigator->add_component('link', 'fields-pages-resolutions', 'fields-pages', T('Resolutions'), 'resolution.php');
146 $navigator->add_component('link', 'fields-pages-severities', 'fields-pages', T('Severities'), 'severity.php');
147 $navigator->add_component('link', 'fields-pages-statuses', 'fields-pages', T('Statuses'), 'status.php');
148 $navigator->add_component('link', 'fields-pages-automations', 'fields-pages', T('Automations'), 'automation.php');
150 // TODO(port): remove this.
151 $navigator->add_component('link', 'fields-pages-v2', 'fields-pages', 'FIELDS - V2', 'field2.php');
154 // ###################################################################
156 * Adding an new custom field
164 $navigator->add_component('section', 'fields', 'fields', T('Custom Fields'), null);
165 $navigator->add_component('link', 'fields-add', 'fields', T('Add New Custom Field'), 'field.php?do=add');
168 // ###################################################################
170 * Edit a custom field
174 * @param integer Field ID
176 function fieldsEdit($id)
180 NavLinks
::fieldsAdd();
181 $navigator->add_component('link', 'fields-delete', 'fields', T('Delete'), 'field.php?do=delete&fieldid=' . $id);
184 // ###################################################################
186 * Adding an new priority
190 function prioritiesAdd()
194 $navigator->add_component('section', 'priorities', 'fields', T('Priorities'), null);
195 $navigator->add_component('link', 'priorities-add', 'priorities', T('Add New Priority'), 'priority.php?do=add');
198 // ###################################################################
204 * @param integer Priority ID
206 function prioritiesEdit($id)
210 NavLinks
::prioritiesAdd();
211 $navigator->add_component('link', 'priorities-delete', 'priorities', T('Delete'), 'priority.php?do=delete&priorityid=' . $id);
214 // ###################################################################
216 * Adding an new resolution
220 function resolutionsAdd()
224 $navigator->add_component('section', 'resolutions', 'fields', T('Resolutions'), null);
225 $navigator->add_component('link', 'resolutions-add', 'resolutions', T('Add New Resolution'), 'resolution.php?do=add');
228 // ###################################################################
234 * @param integer Resolution ID
236 function resolutionsEdit($id)
240 NavLinks
::resolutionsAdd();
241 $navigator->add_component('link', 'resolutions-delete', 'resolutions', T('Delete'), 'resolution.php?do=delete&resolutionid=' . $id);
244 // ###################################################################
246 * Adding an new severity
250 function severitiesAdd()
254 $navigator->add_component('section', 'severities', 'fields', T('Severities'), null);
255 $navigator->add_component('link', 'severities-add', 'severities', T('Add New Severity'), 'severity.php?do=add');
258 // ###################################################################
264 * @param integer Severity ID
266 function severitiesEdit($id)
270 NavLinks
::severitiesAdd();
271 $navigator->add_component('link', 'severities-delete', 'severities', T('Delete'), 'severity.php?do=delete&severityid=' . $id);
274 // ###################################################################
276 * Adding an new status
280 function statusesAdd()
284 $navigator->add_component('section', 'statuses', 'fields', T('Severities'), null);
285 $navigator->add_component('link', 'statuses-add', 'statuses', T('Add New Status'), 'status.php?do=add');
288 // ###################################################################
294 * @param integer Status ID
296 function statusesEdit($id)
300 NavLinks
::statusesAdd();
301 $navigator->add_component('link', 'statuses-delete', 'statuses', T('Delete'), 'status.php?do=delete&statusid=' . $id);
304 // ###################################################################
306 * Adding an new automation
310 function automationsAdd()
314 $navigator->add_component('section', 'automations', 'fields', T('Automations'), null);
315 $navigator->add_component('link', 'automations-add', 'automations', T('Add New Automation'), 'automation.php?do=add');
318 // ###################################################################
324 * @param integer Action ID
326 function automationsEdit($id)
330 NavLinks
::automationsAdd();
331 $navigator->add_component('link', 'automations-delete', 'automations', T('Delete'), 'automation.php?do=delete&actionid=' . $id);
334 // ###################################################################
340 function usersPages()
344 $navigator->add_component('section', 'users-pages', 'users', T('Users & Permissions'), null);
345 $navigator->add_component('link', 'users-pages-users', 'users-pages', T('Users'), 'user.php');
346 $navigator->add_component('link', 'users-pages-usergroups', 'users-pages', T('Usergroups'), 'usergroup.php');
347 $navigator->add_component('link', 'users-pages-permissions', 'users-pages', T('Product-Level Permissions'), 'permission.php');
350 // ###################################################################
360 $navigator->add_component('section', 'users', 'users', T('Users'), null);
361 $navigator->add_component('link', 'users-showall', 'users', T('Show All Users'), 'user.php?do=showall');
362 $navigator->add_component('link', 'users-add', 'users', T('Add New User'), 'user.php?do=add');
365 // ###################################################################
371 * @param integer User ID
373 function usersEdit($id)
377 NavLinks
::usersAdd();
378 $navigator->add_component('link', 'users-delete', 'users', T('Delete'), 'user.php?do=delete&userid=' . $id);
381 // ###################################################################
383 * Add a new usergroup
387 function usergroupsAdd()
391 $navigator->add_component('section', 'usergroups', 'users', T('Usergroups'), null);
392 $navigator->add_component('link', 'usergroups-add', 'usergroups', T('Add New Usergroup'), 'usergroup.php?do=add');
393 $navigator->add_component('link', 'usergroups-approve', 'usergroups', T('Moderate Awaiting Users'), 'usergroup.php?do=approve');
396 // ###################################################################
402 * @param integer User ID
404 function usergroupsEdit($id)
408 NavLinks
::usergroupsAdd();
409 $navigator->add_component('link', 'usergroups-delete', 'usergroups', T('Delete'), 'usergroup.php?do=delete&userid=' . $id);