Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F2114500
form_field_eh.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Nov 18, 4:23 PM
Size
697 B
Mime Type
text/x-php
Expires
Fri, Nov 20, 4:23 PM (24 m, 30 s)
Engine
blob
Format
Raw Data
Handle
994501
Attached To
rINP In-Portal
form_field_eh.php
View Options
<?php
class
FormFieldEventHandler
extends
kDBEventHandler
{
/**
* Returns form field visibility filter
*
* @return string
*/
function
getVisiblilityFilter
()
{
if
(
$this
->
Application
->
LoggedIn
()
&&
!
$this
->
Application
->
isAdminUser
)
{
return
'%1$s.Visibility = '
.
FORM_FIELD_EVERYONE
;
}
return
''
;
}
/**
* Shows fields based on user logged-in status
*
* @param kEvent $event
*/
function
SetCustomQuery
(&
$event
)
{
parent
::
SetCustomQuery
(
$event
);
$object
=&
$event
->
getObject
();
/* @var $object kDBList */
$visibility_filter
=
$this
->
getVisiblilityFilter
();
$object
->
addFilter
(
'visibility_filter'
,
$visibility_filter
);
}
}
Event Timeline
Log In to Comment