diff --git a/README.md b/README.md
index ea58284..bab457d 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,8 @@
##### Changelog:
+##### 26.05.2017 - обновление модуля до версии 1.1.0b - Адаптация модуля для AVE.cms v3.2 - фикс подключения файлового менеджера elfinder.
+
##### 05.03.2017 - обновление модуля до версии 1.0.9b - AJAX загрузка пинов с фильтром вывода по цвету пина + возможность добавления собственных пинов в категорию USER.
##### 18.02.2017 - обновление модуля до версии 1.0.8b - рекомендуется для тестирования. Установка только чистая, обновление не прокатит.
diff --git a/gmap/fm.gmap.php b/gmap/fm.gmap.php
index 48b03fb..1c62887 100644
--- a/gmap/fm.gmap.php
+++ b/gmap/fm.gmap.php
@@ -14,137 +14,36 @@ $fmgmap = $_POST['fmgmap'];
if ($fmgmap == 'dir_upl')
{
-$gmfmen = '";
- print_r($o);
-}
-function logger($cmd, $voumes, $result) {
- $log = $cmd.": [".date("d.m H:s")."] ".$voumes[0]->id()." ";
-
- if (isset($voumes[1])) {
- $log .= $voumes[1]->id()." ";
- }
- switch ($cmd) {
- case "mkdir":
- case "mkfile":
- case "upload":
- $log .= $result["added"][0]["name"];
- break;
- case "rename":
- $log .= "from ".$result["removedDetails"][0]["name"]." to ".$result["added"][0]["name"];
- break;
- case "duplicate":
- $log .= "src: ".$result["src"]["name"]." copy: ".$result["added"][0]["name"];
- break;
- case "rm":
- $log .= $result["removedDetails"][0]["name"];
- break;
- default:
- $log = "";
- }
- if ($log && is_dir("../../../../cache/redactor") || @mkdir("../../../../cache/redactor")) {
- $fp = fopen("../../../../cache/redactor/log.txt", "a");
- if ($fp) {
- fwrite($fp, $log."\n");
- fclose($fp);
- }
- }
- return $result;
+$gmfmen = '
+id()." ";
-
- if (isset($voumes[1])) {
- $log .= $voumes[1]->id()." ";
- }
- switch ($cmd) {
- case "mkdir":
- case "mkfile":
- case "upload":
- case "paste":
- $log .= $result["added"][0]["name"];
- break;
- case "rename":
- $log .= "from ".$result["removedDetails"][0]["name"]." to ".$result["added"][0]["name"];
- break;
- case "duplicate":
- $log .= "src: ".$result["src"]["name"]." copy: ".$result["added"][0]["name"];
- break;
- case "rm":
- $log .= $result["removedDetails"][0]["name"];
- break;
- default:
- $log = "";
- }
- if ($log && is_dir("../../../../cache/redactor") || @mkdir("../../../../cache/redactor")) {
- $fp = fopen("../../../../cache/redactor/log.txt", "a");
- if ($fp) {
- fwrite($fp, $log."\n");
- fclose($fp);
- }
- }
- return $result;
- }
-} // END class
+require "./autoload.php";
+elFinder::$netDrivers["ftp"] = "FTP";
function access($attr, $path, $data, $volume) {
- return strpos(basename($path), ".") === 0
+ return strpos(basename($path), ".") === 0
? !($attr == "read" || $attr == "write")
- : $attr == "read" || $attr == "write";
-}
-class elFinderTestACL {
- public function fsAccess($attr, $path, $data, $volume) {
-
- if ($volume->name() == "localfilesystem") {
- return strpos(basename($path), ".") === 0
- ? !($attr == "read" || $attr == "write")
- : $attr == "read" || $attr == "write";
- }
- return true;
- }
-}
-$acl = new elFinderTestACL();
-function validName($name) {
- return strpos($name, ".") !== 0;
+ : null;
}
$opts = array(
- "locale" => "en_US.UTF-8",
- "bind" => array(
- "mkdir mkfile rename duplicate upload rm paste" => array(new elFinderSimpleLogger(), "write"),
- ),
- "debug" => true,
"roots" => array(
array(
- // "id" => "x5",
- "driver" => "LocalFileSystem", // driver for accessing file system (REQUIRED)
- "path" => "../../../../".UPLOAD_DIR, // path to files (REQUIRED)
- "URL" => "/".UPLOAD_DIR."/", // URL to files (REQUIRED)
- "alias" => UPLOAD_DIR,
- "disabled" => array(),
+ "driver" => "LocalFileSystem",
+ "path" => "../../../../" . UPLOAD_DIR,
+ "URL" => "/".UPLOAD_DIR."/",
+ "uploadOrder" => array("deny", "allow"),
"acceptedName" => "validName",
"uploadAllow" => array("all"),
"uploadDeny" => array("all"),
- "uploadOrder" => "deny,allow",
"uploadOverwrite" => false,
- "uploadMaxSize" => "128m",
- "copyOverwrite" => false,
- "copyJoin" => true,
- "mimeDetect" => "internal",
- "tmbCrop" => false,
- "imgLib" => "gd",
- "utf8fix" => true,
+ "uploadMaxSize" => "256m",
+ "accessControl" => "access",
"attributes" => array(
array(
"pattern" => "/^\/\./",
@@ -153,53 +52,38 @@ $opts = array(
"hidden" => true,
"locked" => true
),
- array(
- "pattern" => "/.tmb/",
- "read" => false,
- "write" => false,
- "hidden" => true,
- "locked" => false
- ),
- array(
- "pattern" => "/\.php$/",
- "read" => false,
- "write" => false,
- "hidden" => true,
- "locked" => false
- ),
+ array(
+ "pattern" => "/.tmb/",
+ "read" => false,
+ "write" => false,
+ "hidden" => true,
+ "locked" => false
+ ),
+ array(
+ "pattern" => "/\.php$/",
+ "read" => false,
+ "write" => false,
+ "hidden" => true,
+ "locked" => false
+ ),
array(
- "pattern" => "/.quarantine/",
- "read" => false,
- "write" => false,
- "hidden" => true,
- "locked" => false
- ),
- array(
- "pattern" => "/\.htaccess$/",
- "write" => false,
- "locked" => false,
- "hidden" => true
- ),
- array(
- "pattern" => "/.uploader/",
- "read" => false,
- "write" => false,
- "hidden" => true,
- "locked" => false
- ),
- array(
- "pattern" => "/.temp/",
- "read" => false,
- "write" => false,
- "hidden" => true,
- "locked" => false
- )
- ),
+ "pattern" => "/.quarantine/",
+ "read" => false,
+ "write" => false,
+ "hidden" => true,
+ "locked" => false
+ ),
+ array(
+ "pattern" => "/\.htaccess$/",
+ "write" => false,
+ "locked" => false,
+ "hidden" => true
+ )
+ )
)
)
);
-header("Access-Control-Allow-Origin: *");
-$connector = new elFinderConnector(new elFinder($opts), true);
+$connector = new elFinderConnector(new elFinder($opts));
$connector->run();
?>';
@@ -215,136 +99,34 @@ $connector->run();
if ($fmgmap == 'dir_uplgmi')
{
$gmfmen = '";
- print_r($o);
-}
-function logger($cmd, $voumes, $result) {
- $log = $cmd.": [".date("d.m H:s")."] ".$voumes[0]->id()." ";
-
- if (isset($voumes[1])) {
- $log .= $voumes[1]->id()." ";
- }
- switch ($cmd) {
- case "mkdir":
- case "mkfile":
- case "upload":
- $log .= $result["added"][0]["name"];
- break;
- case "rename":
- $log .= "from ".$result["removedDetails"][0]["name"]." to ".$result["added"][0]["name"];
- break;
- case "duplicate":
- $log .= "src: ".$result["src"]["name"]." copy: ".$result["added"][0]["name"];
- break;
- case "rm":
- $log .= $result["removedDetails"][0]["name"];
- break;
- default:
- $log = "";
- }
- if ($log && is_dir("../../../../cache/redactor") || @mkdir("../../../../cache/redactor")) {
- $fp = fopen("../../../../cache/redactor/log.txt", "a");
- if ($fp) {
- fwrite($fp, $log."\n");
- fclose($fp);
- }
- }
- return $result;
+error_reporting(0);
+define("BASE_DIR", str_replace("\\\", "/", dirname(dirname(dirname(dirname(dirname(__FILE__)))))));
+include_once "../../../../inc/init.php";
+if (! check_permission("mediapool_finder"))
+{
+ header("Location:/index.php");
+ exit;
}
-class elFinderSimpleLogger {
- public function write($cmd, $voumes, $result) {
- $log = $cmd.": [".date("d.m H:s")."] ".$voumes[0]->id()." ";
-
- if (isset($voumes[1])) {
- $log .= $voumes[1]->id()." ";
- }
- switch ($cmd) {
- case "mkdir":
- case "mkfile":
- case "upload":
- case "paste":
- $log .= $result["added"][0]["name"];
- break;
- case "rename":
- $log .= "from ".$result["removedDetails"][0]["name"]." to ".$result["added"][0]["name"];
- break;
- case "duplicate":
- $log .= "src: ".$result["src"]["name"]." copy: ".$result["added"][0]["name"];
- break;
- case "rm":
- $log .= $result["removedDetails"][0]["name"];
- break;
- default:
- $log = "";
- }
- if ($log && is_dir("../../../../cache/redactor") || @mkdir("../../../../cache/redactor")) {
- $fp = fopen("../../../../cache/redactor/log.txt", "a");
- if ($fp) {
- fwrite($fp, $log."\n");
- fclose($fp);
- }
- }
- return $result;
- }
-} // END class
+require "./autoload.php";
+elFinder::$netDrivers["ftp"] = "FTP";
function access($attr, $path, $data, $volume) {
- return strpos(basename($path), ".") === 0
+ return strpos(basename($path), ".") === 0
? !($attr == "read" || $attr == "write")
- : $attr == "read" || $attr == "write";
-}
-class elFinderTestACL {
- public function fsAccess($attr, $path, $data, $volume) {
-
- if ($volume->name() == "localfilesystem") {
- return strpos(basename($path), ".") === 0
- ? !($attr == "read" || $attr == "write")
- : $attr == "read" || $attr == "write";
- }
- return true;
- }
-}
-$acl = new elFinderTestACL();
-function validName($name) {
- return strpos($name, ".") !== 0;
+ : null;
}
$opts = array(
- "locale" => "en_US.UTF-8",
- "bind" => array(
- "mkdir mkfile rename duplicate upload rm paste" => array(new elFinderSimpleLogger(), "write"),
- ),
- "debug" => true,
"roots" => array(
array(
- // "id" => "x5",
- "driver" => "LocalFileSystem", // driver for accessing file system (REQUIRED)
- "path" => "../../../../".UPLOAD_DIR, // path to files (REQUIRED)
- "URL" => "/".UPLOAD_DIR."/", // URL to files (REQUIRED)
- "alias" => UPLOAD_DIR,
- "disabled" => array(),
+ "driver" => "LocalFileSystem",
+ "path" => "../../../../" . UPLOAD_DIR,
+ "URL" => "/".UPLOAD_DIR."/",
+ "uploadOrder" => array("deny", "allow"),
"acceptedName" => "validName",
"uploadAllow" => array("all"),
"uploadDeny" => array("all"),
- "uploadOrder" => "deny,allow",
"uploadOverwrite" => false,
- "uploadMaxSize" => "128m",
- "copyOverwrite" => false,
- "copyJoin" => true,
- "mimeDetect" => "internal",
- "tmbCrop" => false,
- "imgLib" => "gd",
- "utf8fix" => true,
+ "uploadMaxSize" => "256m",
+ "accessControl" => "access",
"attributes" => array(
array(
"pattern" => "/^\/\./",
@@ -353,69 +135,47 @@ $opts = array(
"hidden" => true,
"locked" => true
),
- array(
- "pattern" => "/.tmb/",
- "read" => false,
- "write" => false,
- "hidden" => true,
- "locked" => false
- ),
- array(
- "pattern" => "/\.php$/",
- "read" => false,
- "write" => false,
- "hidden" => true,
- "locked" => false
- ),
+ array(
+ "pattern" => "/.tmb/",
+ "read" => false,
+ "write" => false,
+ "hidden" => true,
+ "locked" => false
+ ),
+ array(
+ "pattern" => "/\.php$/",
+ "read" => false,
+ "write" => false,
+ "hidden" => true,
+ "locked" => false
+ ),
array(
- "pattern" => "/.quarantine/",
- "read" => false,
- "write" => false,
- "hidden" => true,
- "locked" => false
- ),
- array(
- "pattern" => "/\.htaccess$/",
- "write" => false,
- "locked" => false,
- "hidden" => true
- ),
- array(
- "pattern" => "/.uploader/",
- "read" => false,
- "write" => false,
- "hidden" => true,
- "locked" => false
- ),
- array(
- "pattern" => "/.temp/",
- "read" => false,
- "write" => false,
- "hidden" => true,
- "locked" => false
- )
+ "pattern" => "/.quarantine/",
+ "read" => false,
+ "write" => false,
+ "hidden" => true,
+ "locked" => false
+ ),
+ array(
+ "pattern" => "/\.htaccess$/",
+ "write" => false,
+ "locked" => false,
+ "hidden" => true
+ )
),
),
- array(
- // "id" => "x5",
- "driver" => "LocalFileSystem", // driver for accessing file system (REQUIRED)
- "path" => "../../../../modules/gmap/images", // path to files (REQUIRED)
- "URL" => "/modules/gmap/images/", // URL to files (REQUIRED)
- "alias" => "modules/gmap/images",
- "disabled" => array(),
- "acceptedName" => "validName",
- "uploadAllow" => array("all"),
- "uploadDeny" => array("all"),
- "uploadOrder" => "deny,allow",
+ array(
+ "driver" => "LocalFileSystem",
+ "path" => "../../../../modules/gmap/images",
+ "URL" => "/modules/gmap/images/",
+ "uploadOrder" => array("deny", "allow"),
+ "acceptedName" => "validName",
+ "uploadAllow" => array("all"),
+ "uploadDeny" => array("all"),
"uploadOverwrite" => false,
- "uploadMaxSize" => "128m",
- "copyOverwrite" => false,
- "copyJoin" => true,
- "mimeDetect" => "internal",
- "tmbCrop" => false,
- "imgLib" => "gd",
- "utf8fix" => true,
- "attributes" => array(
+ "uploadMaxSize" => "256m",
+ "accessControl" => "access",
+ "attributes" => array(
array(
"pattern" => "/^\/\./",
"read" => false,
@@ -423,56 +183,40 @@ $opts = array(
"hidden" => true,
"locked" => true
),
- array(
- "pattern" => "/.tmb/",
- "read" => false,
- "write" => false,
- "hidden" => true,
- "locked" => false
- ),
- array(
- "pattern" => "/\.php$/",
- "read" => false,
- "write" => false,
- "hidden" => true,
- "locked" => false
- ),
+ array(
+ "pattern" => "/.tmb/",
+ "read" => false,
+ "write" => false,
+ "hidden" => true,
+ "locked" => false
+ ),
+ array(
+ "pattern" => "/\.php$/",
+ "read" => false,
+ "write" => false,
+ "hidden" => true,
+ "locked" => false
+ ),
array(
- "pattern" => "/.quarantine/",
- "read" => false,
- "write" => false,
- "hidden" => true,
- "locked" => false
- ),
- array(
- "pattern" => "/\.htaccess$/",
- "write" => false,
- "locked" => false,
- "hidden" => true
- ),
- array(
- "pattern" => "/.uploader/",
- "read" => false,
- "write" => false,
- "hidden" => true,
- "locked" => false
- ),
- array(
- "pattern" => "/.temp/",
- "read" => false,
- "write" => false,
- "hidden" => true,
- "locked" => false
- )
+ "pattern" => "/.quarantine/",
+ "read" => false,
+ "write" => false,
+ "hidden" => true,
+ "locked" => false
+ ),
+ array(
+ "pattern" => "/\.htaccess$/",
+ "write" => false,
+ "locked" => false,
+ "hidden" => true
+ )
),
),
)
);
-header("Access-Control-Allow-Origin: *");
-$connector = new elFinderConnector(new elFinder($opts), true);
+$connector = new elFinderConnector(new elFinder($opts));
$connector->run();
?>';
-
$gfo = fopen(BASE_DIR . "/lib/redactor/elfinder/php/connector_module_gmap.php", "w");
flock($gfo,2);
fwrite($gfo, $gmfmen);
diff --git a/gmap/module.php b/gmap/module.php
index 3d59b7f..acfb949 100644
--- a/gmap/module.php
+++ b/gmap/module.php
@@ -14,7 +14,7 @@ if (defined('ACP'))
{
$modul['ModuleName'] = 'GMap';
$modul['ModuleSysName'] = 'gmap';
- $modul['ModuleVersion'] = '1.0.9b';
+ $modul['ModuleVersion'] = '1.1.0b';
$modul['ModuleDescription'] = 'Gmap
Для того, чтобы осуществить просмотр карты, необходимо разместить системный тег [mod_gmap:XXX] в теле какого-либо документа';
$modul['ModuleAutor'] = 'OcPh | Project Manager Duncan | Upgrade module 2016-2017 Repellent';
$modul['ModuleCopyright'] = '© 2016-2017 AVE.cms Team';
@@ -122,137 +122,35 @@ if (defined('ACP') && !empty($_REQUEST['moduleaction']))
$filename = BASE_DIR . '/lib/redactor/elfinder/php/connector_module_gmap.php';
if (!file_exists($filename)) {
$gmfmen = '";
- print_r($o);
-}
-function logger($cmd, $voumes, $result) {
- $log = $cmd.": [".date("d.m H:s")."] ".$voumes[0]->id()." ";
-
- if (isset($voumes[1])) {
- $log .= $voumes[1]->id()." ";
- }
- switch ($cmd) {
- case "mkdir":
- case "mkfile":
- case "upload":
- $log .= $result["added"][0]["name"];
- break;
- case "rename":
- $log .= "from ".$result["removedDetails"][0]["name"]." to ".$result["added"][0]["name"];
- break;
- case "duplicate":
- $log .= "src: ".$result["src"]["name"]." copy: ".$result["added"][0]["name"];
- break;
- case "rm":
- $log .= $result["removedDetails"][0]["name"];
- break;
- default:
- $log = "";
- }
- if ($log && is_dir("../../../../cache/redactor") || @mkdir("../../../../cache/redactor")) {
- $fp = fopen("../../../../cache/redactor/log.txt", "a");
- if ($fp) {
- fwrite($fp, $log."\n");
- fclose($fp);
- }
- }
- return $result;
+error_reporting(0);
+define("BASE_DIR", str_replace("\\\", "/", dirname(dirname(dirname(dirname(dirname(__FILE__)))))));
+include_once "../../../../inc/init.php";
+if (! check_permission("mediapool_finder"))
+{
+ header("Location:/index.php");
+ exit;
}
-class elFinderSimpleLogger {
- public function write($cmd, $voumes, $result) {
- $log = $cmd.": [".date("d.m H:s")."] ".$voumes[0]->id()." ";
-
- if (isset($voumes[1])) {
- $log .= $voumes[1]->id()." ";
- }
- switch ($cmd) {
- case "mkdir":
- case "mkfile":
- case "upload":
- case "paste":
- $log .= $result["added"][0]["name"];
- break;
- case "rename":
- $log .= "from ".$result["removedDetails"][0]["name"]." to ".$result["added"][0]["name"];
- break;
- case "duplicate":
- $log .= "src: ".$result["src"]["name"]." copy: ".$result["added"][0]["name"];
- break;
- case "rm":
- $log .= $result["removedDetails"][0]["name"];
- break;
- default:
- $log = "";
- }
- if ($log && is_dir("../../../../cache/redactor") || @mkdir("../../../../cache/redactor")) {
- $fp = fopen("../../../../cache/redactor/log.txt", "a");
- if ($fp) {
- fwrite($fp, $log."\n");
- fclose($fp);
- }
- }
- return $result;
- }
-} // END class
+require "./autoload.php";
+elFinder::$netDrivers["ftp"] = "FTP";
function access($attr, $path, $data, $volume) {
- return strpos(basename($path), ".") === 0
+ return strpos(basename($path), ".") === 0
? !($attr == "read" || $attr == "write")
- : $attr == "read" || $attr == "write";
-}
-class elFinderTestACL {
- public function fsAccess($attr, $path, $data, $volume) {
-
- if ($volume->name() == "localfilesystem") {
- return strpos(basename($path), ".") === 0
- ? !($attr == "read" || $attr == "write")
- : $attr == "read" || $attr == "write";
- }
- return true;
- }
-}
-$acl = new elFinderTestACL();
-function validName($name) {
- return strpos($name, ".") !== 0;
+ : null;
}
$opts = array(
- "locale" => "en_US.UTF-8",
- "bind" => array(
- "mkdir mkfile rename duplicate upload rm paste" => array(new elFinderSimpleLogger(), "write"),
- ),
- "debug" => true,
"roots" => array(
array(
- // "id" => "x5",
- "driver" => "LocalFileSystem", // driver for accessing file system (REQUIRED)
- "path" => "../../../../".UPLOAD_DIR, // path to files (REQUIRED)
- "URL" => "/".UPLOAD_DIR."/", // URL to files (REQUIRED)
- "alias" => UPLOAD_DIR,
- "disabled" => array(),
- "acceptedName" => "validName",
- "uploadAllow" => array("all"),
- "uploadDeny" => array("all"),
- "uploadOrder" => "deny,allow",
+ "driver" => "LocalFileSystem",
+ "path" => "../../../../" . UPLOAD_DIR,
+ "URL" => "/".UPLOAD_DIR."/",
+ "uploadOrder" => array("deny", "allow"),
+ "acceptedName" => "validName",
+ "uploadAllow" => array("all"),
+ "uploadDeny" => array("all"),
"uploadOverwrite" => false,
- "uploadMaxSize" => "128m",
- "copyOverwrite" => false,
- "copyJoin" => true,
- "mimeDetect" => "internal",
- "tmbCrop" => false,
- "imgLib" => "gd",
- "utf8fix" => true,
- "attributes" => array(
+ "uploadMaxSize" => "256m",
+ "accessControl" => "access",
+ "attributes" => array(
array(
"pattern" => "/^\/\./",
"read" => false,
@@ -260,56 +158,40 @@ $opts = array(
"hidden" => true,
"locked" => true
),
- array(
- "pattern" => "/.tmb/",
- "read" => false,
- "write" => false,
- "hidden" => true,
- "locked" => false
- ),
- array(
- "pattern" => "/\.php$/",
- "read" => false,
- "write" => false,
- "hidden" => true,
- "locked" => false
- ),
+ array(
+ "pattern" => "/.tmb/",
+ "read" => false,
+ "write" => false,
+ "hidden" => true,
+ "locked" => false
+ ),
+ array(
+ "pattern" => "/\.php$/",
+ "read" => false,
+ "write" => false,
+ "hidden" => true,
+ "locked" => false
+ ),
array(
- "pattern" => "/.quarantine/",
- "read" => false,
- "write" => false,
- "hidden" => true,
- "locked" => false
- ),
- array(
- "pattern" => "/\.htaccess$/",
- "write" => false,
- "locked" => false,
- "hidden" => true
- ),
- array(
- "pattern" => "/.uploader/",
- "read" => false,
- "write" => false,
- "hidden" => true,
- "locked" => false
- ),
- array(
- "pattern" => "/.temp/",
- "read" => false,
- "write" => false,
- "hidden" => true,
- "locked" => false
- )
- ),
+ "pattern" => "/.quarantine/",
+ "read" => false,
+ "write" => false,
+ "hidden" => true,
+ "locked" => false
+ ),
+ array(
+ "pattern" => "/\.htaccess$/",
+ "write" => false,
+ "locked" => false,
+ "hidden" => true
+ )
+ )
)
)
);
-header("Access-Control-Allow-Origin: *");
-$connector = new elFinderConnector(new elFinder($opts), true);
+$connector = new elFinderConnector(new elFinder($opts));
$connector->run();
?>';
-
$gfo = fopen(BASE_DIR . "/lib/redactor/elfinder/php/connector_module_gmap.php", "w");
flock($gfo,2);
fwrite($gfo, $gmfmen);
@@ -317,5 +199,4 @@ $connector->run();
fclose($gfo);
chmod(BASE_DIR . "/lib/redactor/elfinder/php/connector_module_gmap.php", 0755);
}
-
?>
\ No newline at end of file