diff --git a/system/controllers/pluginmanager.php b/system/controllers/pluginmanager.php new file mode 100644 index 00000000..6f77b1dc --- /dev/null +++ b/system/controllers/pluginmanager.php @@ -0,0 +1,33 @@ +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'); +} diff --git a/system/lan/indonesia/common.lan.php b/system/lan/indonesia/common.lan.php index fe3ad38f..070c5a83 100644 --- a/system/lan/indonesia/common.lan.php +++ b/system/lan/indonesia/common.lan.php @@ -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'; diff --git a/ui/ui/plugin-manager.tpl b/ui/ui/plugin-manager.tpl new file mode 100644 index 00000000..b8d00508 --- /dev/null +++ b/ui/ui/plugin-manager.tpl @@ -0,0 +1,55 @@ +{include file="sections/header.tpl"} +
+
+
+
{Lang::T('Plugin')}
+
+ {foreach $plugins as $plugin} +
+
+
+

{$plugin['name']}

+
+
{$plugin['description']}
@{$plugin['author']} Last update: {$plugin['last_update']}
+ +
+
+ {/foreach} +
+
+
+
{Lang::T('Payment Gateway')}
+
+ {foreach $pgs as $pg} +
+
+
+

{$pg['name']}

+
+
{$pg['description']}
@{$plugin['author']} Last update: {$plugin['last_update']}
+ +
+
+ {/foreach} +
+
+
+{include file="sections/footer.tpl"} \ No newline at end of file diff --git a/ui/ui/sections/header.tpl b/ui/ui/sections/header.tpl index 8fb9c858..d19ee779 100644 --- a/ui/ui/sections/header.tpl +++ b/ui/ui/sections/header.tpl @@ -163,7 +163,7 @@ {$_MENU_AFTER_REPORTS} {/if} {if $_admin['user_type'] eq 'Admin'} -
  • +
  • {$_L['Network']} @@ -215,6 +215,8 @@ href="{$_url}settings/users">{$_L['Administrator_Users']}
  • {$_L['Backup_Restore']}
  • +
  • {Lang::T('Plugin Manager')}
  • {$_MENU_SETTINGS} @@ -240,9 +242,9 @@

    - {$_title} + {$_title}

    - {if isset($notify)}{$notify}{/if} \ No newline at end of file +{if isset($notify)}{$notify}{/if} \ No newline at end of file