From: Shaun M. <sin...@us...> - 2006-01-27 04:18:29
|
Update of /cvsroot/phpwsbb/phpwsbb/class In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26019 Modified Files: Message.php Log Message: Message preview and stop double error messages appearing by nulling the notice. Index: Message.php =================================================================== RCS file: /cvsroot/phpwsbb/phpwsbb/class/Message.php,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** Message.php 28 Jul 2005 19:09:50 -0000 1.84 --- Message.php 27 Jan 2006 04:18:16 -0000 1.85 *************** *** 326,329 **** --- 326,334 ---- $tabs++; + /* Preview Button */ + $form->add('Message_preview', 'submit', $_SESSION['translate']->it('Preview')); + $form->setTab('Message_preview', $tabs); + $tabs++; + /* Module Information */ $form->add('module', 'hidden', 'phpwsbb'); *************** *** 369,373 **** $this->PHPWSBB_Message($_POST['PHPWSBB_ITEMS'][0]); if (!empty($this->_id) && !$_SESSION['OBJ_user']->allow_access('phpwsbb', 'edit_messages') && !$this->isModerator && ($_SESSION['OBJ_user']->username != $this->getOwner())) { ! $message = $_SESSION['translate']->it('Access to save message [var1] was denied due to lack of proper permissions.', $this->_id); $error = new PHPWS_Error('phpwsbb', 'PHPWSBB_Manager::_accessDenied()', $message, 'exit', 1); $error->message(); --- 374,378 ---- $this->PHPWSBB_Message($_POST['PHPWSBB_ITEMS'][0]); if (!empty($this->_id) && !$_SESSION['OBJ_user']->allow_access('phpwsbb', 'edit_messages') && !$this->isModerator && ($_SESSION['OBJ_user']->username != $this->getOwner())) { ! $message = '<div class="errortext">' . $_SESSION['translate']->it('Access to save message [var1] was denied due to lack of proper permissions.', $this->_id) . '</div>'; $error = new PHPWS_Error('phpwsbb', 'PHPWSBB_Manager::_accessDenied()', $message, 'exit', 1); $error->message(); *************** *** 389,395 **** $this->_body = PHPWS_Text::parseInput($_REQUEST['Message_body']); if (PHPWS_Error::isError($error)) { ! $message = $_SESSION['translate']->it('You must have a subject for your message.'); $_SESSION['PHPWSBB_Manager']->notice = new PHPWS_Message($message, 'CNT_phpwsbb'); $_REQUEST['PHPWSBB_MESSAGE_OP'] = 'edit'; --- 394,407 ---- $this->_body = PHPWS_Text::parseInput($_REQUEST['Message_body']); + if (isset($_REQUEST['Message_preview'])) { + $message = PHPWS_Text::parseOutput($_REQUEST['Message_body']); + $_SESSION['PHPWSBB_Manager']->notice = new PHPWS_Message($message, 'CNT_phpwsbb'); + $_REQUEST['PHPWSBB_MESSAGE_OP'] = 'edit'; + $this->action(); + return; + } if (PHPWS_Error::isError($error)) { ! $message = '<div class="errortext">' . $_SESSION['translate']->it('You must have a subject for your message.') . '</div>'; $_SESSION['PHPWSBB_Manager']->notice = new PHPWS_Message($message, 'CNT_phpwsbb'); $_REQUEST['PHPWSBB_MESSAGE_OP'] = 'edit'; *************** *** 685,690 **** */ function action() { ! if (PHPWS_Message::isMessage($_SESSION['PHPWSBB_Manager']->notice)) ! $_SESSION['PHPWSBB_Manager']->notice->display(); $forum = NULL; --- 697,704 ---- */ function action() { ! if (PHPWS_Message::isMessage($_SESSION['PHPWSBB_Manager']->notice)) { ! $_SESSION['PHPWSBB_Manager']->notice->display(); ! $_SESSION['PHPWSBB_Manager']->notice = null; ! } $forum = NULL; *************** *** 757,759 **** }// END CLASS PHPWSBB_Message ! ?> \ No newline at end of file --- 771,773 ---- }// END CLASS PHPWSBB_Message ! ?> |