Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F458472
PholioInlineThumbController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
907 B
Referenced Files
None
Subscribers
None
PholioInlineThumbController.php
View Options
<?php
/**
* @group pholio
*/
final
class
PholioInlineThumbController
extends
PholioController
{
private
$imageid
;
public
function
shouldAllowPublic
()
{
return
true
;
}
public
function
willProcessRequest
(
array
$data
)
{
$this
->
imageid
=
idx
(
$data
,
'imageid'
);
}
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
$image
=
id
(
new
PholioImage
())->
load
(
$this
->
imageid
);
if
(
$image
==
null
)
{
return
new
Aphront404Response
();
}
$mock
=
id
(
new
PholioMockQuery
())
->
setViewer
(
$user
)
->
withIDs
(
array
(
$image
->
getMockID
()))
->
executeOne
();
if
(!
$mock
)
{
return
new
Aphront404Response
();
}
$file
=
id
(
new
PhabricatorFile
())->
loadOneWhere
(
'phid = %s'
,
$image
->
getFilePHID
());
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
$file
->
getThumb60x45URI
());
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 5, 12:11 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
71454
Default Alt Text
PholioInlineThumbController.php (907 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment