From c4ee1ef5b3330da7754f134eddd94bb30f343a66 Mon Sep 17 00:00:00 2001 From: "M@d D3n" Date: Wed, 27 May 2020 17:28:16 +0300 Subject: [PATCH] Fixes --- admin/templates/browser/browser_2frames.tpl | 418 ++++++++++---------- admin/templates/js/main.js | 4 +- admin/templates/main.tpl | 2 + lib/scripts/uploader/browserplus.js | 8 + 4 files changed, 223 insertions(+), 209 deletions(-) create mode 100644 lib/scripts/uploader/browserplus.js diff --git a/admin/templates/browser/browser_2frames.tpl b/admin/templates/browser/browser_2frames.tpl index 5ed31e9..e9185b5 100644 --- a/admin/templates/browser/browser_2frames.tpl +++ b/admin/templates/browser/browser_2frames.tpl @@ -1,228 +1,232 @@ - + - + - {#MAIN_PAGE_TITLE#} - {*#SUB_TITLE#*} ({$smarty.session.user_name|escape}) + {#MAIN_PAGE_TITLE#} - {*#SUB_TITLE#*} ({$smarty.session.user_name|escape}) - - - + + + - - - - - - - + + + + + + + - - {include file="../scripts.tpl"} + + {include file="../scripts.tpl"} - - - - + + + + - + - - - - - - - -
- -
- -
-
{#MAIN_FILE_MANAGER_TITLE#}
-
-
- {#MAIN_FILE_MANAGER_TIP#} -
-
- -
-
- - - - - {if check_permission('mediapool_add')} - - {/if} - + $(document).ready(function(){ldelim} - - -
- -
- -
- - {if $smarty.request.type!=''} - - -
- -
- - {/if} -
-
-
-   - - {#MAIN_MP_UPLOAD_FILE#} -
- -
-
-
- -
-
-
- - + + + + + +
+ +
+ +
+
{#MAIN_FILE_MANAGER_TITLE#}
+
+
+ {#MAIN_FILE_MANAGER_TIP#} +
+
+ +
+
+ + + + + {if check_permission('mediapool_add')} + + {/if} + + + + +
+ +
+ +
+ + {if $smarty.request.type!=''} + + +
+ +
+ + {/if} +
+
+
+   + + {#MAIN_MP_UPLOAD_FILE#} +
+ +
+
+
+ +
+
+
+ + + {elseif $target=='txtUrl'} + var funcNum = getUrlParam('CKEditorFuncNum'); + var fileUrl = '/{$mediapath}' + document.bForm.bDirName.value + document.bForm.bFileName.value + window.opener.CKEDITOR.tools.callFunction(funcNum, fileUrl); - - + {elseif $target=='navi'} + window.opener.document.getElementById('{$smarty.request.id|escape}').value = '/{$mediapath}' + document.bForm.bDirName.value + document.bForm.bFileName.value; + + {elseif $target=='img_feld' || $target_img=='img_feld'} + window.opener.document.getElementById('img_feld__{$target_id}').value = '/{$mediapath}' + document.bForm.bDirName.value + document.bForm.bFileName.value; + window.opener.document.getElementById('_img_feld__{$target_id}').src = '../index.php?mode=f&width=128&height=128&thumb=/{$mediapath}' + document.bForm.bDirName.value + document.bForm.bFileName.value; + window.opener.$('.preview__{$target_id}').attr("href", '../index.php?mode=f&width=128&height=128&thumb=/{$mediapath}' + document.bForm.bDirName.value + document.bForm.bFileName.value); + + {elseif $target!='' && $target_id!='' && $target_id!=null} + + {if $target=='image'} + window.opener.$('#preview__{$target_id}').attr('src', '../index.php?mode=f&width=128&height=128&thumb=/{$mediapath}' + document.bForm.bDirName.value + document.bForm.bFileName.value); + window.opener.$('.preview__{$target_id}').attr('href', '/{$mediapath}' + document.bForm.bDirName.value + document.bForm.bFileName.value); + window.opener.$('#{$target}__{$target_id}').val('/{$mediapath}' + document.bForm.bDirName.value + document.bForm.bFileName.value); + {/if} + + {if $target=='dir'} + var bdn = document.bForm.bDirName.value.split('/').reverse(); + window.opener.document.getElementById('{$target}__{$target_id}').value = bdn[1]; + {/if} + + {if $target=='directory'} + window.opener.$.fn.myPlugin('/{$mediapath}' + document.bForm.bDirName.value, {$target_id}); + {/if} + + {if $target=='cascad'} + {assign var=data value="_"|explode:$target_id} + window.opener.$.fn.myPlugin('/{$mediapath}' + document.bForm.bDirName.value, {$data[0]}, {$data[1]}); + {/if} + + {elseif $target!='all'} + {if $smarty.request.fillout=='dl'} + window.opener.document.getElementById('{$smarty.request.target|escape}').value = '/{$mediapath}' + document.bForm.bDirName.value + document.bForm.bFileName.value; + {else} + window.opener.updatePreview(); + {/if} + {/if} + setTimeout("self.close();", 100); + {rdelim} + {rdelim} + + function NewFolder() {ldelim} + var title = '{#MAIN_MP_CREATE_FOLDER#}'; + var text = '{#MAIN_ADD_FOLDER#}'; + jPrompt(text, '', title, function(b){ldelim} + if (b){ldelim} + $.alerts._overlay('hide'); + $.alerts._overlay('show'); + parent.frames['zf'].location.href='index.php?do=browser&type={$smarty.request.type|escape}&target={$smarty.request.target|escape}&action=list&dir=' + document.bForm.bDirName.value + '&newdir=' + b; + $.alerts._overlay('hide'); + {rdelim} + else + {ldelim} + $.alerts._overlay('hide'); + $.jGrowl('{#MAIN_NO_ADD_FOLDER#}'); + {rdelim} + {rdelim} + ); + {rdelim} + + + + + + + - + \ No newline at end of file diff --git a/admin/templates/js/main.js b/admin/templates/js/main.js index a09068b..6d3a0d5 100644 --- a/admin/templates/js/main.js +++ b/admin/templates/js/main.js @@ -66,7 +66,7 @@ function openLinkWindow(target, doc, document_alias) { if (typeof scrollbar == 'undefined') var scrollbar = 1; var left = (screen.width - width) / 2; var top = (screen.height - height) / 2; - window.open('index.php?doc=' + doc + '&target=' + target + '&document_alias=' + document_alias + '&do=docs&action=showsimple&cp={$sess}&pop=1', 'pop', 'left=' + left + ',top=' + top + ',width=' + width + ',height=' + height + ',scrollbars=' + scrollbar + ',resizable=1'); + window.open('index.php?doc=' + doc + '&target=' + target + '&document_alias=' + document_alias + '&do=docs&action=showsimple&cp=' + sess + '&pop=1', 'pop', 'left=' + left + ',top=' + top + ',width=' + width + ',height=' + height + ',scrollbars=' + scrollbar + ',resizable=1'); } function openFileWindow(target, id, document_alias) { @@ -76,7 +76,7 @@ function openFileWindow(target, id, document_alias) { if (typeof scrollbar == 'undefined') var scrollbar = 1; var left = (screen.width - width) / 2; var top = (screen.height - height) / 2; - window.open('index.php?do=browser&id=' + id + '&type=file&target=navi&cp={$sess}', 'pop', 'left=' + left + ',top=' + top + ',width=' + width + ',height=' + height + ',scrollbars=' + scrollbar + ',resizable=1'); + window.open('index.php?do=browser&id=' + id + '&type=file&target=navi&cp=' + sess, 'pop', 'left=' + left + ',top=' + top + ',width=' + width + ',height=' + height + ',scrollbars=' + scrollbar + ',resizable=1'); } // Функция-плагин для включения tipsy сразу для всех классов внутри элемента diff --git a/admin/templates/main.tpl b/admin/templates/main.tpl index c69aced..868a435 100644 --- a/admin/templates/main.tpl +++ b/admin/templates/main.tpl @@ -33,6 +33,8 @@ var ave_path = "{$ABS_PATH}"; var ave_theme = "{$smarty.const.DEFAULT_THEME_FOLDER}"; var ave_admintpl = "{$tpl_dir}"; + + var sess = '{$sess}';