Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Application/Controller/Admin/ToxidSetup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Toxid\Application\Controller\Admin;

/**
* TOXID Admin Setup - Navigation node
*/
class ToxidSetup extends \OxidEsales\Eshop\Application\Controller\Admin\ShopController
{
}
10 changes: 10 additions & 0 deletions Application/Controller/Admin/ToxidSetupList.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Toxid\Application\Controller\Admin;

/**
* TOXID Admin Setup List
*/
class ToxidSetupList extends \OxidEsales\Eshop\Application\Controller\Admin\ShopList
{
}
72 changes: 72 additions & 0 deletions Application/Controller/Admin/ToxidSetupMain.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

namespace Toxid\Application\Controller\Admin;

use OxidEsales\Eshop\Core\Registry;

/**
* TOXID Admin Setup Main - Configuration controller
*/
class ToxidSetupMain extends \OxidEsales\Eshop\Application\Controller\Admin\ShopConfiguration
{
const CONFIG_MODULE_NAME = 'module:toxid_curl';

protected $_sThisTemplate = 'admin/toxid_setup_main.tpl';

public function render()
{
$oConf = Registry::getConfig();

$this->_aViewData['aToxidCurlSource'] = $oConf->getShopConfVar('aToxidCurlSource');
$this->_aViewData['aToxidCurlSourceSsl'] = $oConf->getShopConfVar('aToxidCurlSourceSsl');
$this->_aViewData['aToxidSearchUrl'] = $oConf->getShopConfVar('aToxidSearchUrl');
$this->_aViewData['aToxidCurlUrlParams'] = $oConf->getShopConfVar('aToxidCurlUrlParams');
$this->_aViewData['aToxidCurlSeoSnippets'] = $oConf->getShopConfVar('aToxidCurlSeoSnippets');
$this->_aViewData['toxidDontRewriteRelUrls'] = $oConf->getShopConfVar('toxidDontRewriteRelUrls');
$this->_aViewData['toxidDontRewriteFileExtension'] = $oConf->getShopConfVar('toxidDontRewriteFileExtension');
$this->_aViewData['toxidRewriteUrlEncoded'] = $oConf->getShopConfVar('toxidRewriteUrlEncoded');
$this->_aViewData['toxidDontRewriteUrls'] = $oConf->getShopConfVar('toxidDontRewriteUrls');
$this->_aViewData['bToxidDontPassPostVarsToCms'] = $oConf->getShopConfVar('bToxidDontPassPostVarsToCms');
$this->_aViewData['bToxidRedirect301ToStartpage'] = $oConf->getShopConfVar('bToxidRedirect301ToStartpage');
$this->_aViewData['toxidCacheTtl'] = $oConf->getShopConfVar('toxidCacheTtl');
$this->_aViewData['toxidError404Link'] = $oConf->getShopConfVar('toxidError404Link');
$this->_aViewData['aToxidNotFoundUrl'] = $oConf->getShopConfVar('aToxidNotFoundUrl');
$this->_aViewData['aToxidCurlUrlAdminParams'] = $oConf->getShopConfVar('aToxidCurlUrlAdminParams');
$this->_aViewData['toxidAllowedCmsRequestParams'] = $oConf->getShopConfVar('toxidAllowedCmsRequestParams');
$this->_aViewData['toxidDontVerifySSLCert'] = $oConf->getShopConfVar('toxidDontVerifySSLCert');

return parent::render();
}

/**
* Saves the settings
*/
public function save(): void
{
$oConf = Registry::getConfig();
$aParams = $oConf->getRequestParameter("editval");
$sShopId = $oConf->getShopId();

if (!is_array($aParams)) {
return;
}

$oConf->saveShopConfVar('arr', 'aToxidCurlSource', $aParams['aToxidCurlSource'] ?? [], $sShopId, self::CONFIG_MODULE_NAME);
$oConf->saveShopConfVar('arr', 'aToxidCurlSourceSsl', $aParams['aToxidCurlSourceSsl'] ?? [], $sShopId, self::CONFIG_MODULE_NAME);
$oConf->saveShopConfVar('arr', 'aToxidSearchUrl', $aParams['aToxidSearchUrl'] ?? [], $sShopId, self::CONFIG_MODULE_NAME);
$oConf->saveShopConfVar('arr', 'aToxidCurlUrlParams', $aParams['aToxidCurlUrlParams'] ?? [], $sShopId, self::CONFIG_MODULE_NAME);
$oConf->saveShopConfVar('arr', 'aToxidCurlSeoSnippets', $aParams['aToxidCurlSeoSnippets'] ?? [], $sShopId, self::CONFIG_MODULE_NAME);
$oConf->saveShopConfVar('str', 'toxidDontRewriteRelUrls', $aParams['toxidDontRewriteRelUrls'] ?? '', $sShopId, self::CONFIG_MODULE_NAME);
$oConf->saveShopConfVar('str', 'toxidDontRewriteFileExtension', $aParams['toxidDontRewriteFileExtension'] ?? '', $sShopId, self::CONFIG_MODULE_NAME);
$oConf->saveShopConfVar('str', 'toxidCacheTtl', $aParams['toxidCacheTtl'] ?? '', $sShopId, self::CONFIG_MODULE_NAME);
$oConf->saveShopConfVar('str', 'toxidError404Link', $aParams['toxidError404Link'] ?? '', $sShopId, self::CONFIG_MODULE_NAME);
$oConf->saveShopConfVar('arr', 'aToxidNotFoundUrl', $aParams['aToxidNotFoundUrl'] ?? [], $sShopId, self::CONFIG_MODULE_NAME);
$oConf->saveShopConfVar('bl', 'toxidRewriteUrlEncoded', $aParams['toxidRewriteUrlEncoded'] ?? 0, $sShopId, self::CONFIG_MODULE_NAME);
$oConf->saveShopConfVar('bl', 'toxidDontRewriteUrls', $aParams['toxidDontRewriteUrls'] ?? 0, $sShopId, self::CONFIG_MODULE_NAME);
$oConf->saveShopConfVar('bl', 'bToxidDontPassPostVarsToCms', $aParams['bToxidDontPassPostVarsToCms'] ?? 0, $sShopId, self::CONFIG_MODULE_NAME);
$oConf->saveShopConfVar('bl', 'bToxidRedirect301ToStartpage', $aParams['bToxidRedirect301ToStartpage'] ?? 0, $sShopId, self::CONFIG_MODULE_NAME);
$oConf->saveShopConfVar('arr', 'aToxidCurlUrlAdminParams', $aParams['aToxidCurlUrlAdminParams'] ?? [], $sShopId, self::CONFIG_MODULE_NAME);
$oConf->saveShopConfVar('str', 'toxidAllowedCmsRequestParams', $aParams['toxidAllowedCmsRequestParams'] ?? '', $sShopId, self::CONFIG_MODULE_NAME);
$oConf->saveShopConfVar('bl', 'toxidDontVerifySSLCert', $aParams['toxidDontVerifySSLCert'] ?? 0, $sShopId, self::CONFIG_MODULE_NAME);
}
}
62 changes: 62 additions & 0 deletions Application/Controller/ToxidController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php

namespace Toxid\Application\Controller;

use OxidEsales\Eshop\Core\Registry;
use Toxid\Core\ToxidCurl;

/**
* TOXID Frontend Controller - Displays CMS pages
*/
class ToxidController extends \OxidEsales\Eshop\Application\Controller\FrontendController
{
/**
* Current view template
* @var string
*/
protected $_sThisTemplate = 'page/toxid/toxid.tpl';

/**
* Template variable getter. Returns page title from CMS
*/
public function getTitle()
{
return Registry::get(ToxidCurl::class)->_sPageTitle;
}

/**
* Template variable getter. Returns meta description from CMS
*/
public function getMetaDescription()
{
$sDescription = strip_tags(Registry::get(ToxidCurl::class)->_sPageDescription ?? '');

if ($sDescription) {
$this->_sMetaDescription = $sDescription;
}

return $this->_sMetaDescription;
}

/**
* Template variable getter. Returns meta keywords from CMS
*/
public function getMetaKeywords()
{
$sKeywords = strip_tags(Registry::get(ToxidCurl::class)->_sPageKeywords ?? '');

if ($sKeywords) {
$this->_sMetaKeywords = $sKeywords;
}

return $this->_sMetaKeywords;
}

/**
* Render the CMS page
*/
public function render()
{
return parent::render();
}
}
29 changes: 29 additions & 0 deletions Application/views/admin/de/toxid_admin_lang.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

$sLangName = "Deutsch";

$aLang = [
'charset' => 'UTF-8',
'toxid_setup' => 'TOXID Einstellungen',
'toxid_setup_main' => 'TOXID Grundeinstellungen',
'TOXID_SOURCE' => 'CMS URL',
'TOXID_SOURCE_SSL' => 'CMS SSL-URL',
'TOXID_SEO_SNIPPET' => 'URL Identifier / SEO-Snippet',
'TOXID_SEARCH_URL' => 'URL zum Aufruf der Suche (optional)',
'TOXID_NOT_FOUND_URL' => '404 Not found URL (optional)',
'TOXID_PARAM' => 'TOXID URL-Parameter',
'TOXID_PREVIEW_PARAM' => 'Admin URL-Parameter (z.B. Blog Preview)',
'TOXID_CMS_PARAMS' => 'Erlaubte, CMS spezifische Parameter (kommaseparierte Liste)',
'TOXID_DONT_REWRITE' => 'URLs nicht umschreiben',
'TOXID_DONT_PASSTHROUGH' => 'POST-Parameter nicht an CMS durchreichen',
'TOXID_DONT_REWRITE_REL_URLS' => 'URLs fuer bestimmte "rel" Attributwerte nicht umschreiben (kommaseparierte Liste)',
'TOXID_DONT_REWRITE_URLS_WITH_FILE_EXTENSIONS' => 'URLs fuer bestimmte Dateiendungen nicht umschreiben (kommaseparierte Liste)',
'TOXID_ERROR_404_LINK' => 'Redirect-URL bei 404 Fehler (optional)',
'TOXID_REWRITE_URLENCODED' => 'URL-kodierte Links umschreiben',
'TOXID_REDIRECT_301_TO_STARTPAGE' => 'Bei 301 auf Startseite weiterleiten',
'TOXID_GENERAL' => 'Allgemein',
'TOXID_CACHE' => 'Cache',
'TOXID_CACHE_TTL' => 'Cache-Lebenszeit (TTL) in Sekunden',
'HELP_TOXID_CACHE_TTL' => '0 => unendlich<br>kein Wert => Cache deaktiviert',
'TOXID_DONT_VERIFY_SSL_CERTIFICATE' => 'SSL-Zertifikat nicht ueberpruefen',
];
180 changes: 180 additions & 0 deletions Application/views/admin/tpl/toxid_setup_main.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
[{include file="headitem.tpl" title="TOXID cURL Konfiguration"}]
<script type="text/javascript">
<!--
function _groupExp(el) {
var _cur = el.parentNode;
if (_cur.className == "exp") _cur.className = "";
else _cur.className = "exp";
}
//-->
</script>

[{if $readonly}]
[{assign var="readonly" value="readonly disabled"}]
[{else}]
[{assign var="readonly" value=""}]
[{/if}]
<form name="transfer" id="transfer" action="[{$oViewConf->getSelfLink()}]" method="post">
[{$oViewConf->getHiddenSid()}]
<input type="hidden" name="oxid" value="[{$oxid}]">
<input type="hidden" name="cl" value="toxid_setup_main">
<input type="hidden" name="fnc" value="">
<input type="hidden" name="actshop" value="[{$oViewConf->getActiveShopId()}]">
<input type="hidden" name="updatenav" value="">
<input type="hidden" name="editlanguage" value="[{$editlanguage}]">
</form>
<form name="myedit" id="myedit" action="[{$oViewConf->getSelfLink()}]" method="post">
[{$oViewConf->getHiddenSid()}]
<input type="hidden" name="cl" value="toxid_setup_main">
<input type="hidden" name="fnc" value="">
<input type="hidden" name="language" value="[{$actlang}]">
<div class="groupExp">
<div class="exp">
<a href="#" onclick="_groupExp(this);return false;" class="rc"><b>TOXID cURL - CMS Integration</b></a>
<dl>
<dd>
<p>Integrates CMS content (WordPress, TYPO3 etc.) into OXID eShop via cURL/XML.</p>
</dd>
</dl>
</div>
</div>
<div class="groupExp">
<div>
<a href="#" onclick="_groupExp(this);return false;" class="rc"><b>Spracheinstellungen</b></a>
<dl>
<dd>
[{foreach from=$languages key=lang item=olang}]
<fieldset>
<legend>[{$olang->name}]</legend>
<table>
<tr>
<td valign="top" class="edittext">CMS Quell-URL:</td>
<td valign="top" class="edittext">
<input type="text" size="80" name="editval[aToxidCurlSource][[{$lang}]]" value="[{$aToxidCurlSource.$lang}]">
</td>
</tr>
<tr>
<td valign="top" class="edittext">CMS Quell-URL (SSL):</td>
<td valign="top" class="edittext">
<input type="text" size="80" name="editval[aToxidCurlSourceSsl][[{$lang}]]" value="[{$aToxidCurlSourceSsl.$lang}]">
</td>
</tr>
<tr>
<td valign="top" class="edittext">Such-URL:</td>
<td valign="top" class="edittext">
<input type="text" size="80" name="editval[aToxidSearchUrl][[{$lang}]]" value="[{$aToxidSearchUrl.$lang}]">
</td>
</tr>
<tr>
<td valign="top" class="edittext">URL-Parameter:</td>
<td valign="top" class="edittext">
<input type="text" size="80" name="editval[aToxidCurlUrlParams][[{$lang}]]" value="[{$aToxidCurlUrlParams.$lang}]">
</td>
</tr>
<tr>
<td valign="top" class="edittext">URL Identifier / SEO-Snippet:</td>
<td valign="top" class="edittext">
<input type="text" size="80" name="editval[aToxidCurlSeoSnippets][[{$lang}]]" value="[{$aToxidCurlSeoSnippets.$lang}]">
</td>
</tr>
<tr>
<td valign="top" class="edittext">Preview-Parameter (Admin):</td>
<td valign="top" class="edittext">
<input type="text" size="80" name="editval[aToxidCurlUrlAdminParams][[{$lang}]]" value="[{$aToxidCurlUrlAdminParams.$lang}]">
</td>
</tr>
<tr>
<td valign="top" class="edittext">404 Fallback-URL:</td>
<td valign="top" class="edittext">
<input type="text" size="80" name="editval[aToxidNotFoundUrl][[{$lang}]]" value="[{$aToxidNotFoundUrl.$lang}]">
</td>
</tr>
</table>
</fieldset>
[{/foreach}]
<fieldset>
<legend>Allgemein</legend>
<table>
<tr>
<td class="edittext">Erlaubte CMS Request-Parameter:</td>
<td class="edittext">
<input type="text" size="80" name="editval[toxidAllowedCmsRequestParams]" value="[{$toxidAllowedCmsRequestParams}]">
</td>
</tr>
<tr>
<td class="edittext">Nicht umschreiben (rel-Werte):</td>
<td class="edittext">
<input type="text" size="100" name="editval[toxidDontRewriteRelUrls]" value="[{$toxidDontRewriteRelUrls}]">
</td>
</tr>
<tr>
<td class="edittext">Nicht umschreiben (Dateiendungen):</td>
<td class="edittext">
<input type="text" size="100" name="editval[toxidDontRewriteFileExtension]" value="[{$toxidDontRewriteFileExtension}]">
</td>
</tr>
<tr>
<td class="edittext">404 Redirect-Link:</td>
<td class="edittext">
<input type="text" size="100" name="editval[toxidError404Link]" value="[{$toxidError404Link}]">
</td>
</tr>
<tr>
<td valign="top" class="edittext">
<input type="hidden" name="editval[toxidRewriteUrlEncoded]" value="0">
<input type="checkbox" name="editval[toxidRewriteUrlEncoded]" value="1" [{if $toxidRewriteUrlEncoded}]checked="checked"[{/if}]>
URL-kodierte Links umschreiben
</td>
</tr>
<tr>
<td valign="top" class="edittext">
<input type="hidden" name="editval[toxidDontRewriteUrls]" value="0">
<input type="checkbox" name="editval[toxidDontRewriteUrls]" value="1" [{if $toxidDontRewriteUrls}]checked="checked"[{/if}]>
URL-Umschreibung deaktivieren
</td>
</tr>
<tr>
<td valign="top" class="edittext">
<input type="hidden" name="editval[bToxidDontPassPostVarsToCms]" value="0">
<input type="checkbox" name="editval[bToxidDontPassPostVarsToCms]" value="1" [{if $bToxidDontPassPostVarsToCms}]checked="checked"[{/if}]>
POST-Variablen nicht an CMS weiterleiten
</td>
</tr>
<tr>
<td valign="top" class="edittext">
<input type="hidden" name="editval[bToxidRedirect301ToStartpage]" value="0">
<input type="checkbox" name="editval[bToxidRedirect301ToStartpage]" value="1" [{if $bToxidRedirect301ToStartpage}]checked="checked"[{/if}]>
301-Redirects zur Startseite
</td>
</tr>
<tr>
<td valign="top" class="edittext">
<input type="hidden" name="editval[toxidDontVerifySSLCert]" value="0">
<input type="checkbox" name="editval[toxidDontVerifySSLCert]" value="1" [{if $toxidDontVerifySSLCert}]checked="checked"[{/if}]>
SSL-Zertifikat nicht verifizieren
</td>
</tr>
</table>
</fieldset>
<fieldset>
<legend>Cache</legend>
<table>
<tr>
<td class="edittext">Cache TTL (Sekunden):</td>
<td class="edittext">
<input type="text" size="10" name="editval[toxidCacheTtl]" value="[{$toxidCacheTtl}]">
<span class="edittext">(Standard-TTL, kann pro Snippet im Template ueberschrieben werden)</span>
</td>
</tr>
</table>
</fieldset>
</dd>
</dl>
</div>
</div>
<br />
<input type="submit" class="edittext" id="oLockButton" value="Speichern" onclick="Javascript:document.myedit.fnc.value='save'" [{$readonly}]>
</form>

[{include file="bottomnaviitem.tpl"}]
[{include file="bottomitem.tpl"}]
Loading