Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F2751477
UIUtils.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
UIUtils.php
View Options
<?php
namespace
MediaWiki\Extension\OAuth\Frontend
;
use
MediaWiki\Context\IContextSource
;
use
MediaWiki\Message\Message
;
use
OOUI\Tag
;
/**
* Static utility class for the special pages
*/
class
UIUtils
{
/**
* Generate an information table for a consumer. The result will be suitable for use as a
* HTMLForm field with no label.
* @param array $info fieldname-message => description; description will be escaped (use
* HtmlSnippet to avoid); fields with null value will be ignored; messages will be interpreted
* as plaintext
* @param IContextSource $context
* @return string
*/
public
static
function
generateInfoTable
(
$info
,
$context
)
{
$dl
=
new
Tag
(
'dl'
);
$dl
->
addClasses
(
[
'mw-mwoauth-infotable'
]
);
foreach
(
$info
as
$fieldname
=>
$description
)
{
if
(
$description
===
null
)
{
continue
;
}
elseif
(
$description
instanceof
Message
)
{
$description
=
$description
->
plain
();
}
$dt
=
new
Tag
(
'dt'
);
$dd
=
new
Tag
(
'dd'
);
$dt
->
appendContent
(
$context
->
msg
(
$fieldname
)->
text
()
);
$dd
->
appendContent
(
$description
);
$dl
->
appendContent
(
$dt
,
$dd
);
}
return
$dl
->
toString
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Jul 3, 18:37 (1 d, 17 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
66/e5/b990c521d5d80d9b1dc5b395e08d
Default Alt Text
UIUtils.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment