ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
class.ilMailingLists.php
Go to the documentation of this file.
1
<?php
2
/*
3
+-----------------------------------------------------------------------------+
4
| ILIAS open source |
5
+-----------------------------------------------------------------------------+
6
| Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7
| |
8
| This program is free software; you can redistribute it and/or |
9
| modify it under the terms of the GNU General Public License |
10
| as published by the Free Software Foundation; either version 2 |
11
| of the License, or (at your option) any later version. |
12
| |
13
| This program is distributed in the hope that it will be useful, |
14
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
15
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16
| GNU General Public License for more details. |
17
| |
18
| You should have received a copy of the GNU General Public License |
19
| along with this program; if not, write to the Free Software |
20
| Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21
+-----------------------------------------------------------------------------+
22
*/
23
24
require_once
"Services/Contact/classes/class.ilMailingList.php"
;
25
31
class
ilMailingLists
32
{
36
private
$db
;
37
41
private
$user
;
42
46
private
$ml
= null;
47
52
public
function
__construct
(
ilObjUser
$a_user)
53
{
54
global
$DIC
;
55
56
$this->db = $DIC[
'ilDB'
];
57
$this->
user
= $a_user;
58
}
59
60
public
function
get
(
$id
= 0)
61
{
62
return
new
ilMailingList
($this->
user
,
$id
);
63
}
64
65
public
function
getSelected
($a_ids =
array
())
66
{
67
$entries =
array
();
68
69
if
(is_array($a_ids) && !empty($a_ids)) {
70
$counter
= 0;
71
while
(
$id
= @array_pop($a_ids)) {
72
$entries[
$counter
] =
new
ilMailingList
($this->
user
,
$id
);
73
74
++
$counter
;
75
}
76
}
77
78
return
$entries;
79
}
80
81
public
function
getAll
()
82
{
83
$res
= $this->db->queryf(
84
'
85
SELECT * FROM addressbook_mlist
86
WHERE user_id = %s'
,
87
array
(
'integer'
),
88
array
($this->
user
->getId())
89
);
90
91
$entries =
array
();
92
93
$counter
= 0;
94
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
95
$tmpObj =
new
ilMailingList
($this->
user
, 0);
96
$tmpObj->setId(
$row
->ml_id);
97
$tmpObj->setUserId(
$row
->user_id);
98
$tmpObj->setTitle(
$row
->title);
99
$tmpObj->setDescription(
$row
->description);
100
$tmpObj->setCreatedate(
$row
->createdate);
101
$tmpObj->setChangedate(
$row
->changedae);
102
$tmpObj->setMode(
$row
->lmode);
103
104
$entries[
$counter
] = $tmpObj;
105
106
unset($tmpObj);
107
108
++
$counter
;
109
}
110
111
return
$entries;
112
}
113
114
public
function
mailingListExists
($a_list_name)
115
{
116
$ml_id = substr($a_list_name, strrpos($a_list_name,
'_'
) + 1);
117
118
if
(!is_numeric($ml_id) || $ml_id <= 0) {
119
return
false
;
120
}
else
{
121
$this->
setCurrentMailingList
($ml_id);
122
}
123
124
return
true
;
125
}
126
127
public
function
setCurrentMailingList
(
$id
= 0)
128
{
129
$this->ml = $this->
get
(
$id
);
130
}
131
135
public
function
getCurrentMailingList
()
136
{
137
return
$this->ml
;
138
}
139
140
public
function
deleteTemporaryLists
()
141
{
142
foreach
($this->
getAll
() as $mlist) {
143
if
($mlist->getMode() ==
ilMailingList::MODE_TEMPORARY
) {
144
$mlist->delete();
145
}
146
}
147
}
148
}
ilMailingLists\$user
$user
Definition:
class.ilMailingLists.php:41
$DIC
global $DIC
Definition:
saml.php:7
$id
if(!array_key_exists('StateId', $_REQUEST)) $id
Definition:
expirywarning.php:14
ilMailingLists\mailingListExists
mailingListExists($a_list_name)
Definition:
class.ilMailingLists.php:114
ilMailingList
Definition:
class.ilMailingList.php:30
user
user()
Definition:
user.php:4
ilMailingLists\setCurrentMailingList
setCurrentMailingList($id=0)
Definition:
class.ilMailingLists.php:127
$counter
$counter
Definition:
config-scanner.php:59
ilMailingLists\getSelected
getSelected($a_ids=array())
Definition:
class.ilMailingLists.php:65
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilMailingList\MODE_TEMPORARY
const MODE_TEMPORARY
Definition:
class.ilMailingList.php:50
ilMailingLists\$db
$db
Definition:
class.ilMailingLists.php:36
ilMailingLists\__construct
__construct(ilObjUser $a_user)
ilMailingLists constructor.
Definition:
class.ilMailingLists.php:52
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
ilMailingLists\getAll
getAll()
Definition:
class.ilMailingLists.php:81
ilMailingLists
Definition:
class.ilMailingLists.php:31
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
ilObjUser
Definition:
class.ilObjUser.php:25
$row
$row
Definition:
10autofilter-selection-1.php:74
ilMailingLists\deleteTemporaryLists
deleteTemporaryLists()
Definition:
class.ilMailingLists.php:140
ilMailingLists\getCurrentMailingList
getCurrentMailingList()
Definition:
class.ilMailingLists.php:135
ilMailingLists\$ml
$ml
Definition:
class.ilMailingLists.php:46
Services
Contact
classes
class.ilMailingLists.php
Generated on Sat Jan 18 2025 19:01:28 for ILIAS by
1.8.13 (using
Doxyfile
)