ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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{
17 protected $lng;
18
22 protected $settings;
23
27 protected $initDone = false;
28
32 protected function init()
33 {
34 global $DIC;
35
36 if (!$this->initDone) {
37 $this->settings = $DIC->settings();
38 $this->lng = $DIC->language();
39
40 $this->initDone = true;
41 }
42 }
43
44 public function getId()
45 {
46 return "mail_notification";
47 }
48
49 public function getTitle()
50 {
51 $this->init();
52 return $this->lng->txt("cron_mail_notification");
53 }
54
55 public function getDescription()
56 {
57 $this->init();
58 return $this->lng->txt("cron_mail_notification_desc");
59 }
60
61 public function getDefaultScheduleType()
62 {
64 }
65
66 public function getDefaultScheduleValue()
67 {
68 return;
69 }
70
71 public function hasAutoActivation()
72 {
73 return false;
74 }
75
76 public function hasFlexibleSchedule()
77 {
78 return false;
79 }
80
81 public function hasCustomSettings()
82 {
83 return true;
84 }
85
86 public function run()
87 {
88 require_once 'Services/Mail/classes/class.ilMailSummaryNotification.php';
89 $msn = new ilMailSummaryNotification();
90 $msn->send();
91
94 return $result;
95 }
96
98 {
99 $this->init();
100 $cb = new ilCheckboxInputGUI($this->lng->txt("cron_mail_notification_message"), "mail_notification_message");
101 $cb->setInfo($this->lng->txt("cron_mail_notification_message_info"));
102 $cb->setChecked($this->settings->get("mail_notification_message"));
103 $a_form->addItem($cb);
104 }
105
106 public function saveCustomSettings(ilPropertyFormGUI $a_form)
107 {
108 $this->init();
109 $this->settings->set('mail_notification_message', $_POST['mail_notification_message'] ? 1 : 0);
110 return true;
111 }
112
113 public function activationWasToggled($a_currently_active)
114 {
115 $this->init();
116 $this->settings->set('mail_notification', (bool) $a_currently_active);
117 }
118}
$result
$_POST["username"]
An exception for terminatinating execution or to throw for unit testing.
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).
global $DIC
Definition: saml.php:7
settings()
Definition: settings.php:2