1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-09 22:56:55 +02:00
This commit is contained in:
metal_gvc
2014-02-12 21:29:53 +02:00
34 changed files with 4124 additions and 393 deletions

View File

@@ -16,5 +16,6 @@
'Get More Plugins' => 'Hole weitere Plugins',
'Install' => 'Installieren',
'Uninstall' => 'Deinstallieren',
'README.md not found' => 'README.md not found',
)
);

View File

@@ -16,5 +16,6 @@
'Get More Plugins' => 'Get More Plugins',
'Install' => 'Install',
'Uninstall' => 'Uninstall',
'README.md not found' => 'README.md not found',
)
);

View File

@@ -16,5 +16,6 @@
'Get More Plugins' => 'Obtener mas plugins',
'Install' => 'Instalar',
'Uninstall' => 'Desinstalar',
'README.md not found' => 'README.md not found',
)
);

View File

@@ -16,5 +16,6 @@
'Get More Plugins' => 'دریافت افزونه های بیشتر',
'Install' => 'نصب',
'Uninstall' => 'حذف',
'README.md not found' => 'README.md not found',
)
);

View File

@@ -16,5 +16,6 @@
'Get More Plugins' => 'Obtenez plus de plugins',
'Install' => 'Installer',
'Uninstall' => 'Désinstaller',
'README.md not found' => 'README.md not found',
)
);

View File

@@ -16,5 +16,6 @@
'Get More Plugins' => 'Még több Plugin',
'Install' => 'Telepít',
'Uninstall' => 'Töröl',
'README.md not found' => 'README.md not found',
)
);

View File

@@ -16,5 +16,6 @@
'Get More Plugins' => 'Cari Plugins Baru',
'Install' => 'Memasangkan',
'Uninstall' => 'Menghapus Program',
'README.md not found' => 'README.md not found',
)
);

View File

@@ -16,5 +16,6 @@
'Get More Plugins' => 'Scarica altri plugin',
'Install' => 'Installa',
'Uninstall' => 'Disinstalla',
'README.md not found' => 'README.md not found',
)
);

View File

@@ -16,5 +16,6 @@
'Get More Plugins' => 'さらにプラグインを取得',
'Install' => 'インストール',
'Uninstall' => '停止',
'README.md not found' => 'README.md not found',
)
);

View File

@@ -16,5 +16,6 @@
'Get More Plugins' => 'Gauti daugiau papildinių',
'Install' => 'Įdiegti',
'Uninstall' => 'Išdiegti',
'README.md not found' => 'README.md not found',
)
);

View File

@@ -16,5 +16,6 @@
'Get More Plugins' => 'Vind meer plugins',
'Install' => 'Installeren',
'Uninstall' => 'Deinstalleren',
'README.md not found' => 'README.md not found',
)
);

View File

@@ -16,5 +16,6 @@
'Get More Plugins' => 'Pobierz więcej wtyczek',
'Install' => 'Instaluj',
'Uninstall' => 'Odinstaluj',
'README.md not found' => 'README.md not found',
)
);

View File

@@ -16,5 +16,6 @@
'Get More Plugins' => 'Ver mais plugins',
'Install' => 'Instalar',
'Uninstall' => 'Desinstalar',
'README.md not found' => 'README.md not found',
)
);

View File

@@ -16,5 +16,6 @@
'Get More Plugins' => 'Скачать другие плагины',
'Install' => 'Установить',
'Uninstall' => 'Удалить',
'README.md not found' => 'README.md not found',
)
);

View File

@@ -16,5 +16,6 @@
'Get More Plugins' => 'Získať viacej pluginov',
'Install' => 'Inštalovať',
'Uninstall' => 'Odinštalovať',
'README.md not found' => 'README.md not found',
)
);

View File

@@ -16,5 +16,6 @@
'Get More Plugins' => 'Dodaj još dodataka',
'Install' => 'Instaliraj',
'Uninstall' => 'Deinstaliraj',
'README.md not found' => 'README.md not found',
)
);

View File

@@ -16,5 +16,6 @@
'Get More Plugins' => 'Завантажити інші плагіни',
'Install' => 'Установити',
'Uninstall' => 'Видалити',
'README.md not found' => 'README.md not found',
)
);

View File

@@ -6,11 +6,15 @@ 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
{
/**
* Plugins admin
*/
@@ -113,6 +117,7 @@ class PluginsAdmin extends Backend
}
// Upload & extract plugin archive
// -------------------------------------
if (Request::post('upload_file')) {
@@ -218,4 +223,19 @@ class PluginsAdmin extends Backend
))
->display();
}
/**
* _readmeLoadAjax
*/
public static function _readmeLoadAjax() {
if (Request::post('readme_plugin')) {
if (File::exists($file = PLUGINS . DS . Request::post('readme_plugin') . DS . 'README.md')) {
echo Text::toHtml(markdown(Html::toText(File::getContent($file))));
} else {
echo __('README.md not found', 'plugins');
}
Request::shutdown();
}
}
}

View File

@@ -43,10 +43,12 @@
</td>
<td>
<div class="pull-right">
<?php if (File::exists(PLUGINS . DS . $plugin['id'] . DS . 'README.md')) { ?>
<?php echo Html::anchor(__('?', 'plugins'),
'#'.$plugin['id'],
array('class' => 'btn btn-info', 'data-toggle' => 'modal', 'data-target' => '#readme'));
'#',
array('class' => 'btn btn-info readme_plugin', 'data-toggle' => 'modal', 'data-target' => '#readme', 'readme_plugin' => $plugin['id']));
?>
<?php } ?>
<?php echo Html::anchor(__('Uninstall', 'plugins'),
'index.php?id=plugins&delete_plugin='.$plugin['id'].'&token='.Security::token(),
array('class' => 'btn btn-danger', 'onclick' => "return confirmDelete('".__('Delete plugin :plugin', 'plugins', array(':plugin' => $plugin['title']))."')"));
@@ -134,6 +136,21 @@
</div>
<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>
<!-- Modal -->
<div class="modal fade" id="readme" tabindex="-1" role="dialog" aria-hidden="true">
@@ -141,15 +158,9 @@
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</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>