Index: trunk/extensions/Wikidata/WiktionaryZ/WiktionaryZ.php |
— | — | @@ -158,14 +158,6 @@ |
159 | 159 | |
160 | 160 | } |
161 | 161 | |
162 | | - function getExpressionForMeaningId($mid, $langcode) { |
163 | | - $dbr =& wfGetDB(DB_SLAVE); |
164 | | - $sql="SELECT spelling from uw_syntrans,uw_expression_ns where defined_meaning_id=".$mid." and uw_expression_ns.expression_id=uw_syntrans.expression_id and uw_expression_ns.language_id=".$langcode." limit 1"; |
165 | | - $sp_res=$dbr->query($sql); |
166 | | - $sp_row=$dbr->fetchObject($sp_res); |
167 | | - return $sp_row->spelling; |
168 | | - } |
169 | | - |
170 | 162 | function saveForm($sectionArguments) { |
171 | 163 | global |
172 | 164 | $wgTitle; |
— | — | @@ -485,7 +477,7 @@ |
486 | 478 | |
487 | 479 | function getAddRelationsFormFields($definedMeaningId) { |
488 | 480 | return '<h4>Add relation</h4> |
489 | | - <table> |
| 481 | + <table class="wiki-data-table"> |
490 | 482 | <tr><th>Relation type</th><th>Other defined meaning</th></tr> |
491 | 483 | <tr><td>' . $this->getRelationTypeSuggest($definedMeaningId) . '</td><td>' . $this->getDefinedMeaningSuggest($definedMeaningId) . '</td></tr> |
492 | 484 | </table>'; |
— | — | @@ -609,7 +601,7 @@ |
610 | 602 | $att_res=$dbr->query("select member_mid from uw_collection_contents where collection_id=$cid and is_latest_set=1"); |
611 | 603 | while($att_row=$dbr->fetchObject($att_res)) { |
612 | 604 | # fixme hardcoded English |
613 | | - $att_name=$this->getExpressionForMid($att_row->member_mid, 85); |
| 605 | + $att_name=$this->getExpressionForMeaningId($att_row->member_mid, 85); |
614 | 606 | $atts[$att_row->member_mid]=$att_name; |
615 | 607 | } |
616 | 608 | } |
— | — | @@ -622,22 +614,21 @@ |
623 | 615 | $col_res=$dbr->query("select collection_id,collection_mid from uw_collection_ns where collection_type=".$dbr->addQuotes($type)." and is_latest=1"); |
624 | 616 | while($col_row=$dbr->fetchObject($col_res)) { |
625 | 617 | # fixme hardcoded English |
626 | | - $collection_name=$this->getExpressionForMid($col_row->collection_mid,85); |
| 618 | + $collection_name=$this->getExpressionForMeaningId($col_row->collection_mid,85); |
627 | 619 | $typecollections[$collection_name]=$col_row->collection_id; |
628 | 620 | } |
629 | 621 | return $typecollections; |
630 | 622 | |
631 | 623 | } |
632 | 624 | |
633 | | - function getExpressionForMid($mid,$langcode) { |
| 625 | + function getExpressionForMeaningId($mid, $langcode) { |
634 | 626 | $dbr =& wfGetDB(DB_SLAVE); |
635 | 627 | $sql="SELECT spelling from uw_syntrans,uw_expression_ns where defined_meaning_id=".$mid." and uw_expression_ns.expression_id=uw_syntrans.expression_id and uw_expression_ns.language_id=".$langcode." limit 1"; |
636 | 628 | $sp_res=$dbr->query($sql); |
637 | 629 | $sp_row=$dbr->fetchObject($sp_res); |
638 | 630 | return $sp_row->spelling; |
639 | | - #return $sql; |
640 | 631 | } |
641 | | - |
| 632 | + |
642 | 633 | function addRelationFromRequest($definedMeaningId) { |
643 | 634 | global |
644 | 635 | $wgRequest; |
Index: trunk/extensions/Wikidata/WiktionaryZ/tmp/suggest.css |
— | — | @@ -6,6 +6,26 @@ |
7 | 7 | |
8 | 8 | /* Suggestion control */ |
9 | 9 | |
| 10 | +.wiki-data-table td .suggest-link {
|
| 11 | + display: block;
|
| 12 | +}
|
| 13 | +
|
| 14 | +.suggest-link {
|
| 15 | + border-width: 1px;
|
| 16 | + border-style: solid;
|
| 17 | + border-color: #7F9DB9;
|
| 18 | + padding-left: 4px;
|
| 19 | + padding-right: 4px;
|
| 20 | + padding-top: 1px;
|
| 21 | + padding-bottom: 0px;
|
| 22 | +}
|
| 23 | +
|
| 24 | +.suggest-link, .suggest-link:hover, .suggest-link:active, .suggest-link:visited {
|
| 25 | + color: #000000;
|
| 26 | + text-decoration: none;
|
| 27 | + white-space: nowrap;
|
| 28 | +}
|
| 29 | +
|
10 | 30 | .suggestion-row { |
11 | 31 | padding: 0px; |
12 | 32 | margin: 0px; |
Index: trunk/extensions/Wikidata/WiktionaryZ/forms.php |
— | — | @@ -45,7 +45,7 @@ |
46 | 46 | global |
47 | 47 | $dbr; |
48 | 48 | |
49 | | - $result = '<div class="suggest"><input type="hidden" id="'. $name .'-suggest-query" value="'. $query .'"/><input type="hidden" id="'. $name .'" name="'. $name .'" value=""/><a id="'. $name .'-suggest-link" href="#'. $name .'-suggest-div" onclick="suggestLinkClicked(this);" title="Click to change selection">No selection</a></div>'. |
| 49 | + $result = '<div class="suggest"><input type="hidden" id="'. $name .'-suggest-query" value="'. $query .'"/><input type="hidden" id="'. $name .'" name="'. $name .'" value=""/><a id="'. $name .'-suggest-link" class="suggest-link" href="#'. $name .'-suggest-div" onclick="suggestLinkClicked(this);" title="Click to change selection">No selection</a></div>'. |
50 | 50 | '<div style="position: relative"><div id="'. $name .'-suggest-div" style="position: absolute; left: 0px; top: 0px; border: 1px solid #000000; display: none; background-color: white; padding: 4px">' . |
51 | 51 | '<div><table><tr><td><input type="text" id="'. $name .'-suggest-text" autocomplete="off" onkeyup="suggestTextChanged(this)" style="width: 300px"></input></td><td><a id="'. $name .'-suggest-close" href="#'. $name . 'suggest-link" onclick="suggestCloseClicked(this)">[X]</a></td></tr></table></div>' . |
52 | 52 | '<div><table id="'. $name .'-suggest-table"><tr><td></td></tr></table></div>'. |