|
From: Greg M. <bli...@us...> - 2008-08-23 19:01:10
|
Update of /cvsroot/phpwebsite-comm/modules/mailinglists/class In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26362/class Modified Files: MyPage.php Log Message: File Cabinet added to email forms for HTML messages. Index: MyPage.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/mailinglists/class/MyPage.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MyPage.php 22 Aug 2008 03:15:46 -0000 1.3 --- MyPage.php 23 Aug 2008 19:01:13 -0000 1.4 *************** *** 236,239 **** --- 236,241 ---- } + PHPWS_Core::initModClass('filecabinet', 'Cabinet.php'); + $form = new PHPWS_Form; $form->addHidden('module', 'users'); *************** *** 250,264 **** $form->setRows('msg_html', MAILINGLISTS_TEXTAREA_ROWS); $form->setWidth('msg_html', '80%'); - $form->setLabel('msg_html', dgettext('mailinglists', 'Message (HTML)')); $form->useEditor('msg_html'); $form->addTextArea('msg_text', $email->getMsgText(false)); $form->setRows('msg_text', MAILINGLISTS_TEXTAREA_ROWS); $form->setWidth('msg_text', '80%'); - $form->setLabel('msg_text', dgettext('mailinglists', 'Message (Plain Text)')); $form->addSubmit('submit', dgettext('mailinglists', 'Send Email (Do Not Click Twice)')); $template = $form->getTemplate(); if (isset($errors['subject'])) { --- 252,270 ---- $form->setRows('msg_html', MAILINGLISTS_TEXTAREA_ROWS); $form->setWidth('msg_html', '80%'); $form->useEditor('msg_html'); + $manager = Cabinet::fileManager('file_id', $email->getFileId()); + $form->addTplTag('FILE_MANAGER', $manager->get()); + $form->addTextArea('msg_text', $email->getMsgText(false)); $form->setRows('msg_text', MAILINGLISTS_TEXTAREA_ROWS); $form->setWidth('msg_text', '80%'); $form->addSubmit('submit', dgettext('mailinglists', 'Send Email (Do Not Click Twice)')); $template = $form->getTemplate(); + $template['HTML_EMAIL_LEGEND'] = dgettext('mailinglists', 'Message (HTML)'); + $template['TEXT_EMAIL_LEGEND'] = dgettext('mailinglists', 'Message (Plain Text)'); + if (isset($errors['subject'])) { *************** *** 279,283 **** $errors['subject'] = dgettext('mailinglists', 'You must have a subject.'); } ! if (empty($_POST['msg_text']) && empty($_POST['msg_html'])) { $errors['body'] = dgettext('mailinglists', 'You must have a message body.'); --- 285,289 ---- $errors['subject'] = dgettext('mailinglists', 'You must have a subject.'); } ! if (empty($_POST['msg_text']) && (strlen($_POST['msg_html']) < 15)) { $errors['body'] = dgettext('mailinglists', 'You must have a message body.'); *************** *** 287,290 **** --- 293,297 ---- $email->setMsgText($_POST['msg_text']); $email->setMsgHtml($_POST['msg_html']); + $email->setFileId($_POST['file_id']); $email->setUserId(Current_User::getId()); $email->setListId($list->getId()); *************** *** 459,463 **** $email->setMsgHtml(NULL); $email->setUserId(0); ! $email->setListId(0); // Settings the true ID would cause this email to appear in archive $email->setApproved(1); $email->setSubject(sprintf(dgettext('mailinglists', 'Confirmation Email: %s'), $list->getName())); --- 466,470 ---- $email->setMsgHtml(NULL); $email->setUserId(0); ! $email->setListId(0); // Setting the true ID would cause this email to appear in archive $email->setApproved(1); $email->setSubject(sprintf(dgettext('mailinglists', 'Confirmation Email: %s'), $list->getName())); |