update
Nav label added
This commit is contained in:
parent
7e0e09f9bf
commit
10e788e9a2
@ -17,7 +17,7 @@ $menu_registered = array();
|
||||
* | Customer menu: AFTER_DASHBOARD, ORDER, HISTORY, ACCOUNTS
|
||||
* @param string icon from ion icon, ion-person, only for AFTER_
|
||||
*/
|
||||
function register_menu($name, $admin, $function, $position, $icon = '')
|
||||
function register_menu($name, $admin, $function, $position, $icon = '', $label = '', $color = '')
|
||||
{
|
||||
global $menu_registered;
|
||||
$menu_registered[] = [
|
||||
@ -25,7 +25,9 @@ function register_menu($name, $admin, $function, $position, $icon = '')
|
||||
"admin" => $admin,
|
||||
"position" => $position,
|
||||
"icon" => $icon,
|
||||
"function" => $function
|
||||
"function" => $function,
|
||||
"label" => $label,
|
||||
"color" => $color
|
||||
];
|
||||
}
|
||||
|
||||
@ -48,4 +50,3 @@ function run_hook($action){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -223,7 +223,13 @@ function _admin($login = true)
|
||||
|
||||
function _log($description, $type = '', $userid = '0')
|
||||
{
|
||||
Log::put($type, $description, $userid);
|
||||
$d = ORM::for_table('tbl_logs')->create();
|
||||
$d->date = date('Y-m-d H:i:s');
|
||||
$d->type = $type;
|
||||
$d->description = $description;
|
||||
$d->userid = $userid;
|
||||
$d->ip = $_SERVER["REMOTE_ADDR"];
|
||||
$d->save();
|
||||
}
|
||||
|
||||
function Lang($key)
|
||||
@ -321,12 +327,22 @@ try {
|
||||
if (!empty($menu['icon'])) {
|
||||
$menus[$menu['position']] .= '<i class="' . $menu['icon'] . '"></i>';
|
||||
}
|
||||
if (!empty($menu['label'])) {
|
||||
$menus[$menu['position']] .= '<span class="pull-right-container">
|
||||
<small class="label pull-right bg-'. $menu['color'] .'">' . $menu['label'] . '</small>
|
||||
</span>';
|
||||
}
|
||||
$menus[$menu['position']] .= '<span class="text">' . $menu['name'] . '</span></a></li>';
|
||||
} else if (!$menu['admin'] && _auth(false)) {
|
||||
$menus[$menu['position']] .= '<li' . (($routes[1] == $menu['function']) ? ' class="active"' : '') . '><a href="' . U . 'plugin/' . $menu['function'] . '">';
|
||||
if (!empty($menu['icon'])) {
|
||||
$menus[$menu['position']] .= '<i class="' . $menu['icon'] . '"></i>';
|
||||
}
|
||||
if (!empty($menu['label'])) {
|
||||
$menus[$menu['position']] .= '<span class="pull-right-container">
|
||||
<small class="label pull-right bg-'. $menu['color'] .'">' . $menu['label'] . '</small>
|
||||
</span>';
|
||||
}
|
||||
$menus[$menu['position']] .= '<span class="text">' . $menu['name'] . '</span></a></li>';
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user