A lot of the linking/attribute generation stuff has been split into Linker class
This commit is contained in:
@@ -69,7 +69,7 @@ class GCL3Template extends QuickTemplate {
|
|||||||
$smf_head = str_replace('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
$smf_head = str_replace('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml"><head>',"",$smf_head);
|
<html xmlns="http://www.w3.org/1999/xhtml"><head>',"",$smf_head);
|
||||||
$mw_head = str_replace("</head>",$smf_head,$mw_head);
|
$mw_head = str_replace("</head>",$smf_head,$mw_head);
|
||||||
|
|
||||||
echo $mw_head;
|
echo $mw_head;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -138,7 +138,7 @@ class GCL3Template extends QuickTemplate {
|
|||||||
}
|
}
|
||||||
$new_title = implode("/",$linkzor2);
|
$new_title = implode("/",$linkzor2);
|
||||||
foreach($this->data['content_actions'] as $key => $tab) {
|
foreach($this->data['content_actions'] as $key => $tab) {
|
||||||
$linx[] = '<a href="'.htmlspecialchars($tab['href']).'"'.$skin->tooltipAndAccesskeyAttribs('ca-'.$key).'>'.htmlspecialchars($tab['text']).'</a>';
|
$linx[] = '<a href="'.htmlspecialchars($tab['href']).'"'.Linker::tooltipAndAccesskeyAttribs('ca-'.$key).'>'.htmlspecialchars($tab['text']).'</a>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<?php begin_box3($this,$new_title,implode($linx," | ")); ?>
|
<?php begin_box3($this,$new_title,implode($linx," | ")); ?>
|
||||||
@@ -187,9 +187,9 @@ class GCL3Template extends QuickTemplate {
|
|||||||
# used for editing in Safari.
|
# used for editing in Safari.
|
||||||
if( in_array( $action, array( 'edit', 'submit' ) )
|
if( in_array( $action, array( 'edit', 'submit' ) )
|
||||||
&& in_array( $key, array( 'edit', 'watch', 'unwatch' ))) {
|
&& in_array( $key, array( 'edit', 'watch', 'unwatch' ))) {
|
||||||
echo $skin->tooltip( "ca-$key" );
|
echo Linker::tooltip( "ca-$key" );
|
||||||
} else {
|
} else {
|
||||||
echo $skin->tooltipAndAccesskeyAttribs( "ca-$key" );
|
echo Linker::tooltipAndAccesskeyAttribs( "ca-$key" );
|
||||||
}
|
}
|
||||||
echo '>'.htmlspecialchars($tab['text']).'</a></li>';
|
echo '>'.htmlspecialchars($tab['text']).'</a></li>';
|
||||||
} ?>
|
} ?>
|
||||||
@@ -204,7 +204,7 @@ class GCL3Template extends QuickTemplate {
|
|||||||
<?php foreach($this->data['personal_urls'] as $key => $item) { ?>
|
<?php foreach($this->data['personal_urls'] as $key => $item) { ?>
|
||||||
<li id="<?php echo Sanitizer::escapeId( "pt-$key" ) ?>"<?php
|
<li id="<?php echo Sanitizer::escapeId( "pt-$key" ) ?>"<?php
|
||||||
if ($item['active']) { ?> class="active"<?php } ?>><a href="<?php
|
if ($item['active']) { ?> class="active"<?php } ?>><a href="<?php
|
||||||
echo htmlspecialchars($item['href']) ?>"<?php echo $skin->tooltipAndAccesskeyAttribs('pt-'.$key) ?><?php
|
echo htmlspecialchars($item['href']) ?>"<?php echo Linker::tooltipAndAccesskeyAttribs('pt-'.$key) ?><?php
|
||||||
if(!empty($item['class'])) { ?> class="<?php
|
if(!empty($item['class'])) { ?> class="<?php
|
||||||
echo htmlspecialchars($item['class']) ?>"<?php } ?>><?php
|
echo htmlspecialchars($item['class']) ?>"<?php } ?>><?php
|
||||||
echo htmlspecialchars($item['text']) ?></a></li>
|
echo htmlspecialchars($item['text']) ?></a></li>
|
||||||
@@ -215,7 +215,7 @@ class GCL3Template extends QuickTemplate {
|
|||||||
<div class="portlet" id="p-logo">
|
<div class="portlet" id="p-logo">
|
||||||
<a style="background-image: url(<?php $this->text('logopath') ?>);" <?php
|
<a style="background-image: url(<?php $this->text('logopath') ?>);" <?php
|
||||||
?>href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>"<?php
|
?>href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>"<?php
|
||||||
echo $skin->tooltipAndAccesskeyAttribs('p-logo') ?>></a>
|
echo Linker::tooltipAndAccesskeyAttribs('p-logo') ?>></a>
|
||||||
</div>
|
</div>
|
||||||
<script type="<?php $this->text('jsmimetype') ?>"> if (window.isMSIE55) fixalpha(); </script>
|
<script type="<?php $this->text('jsmimetype') ?>"> if (window.isMSIE55) fixalpha(); </script>
|
||||||
|
|
||||||
@@ -282,12 +282,12 @@ if($this->data['copyrightico']) { ?>
|
|||||||
isset( $this->data['search'] ) ? $this->data['search'] : '', 'search',
|
isset( $this->data['search'] ) ? $this->data['search'] : '', 'search',
|
||||||
array(
|
array(
|
||||||
'id' => 'searchInput',
|
'id' => 'searchInput',
|
||||||
'title' => $this->skin->titleAttrib( 'search' ),
|
'title' => Linker::titleAttrib( 'search' ),
|
||||||
'accesskey' => $this->skin->accesskey( 'search' )
|
'accesskey' => Linker::accesskey( 'search' )
|
||||||
) ); ?>
|
) ); ?>
|
||||||
|
|
||||||
<input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg('searcharticle') ?>"<?php echo $this->skin->tooltipAndAccesskeyAttribs( 'search-go' ); ?> /><?php if ($wgUseTwoButtonsSearchForm) { ?>
|
<input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg('searcharticle') ?>"<?php echo Linker::tooltipAndAccesskeyAttribs( 'search-go' ); ?> /><?php if ($wgUseTwoButtonsSearchForm) { ?>
|
||||||
<input type='submit' name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg('searchbutton') ?>"<?php echo $this->skin->tooltipAndAccesskeyAttribs( 'search-fulltext' ); ?> /><?php } else { ?>
|
<input type='submit' name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg('searchbutton') ?>"<?php echo Linker::tooltipAndAccesskeyAttribs( 'search-fulltext' ); ?> /><?php } else { ?>
|
||||||
|
|
||||||
<div><a href="<?php $this->text('searchaction') ?>" rel="search"><?php $this->msg('powersearch-legend') ?></a></div><?php } ?>
|
<div><a href="<?php $this->text('searchaction') ?>" rel="search"><?php $this->msg('powersearch-legend') ?></a></div><?php } ?>
|
||||||
|
|
||||||
@@ -309,23 +309,23 @@ if($this->data['copyrightico']) { ?>
|
|||||||
if($this->data['notspecialpage']) { ?>
|
if($this->data['notspecialpage']) { ?>
|
||||||
<li id="t-whatlinkshere"><a href="<?php
|
<li id="t-whatlinkshere"><a href="<?php
|
||||||
echo htmlspecialchars($this->data['nav_urls']['whatlinkshere']['href'])
|
echo htmlspecialchars($this->data['nav_urls']['whatlinkshere']['href'])
|
||||||
?>"<?php echo $this->skin->tooltipAndAccesskeyAttribs('t-whatlinkshere') ?>><?php $this->msg('whatlinkshere') ?></a></li>
|
?>"<?php echo Linker::tooltipAndAccesskeyAttribs('t-whatlinkshere') ?>><?php $this->msg('whatlinkshere') ?></a></li>
|
||||||
<?php
|
<?php
|
||||||
if( $this->data['nav_urls']['recentchangeslinked'] ) { ?>
|
if( $this->data['nav_urls']['recentchangeslinked'] ) { ?>
|
||||||
<li id="t-recentchangeslinked"><a href="<?php
|
<li id="t-recentchangeslinked"><a href="<?php
|
||||||
echo htmlspecialchars($this->data['nav_urls']['recentchangeslinked']['href'])
|
echo htmlspecialchars($this->data['nav_urls']['recentchangeslinked']['href'])
|
||||||
?>"<?php echo $this->skin->tooltipAndAccesskeyAttribs('t-recentchangeslinked') ?>><?php $this->msg('recentchangeslinked-toolbox') ?></a></li>
|
?>"<?php echo Linker::tooltipAndAccesskeyAttribs('t-recentchangeslinked') ?>><?php $this->msg('recentchangeslinked-toolbox') ?></a></li>
|
||||||
<?php }
|
<?php }
|
||||||
}
|
}
|
||||||
if( isset( $this->data['nav_urls']['trackbacklink'] ) && $this->data['nav_urls']['trackbacklink'] ) { ?>
|
if( isset( $this->data['nav_urls']['trackbacklink'] ) && $this->data['nav_urls']['trackbacklink'] ) { ?>
|
||||||
<li id="t-trackbacklink"><a href="<?php
|
<li id="t-trackbacklink"><a href="<?php
|
||||||
echo htmlspecialchars($this->data['nav_urls']['trackbacklink']['href'])
|
echo htmlspecialchars($this->data['nav_urls']['trackbacklink']['href'])
|
||||||
?>"<?php echo $this->skin->tooltipAndAccesskeyAttribs('t-trackbacklink') ?>><?php $this->msg('trackbacklink') ?></a></li>
|
?>"<?php echo Linker::tooltipAndAccesskeyAttribs('t-trackbacklink') ?>><?php $this->msg('trackbacklink') ?></a></li>
|
||||||
<?php }
|
<?php }
|
||||||
if($this->data['feeds']) { ?>
|
if($this->data['feeds']) { ?>
|
||||||
<li id="feedlinks"><?php foreach($this->data['feeds'] as $key => $feed) {
|
<li id="feedlinks"><?php foreach($this->data['feeds'] as $key => $feed) {
|
||||||
?><a id="<?php echo Sanitizer::escapeId( "feed-$key" ) ?>" href="<?php
|
?><a id="<?php echo Sanitizer::escapeId( "feed-$key" ) ?>" href="<?php
|
||||||
echo htmlspecialchars($feed['href']) ?>" rel="alternate" type="application/<?php echo $key ?>+xml" class="feedlink"<?php echo $this->skin->tooltipAndAccesskeyAttribs('feed-'.$key) ?>><?php echo htmlspecialchars($feed['text'])?></a>
|
echo htmlspecialchars($feed['href']) ?>" rel="alternate" type="application/<?php echo $key ?>+xml" class="feedlink"<?php echo Linker::tooltipAndAccesskeyAttribs('feed-'.$key) ?>><?php echo htmlspecialchars($feed['text'])?></a>
|
||||||
<?php } ?></li><?php
|
<?php } ?></li><?php
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -333,20 +333,20 @@ if($this->data['copyrightico']) { ?>
|
|||||||
|
|
||||||
if($this->data['nav_urls'][$special]) {
|
if($this->data['nav_urls'][$special]) {
|
||||||
?><li id="t-<?php echo $special ?>"><a href="<?php echo htmlspecialchars($this->data['nav_urls'][$special]['href'])
|
?><li id="t-<?php echo $special ?>"><a href="<?php echo htmlspecialchars($this->data['nav_urls'][$special]['href'])
|
||||||
?>"<?php echo $this->skin->tooltipAndAccesskeyAttribs('t-'.$special) ?>><?php $this->msg($special) ?></a></li>
|
?>"<?php echo Linker::tooltipAndAccesskeyAttribs('t-'.$special) ?>><?php $this->msg($special) ?></a></li>
|
||||||
<?php }
|
<?php }
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($this->data['nav_urls']['print']['href'])) { ?>
|
if(!empty($this->data['nav_urls']['print']['href'])) { ?>
|
||||||
<li id="t-print"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['print']['href'])
|
<li id="t-print"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['print']['href'])
|
||||||
?>" rel="alternate"<?php echo $this->skin->tooltipAndAccesskeyAttribs('t-print') ?>><?php $this->msg('printableversion') ?></a></li><?php
|
?>" rel="alternate"<?php echo Linker::tooltipAndAccesskeyAttribs('t-print') ?>><?php $this->msg('printableversion') ?></a></li><?php
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($this->data['nav_urls']['permalink']['href'])) { ?>
|
if(!empty($this->data['nav_urls']['permalink']['href'])) { ?>
|
||||||
<li id="t-permalink"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['permalink']['href'])
|
<li id="t-permalink"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['permalink']['href'])
|
||||||
?>"<?php echo $this->skin->tooltipAndAccesskeyAttribs('t-permalink') ?>><?php $this->msg('permalink') ?></a></li><?php
|
?>"<?php echo Linker::tooltipAndAccesskeyAttribs('t-permalink') ?>><?php $this->msg('permalink') ?></a></li><?php
|
||||||
} elseif ($this->data['nav_urls']['permalink']['href'] === '') { ?>
|
} elseif ($this->data['nav_urls']['permalink']['href'] === '') { ?>
|
||||||
<li id="t-ispermalink"<?php echo $this->skin->tooltip('t-ispermalink') ?>><?php $this->msg('permalink') ?></li><?php
|
<li id="t-ispermalink"<?php echo Linker::tooltip('t-ispermalink') ?>><?php $this->msg('permalink') ?></li><?php
|
||||||
}
|
}
|
||||||
|
|
||||||
wfRunHooks( 'GCL3TemplateToolboxEnd', array( &$this ) );
|
wfRunHooks( 'GCL3TemplateToolboxEnd', array( &$this ) );
|
||||||
@@ -362,7 +362,7 @@ if($this->data['copyrightico']) { ?>
|
|||||||
/*************************************************************************************************/
|
/*************************************************************************************************/
|
||||||
function languageBox() {
|
function languageBox() {
|
||||||
if( $this->data['language_urls'] ) {
|
if( $this->data['language_urls'] ) {
|
||||||
?>
|
?>
|
||||||
<?php begin_box("Languages"); ?>
|
<?php begin_box("Languages"); ?>
|
||||||
<div id="p-lang" class="portlet">
|
<div id="p-lang" class="portlet">
|
||||||
<div class="pBody">
|
<div class="pBody">
|
||||||
@@ -383,14 +383,14 @@ if($this->data['copyrightico']) { ?>
|
|||||||
function customBox( $bar, $cont ) {
|
function customBox( $bar, $cont ) {
|
||||||
?>
|
?>
|
||||||
<?php begin_box($bar); ?>
|
<?php begin_box($bar); ?>
|
||||||
<div class='generated-sidebar portlet' id='<?php echo Sanitizer::escapeId( "p-$bar" ) ?>'<?php echo $this->skin->tooltip('p-'.$bar) ?>>
|
<div class='generated-sidebar portlet' id='<?php echo Sanitizer::escapeId( "p-$bar" ) ?>'<?php echo Linker::tooltip('p-'.$bar) ?>>
|
||||||
<div class='pBody'>
|
<div class='pBody'>
|
||||||
<?php if ( is_array( $cont ) ) { ?>
|
<?php if ( is_array( $cont ) ) { ?>
|
||||||
<ul>
|
<ul>
|
||||||
<?php foreach($cont as $key => $val) { ?>
|
<?php foreach($cont as $key => $val) { ?>
|
||||||
<li id="<?php echo Sanitizer::escapeId($val['id']) ?>"<?php
|
<li id="<?php echo Sanitizer::escapeId($val['id']) ?>"<?php
|
||||||
if ( $val['active'] ) { ?> class="active" <?php }
|
if ( $val['active'] ) { ?> class="active" <?php }
|
||||||
?>><a href="<?php echo htmlspecialchars($val['href']) ?>"<?php echo $this->skin->tooltipAndAccesskeyAttribs($val['id']) ?>><?php echo htmlspecialchars($val['text']) ?></a></li>
|
?>><a href="<?php echo htmlspecialchars($val['href']) ?>"<?php echo Linker::tooltipAndAccesskeyAttribs($val['id']) ?>><?php echo htmlspecialchars($val['text']) ?></a></li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</ul>
|
</ul>
|
||||||
<?php } else {
|
<?php } else {
|
||||||
@@ -456,4 +456,3 @@ echo <<<THERE
|
|||||||
</td></tr></table><br />
|
</td></tr></table><br />
|
||||||
THERE;
|
THERE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user