root
8 years ago
14 changed files with 2012 additions and 118 deletions
@ -0,0 +1,491 @@
|
||||
<?php |
||||
ob_start(); |
||||
ob_implicit_flush(0); |
||||
define('BASE_DIR', str_replace("\\", "/", dirname(dirname(dirname(__FILE__))))); |
||||
require_once(BASE_DIR . '/inc/init.php'); |
||||
if (! check_permission('adminpanel')) |
||||
{ |
||||
header('Location:/index.php'); |
||||
exit; |
||||
} |
||||
|
||||
$fmgmap = $_POST['fmgmap']; |
||||
|
||||
if ($fmgmap == 'dir_upl') |
||||
{ |
||||
|
||||
$gmfmen = '<?php |
||||
error_reporting(E_ALL); // Set E_ALL for debuging |
||||
if (function_exists("date_default_timezone_set")) { |
||||
date_default_timezone_set("Europe/Moscow"); |
||||
} |
||||
include_once dirname(__FILE__).DIRECTORY_SEPARATOR."elFinderConnector.class.php"; |
||||
include_once dirname(__FILE__).DIRECTORY_SEPARATOR."elFinder.class.php"; |
||||
include_once dirname(__FILE__).DIRECTORY_SEPARATOR."elFinderVolumeDriver.class.php"; |
||||
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 |
||||
function access($attr, $path, $data, $volume) { |
||||
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; |
||||
} |
||||
$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", |
||||
"uploadOverwrite" => false, |
||||
"uploadMaxSize" => "128m", |
||||
"copyOverwrite" => false, |
||||
"copyJoin" => true, |
||||
"mimeDetect" => "internal", |
||||
"tmbCrop" => false, |
||||
"imgLib" => "gd", |
||||
"utf8fix" => true, |
||||
"attributes" => array( |
||||
array( |
||||
"pattern" => "/^\/\./", |
||||
"read" => false, |
||||
"write" => false, |
||||
"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" => "/.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 |
||||
) |
||||
), |
||||
) |
||||
) |
||||
); |
||||
header("Access-Control-Allow-Origin: *"); |
||||
$connector = new elFinderConnector(new elFinder($opts), true); |
||||
$connector->run(); |
||||
?>'; |
||||
|
||||
$gfo = fopen(BASE_DIR . "/lib/redactor/elfinder/php/connector_module_gmap.php", "w"); |
||||
flock($gfo,2); |
||||
fwrite($gfo, $gmfmen); |
||||
flock($gfo,3); |
||||
fclose($gfo); |
||||
chmod(BASE_DIR . "/lib/redactor/elfinder/php/connector_module_gmap.php", 0755); |
||||
|
||||
} |
||||
|
||||
if ($fmgmap == 'dir_uplgmi') |
||||
{ |
||||
$gmfmen = '<?php |
||||
error_reporting(E_ALL); // Set E_ALL for debuging |
||||
if (function_exists("date_default_timezone_set")) { |
||||
date_default_timezone_set("Europe/Moscow"); |
||||
} |
||||
include_once dirname(__FILE__).DIRECTORY_SEPARATOR."elFinderConnector.class.php"; |
||||
include_once dirname(__FILE__).DIRECTORY_SEPARATOR."elFinder.class.php"; |
||||
include_once dirname(__FILE__).DIRECTORY_SEPARATOR."elFinderVolumeDriver.class.php"; |
||||
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 |
||||
function access($attr, $path, $data, $volume) { |
||||
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; |
||||
} |
||||
$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", |
||||
"uploadOverwrite" => false, |
||||
"uploadMaxSize" => "128m", |
||||
"copyOverwrite" => false, |
||||
"copyJoin" => true, |
||||
"mimeDetect" => "internal", |
||||
"tmbCrop" => false, |
||||
"imgLib" => "gd", |
||||
"utf8fix" => true, |
||||
"attributes" => array( |
||||
array( |
||||
"pattern" => "/^\/\./", |
||||
"read" => false, |
||||
"write" => false, |
||||
"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" => "/.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 |
||||
) |
||||
), |
||||
), |
||||
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", |
||||
"uploadOverwrite" => false, |
||||
"uploadMaxSize" => "128m", |
||||
"copyOverwrite" => false, |
||||
"copyJoin" => true, |
||||
"mimeDetect" => "internal", |
||||
"tmbCrop" => false, |
||||
"imgLib" => "gd", |
||||
"utf8fix" => true, |
||||
"attributes" => array( |
||||
array( |
||||
"pattern" => "/^\/\./", |
||||
"read" => false, |
||||
"write" => false, |
||||
"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" => "/.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 |
||||
) |
||||
), |
||||
), |
||||
) |
||||
); |
||||
header("Access-Control-Allow-Origin: *"); |
||||
$connector = new elFinderConnector(new elFinder($opts), true); |
||||
$connector->run(); |
||||
?>'; |
||||
|
||||
$gfo = fopen(BASE_DIR . "/lib/redactor/elfinder/php/connector_module_gmap.php", "w"); |
||||
flock($gfo,2); |
||||
fwrite($gfo, $gmfmen); |
||||
flock($gfo,3); |
||||
fclose($gfo); |
||||
chmod(BASE_DIR . "/lib/redactor/elfinder/php/connector_module_gmap.php", 0755); |
||||
} |
||||
|
||||
if ($fmgmap != 'dir_upl' || $fmgmap != 'dir_uplgmi') |
||||
{ |
||||
header('Location:/index.php'); |
||||
exit; |
||||
} |
||||
|
||||
|
||||
?> |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 326 B |
After Width: | Height: | Size: 457 B |
@ -0,0 +1,22 @@
|
||||
$(function loadFM() { |
||||
// отдельный файловый менеджер
|
||||
$('#finder').elfinder({ |
||||
url : ave_path+'lib/redactor/elfinder/php/connector_module_gmap.php', |
||||
lang : 'ru', |
||||
height : 300, |
||||
title : 'Файловый менеджер' |
||||
}).elfinder('instance'); |
||||
|
||||
$('#elFinder a').hover( |
||||
function () { |
||||
$('#elFinder a').animate({ |
||||
'background-position' : '0 -45px' |
||||
}, 300); |
||||
}, |
||||
function () { |
||||
$('#elFinder a').delay(400).animate({ |
||||
'background-position' : '0 0' |
||||
}, 300); |
||||
} |
||||
); |
||||
}); |
@ -0,0 +1,22 @@
|
||||
$(function() { |
||||
// отдельный файловый менеджер
|
||||
$('#finder').elfinder({ |
||||
url : ave_path+'lib/redactor/elfinder/php/connector_template.php', |
||||
lang : 'ru', |
||||
height : 500, |
||||
title : 'Файловый менеджер' |
||||
}).elfinder('instance'); |
||||
|
||||
$('#elFinder a').hover( |
||||
function () { |
||||
$('#elFinder a').animate({ |
||||
'background-position' : '0 -45px' |
||||
}, 300); |
||||
}, |
||||
function () { |
||||
$('#elFinder a').delay(400).animate({ |
||||
'background-position' : '0 0' |
||||
}, 300); |
||||
} |
||||
); |
||||
}); |
@ -0,0 +1,170 @@
|
||||
{literal} |
||||
<style type="text/css"> |
||||
.gmnone { |
||||
display: none; |
||||
} |
||||
</style> |
||||
{/literal} |
||||
<div class="title"><h5>{#ModName#}</h5></div> |
||||
<div class="widget" style="margin-top: 0px;"> |
||||
<div class="body"> |
||||
{#Gmap_warndelcat1#} |
||||
</div> |
||||
</div> |
||||
<div class="breadCrumbHolder module"> |
||||
<div class="breadCrumb module"> |
||||
<ul> |
||||
<li class="firstB"><a href="index.php" title="{#MAIN_PAGE#}">{#MAIN_PAGE#}</a></li> |
||||
<li><a href="index.php?do=modules&cp={$sess}">{#MODULES_SUB_TITLE#}</a></li> |
||||
<li><a href="index.php?do=modules&action=modedit&mod=gmap&moduleaction=1&cp={$sess}">{#ModName#}</a></li> |
||||
<li><strong class="code">{#Gmap_cat_edit#}</strong></li> |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
<div class="widget first"> |
||||
<div class="head"><h5 class="iFrames">{#Gmap_cat_list#}</h5></div> |
||||
|
||||
|
||||
|
||||
|
||||
<table width='100%' border='1' cellspacing='0' cellpadding='0' class="tableStatic mainForm"><tr> |
||||
{foreach from=$gcats item=gcat key=k} |
||||
<td width="25%" id="gcatst_{$gcat.id}">{$gcat.gcat_title}<a id="gcatsa_{$gcat.id}" style="float: right;" class="gcatclick topleftDir icon_sprite ico_delete" href="javascript:void(0);" data-id="{$gcat.id}" title="{#Gmap_cat_del#}"></a></td> |
||||
{if $k%4 == 3}</tr><tr>{/if} |
||||
{/foreach} |
||||
</tr></table> |
||||
</div> |
||||
<div style="text-align: center; padding-top: 10px; padding-bottom: 0px;" id="results"></div> |
||||
<div class="widget first"> |
||||
<table cellspacing="0" width="100%" class="tableStatic mainForm"> |
||||
<tbody> |
||||
<tr> |
||||
<td width="110">{#Gmap_cat_add#}</td> |
||||
<td> |
||||
<div class="pr12"> |
||||
<input class="mousetrap" name="gcatnewadd" type="text" id="gcatnewadd" placeholder="{#Gmap_cat_name#}" value="" size="40" style="width: 300px;" /> |
||||
<input type="hidden" name="gct_link" id="gct_link" value="" /> |
||||
<input id ="gdc" onclick="openLinkWindowSelect('');" type="button" class="basicBtn greenBtn" value="{#Gmap_btn_doc_title#}" /> |
||||
<a class="button redBtn" href="javascript:void(0);" onclick="newCategory();">{#Gmap_cat_save#}</a> |
||||
<a class="btn blueBtn" href="index.php?do=modules&action=modedit&mod=gmap&moduleaction=show&id={$smarty.request.id}&cp={$sess}">{#Gmap_mar_map_retry#}</a> |
||||
<a href="index.php?do=modules&action=modedit&mod=gmap&moduleaction=1&cp={$sess}" class="btn greyishBtn"/>{#Gmap_return#}</a> |
||||
|
||||
</div> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
|
||||
|
||||
<script type="text/javascript"> |
||||
|
||||
// Обнуляем значения полей категорий при вводе с клавиатуры |
||||
$('#gcatnewadd').focus(function(){ldelim} |
||||
$('#gcatnewadd').val(''); |
||||
$('#gct_link').val(''); |
||||
{rdelim}); |
||||
|
||||
//Создание новой категории |
||||
function newCategory(){ldelim} |
||||
|
||||
var gcatnewadd = $('#gcatnewadd').val(); |
||||
var gct_link = $('#gct_link').val(); |
||||
// check response status |
||||
if (gcatnewadd !='') {ldelim} |
||||
var categoryData = {ldelim} |
||||
'gcatnewadd': gcatnewadd, |
||||
'gct_link': gct_link, |
||||
{rdelim}; |
||||
|
||||
$.ajax({ldelim} |
||||
type: 'POST', |
||||
url: 'index.php?do=modules&action=modedit&mod=gmap&moduleaction=addnewcategory&cp={$sess}', |
||||
data: {ldelim} |
||||
category: categoryData |
||||
{rdelim}, |
||||
dataType: 'json', |
||||
async: false, |
||||
success: function(result){ldelim} |
||||
$.jGrowl("{#Gmap_cat_in#}", {ldelim} |
||||
header: '{#Gmap_cat_i#}', |
||||
theme: 'accept' |
||||
{rdelim}); |
||||
var gcat_id = result['id']; |
||||
var gcat_title = "<span style='font-size:12px; padding:5px;' class="+"'link highlight green'><strong style='font-size:16px; position:relative; top:2px; color:orange;'>+</strong> <strong>{#Gmap_cat_nca#}</strong> <strong><i class='link'>"+result['gcat_title']+"</i></strong></span>"+"<br><br>"; |
||||
$('#results').prepend(gcat_title); |
||||
|
||||
{rdelim} |
||||
{rdelim}); |
||||
//add marker to list |
||||
|
||||
{rdelim}else {ldelim} |
||||
alert("Заполните поле название категории"); |
||||
{rdelim}; |
||||
$('#gcatnewadd').val(''); |
||||
$('#gct_link').val(''); |
||||
|
||||
{rdelim} |
||||
|
||||
// УДАЛЯЕМ КАТЕГОРИИ |
||||
|
||||
$('.gcatclick').on('click', function() {ldelim} |
||||
var sess = '{$sess}'; |
||||
var sid = $(this).attr('data-id'); |
||||
// alert(sid); |
||||
var url = "index.php?do=modules&action=modedit&mod=gmap&moduleaction=gcatdel&id=" + sid + "&cp=" + sess; |
||||
//alert(url); |
||||
if (confirm('{#Gmap_cat_delconf#}')) {ldelim} |
||||
$.ajax({ldelim} |
||||
url: url + '?ajax=1', |
||||
success: function(data){ldelim} |
||||
$("#gcatst_"+data).addClass('gmnone'); |
||||
$.jGrowl("{#Gmap_cat_ind#}", {ldelim} |
||||
header: '{#Gmap_cat_i#}', |
||||
theme: 'accept' |
||||
{rdelim}); |
||||
{rdelim} |
||||
{rdelim}); |
||||
// Предотвращаем дефолтное поведение |
||||
return false; |
||||
{rdelim} else {ldelim} |
||||
//alert("Вы нажали кнопку отмена") |
||||
{rdelim} |
||||
{rdelim}); |
||||
</script> |
||||
|
||||
<script> |
||||
function openLinkWindowSelect(target, doc) {ldelim} |
||||
if (typeof width == 'undefined' || width == '') var width = screen.width * 0.8; |
||||
if (typeof height == 'undefined' || height == '') var height = screen.height * 0.6; |
||||
if (typeof doc == 'undefined') var doc = 'title'; |
||||
if (typeof scrollbar == 'undefined') var scrollbar = 1; |
||||
var sess = '{$sess}'; |
||||
var abs_path = '{$ABS_PATH}'; |
||||
var left = ( screen.width - width ) / 2; |
||||
var top = ( screen.height - height ) / 2; |
||||
window.open('index.php?doc=' + doc + '&target=' + target + '&do=docs&action=showsimple&function=1&pop=1&cp=' + sess, 'pop', 'left=' + left + ', top=' + top + ', width=' + width + ', height=' + height + ', scrollbars=' + scrollbar + ', resizable=1'); |
||||
{rdelim} |
||||
$.fn.fromDocList = function set_value(target_id, doc_id) {ldelim} |
||||
var sess = '{$sess}'; |
||||
var abs_path = '{$ABS_PATH}'; |
||||
$.ajax ({ldelim} |
||||
url: 'index.php?do=navigation&cp=' + sess, |
||||
type: 'POST', |
||||
dataType: 'JSON', |
||||
data: {ldelim} |
||||
'action':'itemeditid', |
||||
'doc_id': doc_id |
||||
{rdelim}, |
||||
|
||||
success: function(data){ldelim} |
||||
$('#gcatnewadd').val(data.document_title); |
||||
$('#gct_link').val(data.document_alias); |
||||
{rdelim} |
||||
{rdelim}); |
||||
{rdelim}; |
||||
</script> |
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,293 @@
|
||||
{foreach from=$gmarkers item=gmarker} |
||||
<div class="title"><h5>{#ModName#} - {#MarkerAdress_e_brc#}{$gmarker.id}</h5></div> |
||||
|
||||
<div class="widget" style="margin-top: 0px;"> |
||||
<div class="body"> |
||||
<span style=" position: relative; top: -10px;">{#MarkerAdress_m_e#}</span> <img src='/modules/gmap/images/{$gmarker.image}.png'> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
<div class="breadCrumbHolder module"> |
||||
<div class="breadCrumb module"> |
||||
<ul> |
||||
<li class="firstB"><a href="index.php" title="{#MAIN_PAGE#}">{#MAIN_PAGE#}</a></li> |
||||
<li><a href="index.php?do=modules&cp={$sess}">{#MODULES_SUB_TITLE#}</a></li> |
||||
<li><a href="index.php?do=modules&action=modedit&mod=gmap&moduleaction=1&cp={$sess}">{#ModName#}</a></li> |
||||
<li>{#MarkerView#}</li> |
||||
<li><strong class="code">{#MarkerAdress_e_brc#}{$gmarker.id}</strong></li> |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic mainForm"> |
||||
<col width="250"> |
||||
<col> |
||||
<thead> |
||||
<tr> |
||||
<td><h5 class="iFrames">{#MarkerParam#}</h5></td> |
||||
<td><h5 class="iFrames">{#MarkerSetVal#}</h5></td> |
||||
</tr> |
||||
</thead> |
||||
<tr> |
||||
<td><span style="float: left; margin-right: 5px;">{#MarkerAdress_not#}</span><span style="cursor: help; float: left;" class="toprightDir icon_sprite ico_info" title="{#Gmap_narker_edit_not#}"> </span></td> |
||||
<td nowrap="nowrap"> |
||||
<input disabled class="mousetrap" name="address_e" type="text" id="marker_address_e" value="" size="40" style="width:500px" /> |
||||
<input name="latitude_e" type="hidden" id="lat_e" value="{$gmarker.latitude}"/> |
||||
<input name="longitude_e" type="hidden" id="long_e" value="{$gmarker.longitude}"/> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td><span style="float: left; margin-right: 5px;">{#MarkerDesc#}</span><span style="cursor: help; float: left;" class="toprightDir icon_sprite ico_info" title="{#Gmap_link_category#}"> </span></td> |
||||
<td nowrap="nowrap"> |
||||
<input readonly class="mousetrap" name="marker_cat_title_e" type="text" id="marker_cat_title_e" placeholder="{#Markercat_h#}" value="{$gmarker.marker_cat_title}" style="width:500px" /> |
||||
<input type="hidden" name="marker_cat_link_e" id="marker_cat_link_e" value="{$gmarker.marker_cat_link}" /> |
||||
<input type="hidden" name="marker_cat_id_e" id="marker_cat_id_e" value="{$gmarker.marker_cat_id}" /> |
||||
<select name="category_e" id="category_e" style="width: 300px;"> |
||||
<option value="">{#Gmap_cat_sel#}</option> |
||||
{foreach from=$gcats item=gcat} |
||||
<option value="{$gcat.id}" data-link="{$gcat.gcat_link}">{$gcat.gcat_title|escape}</option> |
||||
{/foreach} |
||||
</select> |
||||
<a class="button redBtn" href="javascript:void(0);" onclick="GetCategoryE()">{#Gmap_cat_cnf#}</a> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td><span style="float: left; margin-right: 5px;">{#Gmap_doc_title#}</span><span style="cursor: help; float: left;" class="toprightDir icon_sprite ico_info" title="{#Gmap_link_single_marker#}"> </span></td> |
||||
<td> |
||||
<input class="mousetrap" name="marker_title_e" type="text" id="marker_title_e" placeholder="{#Gmap_doc_title#}" value="{$gmarker.title}" style="width:500px" /> |
||||
<input type="hidden" name="title_link_e" id="title_link_e" value="{$gmarker.title_link}" /> |
||||
<input onclick="openLinkWindowSelectE('');" type="button" class="basicBtn greenBtn" value="{#Gmap_btn_doc_title#}" /> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td><span style="float: left; margin-right: 5px;">{#Gmap_img_title#}</span><span style="cursor: help; float: left;" class="toprightDir icon_sprite ico_info" title="{#Gmap_link_single_image#}"> </span></td> |
||||
<td> |
||||
<div style="" id="feld__i_e"> |
||||
<img style="" id="_img_feld__i_e" src="{$gmarker.img_title}" alt="" border="0" width="64" height="64" /> |
||||
</div> |
||||
<div style="" id="span_feld__i_e"></div> |
||||
<input class="mousetrap" type="text" style="width: 500px;" placeholder="{#Markerimg_t#}" name="img_feld__i_e" value="{$gmarker.img_title}" id="img_feld__i_e" /> |
||||
<input value="{#Gmap_load_img_title#}"" class="basicBtn" type="button" onclick="browse_uploads('img_feld__i_e', '', '', '0');" /> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td colspan="2"><h5 class="iFrames">{#Gmap_cat_inf_dop#}</h5></td> |
||||
</tr> |
||||
<tr id="tr_city_e"> |
||||
{if $gmarker.marker_city !=''} |
||||
<td><span style="float: left; margin-right: 5px;">{#Gmap_cat_inf_tn#}</span><span style="cursor: help; float: left;" class="toprightDir icon_sprite ico_info" title="{#Gmap_narker_edit_not#}"> </span></td> |
||||
<td> |
||||
<input disabled="disabled" class="mousetrap" name="marker_city_e" type="text" id="marker_city_e" value="{$gmarker.marker_city}" placeholder="{#Gmap_cat_inf_tp#}" style="width:250px" /> |
||||
</td> |
||||
{else} |
||||
<td><span style="float: left; margin-right: 5px;">{#Gmap_cat_inf_t#}</span><span style="cursor: help; float: left;" class="toprightDir icon_sprite ico_info" title="{#Gmap_cat_inf_tt#}"> </span></td> |
||||
<td> |
||||
<input class="mousetrap" name="marker_city_e" type="text" id="marker_city_e" value="{$gmarker.marker_city}" placeholder="{#Gmap_cat_inf_tp#}" style="width:250px" /> |
||||
</td> |
||||
{/if} |
||||
</tr> |
||||
<tr> |
||||
<td><span style="float: left; margin-right: 5px;">{#Gmap_cat_inf_st#}</span><span style="cursor: help; float: left;" class="toprightDir icon_sprite ico_info" title="{#Gmap_mar_key_street#}"> </span></td> |
||||
<td> |
||||
<input class="mousetrap" name="marker_street_e" type="text" id="marker_street_e" value="{$gmarker.marker_street}" placeholder="{#Gmap_cat_inf_stp#}" style="width:250px" /> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td>{#Gmap_cat_inf_bi#}</td> |
||||
<td> |
||||
<input class="mousetrap" name="marker_building_e" type="text" id="marker_building_e" value="{$gmarker.marker_building}" placeholder="{#Gmap_cat_inf_blp#}" style="width:250px" /> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td>{#Gmap_cat_inf_ap#}</td> |
||||
<td> |
||||
<textarea cols="20" wrap="hard" class="mousetrap" name="marker_dopfield_e" type="text" id="marker_dopfield_e" value="{$gmarker.marker_dopfield}" placeholder="{#Gmap_cat_inf_dopfi#}" style="width:250px; word-wrap: inherit;">{$gmarker.marker_dopfield}</textarea> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td>{#Gmap_cat_inf_phone#}</td> |
||||
<td> |
||||
<input class="mousetrap" name="marker_phone_e" type="text" id="marker_phone_e" value="{$gmarker.marker_phone}" placeholder="{#Gmap_cat_inf_telp#}" style="width:250px" /> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td><span style="float: left; margin-right: 5px;">{#Gmap_cat_inf_www#}</span><span style="cursor: help; float: left;" class="toprightDir icon_sprite ico_info" title="{#Gmap_cat_inf_wwwi#}"> </span></td> |
||||
<td> |
||||
<input class="mousetrap" name="marker_www_e" type="text" id="marker_www_e" value="{$gmarker.marker_www}" placeholder="{#Gmap_cat_inf_wwwf#}" style="width:250px" /> |
||||
</td> |
||||
</tr> |
||||
|
||||
<tr> |
||||
<td colspan="2"> |
||||
<input type="button" onclick="editSaveMarker();" value="{#Gmap_mar_editsave#}" class="basicBtn" /> |
||||
<a href="javascript:void(0);" onclick="ClearAllField();" class="btn redBtn">{#Gmap_field_reset#}</a> |
||||
<a href="index.php?do=modules&action=modedit&mod=gmap&moduleaction=show&id={$gmarker.gmap_id}&cp={$sess}" class="btn greenBtn" >{#Gmap_mar_map_ret#}</a> |
||||
</td> |
||||
</tr> |
||||
</table> |
||||
|
||||
{/foreach} |
||||
|
||||
<script type="text/javascript"> |
||||
// Функция обнуления значений всех доступных полей |
||||
function ClearAllField() |
||||
{ldelim} |
||||
$('#marker_title_e').val(''); |
||||
$('#title_link_e').val(''); |
||||
$('#marker_cat_title_e').val(''); |
||||
$('#marker_cat_link_e').val(''); |
||||
$('#marker_cat_id_e').val(''); |
||||
$('#img_feld__i_e').val(''); |
||||
$('#_img_feld__i_e').attr('src',''); |
||||
$('#marker_street_e').val(''); |
||||
$('#marker_building_e').val(''); |
||||
$('#marker_dopfield_e').val(''); |
||||
$('#marker_phone_e').val(''); |
||||
$('#marker_www_e').val(''); |
||||
{rdelim}; |
||||
// Обнуляем значения полей категорий при вводе с клавиатуры |
||||
$('#marker_cat_title_e').focus(function(){ldelim} |
||||
$('#marker_cat_title_e').val(''); |
||||
$('#marker_cat_link_e').val(''); |
||||
$('#marker_cat_id_e').val(''); |
||||
{rdelim}); |
||||
// Обнуляем значения полей Связать с документом при вводе с клавиатуры |
||||
$('#marker_title_e').focus(function(){ldelim} |
||||
$('#marker_title_e').val(''); |
||||
$('#title_link_e').val(''); |
||||
{rdelim}); |
||||
// Функция выбора категории выпадающим списком |
||||
function GetCategoryE() |
||||
{ldelim} |
||||
$('#marker_cat_title_e').val(''); |
||||
$('#marker_cat_link_e').val(''); |
||||
$('#marker_cat_id_e').val(''); |
||||
// получаем индекс выбранного элемента |
||||
var selind_e = document.getElementById("category_e").options.selectedIndex; |
||||
var txt_e= document.getElementById("category_e").options[selind_e].text; |
||||
var val_e= document.getElementById("category_e").options[selind_e].value; |
||||
var link_e= $(':selected', document.getElementById("category_e")).data('link'); |
||||
if (link_e == undefined) {ldelim} |
||||
//alert('{#Gmap_cat_cs#}'); |
||||
$('#marker_cat_title_e').val(''); |
||||
$('#marker_cat_link_e').val(''); |
||||
$('#marker_cat_id_e').val(val_e); |
||||
{rdelim} else {ldelim} |
||||
$('#marker_cat_title_e').val(txt_e); |
||||
$('#marker_cat_link_e').val(link_e); |
||||
$('#marker_cat_id_e').val(val_e); |
||||
{rdelim} |
||||
{rdelim} |
||||
</script> |
||||
<script> |
||||
function editSaveMarker(){ldelim} |
||||
|
||||
var latitude_e = $('#lat_e').val(); |
||||
var longitude_e = $('#long_e').val(); |
||||
var marker_title_e = $('#marker_title_e').val(); |
||||
if ($('#title_link_e').val() =='') |
||||
{ldelim} var title_link_e = 'javascript:void(0);'; {rdelim} |
||||
else |
||||
{ldelim} var title_link_e = $('#title_link_e').val(); {rdelim}; |
||||
var marker_cat_title_e = $('#marker_cat_title_e').val(); |
||||
if ($('#marker_cat_link_e').val() =='') |
||||
{ldelim} var marker_cat_link_e = 'javascript:void(0);'; {rdelim} |
||||
else |
||||
{ldelim} var marker_cat_link_e = $('#marker_cat_link_e').val(); {rdelim}; |
||||
var marker_cat_id_e = $('#marker_cat_id_e').val(); |
||||
if ($('#img_feld__i_e').val() !='') |
||||
{ldelim} var img_feld__i_e = $('#img_feld__i_e').val(); {rdelim} |
||||
else |
||||
{ldelim} var img_feld__i_e = '/modules/gmap/img/no_image.png'; {rdelim}; |
||||
var marker_city_e = $('#marker_city_e').val(); |
||||
var marker_street_e = $('#marker_street_e').val(); |
||||
var marker_building_e = $('#marker_building_e').val(); |
||||
var marker_dopfield_e = $('#marker_dopfield_e').val(); |
||||
var marker_phone_e = $('#marker_phone_e').val(); |
||||
var marker_www_e = $('#marker_www_e').val(); |
||||
var image = '{$gmarker.image}'; |
||||
if (marker_city_e !='') {ldelim} |
||||
var markerDataE = {ldelim} |
||||
'id': {$gmarker.id}, |
||||
'latitude': latitude_e, |
||||
'gmap_id': {$gmarker.gmap_id}, |
||||
'longitude': longitude_e, |
||||
'image': image, |
||||
'title': marker_title_e, |
||||
'title_link': title_link_e, |
||||
'marker_cat_title': marker_cat_title_e, |
||||
'marker_cat_link': marker_cat_link_e, |
||||
'marker_cat_id': marker_cat_id_e, |
||||
'img_title': img_feld__i_e, |
||||
'marker_city': marker_city_e, |
||||
'marker_street': marker_street_e, |
||||
'marker_building': marker_building_e, |
||||
'marker_dopfield': marker_dopfield_e, |
||||
'marker_phone': marker_phone_e, |
||||
'marker_www': marker_www_e, |
||||
{rdelim}; |
||||
|
||||
|
||||
$.ajax({ldelim} |
||||
type: 'POST', |
||||
url: 'index.php?do=modules&action=modedit&mod=gmap&moduleaction=saveeditmarker&id={$gmarker.id}&cp={$sess}', |
||||
data: {ldelim} |
||||
e_marker: markerDataE |
||||
{rdelim}, |
||||
dataType: 'json', |
||||
async: false, |
||||
success: function(result){ldelim} |
||||
$.jGrowl("{#Gmap_sv_mark1#}", {ldelim} |
||||
header: '{#Gmap_sv_mark#}', |
||||
theme: 'accept' |
||||
{rdelim}); |
||||
|
||||
$('#tr_city_e').html("<td><span style=\"float: left; margin-right: 5px;\">{#Gmap_cat_inf_tn#}</span><span style=\"cursor: help; float: left;\" class=\"toprightDir icon_sprite ico_info\" title=\"{#Gmap_narker_edit_not#}\"> </span></td><td><input disabled=\"disabled\" class=\"mousetrap\" name=\"marker_city_e\" type=\"text\" id=\"marker_city_e\" value=\"{$gmarker.marker_city}\" placeholder=\"{#Gmap_cat_inf_tp#}\" style=\"width:250px\" /></td>"); |
||||
var marker_ci =result['marker_city']; |
||||
$('#marker_city_e').val(marker_ci); |
||||
{rdelim} |
||||
{rdelim}); |
||||
|
||||
{rdelim}else {ldelim} |
||||
alert("{#Gmap_not_mark_t#}"); |
||||
{rdelim}; |
||||
|
||||
{rdelim} |
||||
</script> |
||||
|
||||
<script> |
||||
function openLinkWindowSelectE(target, doc) {ldelim} |
||||
$('#marker_title_e').val(''); |
||||
$('#title_link_e').val(''); |
||||
if (typeof width == 'undefined' || width == '') var width = screen.width * 0.8; |
||||
if (typeof height == 'undefined' || height == '') var height = screen.height * 0.6; |
||||
if (typeof doc == 'undefined') var doc = 'title'; |
||||
if (typeof scrollbar == 'undefined') var scrollbar = 1; |
||||
var sess = '{$sess}'; |
||||
var abs_path = '{$ABS_PATH}'; |
||||
var left = ( screen.width - width ) / 2; |
||||
var top = ( screen.height - height ) / 2; |
||||
window.open('index.php?doc=' + doc + '&target=' + target + '&do=docs&action=showsimple&function=1&pop=1&cp=' + sess, 'pop', 'left=' + left + ', top=' + top + ', width=' + width + ', height=' + height + ', scrollbars=' + scrollbar + ', resizable=1'); |
||||
{rdelim} |
||||
|
||||
$.fn.fromDocList = function set_value(target_id, doc_id, id) {ldelim} |
||||
var sess = '{$sess}'; |
||||
var abs_path = '{$ABS_PATH}'; |
||||
$.ajax ({ldelim} |
||||
url: 'index.php?do=navigation&cp=' + sess, |
||||
type: 'POST', |
||||
dataType: 'JSON', |
||||
data: {ldelim} |
||||
'action':'itemeditid', |
||||
'doc_id': doc_id |
||||
{rdelim}, |
||||
|
||||
success: function(data){ldelim} |
||||
$('#marker_title_e').val(data.document_title); |
||||
$('#title_link_e').val(data.document_alias); |
||||
{rdelim} |
||||
{rdelim}); |
||||
{rdelim}; |
||||
</script> |
Loading…
Reference in new issue