本文整理汇总了PHP中CIMNotify::deleteByTag方法的典型用法代码示例。如果您正苦于以下问题:PHP CIMNotify::deleteByTag方法的具体用法?PHP CIMNotify::deleteByTag怎么用?PHP CIMNotify::deleteByTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIMNotify
的用法示例。
在下文中一共展示了CIMNotify::deleteByTag方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onBeforeConfirmNotify
/**
* Catches event from IM module, when user click on buttons in notify.
* @param string $module Module.
* @param string $tag Tag.
* @param string $value Value.
* @param mixed $notify Notify.
* @return void
*/
public static function onBeforeConfirmNotify($module, $tag, $value, $notify)
{
global $USER;
$userId = $USER->getId();
if (!($module === Driver::INTERNAL_MODULE_ID && $userId)) {
return;
}
$sharingModel = static::loadByNotifyTag($tag);
if (!$sharingModel) {
return;
}
if (!$sharingModel->isToUser()) {
return;
}
if ($sharingModel->getToEntity() !== self::CODE_USER . $userId) {
return;
}
list(, $tag) = $sharingModel->getNotifyTags();
\CIMNotify::deleteByTag($tag);
if ($value === 'N') {
$sharingModel->decline($userId);
return;
}
if ($sharingModel->approve()) {
$isFolder = $sharingModel->getLinkObject() instanceof Folder;
$pathInListing = Driver::getInstance()->getUrlManager()->getUrlFocusController('showObjectInGrid', array('objectId' => $sharingModel->getLinkObjectId()));
$message = Loc::getMessage($isFolder ? 'DISK_SHARING_MODEL_AUTOCONNECT_NOTIFY' : 'DISK_SHARING_MODEL_AUTOCONNECT_NOTIFY_FILE', array('#NAME#' => '<a href="' . $pathInListing . '">' . $sharingModel->getLinkObject()->getName() . '</a>', '#DESCRIPTION#' => '', '#DISCONNECT_LINK#' => ''));
list($subTag, $tag) = $sharingModel->getNotifyTags();
Driver::getInstance()->sendNotify(substr($sharingModel->getToEntity(), 1), array('FROM_USER_ID' => $sharingModel->getCreatedBy(), 'NOTIFY_EVENT' => 'sharing', 'NOTIFY_TAG' => $tag, 'NOTIFY_SUB_TAG' => $subTag, 'NOTIFY_MESSAGE' => $message, 'NOTIFY_MESSAGE_OUT' => strip_tags($message)));
}
}
示例2: onBeforeConfirmNotify
public static function onBeforeConfirmNotify($module, $tag, $value, $notify)
{
global $USER;
$userId = $USER->getId();
if (!($module == Driver::INTERNAL_MODULE_ID && $userId)) {
return;
}
$sharingModel = static::loadByNotifyTag($tag);
if (!$sharingModel) {
return;
}
if (!$sharingModel->isToUser()) {
return;
}
if ($sharingModel->getToEntity() != self::CODE_USER . $userId) {
return;
}
list(, $tag) = $sharingModel->getNotifyTags();
\CIMNotify::deleteByTag($tag);
if ($value === 'N') {
$sharingModel->decline($userId);
return;
}
$sharingModel->approve();
return;
}
示例3: removeNotifyToUser
private static function removeNotifyToUser(array $folderInvite)
{
if (\Bitrix\Main\Loader::includeModule('im')) {
\CIMNotify::deleteByTag(self::getNotifyTag($folderInvite));
}
\CWebDavDiskDispatcher::sendChangeStatus($folderInvite['INVITE_USER_ID'], 'delete_symlink');
}