8
0

fix small issues

Dieser Commit ist enthalten in:
O3-Shop 2023-04-07 23:34:59 +02:00
Ursprung 79603ee278
Commit c6496efc62
16 geänderte Dateien mit 29 neuen und 37 gelöschten Zeilen

Datei anzeigen

@ -85,8 +85,10 @@ class Configuration
$this->options[$optionInstance->getKey()] = $option;
}
public function getConfig()
public function getConfig(): string
{
$sConfig = '';
foreach ($this->options as $param => $value) {
$sConfig .= "$param: $value, ";
}

Datei anzeigen

@ -25,6 +25,7 @@ namespace O3\TinyMCE\Application\Core\TinyMCE;
use OxidEsales\Eshop\Application\Model\Content;
use OxidEsales\Eshop\Core\Config;
use OxidEsales\Eshop\Core\Exception\FileException;
use OxidEsales\Eshop\Core\Language;
use OxidEsales\Eshop\Core\Model\BaseModel;
use OxidEsales\Eshop\Core\Registry;
@ -42,6 +43,7 @@ class Loader
/**
* @return string
* @throws FileException
*/
public function getEditorCode(): string
{
@ -74,7 +76,7 @@ class Loader
*/
protected function contentIsPlain(): bool
{
/** @var BaseModel $oEditObject */
/** @var BaseModel|Content $oEditObject */
$oEditObject = $this->getShopConfig()->getActiveView()->getViewDataElement( "edit" );
return $oEditObject instanceof Content && $oEditObject->isPlain();
}
@ -109,7 +111,6 @@ class Loader
$configuration->getConfig(),
file_get_contents(__DIR__.'/../../../out/scripts/init.js')
);
dumpvar($sInit.PHP_EOL, 1);
$smarty = Registry::getUtilsView()->getSmarty();
$sSufix = ($smarty->_tpl_vars["__oxid_include_dynamic"]) ? '_dynamic' : '';
@ -123,7 +124,7 @@ dumpvar($sInit.PHP_EOL, 1);
/**
* @return void
* @throws \oxFileException
* @throws FileException
*/
protected function registerIncludes(): void
{

Datei anzeigen

@ -51,13 +51,5 @@ class ExternalPlugins extends AbstractOption
);
return '{ '.$list.' }';
// plugins for newsletter emails
if ( $this->getActiveClassName() === "newsletter_main" ) {
$aPlugins["legacyoutput"] = "";
$aPlugins["fullpage"] = "fullpage";
}
return 350;
}
}

Datei anzeigen

@ -46,9 +46,7 @@ class Language extends AbstractOption
"nl" => "nl",
"ru" => "ru"
);
$sLang = $aLang[ $oLang->getLanguageAbbr( $oLang->getTplLanguage() ) ] ?? "en";
return $sLang;
return $aLang[ $oLang->getLanguageAbbr( $oLang->getTplLanguage() ) ] ?? "en";
}
public function mustQuote(): bool

Datei anzeigen

@ -23,8 +23,6 @@ declare(strict_types=1);
namespace O3\TinyMCE\Application\Core\TinyMCE\Options;
use OxidEsales\Eshop\Core\Registry;
class Promotion extends AbstractOption
{
protected string $key = 'promotion';

Datei anzeigen

@ -26,7 +26,6 @@ namespace O3\TinyMCE\Application\Core\TinyMCE\Options;
use O3\TinyMCE\Application\Core\TinyMCE\PluginList;
use O3\TinyMCE\Application\Core\TinyMCE\Plugins\PluginInterface;
use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Quickbars;
use O3\TinyMCE\Application\Core\TinyMCE\Utils;
class QuickbarsInsertToolbar extends AbstractOption
{
@ -67,4 +66,4 @@ class QuickbarsInsertToolbar extends AbstractOption
)
);
}
}
}

Datei anzeigen

@ -23,8 +23,6 @@ declare(strict_types=1);
namespace O3\TinyMCE\Application\Core\TinyMCE\Options;
use O3\TinyMCE\Application\Core\TinyMCE\Loader;
class Selector extends AbstractOption
{
protected string $key = 'selector';
@ -33,4 +31,4 @@ class Selector extends AbstractOption
{
return '"textarea:not(.mceNoEditor)"';
}
}
}

Datei anzeigen

@ -24,8 +24,6 @@ declare(strict_types=1);
namespace O3\TinyMCE\Application\Core\TinyMCE\Options;
use O3\TinyMCE\Application\Core\TinyMCE\Loader;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\UtilsServer;
class Skin extends AbstractOption
{
@ -44,4 +42,4 @@ class Skin extends AbstractOption
{
return true;
}
}
}

Datei anzeigen

@ -48,7 +48,7 @@ class Toolbar extends AbstractOption
$this->getMultiLineToolbar($toolbarList);
}
protected function getSingleLineToolbar($toolbarList)
protected function getSingleLineToolbar($toolbarList): string
{
$all = [];
@ -90,7 +90,7 @@ class Toolbar extends AbstractOption
return $toolbarElements . ' | ' . $pluginToolbarElements;
}
protected function getMultiLineToolbar($toolbarList)
protected function getMultiLineToolbar($toolbarList): string
{
$list = [];
@ -112,7 +112,7 @@ class Toolbar extends AbstractOption
}
$pluginList = oxNew(PluginList::class);
$list[] = $pluginToolbarElements = implode(
$list[] = implode(
' | ',
array_filter(
array_map(

Datei anzeigen

@ -30,7 +30,6 @@ use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Charmap;
use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Code;
use O3\TinyMCE\Application\Core\TinyMCE\Plugins\FullPage;
use O3\TinyMCE\Application\Core\TinyMCE\Plugins\FullScreen;
use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Hr;
use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Image;
use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Legacyoutput;
use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Link;
@ -38,7 +37,6 @@ use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Lists;
use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Media;
use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Nonbreaking;
use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Pagebreak;
use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Paste;
use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Preview;
use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Quickbars;
use O3\TinyMCE\Application\Core\TinyMCE\Plugins\Roxy;
@ -75,4 +73,4 @@ class PluginList
'roxy' => oxNew(Roxy::class),
];
}
}
}

Datei anzeigen

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace O3\TinyMCE\Application\Core\TinyMCE\Plugins;
use OxidEsales\Eshop\Core\Exception\FileException;
use OxidEsales\Eshop\Core\Registry;
class FullScreen extends AbstractPlugin
@ -39,6 +40,10 @@ class FullScreen extends AbstractPlugin
];
}
/**
* @return string|null
* @throws FileException
*/
public function getScriptPath(): ?string
{
return Registry::getConfig()->getActiveView()->getViewConfig()->getModuleUrl(

Datei anzeigen

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace O3\TinyMCE\Application\Core\TinyMCE\Plugins;
use OxidEsales\Eshop\Core\Exception\FileException;
use OxidEsales\Eshop\Core\Registry;
class Roxy extends AbstractPlugin
@ -32,6 +33,10 @@ class Roxy extends AbstractPlugin
return 'roxy';
}
/**
* @return string|null
* @throws FileException
*/
public function getScriptPath(): ?string
{
return Registry::getConfig()->getActiveView()->getViewConfig()->getModuleUrl(

Datei anzeigen

@ -26,15 +26,11 @@ namespace O3\TinyMCE\Application\Core\TinyMCE;
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Align;
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Blockquote;
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Color;
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\CopyPaste;
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Font;
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Blocks;
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Indent;
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Lists;
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\RemoveFormat;
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Subscript;
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Superscript;
use O3\TinyMCE\Application\Core\TinyMCE\Toolbar\Undo;
class ToolbarList
{

Datei anzeigen

@ -24,12 +24,14 @@ declare(strict_types=1);
namespace O3\TinyMCE\Application\Core;
use O3\TinyMCE\Application\Core\TinyMCE\Loader;
use OxidEsales\Eshop\Core\Exception\FileException;
use OxidEsales\Eshop\Core\Registry;
class ViewConfig extends ViewConfig_parent
{
/**
* @return string
* @throws FileException
*/
public function loadTinyMce(): string
{

Datei anzeigen

@ -31,6 +31,6 @@ $aLang = array(
'HELP_SHOP_MODULE_aTinyMCE_classes' => 'für die Benutzung von TinyMCE in eigenen Admin Views muss hier die entsprechende Controllerklasse eingetragen werden, dann wird für jedes Textarea je ein Editor erzeugt',
'SHOP_MODULE_sTinyMCE_apikey' => 'optionaler API-Key aus Ihrer TinyMCE Registrierung',
'SHOP_MODULE_aTinyMCE_extjs' => '<h3>Externe JS Abhängigkeiten</h3>',
'HELP_SHOP_MODULE_aTinyMCE_extjs' => 'Komplette URL mit http:// bzw https:// falls der Shop über HTTPS läuft.',
'HELP_SHOP_MODULE_aTinyMCE_extjs' => 'Komplette URL mit https://.',
'SHOP_MODULE_GROUP_tinyMceSettings' => 'TinyMCE Einstellungen &amp; Plugins',
);

Datei anzeigen

@ -31,6 +31,6 @@ $aLang = array(
'HELP_SHOP_MODULE_aTinyMCE_classes' => 'if you want to use TinyMCE for your custom controllers, you need to enter their class names here.',
'SHOP_MODULE_sTinyMCE_apikey' => 'optional API key from your TinyMCE registration',
'SHOP_MODULE_aTinyMCE_extjs' => '<h3>external JS dependencies</h3> (e.g. for plugins)',
'HELP_SHOP_MODULE_aTinyMCE_extjs' => 'full URL with http:// or https:// if your shop runs with HTTPS.',
'HELP_SHOP_MODULE_aTinyMCE_extjs' => 'Full URL with https://.',
'SHOP_MODULE_GROUP_tinyMceSettings' => 'TinyMCE Settings &amp; Plugins',
);