function testNewsform() { global $text, $subject, $sess, $bx, $t; $text = "this is the text"; $subject = "this is the subject"; $proid = "proid"; $bx = $this->_create_default_box(); capture_reset_and_start(); newsform($proid); $this->set_text(capture_stop_and_get()); $this->_checkFor_a_box('Editing News'); $this->_checkFor_a_form('PHP_SELF', array('proid' => $proid)); $this->_checkFor_columns(2); $this->_checkFor_column_titles(array('Body', 'Subject')); $this->_checkFor_column_values(array(html_input_text('subject', 40, 128, $subject), html_textarea('text', 40, 7, 'virtual', 255, $text))); $this->_checkFor_submit_preview_buttons(); $this->_testFor_string_length(2307 + strlen($sess->self_url())); }
# # This program is free software. You can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 or later of the GPL. ###################################################################### require "include/prepend.php3"; page_open(array("sess" => "SourceAgency_Session")); if (isset($auth) && !empty($auth->auth["perm"])) { page_close(); page_open(array("sess" => "SourceAgency_Session", "auth" => "SourceAgency_Auth", "perm" => "SourceAgency_Perm")); } require "include/header.inc"; require "include/newslib.inc"; $bx = new box("80%", $th_box_frame_color, $th_box_frame_width, $th_box_title_bgcolor, $th_box_title_font_color, $th_box_title_align, $th_box_body_bgcolor, $th_box_body_font_color, $th_box_body_align); start_content(); $page = "news_edit"; if (check_permission($proid, $page)) { top_bar($proid, $page); print $t->translate('News can be posted by the project owner(s)') . ".\n<br><p>\n"; if (!isset($submit) || empty($submit)) { if (isset($preview) && !empty($preview)) { news_preview($proid); } newsform($proid); } else { news_insert($proid, $auth->auth["uname"], $subject, $text); } } end_content(); require "include/footer.inc"; @page_close();