diff --git a/system/autoload/Hookers.php b/system/autoload/Hookers.php index 58d89fc0..94d033f6 100644 --- a/system/autoload/Hookers.php +++ b/system/autoload/Hookers.php @@ -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){ } } } - diff --git a/system/boot.php b/system/boot.php index 56ed2d60..f4e88701 100644 --- a/system/boot.php +++ b/system/boot.php @@ -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) @@ -316,20 +322,30 @@ try { // "function" => $function $ui->assign('_system_menu', $routes[0]); foreach ($menu_registered as $menu) { - if ($menu['admin'] && _admin(false)) { - $menus[$menu['position']] .= '