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/>.
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
24 * @uses access_api.php
25 * @uses config_api.php
26 * @uses current_user_api.php
28 * @uses helper_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' ) );
55 <form method
="post" action
="news_add.php">
56 <?php
echo form_security_field( 'news_add' ); ?
>
57 <table
class="width75" cellspacing
="1">
59 <td
class="form-title" colspan
="2">
60 <?php
echo lang_get( 'add_news_title' ) ?
>
64 <td
class="category" width
="25%">
65 <span
class="required">*</span
><?php
echo lang_get( 'headline' ) ?
>
68 <input type
="text" name
="headline" size
="64" maxlength
="64" />
73 <span
class="required">*</span
><?php
echo lang_get( 'body' ) ?
>
76 <textarea name
="body" cols
="60" rows
="8"></textarea
>
81 <?php
echo lang_get( 'announcement' ) ?
><br
/>
82 <span
class="small"><?php
echo lang_get( 'stays_on_top' ) ?
></span
>
85 <input type
="checkbox" name
="announcement" />
89 <td
class="category" width
="25%">
90 <?php
echo lang_get( 'view_status' ) ?
>
93 <select name
="view_state">
94 <?php
print_enum_string_option_list( 'view_state' ) ?
>
100 <span
class="required">* <?php
echo lang_get( 'required' ) ?
></span
>
103 <input type
="submit" class="button" value
="<?php echo lang_get( 'post_news_button' ) ?>" />
111 # Edit/Delete News Form BEGIN
112 if ( news_get_count( helper_get_current_project(), current_user_is_administrator() ) > 0 ) {
116 <form method
="post" action
="news_edit_page.php">
117 <?php
echo form_security_field( 'news_delete' ); ?
>
118 <table
class="width75" cellspacing
="1">
120 <td
class="form-title" colspan
="2">
121 <?php
echo lang_get( 'edit_or_delete_news_title' ) ?
>
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' ) ?
>
131 <td
class="category" width
="25%">
132 <?php
echo lang_get( 'select_post' ) ?
>
135 <select name
="news_id">
136 <?php
print_news_item_option_list() ?
>
141 <td
class="center" colspan
="2">
142 <input type
="submit" class="button" value
="<?php echo lang_get( 'submit_button' ) ?>" />
149 } # Edit/Delete News Form END