Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php |
— | — | @@ -17,16 +17,18 @@ |
18 | 18 | const DISABLE_AUTO_SUGGEST = false; |
19 | 19 | |
20 | 20 | /** |
21 | | - * Builds a read-only #ask of the given query |
| 21 | + * Builds a read-only #ask embed code of the given query. |
22 | 22 | * |
23 | 23 | * @return string |
24 | 24 | */ |
25 | 25 | protected function getAskEmbedBox() { |
26 | | - $result = '<div id="inlinequeryembed"> |
27 | | - <div id="inlinequeryembedinstruct">' . wfMsg( 'smw_ask_embed_instr' ) . '</div> |
28 | | - <textarea id="inlinequeryembedarea" readonly="yes" cols="20" rows="6" onclick="this.select()">' . |
29 | | - $this->m_ui_helper->getAsk() . '</textarea></div>'; |
30 | | - |
| 26 | + $result = ''; |
| 27 | + if ( $this->m_ui_helper->getQueryString() != "" ) { |
| 28 | + $result = Html::rawElement( 'div', array( 'id' => 'inlinequeryembed' ), |
| 29 | + Html::rawElement( 'div', array( 'id' => 'inlinequeryembedinstruct' ), wfMsg( 'smw_ask_embed_instr' ) ) . |
| 30 | + Html::element( 'textarea', array( 'id' => 'inlinequeryembedarea', 'readonly' => 'yes', 'cols' => '20', 'rows' => '6', 'onclick' => 'this.select()' ), |
| 31 | + $this->m_ui_helper->getAsk() ) ); |
| 32 | + } |
31 | 33 | return $result; |
32 | 34 | } |
33 | 35 | |
— | — | @@ -1361,5 +1363,5 @@ |
1362 | 1364 | return false; |
1363 | 1365 | } |
1364 | 1366 | } |
1365 | | - |
| 1367 | + |
1366 | 1368 | } |