From: Ken N. <ke...@co...> - 2004-04-29 06:41:08
|
OK... This may be a phpws programming 101 question, but I think my current problem lies with not understanding phpws sessions. For the sake of an illustration, I am picking the announcement module. 1) runtime.php is parsed a) it parses Announcement.php b) checks to see if any announcements are in the db c) if there are, it creates a new PHPWS_Announcement for every announcement, uses the view() method d) then displays the announcement(s) So far, so good! Now, I look into announcements' index.php and see (for me) a confusing array of session names. I snipped the non-manager $_REQUEST case/switch items. If someone will be so kind as to explain the how and why, I would really appreciate it. /mod/announce/index.php (lines 90-115) <snip> if(isset($_REQUEST["ANN_user_op"])) switch($_REQUEST["ANN_user_op"]) { case "list": $_SESSION["SES_ANN_MANAGER"]->listAnnouncements(); break; case "view": $_SESSION["SES_ANN"] = new PHPWS_Announcement($_REQUEST["ANN_id"]); $_SESSION["SES_ANN"]->view("full"); $_SESSION["SES_ANN"]->hit(); break; case "submit_announcement": $_SESSION["SES_ANN_MANAGER"]->userMenu(); $_SESSION["SES_ANN"] = new PHPWS_Announcement; $_SESSION["SES_ANN"]->edit(); break; case "save": $_SESSION["SES_ANN"]->save(); break; case "categories": $_SESSION["SES_ANN_MANAGER"]->categories(); break; } </snip> Specifically: case "view" uses all $_SESSION["SES_ANN"] while case "submit_announcement" uses both $_SESSION["SES_ANN_MANAGER"] and $_SESSION["SES_ANN"] I know this has to be a really obvious methodology, but I think I am missing the forest because of the trees. Oh, before I sent this in to the list, I did RTFD and STFW for some direction. If someone could walk me through this on or off list, I would appreciate it. -- Kenneth Nordquist http://communitygems.com |