mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2024-11-10 09:12:51 +08:00
Add Custom UI Folder to customize UI
This commit is contained in:
parent
1515a44ae5
commit
1f4bd28045
4 changed files with 25 additions and 18 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -17,3 +17,6 @@ system/paymentgateway/**
|
||||||
!system/plugin/ui/
|
!system/plugin/ui/
|
||||||
system/plugin/ui/*
|
system/plugin/ui/*
|
||||||
!system/plugin/ui/index.html
|
!system/plugin/ui/index.html
|
||||||
|
ui/ui_custom/**
|
||||||
|
!ui/ui_custom/index.html
|
||||||
|
!ui/ui_custom/README.md
|
|
@ -55,7 +55,7 @@ ORM::configure('username', $db_user);
|
||||||
ORM::configure('password', $db_password);
|
ORM::configure('password', $db_password);
|
||||||
ORM::configure('driver_options', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
|
ORM::configure('driver_options', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
|
||||||
ORM::configure('return_result_sets', true);
|
ORM::configure('return_result_sets', true);
|
||||||
if($_app_stage != 'Live'){
|
if ($_app_stage != 'Live') {
|
||||||
ORM::configure('logging', true);
|
ORM::configure('logging', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ foreach ($result as $value) {
|
||||||
date_default_timezone_set($config['timezone']);
|
date_default_timezone_set($config['timezone']);
|
||||||
$_c = $config;
|
$_c = $config;
|
||||||
|
|
||||||
if($config['radius_mode']){
|
if ($config['radius_mode']) {
|
||||||
ORM::configure("mysql:host=$radius_host;dbname=$radius_name", null, 'radius');
|
ORM::configure("mysql:host=$radius_host;dbname=$radius_name", null, 'radius');
|
||||||
ORM::configure('username', $radius_user, 'radius');
|
ORM::configure('username', $radius_user, 'radius');
|
||||||
ORM::configure('password', $radius_password, 'radius');
|
ORM::configure('password', $radius_password, 'radius');
|
||||||
|
@ -84,7 +84,7 @@ function _notify($msg, $type = 'e')
|
||||||
$lan_file = 'system/lan/' . $config['language'] . '/common.lan.php';
|
$lan_file = 'system/lan/' . $config['language'] . '/common.lan.php';
|
||||||
require($lan_file);
|
require($lan_file);
|
||||||
$ui = new Smarty();
|
$ui = new Smarty();
|
||||||
$ui->setTemplateDir('ui/ui/');
|
$ui->setTemplateDir(['custom' => 'ui/ui_custom/', 'default' => 'ui/ui/']);
|
||||||
$ui->addTemplateDir('system/paymentgateway/ui/', 'pg');
|
$ui->addTemplateDir('system/paymentgateway/ui/', 'pg');
|
||||||
$ui->addTemplateDir('system/plugin/ui/', 'plugin');
|
$ui->addTemplateDir('system/plugin/ui/', 'plugin');
|
||||||
$ui->setCompileDir('ui/compiled/');
|
$ui->setCompileDir('ui/compiled/');
|
||||||
|
@ -130,8 +130,7 @@ include "autoload/Hookers.php";
|
||||||
|
|
||||||
|
|
||||||
//register all plugin
|
//register all plugin
|
||||||
foreach (glob("system/plugin/*.php") as $filename)
|
foreach (glob("system/plugin/*.php") as $filename) {
|
||||||
{
|
|
||||||
include $filename;
|
include $filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -290,25 +289,25 @@ if (file_exists($sys_render)) {
|
||||||
// "function" => $function
|
// "function" => $function
|
||||||
$ui->assign('_system_menu', $routes[0]);
|
$ui->assign('_system_menu', $routes[0]);
|
||||||
foreach ($menu_registered as $menu) {
|
foreach ($menu_registered as $menu) {
|
||||||
if($menu['admin'] && _admin(false)) {
|
if ($menu['admin'] && _admin(false)) {
|
||||||
$menus[$menu['position']] .= '<li'.(($routes[1]==$menu['function'])?' class="active"':'').'><a href="'.U.'plugin/'.$menu['function'].'">';
|
$menus[$menu['position']] .= '<li' . (($routes[1] == $menu['function']) ? ' class="active"' : '') . '><a href="' . U . 'plugin/' . $menu['function'] . '">';
|
||||||
if(!empty($menu['icon'])){
|
if (!empty($menu['icon'])) {
|
||||||
$menus[$menu['position']] .= '<i class="'.$menu['icon'].'"></i>';
|
$menus[$menu['position']] .= '<i class="' . $menu['icon'] . '"></i>';
|
||||||
}
|
}
|
||||||
$menus[$menu['position']] .= '<span class="text">'.$menu['name'].'</span></a></li>';
|
$menus[$menu['position']] .= '<span class="text">' . $menu['name'] . '</span></a></li>';
|
||||||
}else if(!$menu['admin'] && _auth(false)) {
|
} else if (!$menu['admin'] && _auth(false)) {
|
||||||
$menus[$menu['position']] .= '<li'.(($routes[1]==$menu['function'])?' class="active"':'').'><a href="'.U.'plugin/'.$menu['function'].'">';
|
$menus[$menu['position']] .= '<li' . (($routes[1] == $menu['function']) ? ' class="active"' : '') . '><a href="' . U . 'plugin/' . $menu['function'] . '">';
|
||||||
if(!empty($menu['icon'])){
|
if (!empty($menu['icon'])) {
|
||||||
$menus[$menu['position']] .= '<i class="'.$menu['icon'].'"></i>';
|
$menus[$menu['position']] .= '<i class="' . $menu['icon'] . '"></i>';
|
||||||
}
|
}
|
||||||
$menus[$menu['position']] .= '<span class="text">'.$menu['name'].'</span></a></li>';
|
$menus[$menu['position']] .= '<span class="text">' . $menu['name'] . '</span></a></li>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($menus as $k => $v) {
|
foreach ($menus as $k => $v) {
|
||||||
$ui->assign('_MENU_'.$k, $v);
|
$ui->assign('_MENU_' . $k, $v);
|
||||||
}
|
}
|
||||||
unset($menus, $menu_registered);
|
unset($menus, $menu_registered);
|
||||||
include($sys_render);
|
include($sys_render);
|
||||||
} else {
|
} else {
|
||||||
r2(U.'dashboard', 'e', 'not found');
|
r2(U . 'dashboard', 'e', 'not found');
|
||||||
}
|
}
|
||||||
|
|
5
ui/ui_custom/README.md
Normal file
5
ui/ui_custom/README.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# CUSTOM DESIGN
|
||||||
|
|
||||||
|
If you want to change the UI, copy the file from UI, to here, and edit as you need, so it will not be overwrite when updating
|
||||||
|
|
||||||
|
Jika mau mengubah tampilan UI, salin filenya dari folder UI kesini, lalu ubah sesuai keinginan, sehingga tidak akan ditimpa saat ada update
|
0
ui/ui_custom/index.html
Normal file
0
ui/ui_custom/index.html
Normal file
Loading…
Reference in a new issue