File: inc.ClassNotify.php

package info (click to toggle)
letodms 3.3.9%2Bdfsg-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 2,828 kB
  • sloc: php: 21,980; sql: 1,054; sh: 85; makefile: 84
file content (51 lines) | stat: -rw-r--r-- 1,557 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
 * Abstract class of notifation system
 *
 * @category   DMS
 * @package    LetoDMS
 * @license    GPL 2
 * @version    @version@
 * @author     Uwe Steinmann <uwe@steinmann.cx>
 * @copyright  Copyright (C) 2002-2005 Markus Westphal,
 *             2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
 *             2010 Uwe Steinmann
 * @version    Release: @package_version@
 */

/**
 * Abstract class of notification systems
 *
 * @category   DMS
 * @package    LetoDMS
 * @author     Markus Westphal, Malcolm Cowe, Uwe Steinmann <uwe@steinmann.cx>
 * @copyright  Copyright (C) 2002-2005 Markus Westphal,
 *             2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
 *             2010 Uwe Steinmann
 * @version    Release: @package_version@
 */
abstract class LetoDMS_Notify {
	/* User sending the notification
	 * Will only be used if the sender of one of the notify methods
	 * is not set
	 */
	protected $sender;

	abstract function toIndividual($sender, $recipient, $subject, $message);
	abstract function toGroup($sender, $groupRecipient, $subject, $message);
	abstract function toList($sender, $recipients, $subject, $message);

	function replaceMarker($text) {
		global $settings;

		return(str_replace(
			array('###SITENAME###', '###HTTP_ROOT###', '###URL_PREFIX###'),
			array($settings->_siteName, $settings->_httpRoot, "http".((isset($_SERVER['HTTPS']) && (strcmp($_SERVER['HTTPS'],'off')!=0)) ? "s" : "")."://".$_SERVER['HTTP_HOST'].$settings->_httpRoot),
			$text));
	}

	function setSender($user) {
		$this->sender = $user;
	}
}
?>