public function acknowledge() { $this->requireParameter("id"); $entity = SystemNoticeManager::getInstance()->getEntity($this->getParameter("id")); $entity->setAcknowledgedFlag(); }
/** * Checks against the versions at partkeepr.org. * * If a newer version was found, create a system notice entry. */ public static function doVersionCheck() { $data = file_get_contents("http://www.partkeepr.org/versions.json"); $versions = json_decode($data, true); if (PartKeeprVersion::PARTKEEPR_VERSION == "{V_GIT}") { return; } if (substr(PartKeeprVersion::PARTKEEPR_VERSION, 0, 17) == "partkeepr-nightly") { return; } if (version_compare(PartKeepr::getVersion(), $versions[0]["version"], '<')) { SystemNoticeManager::getInstance()->createUniqueSystemNotice("PARTKEEPR_VERSION_" . $versions[0]["version"], sprintf(PartKeepr::i18n("New PartKeepr Version %s available"), $versions[0]["version"]), sprintf(PartKeepr::i18n("PartKeepr Version %s changelog:"), $versions[0]["version"]) . "\n\n" . $versions[0]["changelog"]); } }