/** * @param \OCP\IL10N $l * @return array Array "stringID of the type" => "translated string description for the setting" */ public function getNotificationTypes(\OCP\IL10N $l) { if (isset($this->notificationTypes[$l->getLanguageCode()])) { return $this->notificationTypes[$l->getLanguageCode()]; } // Allow apps to add new notification types $notificationTypes = $this->activityManager->getNotificationTypes($l->getLanguageCode()); $this->notificationTypes[$l->getLanguageCode()] = $notificationTypes; return $notificationTypes; }
/** * @param \OCP\IL10N $l * @return array Array "stringID of the type" => "translated string description for the setting" */ public function getNotificationTypes(\OCP\IL10N $l) { if (isset($this->notificationTypes[$l->getLanguageCode()])) { return $this->notificationTypes[$l->getLanguageCode()]; } $notificationTypes = array(self::TYPE_SHARED => $l->t('A file or folder has been <strong>shared</strong>'), self::TYPE_SHARE_CREATED => $l->t('A new file or folder has been <strong>created</strong>'), self::TYPE_SHARE_CHANGED => $l->t('A file or folder has been <strong>changed</strong>'), self::TYPE_SHARE_DELETED => $l->t('A file or folder has been <strong>deleted</strong>'), self::TYPE_SHARE_RESTORED => $l->t('A file or folder has been <strong>restored</strong>')); // Allow other apps to add new notification types $additionalNotificationTypes = $this->activityManager->getNotificationTypes($l->getLanguageCode()); $notificationTypes = array_merge($notificationTypes, $additionalNotificationTypes); $this->notificationTypes[$l->getLanguageCode()] = $notificationTypes; return $notificationTypes; }