Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F10421
tag-code.php
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 22 2014, 1:19 AM
2014-11-22 01:19:56 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
tag-code.php
View Options
public
static
function
pwTagSection
(
$input
,
array
$args
,
Parser
$parser
,
PPFrame
$frame
){
//First, process the arguments
foreach
(
$args
as
$argn
=>
$argv_raw
){
$argv
=
htmlspecialchars
(
$argv_raw
);
switch
(
htmlspecialchars
(
$argn
)
){
case
'notitle'
:
$notitle
=
true
;
case
'title'
:
$title
=
$argv
;
break
;
case
'header'
:
$headerlevel
=
(
int
)
$argv
;
break
;
case
'foldable'
:
if
(
$argv
==
'true'
)
$foldable
=
true
;
break
;
case
'name'
:
$name
=
$argv
;
default
:
break
;
}
}
//Catch omitted parameters
//TODO: Catch malformed parameters
if
(
!
isset
(
$notitle
)
)
$notitle
=
false
;
if
(
!
isset
(
$title
)
&&
!
$notitle
)
$title
=
"Section"
;
if
(
!
isset
(
$headerlevel
)
)
$headerlevel
=
2
;
if
(
!
isset
(
$foldable
)
)
$foldable
=
false
;
if
(
!
isset
(
$name
)
)
$name
=
""
;
//Start building output
$out
=
""
;
//Put up a section title if desired
if
(
!
$notitle
){
//Create =s
$header
=
""
;
for
(
$i
=
1
;
$i
<=
$headerlevel
;
$i
++
){
$header
.=
"="
;
}
//Append title
$out
.=
$header
.
" "
;
$out
.=
$title
;
$out
.=
" "
.
$header
.
"
\n
"
;
}
//Append actual content
$out
.=
$input
;
//Return the result
//$out_tmp = $parser->recursiveTagParse( $out, $frame );
//var_dump($out_tmp);
return
$parser
->
insertStripItem
(
$parser
->
recursiveTagParse
(
$out
,
$frame
),
$parser
->
mStripState
);
//return array( $out , 'noparse' => false );
}
File Metadata
Details
Attached
Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
9902
Default Alt Text
tag-code.php (1 KB)
Attached To
Mode
T47317: Sections generated by tag extension do not show up in TOC
Attached
Detach File
Event Timeline
Log In to Comment