file, "w");
fwrite($fp, "\n");
fwrite($fp, "
Looking ok?
"; $form = new Form("send"); $form->addWidget(new Hidden($vars)); $form->addWidget(new Button("yes")); $form->render(); $form = new Form("retry"); $form->addWidget(new Hidden($vars)); $form->addWidget(new Button("no")); $form->render(); break; case "retry": $testaddr = $vars["testaddr"]; $subject = $vars["subject"]; $content = $vars["content"]; default: $form = new Form("preview"); $form->addWidget(new LineEdit("Test address:", "testaddr", $testaddr)); $form->addWidget(new LineEdit("Subject:", "subject", $subject)); $form->addWidget(new TextEdit("Content:", "content", $content)); $form->addWidget(new Button("Send")); $form->render(); break; } } public function admin_config($action, $vars) { switch($action) { case "update": $this->mailinglist->subj_prefix = $vars["subj_prefix"]; $this->mailinglist->sender = $vars["sender"]; $this->mailinglist->replyto = $vars["replyto"]; $this->mailinglist->footer = $vars["footer"]; $this->mailinglist->write(); break; default: $form = new Form("update"); $form->addWidget(new LineEdit("Subject prefix:", "subj_prefix", $this->mailinglist->subj_prefix)); $form->addWidget(new LineEdit("Sender:", "sender", $this->mailinglist->sender)); $form->addWidget(new LineEdit("Reply to:", "replyto", $this->mailinglist->replyto)); $form->addWidget(new TextEdit("Footer:", "footer", $this->mailinglist->footer)); $form->addWidget(new Button("Update")); $form->render(); break; } } public function admin($sub, $action, $vars) { switch($sub) { case "send": $this->admin_send($action, $vars); break; case "config": $this->admin_config($action, $vars); break; } } public function run($params) { return ""; } private function read() { $this->mailinglist = new PMailinglist($this->file); } public function PressRelease($file) { $this->file = $file; if(file_exists($file)) $this->read(); } } function pressrelease_init() { global $DATA_DIR; return new PressRelease($DATA_DIR . "/pressrelease.xml"); } ?>