BryanDavis has uploaded a new change for review.
https://gerrit.wikimedia.org/r/266081
Change subject: Cleanup code style of tool.php
......................................................................
Cleanup code style of tool.php
Apply MediaWiki coding style to tool.php
Change-Id: Iea20a1bb93665fcbde45aca0351ae3e8e520e1e4
---
M www/content/tool.php
1 file changed, 50 insertions(+), 42 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/labs/toollabs
refs/changes/81/266081/1
diff --git a/www/content/tool.php b/www/content/tool.php
index 69766d2..8a18b34 100644
--- a/www/content/tool.php
+++ b/www/content/tool.php
@@ -1,42 +1,50 @@
-<H1>Wikimedia Tool Labs</H1>
-Welcome to the Tool Labs project, the home of community-maintained external
tools supporting Wikimedia projects and their users.
- <?php $tool='';
- $g = posix_getgrnam("tools." . $_REQUEST['tool']);
- $u = posix_getpwnam("tools." . $_REQUEST['tool']);
- if($g and $u) {
- $tool = $_REQUEST['tool'];
- $maintainers = $g['members'];
- $home = $u['dir'];
- }
- if($tool != ''):
- ?>
- <H2>Tool details</H2>
- <TABLE CLASS="tool-info" COLS=2 WIDTH="95%">
- <TR><TH class="tool-name"><?php
- echo $tool;
- if(array_key_exists(0, glob("$home/public_html/index.*")))
- print "<br/><a href=\"/$tool/\">(Web interface)</a>";
- ?></TH><TD></TD></TR>
- <TR><TH>Description</TH>
- <TD><?php
- if(is_readable("$home/.description")) {
- $desc = file_get_contents("$home/.description", false, NULL, 0,
2048);
- print $purifier->purify($desc);
- }
- ?></TD></TR>
- <TR><TH>Maintainers</TH><TD><?php
- foreach($maintainers as $maint):
- $mu = posix_getpwnam($maint);
- if($mu):
- $wtu = $mu['gecos'];
- ?><A HREF="https://wikitech.wikimedia.org/wiki/User:<?= $wtu
?>"><?= ucfirst($wtu) ?></A> <?php
- else:
- echo ucfirst($maint), " ";
- endif;
- endforeach;
- ?><TD>
- </TD></TR>
- </TABLE>
- <?php else: ?>
- No such tool? Trying to guess, are you?
- <?php endif;
+<h1>Wikimedia Tool Labs</h1>
+<p>Welcome to the Tool Labs project, the home of community-maintained external
tools supporting Wikimedia projects and their users.</p>
+<?php
+$tool='';
+$g = posix_getgrnam( 'tools.' . $_REQUEST['tool'] );
+$u = posix_getpwnam( 'tools.' . $_REQUEST['tool'] );
+if ( $g && $u ) {
+ $tool = $_REQUEST['tool'];
+ $maintainers = $g['members'];
+ $home = $u['dir'];
+}
+if ( $tool !== '' ) {
+?>
+<h2>Tool details</h2>
+<table class="tool-info" cols="2" width="95%">
+<tr><th class="tool-name">
+<?php
+ echo htmlspecialchars( $tool );
+ if ( array_key_exists( 0, glob( "{$home}/public_html/index.*" ) ) ) {
+ echo '<br/><a href="/', urlencode( $tool ), '/">(Web
interface)</a>';
+ }
+?>
+</th><td></td></tr>
+<tr><th>Description</th>
+<td>
+<?php
+ if ( is_readable( "{$home}/.description" ) ) {
+ $desc = file_get_contents( "{$home}/.description", false, null,
0, 2048 );
+ print $purifier->purify( $desc );
+ }
+?>
+</td></tr>
+<tr><th>Maintainers</th><td>
+<?php
+ foreach ( $maintainers as $maint ) {
+ $mu = posix_getpwnam( $maint );
+ if ( $mu ) {
+ $wtu = $mu['gecos'];
+?>
+ <a href="https://wikitech.wikimedia.org/wiki/User:<?= urlencode( $wtu )
?>"><?= htmlspecialchars( ucfirst( $wtu ) ) ?></a>
+<?php
+ } else {
+ echo htmlspecialchars( ucfirst( $maint ) ), ' ';
+ }
+ }
+?>
+</td></tr></table>
+<?php } else { ?>
+<p>No such tool? Trying to guess, are you?</p>
+<?php }
--
To view, visit https://gerrit.wikimedia.org/r/266081
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iea20a1bb93665fcbde45aca0351ae3e8e520e1e4
Gerrit-PatchSet: 1
Gerrit-Project: labs/toollabs
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits