Umstellung auf static method

This commit is contained in:
Carsten Götzinger 2018-02-13 14:47:42 +01:00
parent de73c3d2ec
commit 9f40e2f9d7
2 changed files with 2 additions and 22 deletions

View File

@ -36,12 +36,6 @@ namespace cgoIT\aeo;
class AeoJavaScript
{
/**
* Current object instance (Singleton)
* @var Cache
*/
protected static $objInstance;
/**
* Template
* @var string
@ -59,7 +53,7 @@ class AeoJavaScript
*/
final private function __clone() {}
public function getContent($folder, $rot13 = true) {
public static function getContent($folder, $rot13 = true) {
$Template = new \FrontendTemplate(self::$strTemplate);
$Template->rot13 = $rot13;
$Template->folder = $folder;
@ -67,18 +61,6 @@ class AeoJavaScript
$Template->tooltip_js_off = $GLOBALS['TL_LANG']['aeo']['tooltip_no_js'];
return $Template->parse();
}
/**
* Instantiate a new cache object and return it (Factory)
* @return Cache
*/
public static function getInstance() {
if (!is_object(self::$objInstance)) {
self::$objInstance = new self();
}
return self::$objInstance;
}
}
?>

View File

@ -80,7 +80,6 @@ class AeoFrontendUtil extends \Frontend {
protected $aeo;
protected $aeoUtil;
protected $aeoJavaScript;
/**
* Initialize the object
@ -92,7 +91,6 @@ class AeoFrontendUtil extends \Frontend {
if (TL_MODE == 'FE') {
global $objPage;
$this->aeoUtil = new AeoUtil();
$this->aeoJavaScript = AeoJavaScript::getInstance();
if ($GLOBALS['TL_CONFIG']['aeo_replace_standard_obfuscation'] === true) {
$this->use_rot_13 = $GLOBALS['TL_CONFIG']['aeo_use_rot_13'];
@ -498,7 +496,7 @@ class Aeo extends \System {
}
function dropJS() {
$strContentJs = $this->aeoJavaScript->getContent(str_replace("/", "\/", $this->folder), $this->rot13);
$strContentJs = AeoJavaScript::getContent(str_replace("/", "\/", $this->folder), $this->rot13);
$strContentJs = "\n<script type=\"text/javascript\">\n$strContentJs\n</script>\n";
return $strContentJs;
}