Changeset 1281
- Timestamp:
- 02/06/11 15:10:33 (2 years ago)
- Location:
- solr
- Files:
-
- 4 added
- 5 modified
-
files/lib/page/SolrSearchPage.class.php (modified) (5 diffs)
-
files/lib/util (added)
-
files/lib/util/SolrTemplateWrapperUtil.class.php (added)
-
optionals/de.easy-coding.wcf.opensearch/files/lib/page/SolrSearchSuggestionPage.class.php (added)
-
optionals/de.easy-coding.wcf.opensearch/templates/openSearch.tpl (modified) (1 diff)
-
package.xml (modified) (2 diffs)
-
templates/searchResultSolr.tpl (modified) (1 diff)
-
templates/solr.tpl (modified) (1 diff)
-
templates/solrAtom.tpl (added)
Legend:
- Unmodified
- Added
- Removed
-
solr/files/lib/page/SolrSearchPage.class.php
r1268 r1281 51 51 return $string; 52 52 } 53 54 /**55 * if the client is (or claims to be) connected via HTTPS56 * @return boolean57 */58 protected function isHTTPS() {59 return isset($_SERVER["HTTP_X_PROTO"]) ||60 (isset($_SERVER['HTTPS']) &&61 !empty($_SERVER['HTTPS']) &&62 $_SERVER['HTTPS'] !== 'off');63 }64 53 65 54 /** … … 117 106 $val = array_slice($val, 0, 20, true); 118 107 } 108 /* 109 if($key == 'type') { 110 $tmp = $val; 111 $val = array(); 112 foreach($tmp as $key => $value) { 113 $key = WCF::getLanguage()->get("wcf.search.type.".$key); 114 $val[$key] = $value; 115 } 116 }*/ 119 117 } 120 118 $this->facets = array_filter($facets); … … 182 180 */ 183 181 public function assignVariables() { 182 184 183 parent::assignVariables(); 184 185 if($this->templateName == 'solrAtom') { 186 require_once(WCF_DIR.'lib/util/SolrTemplateWrapperUtil.class.php'); 187 $this->messages = SolrTemplateWrapperUtil::parse($this->messages); 188 } 185 189 186 190 $additionalPagesParameters = array(); … … 190 194 191 195 WCF::getTPL()->assign(array( 196 'messages' => $this->messages, 192 197 'facets' => $this->facets, 193 198 'additionalPagesParameterString' => $additionalPagesParameters ? '&'.http_build_query($additionalPagesParameters) : '', … … 196 201 )); 197 202 } 203 204 /** 205 * @see Page::show() 206 */ 207 public function show() { 208 209 // overwrite template with atom format 210 if (isset($_REQUEST['format']) && $_REQUEST['format'] == 'atom') { 211 $this->templateName = 'solrAtom'; 212 } 213 if (isset($_REQUEST['num'])) $this->itemsPerPage = intval($_REQUEST['num']); 214 215 parent::show(); 216 217 // overwrite template with atom format 218 if (isset($_REQUEST['format']) && $_REQUEST['format'] == 'atom') { 219 header('Content-type: text/xml'); 220 } 221 } 198 222 } 199 223 ?> -
solr/optionals/de.easy-coding.wcf.opensearch/templates/openSearch.tpl
r1276 r1281 1 1 <?xml version="1.0" encoding="{@CHARSET}"?> 2 2 <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> 3 <ShortName> {@PAGE_TITLE}</ShortName>4 <Description> {@PAGE_TITLE} {lang}wcf.search.title{/lang}</Description>3 <ShortName><![CDATA[{lang}{@PAGE_TITLE}{/lang}]]></ShortName> 4 <Description><![CDATA[{lang}{@PAGE_TITLE}{/lang} {lang}wcf.search.title{/lang}]]></Description> 5 5 <Url type="text/html" template="{@PAGE_URL}/index.php?form=SolrSearch&q={literal}{searchTerms}{/literal}"/> 6 <Url type="application/atom+xml" template="{@PAGE_URL}/index.php?form=SolrSearch&format=atom&q={literal}{searchTerms}{/literal}"/> 7 <!-- <Url type="application/x-suggestions+json" template="{@PAGE_URL}/index.php?form=SolrSearchSuggestion&q={literal}{searchTerms}{/literal}"/> --> 6 8 </OpenSearchDescription> -
solr/package.xml
r1272 r1281 6 6 <packagedescription>Solr powered search client. Solr backend needed!</packagedescription> 7 7 <packagedescription language="de">Das Paket integriert ein Solr Search Interface. Es wird ein zusÀtzlicher Solr Server benötigt.</packagedescription> 8 <version>1.0.0 RC 3</version>8 <version>1.0.0 RC 4</version> 9 9 <plugin>com.woltlab.wcf</plugin> 10 10 <isunique>1</isunique> … … 44 44 <languages languagecode="en">en.xml</languages> 45 45 </instructions> 46 47 <instructions type="update" fromversion="1.0.0 RC 2">46 47 <instructions type="update" fromversion="1.0.0 RC 3"> 48 48 <files>files.tar</files> 49 49 <templates>templates.tar</templates> 50 <acptemplates>acptemplates.tar</acptemplates>51 <sql>update.sql</sql>52 50 53 51 <!-- languages --> -
solr/templates/searchResultSolr.tpl
r1190 r1281 15 15 16 16 <div class="messageFooter"> 17 <a href="{$item.message->url} " class="externalURL">{@$item.message->displayurl}</a>17 <a href="{$item.message->url}{@SID_ARG_2ND}" class="externalURL">{@$item.message->displayurl}</a> 18 18 </div> 19 19 <hr /> -
solr/templates/solr.tpl
r1268 r1281 110 110 <div class="containerHead"> 111 111 <h3>{lang}{$headline}{/lang}</h3> 112 </div> 112 </div> 113 113 114 114 <ul class="dataList">
