r21401 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r21400‎ | r21401 | r21402 >
Date:08:20, 20 April 2007
Author:mkroetzsch
Status:old
Tags:
Comment:
Disabled deprecated special page and provided links to new specials that replacing functionality.
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchTriple.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchTriple.php
@@ -19,7 +19,7 @@
2020 require_once( "$IP/includes/SpecialPage.php" );
2121
2222 function doSpecialSearchTriple($par = null) {
23 - global $wgOut, $wgRequest;
 23+ global $wgOut, $wgRequest, $wgUser;
2424
2525 $out = '';
2626 $searchtype = $wgRequest->getVal('do');
@@ -32,6 +32,15 @@
3333 $relation = ucfirst($relation);
3434 $attribute = ucfirst($attribute);
3535
 36+
 37+ $sk =& $wgUser->getSkin();
 38+ $out .= '<h2>' . wfMsg('redirectpagesub') . '</h2>';
 39+ $out .= '<ul><li>' . $sk->makeKnownLinkObj(Title::newFromText('Browse',NS_SPECIAL), wfMsg('browse') ) . '</li>';
 40+ $out .= '<li>' . $sk->makeKnownLinkObj(Title::newFromText('SearchByRelation',NS_SPECIAL), wfMsg('searchbyrelation') ) . '</li>';
 41+ $out .= '<li>' . $sk->makeKnownLinkObj(Title::newFromText('SearchByAttribute',NS_SPECIAL), wfMsg('searchbyattribute') ) . '</li>';
 42+ $out .= '<li>' . $sk->makeKnownLinkObj(Title::newFromText('Ask',NS_SPECIAL), wfMsg('ask') ) . '</li></ul>';
 43+ $out .= '<br /><br /><div style="border: 1px solid grey; padding: 20px; background: #DDD; ">';
 44+
3645 $out .= SMWSpecialSearchTriple::getSearchForm($subject, $relation, $object, $attribute, $value, $searchtype);
3746 // find out what the user wants:
3847 if ( ($searchtype==wfMsg('smw_searchtriple_searchatt')) || ($searchtype=='Search Attributes')) {
@@ -43,6 +52,7 @@
4453 } // else: just don't do anything
4554
4655 $wgOut->setPageTitle(wfMsg('searchtriple'));
 56+ $out .= '</div>';
4757 $wgOut->addHTML($out);
4858 }
4959
@@ -66,7 +76,7 @@
6777 // '<input id="rel" type="radio" name="searchtype" value="relation" checked="checked" /><label for="rel">Relation</label>'.
6878 // '<input id="att" type="radio" name="searchtype" value="attribute" checked="checked" /><label for="att">Attribute</label>';
6979
70 - $form .= '<table summary="layout table" style="padding: 4px 5px; border:0px; border-collapse:collapse;">' . "\n";
 80+ $form .= '<table summary="layout table" style="padding: 4px 5px; border:0px; border-collapse:collapse; background: none; ">' . "\n";
7181 //line 1 and 2: search for relations
7282 $form .= '<tr>' . "\n";
7383 $form .= '<td>' . wfMsg('smw_searchtriple_subject') . '</td>' . "\n";
@@ -75,10 +85,10 @@
7686 $form .= '<td></td>' . "\n";
7787 $form .= '</tr>' . "\n";
7888 $form .= '<tr>' . "\n";
79 - $form .= '<td><input type="text" name="subject" value="' . htmlspecialchars($subject) . '"/></td>' . "\n";
80 - $form .= '<td><input type="text" name="relation" value="' . htmlspecialchars($relation) . '"/></td>' . "\n";
81 - $form .= '<td><input type="text" name="object" value="' . htmlspecialchars($object) . '"/></td>' . "\n";
82 - $form .= '<td><input type="submit" name="do" value="' . wfMsg('smw_searchtriple_searchrel') . '"/></td>' . "\n";
 89+ $form .= '<td><input disabled="disabled" type="text" name="subject" value="' . htmlspecialchars($subject) . '"/></td>' . "\n";
 90+ $form .= '<td><input disabled="disabled" type="text" name="relation" value="' . htmlspecialchars($relation) . '"/></td>' . "\n";
 91+ $form .= '<td><input disabled="disabled" type="text" name="object" value="' . htmlspecialchars($object) . '"/></td>' . "\n";
 92+ $form .= '<td><input disabled="disabled" type="submit" name="do" value="' . wfMsg('smw_searchtriple_searchrel') . '"/></td>' . "\n";
8393 $form .= '</tr>' . "\n";
8494 //line 3 and 4: search for attributes
8595 $form .= '<tr>' . "\n";
@@ -89,9 +99,9 @@
90100 $form .= '</tr>' . "\n";
91101 $form .= '<tr>' . "\n";
92102 $form .= '<td></td>' . "\n";
93 - $form .= '<td><input type="text" name="attribute" value="' . htmlspecialchars($attribute) . '"/></td>' . "\n";
94 - $form .= '<td><input type="text" name="value" value="' . htmlspecialchars($value) . '"/></td>' . "\n";
95 - $form .= '<td><input type="submit" name="do" value="' . wfMsg('smw_searchtriple_searchatt') . '"/></td>' . "\n";
 103+ $form .= '<td><input disabled="disabled" type="text" name="attribute" value="' . htmlspecialchars($attribute) . '"/></td>' . "\n";
 104+ $form .= '<td><input disabled="disabled" type="text" name="value" value="' . htmlspecialchars($value) . '"/></td>' . "\n";
 105+ $form .= '<td><input disabled="disabled" type="submit" name="do" value="' . wfMsg('smw_searchtriple_searchatt') . '"/></td>' . "\n";
96106 $form .= '</tr>' . "\n";
97107 $form .= "</table> \n </form> \n <br/><hr/> \n";
98108

Status & tagging log