From: <dts...@us...> - 2003-05-21 21:56:28
|
Update of /cvsroot/phpwebsite-comm/modules/phpwsbb/class In directory sc8-pr-cvs1:/tmp/cvs-serv11998/class Modified Files: Message.php Log Message: Adding basic view capabilities Index: Message.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/phpwsbb/class/Message.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Message.php 21 May 2003 15:54:13 -0000 1.3 --- Message.php 21 May 2003 21:56:23 -0000 1.4 *************** *** 10,14 **** var $_guestname = NULL; var $_guestemail = NULL; - var $_subject = NULL; var $_body = NULL; --- 10,13 ---- *************** *** 29,32 **** --- 28,63 ---- + function _view() { + $tags = array(); + + $tags["ID"] = $this->getId(); + $tags["OWNER"] = $this->getOwner(); + $tags["EDITOR"] = $this->getEditor(); + $tags["IP"] = $this->getIp(); + $tags["CREATED"] = $this->getCreated(); + $tags["UPDATED"] = $this->getUpdated(); + $tags["SUBJECT"] = $this->getLabel(); + $tags["BODY"] = $this->_body; + $tags["GUESTNAME"] = $this->_guestname; + $tags["GUESTEMAIL"] = $this->_guestemail; + $tags["PID"] = $this->_pid; + + $poster = $this->getOwner(); + if(empty($poster)) { + $poster = $this->guestname; + $posteremail = $this->guestemail; + } + + $tags["POSTED"] = $_SESSION["translate"]->it("Posted by [var1] on [var2]", $poster, $this->getCreated()); + + $tags["REPLY"] = $_SESSION["translate"]->it("Reply to Message"); + + // Need to cycle through all children still + + return $GLOBALS["core"]->processTemplate($tags, "phpwsbb", "view.tpl"); + + }// END FUNC _view + + function _edit() { if(!empty($this->_id) && !$_SESSION["OBJ_user"]->allow_access("phpwsbb", "edit_messages")) { *************** *** 81,85 **** /* Module Information */ $form->add("module", "hidden", "phpwsbb"); ! $form->add("PHPWSBB_op", "hidden", "save"); $form->add("Message_pid", "hidden", $_REQUEST["Message_pid"]); --- 112,116 ---- /* Module Information */ $form->add("module", "hidden", "phpwsbb"); ! $form->add("PHPWSBB_OP", "hidden", "save"); $form->add("Message_pid", "hidden", $_REQUEST["Message_pid"]); *************** *** 100,105 **** function _save() { if(!empty($this->_id) && !$_SESSION["OBJ_user"]->allow_access("phpwsbb", "edit_messages")) { - //$_REQUEST["PHPWSBB_MAN_OP"] = "access_denied"; - //$_SESSION["PHPWSBB_Manager"]->action(); $message = $_SESSION["translate"]->it("Access to save message $this->_id was denied due to lack of proper permissions."); $error = new PHPWS_Error("phpwsbb", "PHPWSBB_Manager::_accessDenied()", $message, "exit", 1); --- 131,134 ---- *************** *** 112,119 **** if(isset($_REQUEST["Message_body"])) ! $this->_body($_REQUEST["Message_body"]); if(isset($_REQUEST["Message_pid"])) ! $this->_pid($_REQUEST["Message_pid"]); $error = $this->commit(); --- 141,154 ---- if(isset($_REQUEST["Message_body"])) ! $this->_body = $_REQUEST["Message_body"]; if(isset($_REQUEST["Message_pid"])) ! $this->_pid = $_REQUEST["Message_pid"]; ! ! if(isset($_REQUEST["Message_guestname"])) ! $this->_guestname = $_REQUEST["Message_guestname"]; ! ! if(isset($_REQUEST["Message_guestemail"])) ! $this->_guestemail = $_REQUEST["Message_guestemail"]; $error = $this->commit(); *************** *** 145,149 **** --- 180,187 ---- case "save": $this->_save(); + break; case "view": + $content = $this->_view(); + break; case "fork": case "lock": |