// some action for every record if required if ($this->mode == 'update') { global ${'value_' . $res[$i]['ID']}; global ${'notes_' . $res[$i]['ID']}; $all_settings[$res[$i]['NAME']] = ${'value_' . $res[$i]['ID']}; $res[$i]['VALUE'] = ${'value_' . $res[$i]['ID']}; $res[$i]['NOTES'] = htmlspecialchars(${'notes_' . $res[$i]['ID']}); SQLUpdate('settings', $res[$i]); } if ($this->mode == 'reset') { $res[$i]['VALUE'] = $res[$i]['DEFAULTVALUE']; SQLUpdate('settings', $res[$i]); } if ($res[$i]['VALUE'] == $res[$i]['DEFAULTVALUE']) { $res[$i]['ISDEFAULT'] = '1'; } $res[$i]['VALUE'] = htmlspecialchars($res[$i]['VALUE']); } $out['RESULT'] = $res; } // some action for every record if required if ($this->mode == 'update') { if ($all_settings['GROWL_ENABLE']) { include_once ROOT . 'lib/growl/growl.gntp.php'; $growl = new Growl($all_settings['GROWL_HOST'], $all_settings['GROWL_PASSWORD']); $growl->setApplication('MajorDoMo', 'Notifications'); $growl->registerApplication('http://connect.smartliving.ru/img/logo.png'); $growl->notify('Test!'); } $this->redirect("?updated=1&filter_name=" . $this->filter_name); }
/** * Send growl message * * @param string $title Notification title * @param string $message Notification message */ protected function sendGrowlMessage($title, $message) { require CLITOOLS_ROOT_FS . '/vendor/jamiebicknell/Growl-GNTP/growl.gntp.php'; $growlServer = (string) $this->getApplication()->getConfigValue('growl', 'server', null); $growlPassword = (string) $this->getApplication()->getConfigValue('growl', 'password', null); if (!empty($growlServer)) { $growl = new \Growl($growlServer, $growlPassword); $growl->setApplication('Vagrant VM', 'Vagrant Development VM'); // Only need to use the following method on first use or change of icon $growl->registerApplication(); // Basic Notification $growl->notify($title, $message); } }