From 55a23ad803656de39ee33a9aefa36bf15f20df02 Mon Sep 17 00:00:00 2001 From: Robert Korulczyk Date: Thu, 14 Jan 2016 18:06:50 +0100 Subject: [PATCH] smarter import of TinyMceFileManager class --- ElFinderHelper.php | 15 +++++++++++++++ TinyMceElFinder.php | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ElFinderHelper.php b/ElFinderHelper.php index 8b0c046..0823a23 100644 --- a/ElFinderHelper.php +++ b/ElFinderHelper.php @@ -133,4 +133,19 @@ public static function getAssetsDir() { return self::$_assetsDir; } + /** + * Try import TinyMceFileManager class. + */ + public static function importTinyMceFileManager() { + if (@class_exists('TinyMceFileManager')) { + // class already imported or declared + } elseif (Yii::getPathOfAlias('tinymce')) { + // try import by declared alias + Yii::import('tinymce.TinyMceFileManager'); + } else { + // try import by default extension directory + Yii::import('ext.tinymce.TinyMceFileManager'); + } + } + } diff --git a/TinyMceElFinder.php b/TinyMceElFinder.php index 7de3b74..231e719 100644 --- a/TinyMceElFinder.php +++ b/TinyMceElFinder.php @@ -1,6 +1,7 @@