diff --git a/plugins/email-table.php b/plugins/email-table.php new file mode 100644 index 00000000..5c897ccd --- /dev/null +++ b/plugins/email-table.php @@ -0,0 +1,51 @@ +table = $table; + $this->id = $id; + $this->title = $title; + $this->subject = $subject; + $this->message = $message; + } + + function selectEmailPrint($emailFields, $columns) { + if ($emailFields) { + print_fieldset("email", ('E-mail')); + echo "
\n"; + echo "

" . ('From') . ": \n"; + echo ('Subject') . ": \n"; + echo "

" . ('Attachments') . ": "; + echo "

" . (count($emailFields) == 1 ? '' : html_select("email_field", $emailFields)); + echo "\n"; + echo "

\n"; + echo "\n"; + return true; + } + } + + function selectEmailProcess($where, $foreignKeys) { + $connection = connection(); + if ($_POST["email_id"]) { + $result = $connection->query("SELECT $this->subject, $this->message FROM $this->table WHERE $this->id = " . q($_POST["email_id"])); + $row = $result->fetch_row(); + $_POST["email_subject"] = $row[0]; + $_POST["email_message"] = $row[1]; + } + } + +}