Fix #11417: Allow EVENT_MENU_MAIN plugin events to return null
[mantis/radio.git] / news_menu_page.php
blob9e66bea472bd3e5c7dec847768508d1f087de9d5
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) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
20 * @copyright Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
21 * @link http://www.mantisbt.org
23 * @uses core.php
24 * @uses access_api.php
25 * @uses config_api.php
26 * @uses current_user_api.php
27 * @uses form_api.php
28 * @uses helper_api.php
29 * @uses html_api.php
30 * @uses lang_api.php
31 * @uses news_api.php
32 * @uses print_api.php
35 require_once( 'core.php' );
36 require_api( 'access_api.php' );
37 require_api( 'config_api.php' );
38 require_api( 'current_user_api.php' );
39 require_api( 'form_api.php' );
40 require_api( 'helper_api.php' );
41 require_api( 'html_api.php' );
42 require_api( 'lang_api.php' );
43 require_api( 'news_api.php' );
44 require_api( 'print_api.php' );
46 news_ensure_enabled();
48 access_ensure_project_level( config_get( 'manage_news_threshold' ) );
50 html_page_top( lang_get( 'edit_news_link' ) );
53 <br />
54 <div align="center">
55 <form method="post" action="news_add.php">
56 <?php echo form_security_field( 'news_add' ); ?>
57 <table class="width75" cellspacing="1">
58 <tr>
59 <td class="form-title" colspan="2">
60 <?php echo lang_get( 'add_news_title' ) ?>
61 </td>
62 </tr>
63 <tr class="row-1">
64 <td class="category" width="25%">
65 <span class="required">*</span><?php echo lang_get( 'headline' ) ?>
66 </td>
67 <td width="75%">
68 <input type="text" name="headline" size="64" maxlength="64" />
69 </td>
70 </tr>
71 <tr class="row-2">
72 <td class="category">
73 <span class="required">*</span><?php echo lang_get( 'body' ) ?>
74 </td>
75 <td>
76 <textarea name="body" cols="60" rows="8"></textarea>
77 </td>
78 </tr>
79 <tr class="row-1">
80 <td class="category">
81 <?php echo lang_get( 'announcement' ) ?><br />
82 <span class="small"><?php echo lang_get( 'stays_on_top' ) ?></span>
83 </td>
84 <td>
85 <input type="checkbox" name="announcement" />
86 </td>
87 </tr>
88 <tr class="row-2">
89 <td class="category" width="25%">
90 <?php echo lang_get( 'view_status' ) ?>
91 </td>
92 <td width="75%">
93 <select name="view_state">
94 <?php print_enum_string_option_list( 'view_state' ) ?>
95 </select>
96 </td>
97 </tr>
98 <tr>
99 <td>
100 <span class="required">* <?php echo lang_get( 'required' ) ?></span>
101 </td>
102 <td class="center">
103 <input type="submit" class="button" value="<?php echo lang_get( 'post_news_button' ) ?>" />
104 </td>
105 </tr>
106 </table>
107 </form>
108 </div>
109 <?php
110 # Add News Form END
111 # Edit/Delete News Form BEGIN
112 if ( news_get_count( helper_get_current_project(), current_user_is_administrator() ) > 0 ) {
114 <br />
115 <div align="center">
116 <form method="post" action="news_edit_page.php">
117 <?php echo form_security_field( 'news_delete' ); ?>
118 <table class="width75" cellspacing="1">
119 <tr>
120 <td class="form-title" colspan="2">
121 <?php echo lang_get( 'edit_or_delete_news_title' ) ?>
122 </td>
123 </tr>
124 <tr class="row-1">
125 <td class="center" colspan="2">
126 <input type="radio" name="action" value="edit" checked="checked" /> <?php echo lang_get( 'edit_post' ) ?>
127 <input type="radio" name="action" value="delete" /> <?php echo lang_get( 'delete_post' ) ?>
128 </td>
129 </tr>
130 <tr class="row-2">
131 <td class="category" width="25%">
132 <?php echo lang_get( 'select_post' ) ?>
133 </td>
134 <td width="75%">
135 <select name="news_id">
136 <?php print_news_item_option_list() ?>
137 </select>
138 </td>
139 </tr>
140 <tr>
141 <td class="center" colspan="2">
142 <input type="submit" class="button" value="<?php echo lang_get( 'submit_button' ) ?>" />
143 </td>
144 </tr>
145 </table>
146 </form>
147 </div>
148 <?php
149 } # Edit/Delete News Form END
151 html_page_bottom();