Exemple #1
0
 public function addAdminNotification(ADMIN_CLASS_NotificationCollector $coll)
 {
     // update soft
     if (OW::getConfig()->getValue('base', 'update_soft')) {
         $coll->add(OW::getLanguage()->text('admin', 'notification_soft_update', array('link' => OW::getRouter()->urlForRoute('admin_core_update_request'))), ADMIN_CLASS_NotificationCollector::NOTIFICATION_WARNING);
     }
     $pluginsCount = BOL_PluginService::getInstance()->getPluginsToUpdateCount();
     // plugins update
     if ($pluginsCount > 0) {
         $coll->add(OW::getLanguage()->text('admin', 'notification_plugins_to_update', array('link' => OW::getRouter()->urlForRoute('admin_plugins_installed'), 'count' => $pluginsCount)), ADMIN_CLASS_NotificationCollector::NOTIFICATION_UPDATE);
     }
     $themesCount = BOL_ThemeService::getInstance()->getThemesToUpdateCount();
     // themes update
     if ($themesCount > 0) {
         $coll->add(OW::getLanguage()->text('admin', 'notification_themes_to_update', array('link' => OW::getRouter()->urlForRoute('admin_themes_choose'), 'count' => $themesCount)), ADMIN_CLASS_NotificationCollector::NOTIFICATION_UPDATE);
     }
     if (OW::getConfig()->configExists('base', 'cron_is_active') && (int) OW::getConfig()->getValue('base', 'cron_is_active') === 0) {
         $coll->add(OW::getLanguage()->text('admin', 'warning_cron_is_not_active', array('path' => OW_DIR_ROOT . 'ow_cron' . DS . 'run.php')), ADMIN_CLASS_NotificationCollector::NOTIFICATION_WARNING);
     }
     if (!ini_get('allow_url_fopen')) {
         $coll->add(OW::getLanguage()->text('admin', 'warning_url_fopen_disabled'), ADMIN_CLASS_NotificationCollector::NOTIFICATION_WARNING);
     }
 }
Exemple #2
0
 public function onAddAdminNotification(ADMIN_CLASS_NotificationCollector $coll)
 {
     $router = OW::getRouter();
     $language = OW::getLanguage();
     $pluginService = BOL_PluginService::getInstance();
     $themeService = BOL_ThemeService::getInstance();
     $storageService = BOL_StorageService::getInstance();
     $request = OW::getRequest();
     // update soft
     if (OW::getConfig()->getValue("base", "update_soft")) {
         $coll->add($language->text("admin", "notification_soft_update", array("link" => $router->urlForRoute("admin_core_update_request"))), ADMIN_CLASS_NotificationCollector::NOTIFICATION_UPDATE);
     }
     $pluginsToUpdateCount = $pluginService->getPluginsToUpdateCount();
     // plugins update
     if ($pluginsToUpdateCount > 0) {
         $coll->add($language->text("admin", "notification_plugins_to_update", array("link" => $router->urlForRoute("admin_plugins_installed"), "count" => $pluginsToUpdateCount)), ADMIN_CLASS_NotificationCollector::NOTIFICATION_UPDATE);
     }
     $themesToUpdateCount = $themeService->getThemesToUpdateCount();
     // themes update
     if ($themesToUpdateCount > 0) {
         $coll->add($language->text("admin", "notification_themes_to_update", array("link" => $router->urlForRoute("admin_themes_choose"), "count" => $themesToUpdateCount)), ADMIN_CLASS_NotificationCollector::NOTIFICATION_UPDATE);
     }
     if (OW::getConfig()->configExists("base", "cron_is_active") && (int) OW::getConfig()->getValue("base", "cron_is_active") == 0) {
         $coll->add($language->text("admin", "warning_cron_is_not_active", array("path" => OW_DIR_ROOT . "ow_cron" . DS . "run.php")), ADMIN_CLASS_NotificationCollector::NOTIFICATION_WARNING);
     }
     $items = $storageService->findItemsWithInvalidLicense();
     $licenseRequestUrl = OW::getRouter()->urlFor("ADMIN_CTRL_Storage", "checkItemLicense");
     $backUri = OW::getRouter()->getUri();
     /* @var $plugin BOL_StoreItem */
     foreach ($items as $item) {
         $type = $item instanceof BOL_Plugin ? BOL_StorageService::URI_VAR_ITEM_TYPE_VAL_PLUGIN : BOL_StorageService::URI_VAR_ITEM_TYPE_VAL_THEME;
         $params = array(BOL_StorageService::URI_VAR_ITEM_TYPE => $type, BOL_StorageService::URI_VAR_KEY => $item->getKey(), BOL_StorageService::URI_VAR_DEV_KEY => $item->getDeveloperKey(), BOL_StorageService::URI_VAR_BACK_URI => $backUri);
         $langParams = array("name" => $item->getTitle(), "url" => $request->buildUrlQueryString($licenseRequestUrl, $params));
         $coll->add($language->text("admin", "invalid _license_item_notification", $langParams), ADMIN_CLASS_NotificationCollector::NOTIFICATION_WARNING);
     }
 }