| 1 | <?php |
|---|
| 2 | // $Id: mailform.php,v 1.4 2005/08/03 12:39:16 onokazu Exp $ |
|---|
| 3 | // ------------------------------------------------------------------------ // |
|---|
| 4 | // XOOPS - PHP Content Management System // |
|---|
| 5 | // Copyright (c) 2000 XOOPS.org // |
|---|
| 6 | // <http://www.xoops.org/> // |
|---|
| 7 | // ------------------------------------------------------------------------ // |
|---|
| 8 | // This program is free software; you can redistribute it and/or modify // |
|---|
| 9 | // it under the terms of the GNU General Public License as published by // |
|---|
| 10 | // the Free Software Foundation; either version 2 of the License, or // |
|---|
| 11 | // (at your option) any later version. // |
|---|
| 12 | // // |
|---|
| 13 | // You may not change or alter any portion of this comment or credits // |
|---|
| 14 | // of supporting developers from this source code or any supporting // |
|---|
| 15 | // source code which is considered copyrighted (c) material of the // |
|---|
| 16 | // original comment or credit authors. // |
|---|
| 17 | // // |
|---|
| 18 | // This program is distributed in the hope that it will be useful, // |
|---|
| 19 | // but WITHOUT ANY WARRANTY; without even the implied warranty of // |
|---|
| 20 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // |
|---|
| 21 | // GNU General Public License for more details. // |
|---|
| 22 | // // |
|---|
| 23 | // You should have received a copy of the GNU General Public License // |
|---|
| 24 | // along with this program; if not, write to the Free Software // |
|---|
| 25 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // |
|---|
| 26 | // ------------------------------------------------------------------------ // |
|---|
| 27 | // Author: Kazumi Ono (AKA onokazu) // |
|---|
| 28 | // URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ // |
|---|
| 29 | // Project: The XOOPS Project // |
|---|
| 30 | // ------------------------------------------------------------------------- // |
|---|
| 31 | |
|---|
| 32 | $form = new XoopsThemeForm(_AM_SENDMTOUSERS, "mailusers", "admin.php?fct=mailusers"); |
|---|
| 33 | $form->addElement(new XoopsFormToken(XoopsSingleTokenHandler::quickCreate('mailusers_send'))); |
|---|
| 34 | |
|---|
| 35 | // from finduser section |
|---|
| 36 | if (!empty($_POST['memberslist_id'])) { |
|---|
| 37 | $user_count = count($_POST['memberslist_id']); |
|---|
| 38 | $display_names = ""; |
|---|
| 39 | for ( $i = 0; $i < $user_count; $i++ ) { |
|---|
| 40 | $uid_hidden = new XoopsFormHidden("mail_to_user[]", $_POST['memberslist_id'][$i]); |
|---|
| 41 | $form->addElement($uid_hidden); |
|---|
| 42 | $display_names .= "<a href='".XOOPS_URL."/userinfo.php?uid=".$_POST['memberslist_id'][$i]."' target='_blank'>".$_POST['memberslist_uname'][$_POST['memberslist_id'][$i]]."</a>, "; |
|---|
| 43 | unset($uid_hidden); |
|---|
| 44 | } |
|---|
| 45 | $users_label = new XoopsFormLabel(_AM_SENDTOUSERS2, substr($display_names, 0, -2)); |
|---|
| 46 | $form->addElement($users_label); |
|---|
| 47 | $display_criteria = 0; |
|---|
| 48 | } |
|---|
| 49 | if ( !empty($display_criteria) ) { |
|---|
| 50 | $selected_groups = array(); |
|---|
| 51 | $group_select = new XoopsFormSelectGroup(_AM_GROUPIS."<br />", "mail_to_group", false, $selected_groups, 5, true); |
|---|
| 52 | $lastlog_min = new XoopsFormText(_AM_LASTLOGMIN."<br />"._AM_TIMEFORMAT."<br />", "mail_lastlog_min", 20, 10); |
|---|
| 53 | $lastlog_max = new XoopsFormText(_AM_LASTLOGMAX."<br />"._AM_TIMEFORMAT."<br />", "mail_lastlog_max", 20, 10); |
|---|
| 54 | $regd_min = new XoopsFormText(_AM_REGDMIN."<br />"._AM_TIMEFORMAT."<br />", "mail_regd_min", 20, 10); |
|---|
| 55 | $regd_max = new XoopsFormText(_AM_REGDMAX."<br />"._AM_TIMEFORMAT."<br />", "mail_regd_max", 20, 10); |
|---|
| 56 | $idle_more = new XoopsFormText(_AM_IDLEMORE."<br />", "mail_idle_more", 10, 5); |
|---|
| 57 | $idle_less = new XoopsFormText(_AM_IDLELESS."<br />", "mail_idle_less", 10, 5); |
|---|
| 58 | $mailok_cbox = new XoopsFormCheckBox('', 'mail_mailok'); |
|---|
| 59 | $mailok_cbox->addOption(1, _AM_MAILOK); |
|---|
| 60 | $inactive_cbox = new XoopsFormCheckBox(_AM_INACTIVE."<br />", "mail_inactive"); |
|---|
| 61 | $inactive_cbox->addOption(1, _AMIFCHECKD); |
|---|
| 62 | $inactive_cbox->setExtra("onclick='javascript:disableElement(\"mail_lastlog_min\");disableElement(\"mail_lastlog_max\");disableElement(\"mail_idle_more\");disableElement(\"mail_idle_less\");disableElement(\"mail_to_group[]\");'"); |
|---|
| 63 | $criteria_tray = new XoopsFormElementTray(_AM_SENDTOUSERS, "<br /><br />"); |
|---|
| 64 | $criteria_tray->addElement($group_select); |
|---|
| 65 | $criteria_tray->addElement($lastlog_min); |
|---|
| 66 | $criteria_tray->addElement($lastlog_max); |
|---|
| 67 | $criteria_tray->addElement($idle_more); |
|---|
| 68 | $criteria_tray->addElement($idle_less); |
|---|
| 69 | $criteria_tray->addElement($mailok_cbox); |
|---|
| 70 | $criteria_tray->addElement($inactive_cbox); |
|---|
| 71 | $criteria_tray->addElement($regd_min); |
|---|
| 72 | $criteria_tray->addElement($regd_max); |
|---|
| 73 | $form->addElement($criteria_tray); |
|---|
| 74 | } |
|---|
| 75 | |
|---|
| 76 | $fname_text = new XoopsFormText(_AM_MAILFNAME, "mail_fromname", 30, 255, htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)); |
|---|
| 77 | $fromemail = !empty($xoopsConfig['adminmail']) ? $xoopsConfig['adminmail'] : $xoopsUser->getVar("email", "E"); |
|---|
| 78 | $femail_text = new XoopsFormText(_AM_MAILFMAIL, "mail_fromemail", 30, 255, $fromemail); |
|---|
| 79 | //$subject_caption = _AM_MAILSUBJECT."<br /><br /><span style='font-size:x-small;font-weight:bold;'>"._AM_MAILTAGS."</span><br /><span style='font-size:x-small;font-weight:normal;'>"._AM_MAILTAGS1."<br />"._AM_MAILTAGS2."<br />"._AM_MAILTAGS3."</span>"; |
|---|
| 80 | $subject_caption = _AM_MAILSUBJECT."<br /><br /><span style='font-size:x-small;font-weight:bold;'>"._AM_MAILTAGS."</span><br /><span style='font-size:x-small;font-weight:normal;'>"._AM_MAILTAGS2."</span>"; |
|---|
| 81 | $subject_text = new XoopsFormText($subject_caption, "mail_subject", 50, 255); |
|---|
| 82 | $body_caption = _AM_MAILBODY."<br /><br /><span style='font-size:x-small;font-weight:bold;'>"._AM_MAILTAGS."</span><br /><span style='font-size:x-small;font-weight:normal;'>"._AM_MAILTAGS1."<br />"._AM_MAILTAGS2."<br />"._AM_MAILTAGS3."<br />"._AM_MAILTAGS4."</span>"; |
|---|
| 83 | $body_text = new XoopsFormTextArea($body_caption, "mail_body", "", 10); |
|---|
| 84 | $to_checkbox = new XoopsFormCheckBox(_AM_SENDTO, "mail_send_to", "mail"); |
|---|
| 85 | $to_checkbox->addOption("mail", _AM_EMAIL); |
|---|
| 86 | $to_checkbox->addOption("pm", _AM_PM); |
|---|
| 87 | $start_hidden = new XoopsFormHidden("mail_start", 0); |
|---|
| 88 | $op_hidden = new XoopsFormHidden("op", "send"); |
|---|
| 89 | $submit_button = new XoopsFormButton("", "mail_submit", _SEND, "submit"); |
|---|
| 90 | |
|---|
| 91 | $form->addElement($fname_text); |
|---|
| 92 | $form->addElement($femail_text); |
|---|
| 93 | $form->addElement($subject_text); |
|---|
| 94 | $form->addElement($body_text); |
|---|
| 95 | $form->addElement($to_checkbox); |
|---|
| 96 | $form->addElement($op_hidden); |
|---|
| 97 | $form->addElement($start_hidden); |
|---|
| 98 | $form->addElement($submit_button); |
|---|
| 99 | $form->setRequired($subject_text); |
|---|
| 100 | $form->setRequired($body_text); |
|---|
| 101 | //$form->setRequired($to_checkbox); |
|---|
| 102 | ?> |
|---|