Browse Source

+ обновление модуля до версии 1.1.0b

master
root 8 years ago
parent
commit
f35873cd14
  1. 2
      README.md
  2. 342
      gmap/fm.gmap.php
  3. 157
      gmap/module.php

2
README.md

@ -8,6 +8,8 @@
##### Changelog: ##### Changelog:
##### 26.05.2017 - обновление модуля до версии 1.1.0b - Адаптация модуля для AVE.cms v3.2 - фикс подключения файлового менеджера elfinder.
##### 05.03.2017 - обновление модуля до версии 1.0.9b - AJAX загрузка пинов с фильтром вывода по цвету пина + возможность добавления собственных пинов в категорию USER. ##### 05.03.2017 - обновление модуля до версии 1.0.9b - AJAX загрузка пинов с фильтром вывода по цвету пина + возможность добавления собственных пинов в категорию USER.
##### 18.02.2017 - обновление модуля до версии 1.0.8b - рекомендуется для тестирования. Установка только чистая, обновление не прокатит. ##### 18.02.2017 - обновление модуля до версии 1.0.8b - рекомендуется для тестирования. Установка только чистая, обновление не прокатит.

342
gmap/fm.gmap.php

@ -14,137 +14,36 @@ $fmgmap = $_POST['fmgmap'];
if ($fmgmap == 'dir_upl') if ($fmgmap == 'dir_upl')
{ {
$gmfmen = '<?php $gmfmen = '
error_reporting(E_ALL); // Set E_ALL for debuging <?php
if (function_exists("date_default_timezone_set")) { error_reporting(0);
date_default_timezone_set("Europe/Moscow"); define("BASE_DIR", str_replace("\\\", "/", dirname(dirname(dirname(dirname(dirname(__FILE__)))))));
} include_once "../../../../inc/init.php";
include_once dirname(__FILE__).DIRECTORY_SEPARATOR."elFinderConnector.class.php"; if (! check_permission("mediapool_finder"))
include_once dirname(__FILE__).DIRECTORY_SEPARATOR."elFinder.class.php"; {
include_once dirname(__FILE__).DIRECTORY_SEPARATOR."elFinderVolumeDriver.class.php"; header("Location:/index.php");
include_once dirname(__FILE__).DIRECTORY_SEPARATOR."elFinderVolumeLocalFileSystem.class.php"; exit;
include_once dirname(__FILE__).DIRECTORY_SEPARATOR."elFinderVolumeMySQL.class.php";
include_once "../../../../inc/config.php";
include_once "../../../../inc/config.inc.php";
function debug($o) {
echo "<pre>";
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;
}
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) { function access($attr, $path, $data, $volume) {
return strpos(basename($path), ".") === 0 return strpos(basename($path), ".") === 0
? !($attr == "read" || $attr == "write") ? !($attr == "read" || $attr == "write")
: $attr == "read" || $attr == "write"; : null;
}
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;
} }
$opts = array( $opts = array(
"locale" => "en_US.UTF-8",
"bind" => array(
"mkdir mkfile rename duplicate upload rm paste" => array(new elFinderSimpleLogger(), "write"),
),
"debug" => true,
"roots" => array( "roots" => array(
array( array(
// "id" => "x5", "driver" => "LocalFileSystem",
"driver" => "LocalFileSystem", // driver for accessing file system (REQUIRED) "path" => "../../../../" . UPLOAD_DIR,
"path" => "../../../../".UPLOAD_DIR, // path to files (REQUIRED) "URL" => "/".UPLOAD_DIR."/",
"URL" => "/".UPLOAD_DIR."/", // URL to files (REQUIRED) "uploadOrder" => array("deny", "allow"),
"alias" => UPLOAD_DIR,
"disabled" => array(),
"acceptedName" => "validName", "acceptedName" => "validName",
"uploadAllow" => array("all"), "uploadAllow" => array("all"),
"uploadDeny" => array("all"), "uploadDeny" => array("all"),
"uploadOrder" => "deny,allow",
"uploadOverwrite" => false, "uploadOverwrite" => false,
"uploadMaxSize" => "128m", "uploadMaxSize" => "256m",
"copyOverwrite" => false, "accessControl" => "access",
"copyJoin" => true,
"mimeDetect" => "internal",
"tmbCrop" => false,
"imgLib" => "gd",
"utf8fix" => true,
"attributes" => array( "attributes" => array(
array( array(
"pattern" => "/^\/\./", "pattern" => "/^\/\./",
@ -179,27 +78,12 @@ $opts = array(
"write" => false, "write" => false,
"locked" => false, "locked" => false,
"hidden" => true "hidden" => true
),
array(
"pattern" => "/.uploader/",
"read" => false,
"write" => false,
"hidden" => true,
"locked" => false
),
array(
"pattern" => "/.temp/",
"read" => false,
"write" => false,
"hidden" => true,
"locked" => false
) )
), )
) )
) )
); );
header("Access-Control-Allow-Origin: *"); $connector = new elFinderConnector(new elFinder($opts));
$connector = new elFinderConnector(new elFinder($opts), true);
$connector->run(); $connector->run();
?>'; ?>';
@ -215,136 +99,34 @@ $connector->run();
if ($fmgmap == 'dir_uplgmi') if ($fmgmap == 'dir_uplgmi')
{ {
$gmfmen = '<?php $gmfmen = '<?php
error_reporting(E_ALL); // Set E_ALL for debuging error_reporting(0);
if (function_exists("date_default_timezone_set")) { define("BASE_DIR", str_replace("\\\", "/", dirname(dirname(dirname(dirname(dirname(__FILE__)))))));
date_default_timezone_set("Europe/Moscow"); include_once "../../../../inc/init.php";
} if (! check_permission("mediapool_finder"))
include_once dirname(__FILE__).DIRECTORY_SEPARATOR."elFinderConnector.class.php"; {
include_once dirname(__FILE__).DIRECTORY_SEPARATOR."elFinder.class.php"; header("Location:/index.php");
include_once dirname(__FILE__).DIRECTORY_SEPARATOR."elFinderVolumeDriver.class.php"; exit;
include_once dirname(__FILE__).DIRECTORY_SEPARATOR."elFinderVolumeLocalFileSystem.class.php";
include_once dirname(__FILE__).DIRECTORY_SEPARATOR."elFinderVolumeMySQL.class.php";
include_once "../../../../inc/config.php";
include_once "../../../../inc/config.inc.php";
function debug($o) {
echo "<pre>";
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;
}
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) { function access($attr, $path, $data, $volume) {
return strpos(basename($path), ".") === 0 return strpos(basename($path), ".") === 0
? !($attr == "read" || $attr == "write") ? !($attr == "read" || $attr == "write")
: $attr == "read" || $attr == "write"; : null;
}
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;
} }
$opts = array( $opts = array(
"locale" => "en_US.UTF-8",
"bind" => array(
"mkdir mkfile rename duplicate upload rm paste" => array(new elFinderSimpleLogger(), "write"),
),
"debug" => true,
"roots" => array( "roots" => array(
array( array(
// "id" => "x5", "driver" => "LocalFileSystem",
"driver" => "LocalFileSystem", // driver for accessing file system (REQUIRED) "path" => "../../../../" . UPLOAD_DIR,
"path" => "../../../../".UPLOAD_DIR, // path to files (REQUIRED) "URL" => "/".UPLOAD_DIR."/",
"URL" => "/".UPLOAD_DIR."/", // URL to files (REQUIRED) "uploadOrder" => array("deny", "allow"),
"alias" => UPLOAD_DIR,
"disabled" => array(),
"acceptedName" => "validName", "acceptedName" => "validName",
"uploadAllow" => array("all"), "uploadAllow" => array("all"),
"uploadDeny" => array("all"), "uploadDeny" => array("all"),
"uploadOrder" => "deny,allow",
"uploadOverwrite" => false, "uploadOverwrite" => false,
"uploadMaxSize" => "128m", "uploadMaxSize" => "256m",
"copyOverwrite" => false, "accessControl" => "access",
"copyJoin" => true,
"mimeDetect" => "internal",
"tmbCrop" => false,
"imgLib" => "gd",
"utf8fix" => true,
"attributes" => array( "attributes" => array(
array( array(
"pattern" => "/^\/\./", "pattern" => "/^\/\./",
@ -379,42 +161,20 @@ $opts = array(
"write" => false, "write" => false,
"locked" => false, "locked" => false,
"hidden" => true "hidden" => true
),
array(
"pattern" => "/.uploader/",
"read" => false,
"write" => false,
"hidden" => true,
"locked" => false
),
array(
"pattern" => "/.temp/",
"read" => false,
"write" => false,
"hidden" => true,
"locked" => false
) )
), ),
), ),
array( array(
// "id" => "x5", "driver" => "LocalFileSystem",
"driver" => "LocalFileSystem", // driver for accessing file system (REQUIRED) "path" => "../../../../modules/gmap/images",
"path" => "../../../../modules/gmap/images", // path to files (REQUIRED) "URL" => "/modules/gmap/images/",
"URL" => "/modules/gmap/images/", // URL to files (REQUIRED) "uploadOrder" => array("deny", "allow"),
"alias" => "modules/gmap/images",
"disabled" => array(),
"acceptedName" => "validName", "acceptedName" => "validName",
"uploadAllow" => array("all"), "uploadAllow" => array("all"),
"uploadDeny" => array("all"), "uploadDeny" => array("all"),
"uploadOrder" => "deny,allow",
"uploadOverwrite" => false, "uploadOverwrite" => false,
"uploadMaxSize" => "128m", "uploadMaxSize" => "256m",
"copyOverwrite" => false, "accessControl" => "access",
"copyJoin" => true,
"mimeDetect" => "internal",
"tmbCrop" => false,
"imgLib" => "gd",
"utf8fix" => true,
"attributes" => array( "attributes" => array(
array( array(
"pattern" => "/^\/\./", "pattern" => "/^\/\./",
@ -449,30 +209,14 @@ $opts = array(
"write" => false, "write" => false,
"locked" => false, "locked" => false,
"hidden" => true "hidden" => true
),
array(
"pattern" => "/.uploader/",
"read" => false,
"write" => false,
"hidden" => true,
"locked" => false
),
array(
"pattern" => "/.temp/",
"read" => false,
"write" => false,
"hidden" => true,
"locked" => false
) )
), ),
), ),
) )
); );
header("Access-Control-Allow-Origin: *"); $connector = new elFinderConnector(new elFinder($opts));
$connector = new elFinderConnector(new elFinder($opts), true);
$connector->run(); $connector->run();
?>'; ?>';
$gfo = fopen(BASE_DIR . "/lib/redactor/elfinder/php/connector_module_gmap.php", "w"); $gfo = fopen(BASE_DIR . "/lib/redactor/elfinder/php/connector_module_gmap.php", "w");
flock($gfo,2); flock($gfo,2);
fwrite($gfo, $gmfmen); fwrite($gfo, $gmfmen);

157
gmap/module.php

@ -14,7 +14,7 @@ if (defined('ACP'))
{ {
$modul['ModuleName'] = 'GMap'; $modul['ModuleName'] = 'GMap';
$modul['ModuleSysName'] = 'gmap'; $modul['ModuleSysName'] = 'gmap';
$modul['ModuleVersion'] = '1.0.9b'; $modul['ModuleVersion'] = '1.1.0b';
$modul['ModuleDescription'] = 'Gmap<br/>Для того, чтобы осуществить просмотр карты, необходимо разместить системный тег <strong>[mod_gmap:XXX]</strong> в теле какого-либо документа'; $modul['ModuleDescription'] = 'Gmap<br/>Для того, чтобы осуществить просмотр карты, необходимо разместить системный тег <strong>[mod_gmap:XXX]</strong> в теле какого-либо документа';
$modul['ModuleAutor'] = 'OcPh | Project Manager Duncan | Upgrade module 2016-2017 Repellent'; $modul['ModuleAutor'] = 'OcPh | Project Manager Duncan | Upgrade module 2016-2017 Repellent';
$modul['ModuleCopyright'] = '&copy; 2016-2017 AVE.cms Team'; $modul['ModuleCopyright'] = '&copy; 2016-2017 AVE.cms Team';
@ -122,136 +122,34 @@ if (defined('ACP') && !empty($_REQUEST['moduleaction']))
$filename = BASE_DIR . '/lib/redactor/elfinder/php/connector_module_gmap.php'; $filename = BASE_DIR . '/lib/redactor/elfinder/php/connector_module_gmap.php';
if (!file_exists($filename)) { if (!file_exists($filename)) {
$gmfmen = '<?php $gmfmen = '<?php
error_reporting(E_ALL); // Set E_ALL for debuging error_reporting(0);
if (function_exists("date_default_timezone_set")) { define("BASE_DIR", str_replace("\\\", "/", dirname(dirname(dirname(dirname(dirname(__FILE__)))))));
date_default_timezone_set("Europe/Moscow"); include_once "../../../../inc/init.php";
} if (! check_permission("mediapool_finder"))
include_once dirname(__FILE__).DIRECTORY_SEPARATOR."elFinderConnector.class.php"; {
include_once dirname(__FILE__).DIRECTORY_SEPARATOR."elFinder.class.php"; header("Location:/index.php");
include_once dirname(__FILE__).DIRECTORY_SEPARATOR."elFinderVolumeDriver.class.php"; exit;
include_once dirname(__FILE__).DIRECTORY_SEPARATOR."elFinderVolumeLocalFileSystem.class.php";
include_once dirname(__FILE__).DIRECTORY_SEPARATOR."elFinderVolumeMySQL.class.php";
include_once "../../../../inc/config.php";
include_once "../../../../inc/config.inc.php";
function debug($o) {
echo "<pre>";
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;
}
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) { function access($attr, $path, $data, $volume) {
return strpos(basename($path), ".") === 0 return strpos(basename($path), ".") === 0
? !($attr == "read" || $attr == "write") ? !($attr == "read" || $attr == "write")
: $attr == "read" || $attr == "write"; : null;
}
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;
} }
$opts = array( $opts = array(
"locale" => "en_US.UTF-8",
"bind" => array(
"mkdir mkfile rename duplicate upload rm paste" => array(new elFinderSimpleLogger(), "write"),
),
"debug" => true,
"roots" => array( "roots" => array(
array( array(
// "id" => "x5", "driver" => "LocalFileSystem",
"driver" => "LocalFileSystem", // driver for accessing file system (REQUIRED) "path" => "../../../../" . UPLOAD_DIR,
"path" => "../../../../".UPLOAD_DIR, // path to files (REQUIRED) "URL" => "/".UPLOAD_DIR."/",
"URL" => "/".UPLOAD_DIR."/", // URL to files (REQUIRED) "uploadOrder" => array("deny", "allow"),
"alias" => UPLOAD_DIR,
"disabled" => array(),
"acceptedName" => "validName", "acceptedName" => "validName",
"uploadAllow" => array("all"), "uploadAllow" => array("all"),
"uploadDeny" => array("all"), "uploadDeny" => array("all"),
"uploadOrder" => "deny,allow",
"uploadOverwrite" => false, "uploadOverwrite" => false,
"uploadMaxSize" => "128m", "uploadMaxSize" => "256m",
"copyOverwrite" => false, "accessControl" => "access",
"copyJoin" => true,
"mimeDetect" => "internal",
"tmbCrop" => false,
"imgLib" => "gd",
"utf8fix" => true,
"attributes" => array( "attributes" => array(
array( array(
"pattern" => "/^\/\./", "pattern" => "/^\/\./",
@ -286,30 +184,14 @@ $opts = array(
"write" => false, "write" => false,
"locked" => false, "locked" => false,
"hidden" => true "hidden" => true
),
array(
"pattern" => "/.uploader/",
"read" => false,
"write" => false,
"hidden" => true,
"locked" => false
),
array(
"pattern" => "/.temp/",
"read" => false,
"write" => false,
"hidden" => true,
"locked" => false
) )
), )
) )
) )
); );
header("Access-Control-Allow-Origin: *"); $connector = new elFinderConnector(new elFinder($opts));
$connector = new elFinderConnector(new elFinder($opts), true);
$connector->run(); $connector->run();
?>'; ?>';
$gfo = fopen(BASE_DIR . "/lib/redactor/elfinder/php/connector_module_gmap.php", "w"); $gfo = fopen(BASE_DIR . "/lib/redactor/elfinder/php/connector_module_gmap.php", "w");
flock($gfo,2); flock($gfo,2);
fwrite($gfo, $gmfmen); fwrite($gfo, $gmfmen);
@ -317,5 +199,4 @@ $connector->run();
fclose($gfo); fclose($gfo);
chmod(BASE_DIR . "/lib/redactor/elfinder/php/connector_module_gmap.php", 0755); chmod(BASE_DIR . "/lib/redactor/elfinder/php/connector_module_gmap.php", 0755);
} }
?> ?>
Loading…
Cancel
Save