Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5986389
Manager.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
Manager.php
View Options
<?php
namespace
MobileFrontend\Amc
;
use
MediaWiki\Config\Config
;
use
MediaWiki\Config\ConfigException
;
use
MobileContext
;
/**
* Advanced Mobile Contributions Manager
*
* @package MobileFrontend\Amc
*/
final
class
Manager
{
/**
* A config name used to enable/disable the AMC mode
*/
private
const
AMC_MODE_CONFIG_NAME
=
'MFAdvancedMobileContributions'
;
/**
* Mode identifier used in feature configs
*/
private
const
AMC_MODE_IDENTIFIER
=
'amc'
;
/**
* Change tag
* All edits when has AMC enabled will be tagged with AMC_EDIT_TAG
*/
public
const
AMC_EDIT_TAG
=
'advanced mobile edit'
;
/**
* MobileContext used to retrieve shouldDisplayMobileView and user information
*
* @var MobileContext
*/
private
$mobileContext
;
/**
* System config
* @var Config
*/
private
$config
;
/**
* @param Config $config
* @param MobileContext $mobileContext
*/
public
function
__construct
(
Config
$config
,
MobileContext
$mobileContext
)
{
$this
->
config
=
$config
;
$this
->
mobileContext
=
$mobileContext
;
}
/**
* Returns information if the AMC mode is available for current session
* @return bool
* @throws ConfigException
*/
public
function
isAvailable
()
{
return
$this
->
mobileContext
->
shouldDisplayMobileView
()
&&
$this
->
config
->
get
(
self
::
AMC_MODE_CONFIG_NAME
)
&&
!
$this
->
mobileContext
->
getUser
()->
isAnon
();
}
/**
* Get the mode identifier (used in configs)
*
* @return string
*/
public
function
getModeIdentifier
()
{
return
self
::
AMC_MODE_IDENTIFIER
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Oct 4, 00:05 (2 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
42/51/23a9c065f72aab949a6f805ba5ec
Default Alt Text
Manager.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment