Fix #11417: Allow EVENT_MENU_MAIN plugin events to return null
[mantis/radio.git] / tag_update_page.php
blobee30547474583bf3419c557c02f159ff9900615f
1 <?php
2 # MantisBT - A PHP based bugtracking system
4 # MantisBT is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 2 of the License, or
7 # (at your option) any later version.
9 # MantisBT is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
17 /**
18 * @package MantisBT
19 * @copyright Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
20 * @link http://www.mantisbt.org
22 * @uses core.php
23 * @uses access_api.php
24 * @uses ajax_api.php
25 * @uses authentication_api.php
26 * @uses compress_api.php
27 * @uses config_api.php
28 * @uses constant_inc.php
29 * @uses form_api.php
30 * @uses gpc_api.php
31 * @uses helper_api.php
32 * @uses html_api.php
33 * @uses lang_api.php
34 * @uses prepare_api.php
35 * @uses print_api.php
36 * @uses string_api.php
37 * @uses tag_api.php
38 * @uses user_api.php
41 require_once( 'core.php' );
42 require_api( 'access_api.php' );
43 require_api( 'ajax_api.php' );
44 require_api( 'authentication_api.php' );
45 require_api( 'compress_api.php' );
46 require_api( 'config_api.php' );
47 require_api( 'constant_inc.php' );
48 require_api( 'form_api.php' );
49 require_api( 'gpc_api.php' );
50 require_api( 'helper_api.php' );
51 require_api( 'html_api.php' );
52 require_api( 'lang_api.php' );
53 require_api( 'prepare_api.php' );
54 require_api( 'print_api.php' );
55 require_api( 'string_api.php' );
56 require_api( 'tag_api.php' );
57 require_api( 'user_api.php' );
59 compress_enable();
61 $f_tag_id = gpc_get_int( 'tag_id' );
62 $t_tag_row = tag_get( $f_tag_id );
64 $t_name = string_display_line( $t_tag_row['name'] );
65 $t_description = string_display( $t_tag_row['description'] );
67 if ( !( access_has_global_level( config_get( 'tag_edit_threshold' ) )
68 || ( auth_get_current_user_id() == $t_tag_row['user_id'] )
69 && access_has_global_level( config_get( 'tag_edit_own_threshold' ) ) ) )
71 access_denied();
74 html_page_top( sprintf( lang_get( 'tag_update' ), $t_name ) );
77 <br/>
78 <form method="post" action="tag_update.php">
79 <?php echo form_security_field( 'tag_update' ) ?>
80 <table class="width100" cellspacing="1">
82 <!-- Title -->
83 <tr>
84 <td class="form-title" colspan="2">
85 <?php echo sprintf( lang_get( 'tag_update' ), $t_name ) ?>
86 <input type="hidden" name="tag_id" value="<?php echo $f_tag_id ?>"/>
87 </td>
88 <td class="right" colspan="3">
89 <?php print_bracket_link( 'tag_view_page.php?tag_id='.$f_tag_id, lang_get( 'tag_update_return' ) ); ?>
90 </td>
91 </tr>
93 <!-- Info -->
94 <tr class="row-category">
95 <td width="15%"><?php echo lang_get( 'tag_id' ) ?></td>
96 <td width="25%"><?php echo lang_get( 'tag_name' ) ?></td>
97 <td width="20%"><?php echo lang_get( 'tag_creator' ) ?></td>
98 <td width="20%"><?php echo lang_get( 'tag_created' ) ?></td>
99 <td width="20%"><?php echo lang_get( 'tag_updated' ) ?></td>
100 </tr>
102 <tr <?php echo helper_alternate_class() ?>>
103 <td><?php echo $t_tag_row['id'] ?></td>
104 <td><input type="text" <?php echo helper_get_tab_index() ?> name="name" value="<?php echo $t_name ?>"/></td>
105 <td><?php
106 if ( access_has_global_level( config_get( 'tag_edit_threshold' ) ) ) {
107 if ( ON == config_get( 'use_javascript' ) ) {
108 $t_username = prepare_user_name( $t_tag_row['user_id'] );
109 echo ajax_click_to_edit( $t_username, 'user_id', 'entrypoint=user_combobox&user_id=' . $t_tag_row['user_id'] . '&access_level=' . config_get( 'tag_create_threshold' ) );
110 } else {
111 echo '<select ', helper_get_tab_index(), ' name="user_id">';
112 print_user_option_list( $t_tag_row['user_id'], ALL_PROJECTS, config_get( 'tag_create_threshold' ) );
113 echo '</select>';
115 } else {
116 echo string_display_line( user_get_name($t_tag_row['user_id']) );
118 ?></td>
119 <td><?php echo date( config_get( 'normal_date_format' ), $t_tag_row['date_created'] ) ?> </td>
120 <td><?php echo date( config_get( 'normal_date_format' ), $t_tag_row['date_updated'] ) ?> </td>
121 </tr>
123 <!-- spacer -->
124 <tr class="spacer">
125 <td colspan="5"></td>
126 </tr>
128 <!-- Description -->
129 <tr <?php echo helper_alternate_class() ?>>
130 <td class="category"><?php echo lang_get( 'tag_description' ) ?></td>
131 <td colspan="4">
132 <textarea name="description" <?php echo helper_get_tab_index() ?> cols="80" rows="6"><?php echo string_textarea( $t_description ) ?></textarea>
133 </td>
134 </tr>
136 <!-- Submit Button -->
137 <tr>
138 <td class="center" colspan="6">
139 <input <?php echo helper_get_tab_index() ?> type="submit" class="button" value="<?php echo lang_get( 'tag_update_button' ) ?>" />
140 </td>
141 </tr>
143 </table>
144 </form>
146 <?php
147 html_page_bottom();