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)); }
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); }
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); } }
function execute() { $id = (int) Request::post('id'); connectionNotificationModel::create()->where(array('id' => $id))->delete(); }
function execute() { $notification = Request::post('notification'); connectionNotificationModel::create()->add($notification); }