Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F443944
PonderVotableView.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PonderVotableView.php
View Options
<?php
final
class
PonderVotableView
extends
AphrontView
{
private
$phid
;
private
$uri
;
private
$count
;
private
$vote
;
public
function
setPHID
(
$phid
)
{
$this
->
phid
=
$phid
;
return
$this
;
}
public
function
setURI
(
$uri
)
{
$this
->
uri
=
$uri
;
return
$this
;
}
public
function
setCount
(
$count
)
{
$this
->
count
=
$count
;
return
$this
;
}
public
function
setVote
(
$vote
)
{
$this
->
vote
=
$vote
;
return
$this
;
}
public
function
render
()
{
require_celerity_resource
(
'ponder-vote-css'
);
require_celerity_resource
(
'javelin-behavior-ponder-votebox'
);
Javelin
::
initBehavior
(
'ponder-votebox'
,
array
());
$uri
=
id
(
new
PhutilURI
(
$this
->
uri
))->
alter
(
'phid'
,
$this
->
phid
);
$up
=
javelin_render_tag
(
'a'
,
array
(
'href'
=>
(
string
)
$uri
,
'sigil'
=>
'upvote'
,
'mustcapture'
=>
true
,
'class'
=>
(
$this
->
vote
>
0
)
?
'ponder-vote-active'
:
null
,
),
"
\x
E2
\x
96
\x
B2"
);
$down
=
javelin_render_tag
(
'a'
,
array
(
'href'
=>
(
string
)
$uri
,
'sigil'
=>
'downvote'
,
'mustcapture'
=>
true
,
'class'
=>
(
$this
->
vote
<
0
)
?
'ponder-vote-active'
:
null
,
),
"
\x
E2
\x
96
\x
BC"
);
$count
=
javelin_render_tag
(
'div'
,
array
(
'class'
=>
'ponder-vote-count'
,
'sigil'
=>
'ponder-vote-count'
,
),
phutil_escape_html
(
$this
->
count
));
return
javelin_render_tag
(
'div'
,
array
(
'class'
=>
'ponder-votable'
,
'sigil'
=>
'ponder-votable'
,
'meta'
=>
array
(
'count'
=>
(
int
)
$this
->
count
,
'vote'
=>
(
int
)
$this
->
vote
,
),
),
javelin_render_tag
(
'div'
,
array
(
'class'
=>
'ponder-votebox'
,
),
$up
.
$count
.
$down
).
phutil_render_tag
(
'div'
,
array
(
'class'
=>
'ponder-votebox-content'
,
),
$this
->
renderChildren
()));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, May 4, 11:17 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
64981
Default Alt Text
PonderVotableView.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment