本文整理汇总了PHP中OCP\Activity\IManager::getNotificationTypes方法的典型用法代码示例。如果您正苦于以下问题:PHP IManager::getNotificationTypes方法的具体用法?PHP IManager::getNotificationTypes怎么用?PHP IManager::getNotificationTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OCP\Activity\IManager
的用法示例。
在下文中一共展示了IManager::getNotificationTypes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getNotificationTypes
/**
* @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;
}
示例2: getNotificationTypes
/**
* @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;
}