Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96362034
PhabricatorNotificationClearController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Dec 25, 22:21
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Dec 27, 22:21 (2 d)
Engine
blob
Format
Raw Data
Handle
23172061
Attached To
rPH Phabricator
PhabricatorNotificationClearController.php
View Options
<?php
final
class
PhabricatorNotificationClearController
extends
PhabricatorNotificationController
{
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$chrono_key
=
$request
->
getInt
(
'chronoKey'
);
$user
=
$request
->
getUser
();
if
(
$request
->
isDialogFormPost
())
{
$table
=
new
PhabricatorFeedStoryNotification
();
queryfx
(
$table
->
establishConnection
(
'w'
),
'UPDATE %T SET hasViewed = 1 '
.
'WHERE userPHID = %s AND hasViewed = 0 and chronologicalKey <= %d'
,
$table
->
getTableName
(),
$user
->
getPHID
(),
$chrono_key
);
return
id
(
new
AphrontReloadResponse
())
->
setURI
(
'/notification/'
);
}
$dialog
=
new
AphrontDialogView
();
$dialog
->
setUser
(
$user
);
$dialog
->
addCancelButton
(
'/notification/'
);
if
(
$chrono_key
)
{
$dialog
->
setTitle
(
'Really mark all notifications as read?'
);
$dialog
->
addHiddenInput
(
'chronoKey'
,
$chrono_key
);
$is_serious
=
PhabricatorEnv
::
getEnvConfig
(
'phabricator.serious-business'
);
if
(
$is_serious
)
{
$dialog
->
appendChild
(
pht
(
'All unread notifications will be marked as read. You can not '
.
'undo this action.'
));
}
else
{
$dialog
->
appendChild
(
pht
(
"You can't ignore your problems forever, you know."
));
}
$dialog
->
addSubmitButton
(
pht
(
'Mark All Read'
));
}
else
{
$dialog
->
setTitle
(
'No notifications to mark as read.'
);
$dialog
->
appendChild
(
pht
(
'You have no unread notifications.'
));
}
return
id
(
new
AphrontDialogResponse
())->
setDialog
(
$dialog
);
}
}
Event Timeline
Log In to Comment