User interface for e-mail {$name}
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1081 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
2c7657835c
commit
1e55d4755e
|
@ -236,13 +236,15 @@ class Adminer {
|
||||||
|
|
||||||
/** Print extra text in the end of a select form
|
/** Print extra text in the end of a select form
|
||||||
* @param array fields holding e-mails
|
* @param array fields holding e-mails
|
||||||
|
* @param array selectable columns
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
function selectEmailPrint($emailFields) {
|
function selectEmailPrint($emailFields, $columns) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Process columns box in select
|
/** Process columns box in select
|
||||||
* @param array selectable columns
|
* @param array selectable columns
|
||||||
|
* @param array
|
||||||
* @return array (array(select_expressions), array(group_expressions))
|
* @return array (array(select_expressions), array(group_expressions))
|
||||||
*/
|
*/
|
||||||
function selectColumnsProcess($columns, $indexes) {
|
function selectColumnsProcess($columns, $indexes) {
|
||||||
|
|
|
@ -286,7 +286,7 @@ if (!$columns) {
|
||||||
}
|
}
|
||||||
echo "<fieldset><legend>" . lang('CSV Import') . "</legend><div><input type='hidden' name='token' value='$token'><input type='file' name='csv_file'> <input type='submit' name='import' value='" . lang('Import') . "'></div></fieldset>\n";
|
echo "<fieldset><legend>" . lang('CSV Import') . "</legend><div><input type='hidden' name='token' value='$token'><input type='file' name='csv_file'> <input type='submit' name='import' value='" . lang('Import') . "'></div></fieldset>\n";
|
||||||
|
|
||||||
$adminer->selectEmailPrint(array_filter($email_fields, 'strlen'));
|
$adminer->selectEmailPrint(array_filter($email_fields, 'strlen'), $columns);
|
||||||
|
|
||||||
echo "</form>\n";
|
echo "</form>\n";
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ class Adminer {
|
||||||
function loginForm($username) {
|
function loginForm($username) {
|
||||||
?>
|
?>
|
||||||
<table cellspacing="0">
|
<table cellspacing="0">
|
||||||
<tr><th><?php echo lang('Username'); ?><td><input type="hidden" name="server" value="" /><input name="username" value="<?php echo h($username); ?>">
|
<tr><th><?php echo lang('Username'); ?><td><input type="hidden" name="server" value=""><input name="username" value="<?php echo h($username); ?>">
|
||||||
<tr><th><?php echo lang('Password'); ?><td><input type="password" name="password">
|
<tr><th><?php echo lang('Password'); ?><td><input type="password" name="password">
|
||||||
</table>
|
</table>
|
||||||
<?php
|
<?php
|
||||||
|
@ -181,14 +181,14 @@ ORDER BY ORDINAL_POSITION"); //! requires MySQL 5
|
||||||
echo "</div></fieldset>\n";
|
echo "</div></fieldset>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectEmailPrint($emailFields) {
|
function selectEmailPrint($emailFields, $columns) {
|
||||||
global $confirm;
|
global $confirm;
|
||||||
if ($emailFields) {
|
if ($emailFields) {
|
||||||
echo '<fieldset><legend><a href="#fieldset-email" onclick="return !toggle(\'fieldset-email\');">' . lang('E-mail') . "</a></legend><div id='fieldset-email' class='hidden'>\n";
|
echo '<fieldset><legend><a href="#fieldset-email" onclick="return !toggle(\'fieldset-email\');">' . lang('E-mail') . "</a></legend><div id='fieldset-email'" . ($_POST["email_append"] ? "" : " class='hidden'") . ">\n";
|
||||||
echo "<p>" . lang('From') . ": <input name='email_from'>\n";
|
echo "<p>" . lang('From') . ": <input name='email_from' value='" . h($_POST["email_from"]) . "'>\n";
|
||||||
echo lang('Subject') . ": <input name='email_subject'>\n";
|
echo lang('Subject') . ": <input name='email_subject' value='" . h($_POST["email_subject"]) . "'>\n";
|
||||||
echo "<p><textarea name='email_message' rows='15' cols='60'></textarea>\n";
|
echo "<p><textarea name='email_message' rows='15' cols='60'>" . h($_POST["email_message"] . ($_POST["email_append"] ? '{$' . "$_POST[email_addition]}" : "")) . "</textarea><br>\n";
|
||||||
//! add UI for {$name} fields
|
echo "<select name='email_addition'>" . optionlist($columns, $_POST["email_addition"]) . "</select> <input type='submit' name='email_append' value='" . lang('Insert') . "'>\n"; //! JavaScript
|
||||||
echo "<p>" . (count($emailFields) == 1 ? '<input type="hidden" name="email_field" value="' . h(key($emailFields)) . '">' : '<select name="email_field">' . optionlist($emailFields) . '</select> ');
|
echo "<p>" . (count($emailFields) == 1 ? '<input type="hidden" name="email_field" value="' . h(key($emailFields)) . '">' : '<select name="email_field">' . optionlist($emailFields) . '</select> ');
|
||||||
echo "<input type='submit' name='email' value='" . lang('Send') . "'$confirm>\n";
|
echo "<input type='submit' name='email' value='" . lang('Send') . "'$confirm>\n";
|
||||||
echo "</div></fieldset>\n";
|
echo "</div></fieldset>\n";
|
||||||
|
@ -252,6 +252,9 @@ ORDER BY ORDINAL_POSITION"); //! requires MySQL 5
|
||||||
|
|
||||||
function selectEmailProcess($where, $foreignKeys) {
|
function selectEmailProcess($where, $foreignKeys) {
|
||||||
global $dbh;
|
global $dbh;
|
||||||
|
if ($_POST["email_append"]) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if ($_POST["email"]) {
|
if ($_POST["email"]) {
|
||||||
$sent = 0;
|
$sent = 0;
|
||||||
if ($_POST["all"] || $_POST["check"]) {
|
if ($_POST["all"] || $_POST["check"]) {
|
||||||
|
|
Loading…
Reference in a new issue