64 lines
1.6 KiB
PHP
64 lines
1.6 KiB
PHP
<?php
|
|
if (array_key_exists('template',$_POST)) {
|
|
$template = $_POST['template'];
|
|
$filename = "_email.$template.html";
|
|
if (is_file($filename)) {
|
|
$content = file_get_contents($filename);
|
|
}
|
|
}
|
|
|
|
if (!isset($content) || strlen($content) == 0) {
|
|
$content = "<p>Enter your message here...</p>";
|
|
}
|
|
|
|
$dir = opendir(".");
|
|
$templates = array();
|
|
while ($file = readdir($dir)) {
|
|
if (strpos($file, "_email.") !== 0) continue;
|
|
$templates[] = $file;
|
|
}
|
|
|
|
if (count($templates)) {
|
|
sort($templates);
|
|
?>
|
|
<center>
|
|
<form action="/" method="post">
|
|
<table width="700" border="0" cellspacing="0" cellpadding="2" bgcolor="#eeeeee" style="border: solid 1px #000000;">
|
|
<tr>
|
|
<td colspan='2' align='left' valign="top">
|
|
<h2>Select Message Template</h2>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right'>Load Template:</td>
|
|
<td align='left'>
|
|
<select name='template'>
|
|
<option value='blank'>blank template</option>
|
|
<?php
|
|
for ($i = 0; $i < count($templates); $i++) {
|
|
$tmpl = str_replace("_email.","",$templates[$i]);
|
|
$tmpl = str_replace(".html","",$tmpl);
|
|
$selected = "";
|
|
if ($tmpl == $template) $selected = " selected='selected'";
|
|
echo(" <option value=\"$tmpl\"$selected>$tmpl</option>\n");
|
|
}
|
|
?>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan='2' align="center" valign="top">
|
|
<br>
|
|
<input type="hidden" name="action" value="email-messages">
|
|
<input type="hidden" name="naction" value="add">
|
|
<input type="submit" value="Load Template">
|
|
<br>
|
|
<br>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
</center>
|
|
<?php
|
|
}
|
|
?>
|