Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 12... Línea 12...
12
// GNU General Public License for more details.
12
// GNU General Public License for more details.
13
//
13
//
14
// You should have received a copy of the GNU General Public License
14
// You should have received a copy of the GNU General Public License
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
Línea 16... Línea -...
16
 
-
 
17
/**
-
 
18
 * New messaging class.
-
 
19
 *
-
 
20
 * @package   core_message
-
 
21
 * @since     Moodle 2.9
-
 
22
 * @copyright 2015 onwards Ankit Agarwal
-
 
23
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
-
 
24
 */
-
 
25
 
16
 
Línea 26... Línea 17...
26
namespace core\message;
17
namespace core\message;
Línea 27... Línea 18...
27
 
18
 
28
defined('MOODLE_INTERNAL') || die();
19
use core\url;
29
 
20
 
30
/**
21
/**
Línea 44... Línea 35...
44
 * Required parameters of the $eventdata object for PERSONAL MESSAGES:
35
 * Required parameters of the $eventdata object for PERSONAL MESSAGES:
45
 *  convid int The conversation identifier where this message will be sent
36
 *  convid int The conversation identifier where this message will be sent
46
 *
37
 *
47
 * Optional parameters of the $eventdata object:
38
 * Optional parameters of the $eventdata object:
48
 *  notification bool Should the message be considered as a notification rather than a personal message
39
 *  notification bool Should the message be considered as a notification rather than a personal message
49
 *  contexturl string If this is a notification then you can specify a url to view the event.
40
 *  contexturl string|url If this is a notification then you can specify a url to view the event.
50
 *                    For example the forum post the user is being notified of.
41
 *                    For example the forum post the user is being notified of.
51
 *  contexturlname string The display text for contexturl.
42
 *  contexturlname string The display text for contexturl.
52
 *  replyto string An email address which can be used to send an reply.
43
 *  replyto string An email address which can be used to send an reply.
53
 *  attachment stored_file File instance that needs to be sent as attachment.
44
 *  attachment stored_file File instance that needs to be sent as attachment.
54
 *  attachname string Name of the attachment.
45
 *  attachname string Name of the attachment.
Línea 94... Línea 85...
94
    private $fullmessageformat;
85
    private $fullmessageformat;
Línea 95... Línea 86...
95
 
86
 
96
    /** @var string Complete message in html format. */
87
    /** @var string Complete message in html format. */
Línea -... Línea 88...
-
 
88
    private $fullmessagehtml;
-
 
89
 
-
 
90
    /** @var string Complete message in sms format. */
97
    private $fullmessagehtml;
91
    private $fullmessagesms;
98
 
92
 
Línea 99... Línea 93...
99
    /** @var  string Smaller version of the message. */
93
    /** @var  string Smaller version of the message. */
100
    private $smallmessage;
94
    private $smallmessage;
Línea 101... Línea 95...
101
 
95
 
102
    /** @var  int Is it a notification? */
96
    /** @var  int Is it a notification? */
Línea 103... Línea 97...
103
    private $notification;
97
    private $notification;
104
 
98
 
Línea 147... Línea 141...
147
        'userto',
141
        'userto',
148
        'subject',
142
        'subject',
149
        'fullmessage',
143
        'fullmessage',
150
        'fullmessageformat',
144
        'fullmessageformat',
151
        'fullmessagehtml',
145
        'fullmessagehtml',
-
 
146
        'fullmessagesms',
152
        'smallmessage',
147
        'smallmessage',
153
        'notification',
148
        'notification',
154
        'contexturl',
149
        'contexturl',
155
        'contexturlname',
150
        'contexturlname',
156
        'replyto',
151
        'replyto',
Línea 196... Línea 191...
196
            return $this->fullmessage;
191
            return $this->fullmessage;
197
        }
192
        }
198
    }
193
    }
Línea 199... Línea 194...
199
 
194
 
-
 
195
    /**
-
 
196
     * Fullmessagesms content including any processor specific content.
-
 
197
     *
-
 
198
     * @param string $processorname Name of the processor.
-
 
199
     *
-
 
200
     * @return mixed|string
-
 
201
     */
-
 
202
    protected function get_fullmessagesms(string $processorname = '') {
-
 
203
        if (!empty($processorname) && isset($this->additionalcontent[$processorname])) {
-
 
204
            return $this->get_message_with_additional_content($processorname, 'fullmessagesms');
-
 
205
        } else {
-
 
206
            return $this->fullmessagesms;
-
 
207
        }
-
 
208
    }
-
 
209
 
200
    /**
210
    /**
201
     * Smallmessage content including any processor specific content.
211
     * Smallmessage content including any processor specific content.
202
     *
212
     *
203
     * @param string $processorname Name of the processor.
213
     * @param string $processorname Name of the processor.
204
     *
214
     *
Línea 336... Línea 346...
336
            $func = "get_$prop";
346
            $func = "get_$prop";
337
            $eventdata->$prop = method_exists($this, $func) ? $this->$func($processorname) : $this->$prop;
347
            $eventdata->$prop = method_exists($this, $func) ? $this->$func($processorname) : $this->$prop;
338
        }
348
        }
339
        return $eventdata;
349
        return $eventdata;
340
    }
350
    }
341
}
-
 
342
351
}
-
 
352