ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilMailCronNotification.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5include_once "Services/Cron/classes/class.ilCronJob.php";
6
13{
14 public function getId()
15 {
16 return "mail_notification";
17 }
18
19 public function getTitle()
20 {
21 global $lng;
22
23 return $lng->txt("cron_mail_notification");
24 }
25
26 public function getDescription()
27 {
28 global $lng;
29
30 return $lng->txt("cron_mail_notification_desc");
31 }
32
33 public function getDefaultScheduleType()
34 {
36 }
37
38 public function getDefaultScheduleValue()
39 {
40 return;
41 }
42
43 public function hasAutoActivation()
44 {
45 return false;
46 }
47
48 public function hasFlexibleSchedule()
49 {
50 return false;
51 }
52
53 public function hasCustomSettings()
54 {
55 return true;
56 }
57
58 public function run()
59 {
60 require_once 'Services/Mail/classes/class.ilMailSummaryNotification.php';
61 $msn = new ilMailSummaryNotification();
62 $msn->send();
63
66 return $result;
67 }
68
70 {
71 global $lng, $ilSetting;
72
73 $cb = new ilCheckboxInputGUI($lng->txt("cron_mail_notification_message"), "mail_notification_message");
74 $cb->setInfo($lng->txt("cron_mail_notification_message_info"));
75 $cb->setChecked($ilSetting->get("mail_notification_message"));
76 $a_form->addItem($cb);
77 }
78
79 public function saveCustomSettings(ilPropertyFormGUI $a_form)
80 {
81 global $ilSetting;
82
83 $ilSetting->set('mail_notification_message', $_POST['mail_notification_message'] ? 1 : 0);
84
85 return true;
86 }
87
88 public function activationWasToggled($a_currently_active)
89 {
90 global $ilSetting;
91
92 // propagate cron-job setting to object setting
93 $ilSetting->set('mail_notification', (bool)$a_currently_active);
94 }
95}
96
97?>
$result
This class represents a checkbox property in a property form.
Cron job result data container.
Cron job application base class.
const SCHEDULE_TYPE_DAILY
hasAutoActivation()
Is to be activated on "installation".
hasCustomSettings()
Has cron job any custom setting which can be edited?
addCustomSettingsToForm(ilPropertyFormGUI $a_form)
Add custom settings to form.
hasFlexibleSchedule()
Can the schedule be configured?
getDefaultScheduleValue()
Get schedule value.
saveCustomSettings(ilPropertyFormGUI $a_form)
Save custom settings.
activationWasToggled($a_currently_active)
Cron job status was changed.
getDefaultScheduleType()
Get schedule type.
This class represents a property form user interface.
addItem($a_item)
Add Item (Property, SectionHeader).
$_POST['username']
Definition: cron.php:12
global $lng
Definition: privfeed.php:40
global $ilSetting
Definition: privfeed.php:40