本文整理匯總了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');
}