2 /*******************************************************************************
3 * Copyright (C) 2007 Easter-eggs
4 * http://ldapsaisie.labs.libre-entreprise.org
6 * Author: See AUTHORS file in top-level directory.
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License version 2
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 ******************************************************************************/
26 * Méthode chargeant les dépendances d'affichage
30 public static function loadDependenciesDisplay() {
31 if (LSsession :: loadLSclass('LSsmoothbox')) {
32 LSsmoothbox :: loadDependenciesDisplay();
35 LSsession :: addJSscript('LSmail.js');
36 LSsession :: addCssFile('LSmail.css');
39 public static function ajax_display(&$data) {
40 if (isset($_REQUEST['object']['type']) && isset($_REQUEST['object']['dn'])) {
41 if (LSsession ::loadLSobject($_REQUEST['object']['type'])) {
42 $obj = new $_REQUEST['object']['type']();
43 $obj -> loadData($_REQUEST['object']['dn']);
44 $msg = $obj -> getFData($_REQUEST['msg']);
45 $subject = $obj -> getFData($_REQUEST['subject']);
49 $msg = $_REQUEST['msg'];
50 $subject = $_REQUEST['subject'];
53 $GLOBALS['Smarty'] -> assign('LSmail_msg',$msg);
54 $GLOBALS['Smarty'] -> assign('LSmail_subject',$subject);
55 if (is_array($_REQUEST['mails'])) {
56 $GLOBALS['Smarty'] -> assign('LSmail_mails',$_REQUEST['mails']);
58 else if(empty($_REQUEST['mails'])) {
59 $GLOBALS['Smarty'] -> assign('LSmail_mails',array($_REQUEST['mails']));
61 $GLOBALS['Smarty'] -> assign('LSmail_mail_label',_('Email'));
62 $GLOBALS['Smarty'] -> assign('LSmail_subject_label',_('Title'));
63 $GLOBALS['Smarty'] -> assign('LSmail_msg_label',_('Message'));
66 'html' => $GLOBALS['Smarty'] -> fetch('LSmail.tpl')
70 public static function ajax_send(&$data) {
71 if (isset($_REQUEST['infos'])) {
72 if (LSsession ::loadLSaddon('mail')) {
73 if(sendMail($_REQUEST['infos']['mail'],$_REQUEST['infos']['subject'],$_REQUEST['infos']['msg'])) {
75 'msgok' => _("Your message has been sent successfully.")
81 LSerror :: addErrorCode('LSsession_12');