Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php |
— | — | @@ -925,11 +925,11 @@ |
926 | 926 | '</span><strong>' . |
927 | 927 | wfMsg( 'smw_qui_rescol' ) . |
928 | 928 | '</strong></span>' . |
929 | | - Xml::input( "maincol_label[$i]", |
930 | | - '25', |
| 929 | + Html::hidden( "maincol_label[$i]", |
931 | 930 | $mainColumnLabels[$key], |
932 | 931 | array ( 'id' => "maincol_label$i" ) |
933 | 932 | ) . " " . |
| 933 | + '<a class="smwq-more" href="javascript:smw_makeQueryMatchesDialog(\'' . $i . '\')">' . wfMsg( 'smw_qui_options' ) . '</a> ' . |
934 | 934 | '</div>'; |
935 | 935 | $urlArgs["maincol_label[$i]"] = |
936 | 936 | ( $mainColumnLabels[$key] == '' ) ? ' ':$mainColumnLabels[$key]; |
— | — | @@ -997,7 +997,7 @@ |
998 | 998 | '</a>' . |
999 | 999 | '</span><strong>' . |
1000 | 1000 | wfMsg( 'smw_qui_rescol' ) . '</strong></span>' . |
1001 | | - Xml::input( "maincol_label_num", '25' ) . " " . |
| 1001 | + Html::hidden( "maincol_label_num", '' ) . " " . |
1002 | 1002 | Xml::closeElement( 'div' ); |
1003 | 1003 | $hiddenMainColumn = json_encode( $hiddenMainColumn ); |
1004 | 1004 | |
— | — | @@ -1068,12 +1068,17 @@ |
1069 | 1069 | '<tr><td>' . $categoryNoHtml[0] . '</td><td>' . $categoryNoHtml[1] . '</td></tr>' . |
1070 | 1070 | '</table>' . |
1071 | 1071 | Xml::closeElement( 'div' ); |
1072 | | - $mainLabelDialogBox = Xml::openElement( 'div', |
1073 | | - array( 'id' => 'mainlabel-dialog', |
| 1072 | + |
| 1073 | + // Create dialog box for QueryMatches |
| 1074 | + $mainResLabelHtml = Xml::inputLabelSep( wfMsg( 'smw_qui_dlabel' ), '', 'd-mainres-label' ); |
| 1075 | + $mainResDialogBox = Xml::openElement( 'div', |
| 1076 | + array( 'id' => 'mainres-dialog', |
1074 | 1077 | 'title' => wfMsg( 'smw_qui_mainlabopts' ), |
1075 | 1078 | 'class' => 'smwmainlabdialog' ) |
1076 | 1079 | ) . |
1077 | | - Xml::inputLabel( wfMsg( 'smw_qui_dlabel' ), '', 'd-mainlabel-label' ) . |
| 1080 | + '<table align="center">' . |
| 1081 | + '<tr><td>' . $mainResLabelHtml[0] . '</td><td>' . $mainResLabelHtml[1] . '</td></tr>' . |
| 1082 | + '</table>' . |
1078 | 1083 | Xml::closeElement( 'div' ); |
1079 | 1084 | |
1080 | 1085 | $result .= '<div id="sorting_main"></div>' . "\n"; |
— | — | @@ -1157,6 +1162,13 @@ |
1158 | 1163 | jQuery('#mainlabel-dialog').dialog("open"); |
1159 | 1164 | } |
1160 | 1165 | |
| 1166 | + function smw_makeQueryMatchesDialog( qm_id ){ |
| 1167 | + qmLabel=jQuery('#maincol_label'+qm_id).attr('value'); |
| 1168 | + jQuery('#d-mainres-label').attr('value', qmLabel); |
| 1169 | + jQuery( '#mainres-dialog' ).dialog.sortid = qm_id; |
| 1170 | + jQuery( '#mainres-dialog' ).dialog( 'open' ); |
| 1171 | + } |
| 1172 | + |
1161 | 1173 | function smw_makeCatDialog( cat_id ){ |
1162 | 1174 | jQuery( '#prop-cat input' ).attr('value',''); |
1163 | 1175 | |
— | — | @@ -1319,6 +1331,7 @@ |
1320 | 1332 | jQuery('$hiddenMainColumn').appendTo(document.body); |
1321 | 1333 | jQuery('$propertyDialogBox').appendTo(document.body); |
1322 | 1334 | jQuery('$categoryDialogBox').appendTo(document.body); |
| 1335 | + jQuery('$mainResDialogBox').appendTo(document.body); |
1323 | 1336 | |
1324 | 1337 | jQuery( '#mainlabel-dialog' ).dialog( { |
1325 | 1338 | autoOpen: false, |
— | — | @@ -1336,6 +1349,24 @@ |
1337 | 1350 | } |
1338 | 1351 | } ); |
1339 | 1352 | |
| 1353 | + jQuery( '#mainres-dialog' ).dialog( { |
| 1354 | + autoOpen: false, |
| 1355 | + modal: true, |
| 1356 | + resizable: true, |
| 1357 | + minWidth: 400, |
| 1358 | + buttons: { |
| 1359 | + "{$okMsg}": function(){ |
| 1360 | + id = jQuery( this ).dialog.sortid; |
| 1361 | + label = jQuery('#d-mainres-label'); |
| 1362 | + jQuery('#maincol_label'+id).attr('value', label); |
| 1363 | + jQuery(this).dialog("close"); |
| 1364 | + }, |
| 1365 | + "{$cancelMsg}": function(){ |
| 1366 | + jQuery(this).dialog("close"); |
| 1367 | + } |
| 1368 | + } |
| 1369 | + } ); |
| 1370 | + |
1340 | 1371 | jQuery( '#cat-dialog' ).dialog( { |
1341 | 1372 | autoOpen: false, |
1342 | 1373 | modal: true, |