mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-06 13:16:54 +02:00
Plugins. README.MD #167
This commit is contained in:
@@ -6,11 +6,22 @@ Javascript::add('plugins/box/filesmanager/js/fileuploader.js', 'backend', 11);
|
||||
// Add plugin navigation link
|
||||
Navigation::add(__('Plugins', 'plugins'), 'extends', 'plugins', 1);
|
||||
|
||||
// Add action on admin_pre_render hook
|
||||
Action::add('admin_pre_render','PluginsAdmin::_readmeLoadAjax');
|
||||
|
||||
/**
|
||||
* Plugins Admin
|
||||
*/
|
||||
class PluginsAdmin extends Backend
|
||||
{
|
||||
|
||||
public static function _readmeLoadAjax() {
|
||||
if (Request::post('readme_plugin')) {
|
||||
echo Text::toHtml(markdown(Html::toText(File::getContent(PLUGINS . DS . Request::post('readme_plugin') . DS . 'README.md'))));
|
||||
Request::shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Plugins admin
|
||||
*/
|
||||
@@ -113,6 +124,7 @@ class PluginsAdmin extends Backend
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Upload & extract plugin archive
|
||||
// -------------------------------------
|
||||
if (Request::post('upload_file')) {
|
||||
|
@@ -137,7 +137,14 @@
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('.readme_plugin').click(function() {
|
||||
|
||||
$.ajax({
|
||||
type:"post",
|
||||
data:"readme_plugin="+$(this).attr('readme_plugin'),
|
||||
url: "<?php echo Site::url(); ?>/admin/index.php?id=plugins",
|
||||
success: function(data){
|
||||
$('#readme .modal-body').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -149,15 +156,9 @@
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary">Save changes</button>
|
||||
<h4 class="modal-title" id="myModalLabel">README.md</h4>
|
||||
</div>
|
||||
<div class="modal-body"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user