Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F4648
Intersection-DynamicPageList.diff
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 10:03 PM
2014-11-21 22:03:01 (UTC+0)
Size
2 KB
Referenced Files
None
Subscribers
None
Intersection-DynamicPageList.diff
View Options
Index: intersection/DynamicPageList.php
===================================================================
--- intersection/DynamicPageList.php (revisjon 33116)
+++ intersection/DynamicPageList.php (arbeidskopi)
@@ -62,6 +62,8 @@
// The callback function for converting the input text to HTML output
function DynamicPageList( $input ) {
+ global $wgParser;
+ global $wgMessageCache;
global $wgUser;
global $wgLang;
global $wgContLang;
@@ -70,6 +72,7 @@
$aParams = array();
$bCountSet = false;
+ $bLinkObject = true;
$sStartList = '<ul>';
$sEndList = '</ul>';
@@ -160,12 +163,28 @@
$sEndItem = '</li>';
break;
case 'unordered':
- default:
$sStartList = '<ul>';
$sEndList = '</ul>';
$sStartItem = '<li>';
$sEndItem = '</li>';
break;
+ default:
+ if ($sArg) {
+ $tpl = $wgMessageCache->getMsgFromNamespace('Intersection-' . $sArg);
+ if (!$tpl) $tpl = '<' . $sArg . '>';
+ $sStartList = '';
+ $sEndList = '';
+ $sStartItem = '{{' . $tpl . '|';
+ $sEndItem = '}}';
+ $bLinkObject = false;
+ }
+ else {
+ $sStartList = '<ul>';
+ $sEndList = '</ul>';
+ $sStartItem = '<li>';
+ $sEndItem = '</li>';
+ }
+ break;
}
}
else if ('order' == $sType)
@@ -367,18 +386,28 @@
while ($row = $dbr->fetchObject( $res ) ) {
$title = Title::makeTitle( $row->page_namespace, $row->page_title);
$output .= $sStartItem;
- if (true == $bAddFirstCategoryDate)
- $output .= $wgLang->date($row->cl_timestamp) . ': ';
- if (true == $bShowNamespace)
- $output .= $sk->makeKnownLinkObj($title);
- else
- $output .= $sk->makeKnownLinkObj($title, htmlspecialchars($title->getText()));
+ if (true == $bLinkObject) {
+ if (true == $bAddFirstCategoryDate)
+ $output .= $wgLang->date($row->cl_timestamp) . ': ';
+ if (true == $bShowNamespace)
+ $output .= $sk->makeKnownLinkObj($title);
+ else
+ $output .= $sk->makeKnownLinkObj($title, htmlspecialchars($title->getText()));
+ }
+ else {
+ if (true == $bShowNamespace)
+ $output .= $title;
+ else
+ $output .= $title->getText();
+ if (true == $bAddFirstCategoryDate)
+ $output .= '|' . $wgLang->date($row->cl_timestamp);
+ }
$output .= $sEndItem . "\n";
}
//end unordered list
$output .= $sEndList . "\n";
- return $output;
+ return (true == $bLinkObject ? $output : $wgParser->recursiveTagParse($output));
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4213
Default Alt Text
Intersection-DynamicPageList.diff (2 KB)
Attached To
Mode
T15692: Use of templates in intersections
Attached
Detach File
Event Timeline
Log In to Comment