Plugin Manager, install belum
This commit is contained in:
parent
d526ceb6bc
commit
976300bac7
33
system/controllers/pluginmanager.php
Normal file
33
system/controllers/pluginmanager.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
|
||||
|
||||
**/
|
||||
_admin();
|
||||
$ui->assign('_title', $_L['Plugin Manager']);
|
||||
$ui->assign('_system_menu', 'settings');
|
||||
|
||||
$action = $routes['1'];
|
||||
$admin = Admin::_info();
|
||||
$ui->assign('_admin', $admin);
|
||||
|
||||
|
||||
if ($admin['user_type'] != 'Admin') {
|
||||
r2(U . "dashboard", 'e', $_L['Do_Not_Access']);
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
|
||||
default:
|
||||
$cache = 'system/cache/plugin_repository.json';
|
||||
if (file_exists($cache) && time() - filemtime($cache) > (24 * 60 * 60)) {
|
||||
$json = json_decode(file_get_contents($cache), true);
|
||||
}
|
||||
$data = file_get_contents('https://hotspotbilling.github.io/Plugin-Repository/repository.json');
|
||||
file_put_contents($cache, $data);
|
||||
$json = json_decode($data, true);
|
||||
$ui->assign('plugins', $json['plugins']);
|
||||
$ui->assign('pgs', $json['payment_gateway']);
|
||||
$ui->display('plugin-manager.tpl');
|
||||
}
|
@ -306,3 +306,6 @@ $_L['Verification_Code'] = 'Verification Code';
|
||||
$_L['SMS_Verification_Code'] = 'SMS Verification Code';
|
||||
$_L['Please_enter_your_email_address'] = 'Please enter your email address';
|
||||
$_L['Failed_to_create_Paypal_transaction'] = 'Failed to create Paypal transaction.';
|
||||
$_L['Plugin'] = 'Plugin';
|
||||
$_L['Plugin_Manager'] = 'Plugin Manager';
|
||||
$_L['Plugin_Manager'] = 'Plugin Manager';
|
||||
|
55
ui/ui/plugin-manager.tpl
Normal file
55
ui/ui/plugin-manager.tpl
Normal file
@ -0,0 +1,55 @@
|
||||
{include file="sections/header.tpl"}
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="panel panel-primary panel-hovered">
|
||||
<div class="panel-heading">{Lang::T('Plugin')}</div>
|
||||
<div class="panel-body row">
|
||||
{foreach $plugins as $plugin}
|
||||
<div class="col-md-4">
|
||||
<div class="box box-hovered mb20 box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">{$plugin['name']}</h3>
|
||||
</div>
|
||||
<div class="box-body">{$plugin['description']}<br><small><i>@{$plugin['author']} Last update: {$plugin['last_update']}</i></small></div>
|
||||
<div class="box-footer ">
|
||||
<div class="btn-group btn-group-justified" role="group" aria-label="...">
|
||||
<a href="{$plugin['url']}" target="_blank"
|
||||
class="btn btn-primary"><i class="ion ion-chatboxes"></i> Website</a>
|
||||
<a href="{$plugin['github']}" target="_blank"
|
||||
class="btn btn-success"><i class="ion ion-chatboxes"></i> Github</a>
|
||||
<a href="{$_url}pluginmanager/?install={$plugin['id']}"
|
||||
class="btn btn-warning"><i class="ion ion-chatboxes"></i> Install</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-primary panel-hovered">
|
||||
<div class="panel-heading">{Lang::T('Payment Gateway')}</div>
|
||||
<div class="panel-body row">
|
||||
{foreach $pgs as $pg}
|
||||
<div class="col-md-4">
|
||||
<div class="box box-hovered mb20 box-primary">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">{$pg['name']}</h3>
|
||||
</div>
|
||||
<div class="box-body">{$pg['description']}<br><small><i>@{$plugin['author']} Last update: {$plugin['last_update']}</i></small></div>
|
||||
<div class="box-footer ">
|
||||
<div class="btn-group btn-group-justified" role="group" aria-label="...">
|
||||
<a href="{$pg['url']}" target="_blank"
|
||||
class="btn btn-primary"><i class="ion ion-chatboxes"></i> Website</a>
|
||||
<a href="{$pg['github']}" target="_blank"
|
||||
class="btn btn-success"><i class="ion ion-chatboxes"></i> Github</a>
|
||||
<a href="{$_url}pluginmanager/?install={$pg['id']}"
|
||||
class="btn btn-warning"><i class="ion ion-chatboxes"></i> Install</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{include file="sections/footer.tpl"}
|
@ -215,6 +215,8 @@
|
||||
href="{$_url}settings/users">{$_L['Administrator_Users']}</a></li>
|
||||
<li {if $_routes[1] eq 'dbstatus'}class="active" {/if}><a
|
||||
href="{$_url}settings/dbstatus">{$_L['Backup_Restore']}</a></li>
|
||||
<li {if $_routes[1] eq 'dbstatus'}class="active" {/if}><a
|
||||
href="{$_url}pluginmanager">{Lang::T('Plugin Manager')}</a></li>
|
||||
{$_MENU_SETTINGS}
|
||||
</ul>
|
||||
</li>
|
||||
@ -245,4 +247,4 @@
|
||||
</section>
|
||||
|
||||
<section class="content">
|
||||
{if isset($notify)}{$notify}{/if}
|
||||
{if isset($notify)}{$notify}{/if}
|
Loading…
x
Reference in New Issue
Block a user