コード例 #1
0
 function execute()
 {
     $event = Request::post('event');
     $eventList = connectionNotificationModel::getEventList();
     $locale = new Locales('connection');
     $list = $locale->getList();
     $this->smarty->assign('eventInfo', $eventList[$event]);
     $this->smarty->assign('lang', $list);
     $this->smarty->assign('event', connectionNotificationModel::create()->getEvent($event));
 }
コード例 #2
0
 function execute()
 {
     $locale = new Locales('connection');
     $list = $locale->getList();
     $notification = connectionNotificationModel::create()->where(array('id' => (int) Request::post('id')))->fetchOne();
     $eventList = connectionNotificationModel::getEventList();
     $this->smarty->assign('eventInfo', $eventList[$notification['event']]);
     $this->smarty->assign('lang', $list);
     $this->smarty->assign('notification', $notification);
 }
コード例 #3
0
 public static function run($event, $data = array(), $iso = 'ru')
 {
     $eventList = self::getEventList();
     if (!$eventList[$event]) {
         return false;
     }
     $model = connectionNotificationModel::create();
     $notification = $model->getEvent($event);
     Load::dependence('smarty');
     $smarty = Load::$dependences['smarty'];
     foreach ($data as $key => $value) {
         $smarty->assign($key, $value);
     }
     foreach ($notification as $item) {
         $to = $smarty->fetch('string:' . $item['to']);
         $title = $smarty->fetch('string:' . $item[$iso]['title']);
         $content = $smarty->fetch('string:' . $item[$iso]['content']);
         $headers = "Content-type: text/html; charset=utf-8 \r\n";
         $headers .= "From: " . Settings::getValue('admin_email_name', 'connection') . " <" . Settings::getValue('admin_email', 'connection') . ">\r\n";
         mail($to, $title, $content, $headers);
     }
 }
コード例 #4
0
 function execute()
 {
     $id = (int) Request::post('id');
     connectionNotificationModel::create()->where(array('id' => $id))->delete();
 }
コード例 #5
0
 function execute()
 {
     $notification = Request::post('notification');
     connectionNotificationModel::create()->add($notification);
 }