mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-02 19:27:52 +02:00
Uploading new plugins via the admin panel - active tab 'Install New' after plugin uploading #215
This commit is contained in:
@@ -86,7 +86,7 @@ $.monstra.fileuploader = {
|
||||
},
|
||||
success: function(data){
|
||||
$.monstra.fileuploader.setProgress(100);
|
||||
location.href = $.monstra.fileuploader.conf.uploadUrl;
|
||||
$.event.trigger('uploaded.fuploader');
|
||||
},
|
||||
error: function(){
|
||||
Messenger().post({
|
||||
@@ -121,11 +121,3 @@ $.monstra.fileuploader = {
|
||||
this._uploaderObj.find('.upload-file-info').html(fname +' '+ sizeStr);
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready(function(){
|
||||
$val_fUploaderInit = $('#fUploaderInit').val();
|
||||
if ($val_fUploaderInit !== undefined) {
|
||||
$.monstra.fileuploader.init($.extend({}, {uploaderId:'DgDfileUploader'}, $.parseJSON($val_fUploaderInit)));
|
||||
}
|
||||
});
|
||||
|
||||
|
@@ -1,6 +1,13 @@
|
||||
<h2 class="margin-bottom-1"><?php echo __('Files', 'filesmanager'); ?></h2>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$.monstra.fileuploader.init($.extend({}, {uploaderId:'DgDfileUploader'}, <?php echo json_encode($fileuploader); ?>));
|
||||
$(document).on('uploaded.fuploader', function(){
|
||||
location.href = $.monstra.fileuploader.conf.uploadUrl;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<input type="hidden" id="fUploaderInit" value='<?php echo json_encode($fileuploader); ?>' />
|
||||
<h2 class="margin-bottom-1"><?php echo __('Files', 'filesmanager'); ?></h2>
|
||||
|
||||
<!-- Filesmanager_upload_files -->
|
||||
<div class="row">
|
||||
|
2
plugins/box/plugins/js/.htaccess
Normal file
2
plugins/box/plugins/js/.htaccess
Normal file
@@ -0,0 +1,2 @@
|
||||
Options -Indexes
|
||||
Allow from all
|
15
plugins/box/plugins/js/plugins.js
Normal file
15
plugins/box/plugins/js/plugins.js
Normal file
@@ -0,0 +1,15 @@
|
||||
if (typeof $.monstra == 'undefined') $.monstra = {};
|
||||
|
||||
$.monstra.plugins = {
|
||||
|
||||
init: function(){
|
||||
if (window.location.hash && $('a[href="'+ window.location.hash +'"]')) {
|
||||
$('a[href="'+ window.location.hash +'"]').click();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$(document).ready(function(){
|
||||
$.monstra.plugins.init();
|
||||
});
|
@@ -2,6 +2,7 @@
|
||||
|
||||
Stylesheet::add('plugins/box/filesmanager/css/style.css', 'backend', 11);
|
||||
Javascript::add('plugins/box/filesmanager/js/fileuploader.js', 'backend', 11);
|
||||
Javascript::add('plugins/box/plugins/js/plugins.js', 'backend', 11);
|
||||
|
||||
// Add plugin navigation link
|
||||
Navigation::add(__('Plugins', 'plugins'), 'extends', 'plugins', 1);
|
||||
|
@@ -1,7 +1,5 @@
|
||||
<h2 class="margin-bottom-1"><?php echo __('Plugins', 'plugins'); ?></h2>
|
||||
|
||||
<input type="hidden" id="fUploaderInit" value='<?php echo json_encode($fileuploader); ?>' />
|
||||
|
||||
<div class="tabbable">
|
||||
|
||||
<!-- Plugins_tabs -->
|
||||
@@ -156,6 +154,11 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
$.monstra.fileuploader.init($.extend({}, {uploaderId:'DgDfileUploader'}, <?php echo json_encode($fileuploader); ?>));
|
||||
$(document).on('uploaded.fuploader', function(){
|
||||
location.href = $.monstra.fileuploader.conf.uploadUrl +'#installnew';
|
||||
window.location.reload(true);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
Reference in New Issue
Block a user