<?php
/* --------------------------------------------------------------
GMOpenSearch.php 2008-08-07 gambio
Gambio OHG
http://www.gambio.de
Copyright (c) 2008 Gambio OHG
Released under the GNU General Public License (Version 2)
[http://www.gnu.org/licenses/gpl-2.0.html]
--------------------------------------------------------------
// add on put this to your header.php
// bof gm opensearch
if(gm_get_conf('GM_OPENSEARCH') == 1) {
require_once(DIR_FS_CATALOG . 'gm/classes/GMLogoManager.php');
require_once(DIR_FS_CATALOG . 'admin/gm/classes/GMOpenSearch.php');
$opensearch = new GMOpenSearch();
$opensearch->create(true);
echo '<link rel="search" type="application/opensearchdescription+xml" href="' . HTTP_SERVER . DIR_WS_CATALOG . $_SESSION['languages_id'] . '_opensearch.xml' . '" title="' . gm_get_content('GM_OPENSEARCH_TITLE', $_SESSION['languages_id']) . '" />';
} // eof gm opensearch
*/
?><?php
class GMOpenSearch {
/*
* -> !shortname, must contain 16 or fewer characters of plain text
*/
var $shortname;
/*
* -> longname, must contain 48 or fewer characters of plain text
*/
var $longname;
/*
* -> !tags, must contain 256 or fewer characters of plain text
*/
var $tags;
/*
* -> !description, must contain 1024 or fewer characters of plain text.
*/
var $description;
/*
* -> contact, an valid e-mail-adress
*/
var $contact;
/*
* -> xmlns spec of the root node of the OpenSearch description document
*/
var $xmlns = 'http://a9.com/-/spec/opensearch/1.1/';
/*
* -> kind of xml encoding - e.g. 'UTF-8', 'ISO-8859-1', etc.
*/
var $xml_encoding = 'UTF-8';
/*
* -> kind of the xml version
*/
var $xml_version = '1.0';
/*
* -> references the current protocol standard
*/
var $path = DIR_FS_CATALOG;
/*
* -> references the current protocol standard
*/
var $filename = 'opensearch';
/*
* -> search url
*/
var $search_url;
/*
* -> search url
*/
var $image;
/*
* -> constructor
*/
function GMOpenSearch() {
$this->search_url = HTTP_SERVER . DIR_WS_CATALOG . "advanced_search_result.php?keywords={searchTerms}";
$this->image = MainFactory::create_object('GMLogoManager', array("gm_logo_favicon"));
return;
}
/*
* -> create cml doc
*/
function create($output=false) {
$_xml = '<?xml version="' . $this->xml_version . '" encoding="' . $this->xml_encoding . '"?>' . "\n\t";
$_xml .= '<OpenSearchDescription xmlns="' . $this->xmlns . '">' . "\n\t\t";
$_xml .= '{#CONTENT#}';
$_xml .= "\n\t" . '</OpenSearchDescription>';
if($output) {
$this->output($_xml);
} else {
return $_xml;
}
}
/*
* -> get content
*/
function get_content($lang_id) {
$_xml .= '<ShortName>' . gm_get_content('GM_OPENSEARCH_SHORTNAME', $lang_id) . '</ShortName>' . "\n\t\t";
$_xml .= '<LongName>' . gm_get_content('GM_OPENSEARCH_LONGNAME', $lang_id) . '</LongName>' . "\n\t\t";
$_xml .= '<Description>' . gm_get_content('GM_OPENSEARCH_DESCRIPTION', $lang_id) . '</Description>' . "\n\t\t";
$_xml .= '<Tags>' . gm_get_content('GM_OPENSEARCH_TAGS', $lang_id) . '</Tags>' . "\n\t\t";
$_xml .= '<Contact>' . gm_get_content('GM_OPENSEARCH_CONTACT', $lang_id) . '</Contact>' . "\n\t\t";
if($this->image->logo_exist()) {
$_xml .= '<Image type="image/x-icon">' .$this->image->logo_path . $this->image->logo_file.'</Image>' . "\n\t\t";
}
$_xml .= '<Url type="text/html" template="' . $this->search_url . '"/>';
return $_xml;
}
/*
* -> create output
*/
function output($content) {
$gm_lang = gm_get_language();
foreach($gm_lang as $value) {
$_xml = str_replace('{#CONTENT#}', $this->get_content($value['languages_id']), $content);
$fp = fopen($this->path . 'export/' . $this->filename . '_' . $value['languages_id'] . '.xml', 'w');
fwrite($fp, $_xml);
fclose($fp);
}
return;
}
}
?>| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| GMAltText.php | 2013-11-12 20:53 | 2.55 KB | 76129f60960:kunden | -xw-x----- | |
| GMGroupIdChecker.php | 2013-11-12 20:53 | 2.33 KB | 76129f60960:kunden | -xw-x----- | |
| GMIdStarts.php | 2013-11-12 20:53 | 2.52 KB | 76129f60960:kunden | -xw-x----- | |
| GMInvoicing.php | 2013-11-12 20:53 | 10.88 KB | 76129f60960:kunden | -xw-x----- | |
| GMInvoicingConfiguration.php | 2013-11-12 20:53 | 6.39 KB | 76129f60960:kunden | -xw-x----- | |
| GMLangFileImport.php | 2013-11-12 20:53 | 795 B | 76129f60960:kunden | -xw-x----- | |
| GMModulesManager.php | 2013-11-12 20:53 | 13.34 KB | 76129f60960:kunden | -xw-x----- | |
| GMOpenSearch.php | 2013-11-12 20:53 | 4.09 KB | 76129f60960:kunden | -xw-x----- | |
| GMOrderFormat.php | 2013-11-12 20:53 | 4.09 KB | 76129f60960:kunden | -xw-x----- | |
| GMProductExport.php | 2013-11-12 20:53 | 56.76 KB | 76129f60960:kunden | -xw-x----- | |
| GMProductUpload.php | 2013-11-12 20:53 | 7.9 KB | 76129f60960:kunden | -xw-x----- | |
| GMSitemapXML.php | 2013-11-12 20:53 | 15.42 KB | 76129f60960:kunden | -xw-x----- | |
| GMStart.php | 2013-11-12 20:53 | 11.6 KB | 76129f60960:kunden | -xw-x----- | |
| GMStat.php | 2013-11-12 20:53 | 19.62 KB | 76129f60960:kunden | -xw-x----- | |
| GMUpload.php | 2013-11-12 20:53 | 5.52 KB | 76129f60960:kunden | -xw-x----- | |
| ShowLogs.php | 2013-11-12 20:53 | 7.29 KB | 76129f60960:kunden | -xw-x----- | |
| gmOrderPDF.php | 2013-11-12 20:53 | 26.84 KB | 76129f60960:kunden | -xw-x----- | |
| gmPDF.php | 2013-11-12 20:53 | 13.37 KB | 76129f60960:kunden | -xw-x----- | |