Index: trunk/extensions/Wikidata/Wikidata.i18n.php |
— | — | @@ -85,6 +85,9 @@ |
86 | 86 | 'ow_exporttsv_export_failed' => 'Export failed', |
87 | 87 | |
88 | 88 | 'addcollection' => 'Wikidata: Add collection', |
| 89 | + 'ow_searchnoresult' => "<p>You may:<br /> |
| 90 | +* '''Create the expression \"[[Expression:\$1]]\"''' (and add a definition)<br /> |
| 91 | +* '''Create the page \"[[:\$1]]\"''' (a standard wiki page)</p>", |
89 | 92 | 'ow_save' => 'Save', |
90 | 93 | 'ow_history' => 'History', |
91 | 94 | 'ow_datasets' => 'Data-set selection', |
Index: trunk/extensions/Wikidata/OmegaWiki/WikiDataGlobals.php |
— | — | @@ -131,4 +131,20 @@ |
132 | 132 | * |
133 | 133 | */ |
134 | 134 | $wgPropertyToColumnFilters = array(); |
| 135 | + |
| 136 | +// Hook: replace the proposition to "create new page" by a custom, allowing to create new expression as well |
| 137 | +$wgHooks[ 'SpecialSearchNogomatch' ][] = 'owNoGoMatchHook'; |
| 138 | + |
| 139 | +function owNoGoMatchHook( &$title ) { |
| 140 | + global $wgOut,$wgDisableTextSearch; |
| 141 | + $wgOut->addWikiMsg( 'search-nonefound' ); |
| 142 | + $wgOut->addWikiMsg( 'ow_searchnoresult', wfEscapeWikiText( $title ) ); |
| 143 | +// $wgOut->addWikiMsg( 'ow_searchnoresult', $title ); |
| 144 | + |
| 145 | + $wgDisableTextSearch = true ; |
| 146 | + return true; |
| 147 | +} |
| 148 | + |
| 149 | + |
| 150 | + |
135 | 151 | ?> |