$value) {
?>
">" class="nav-link ">"> ' : ''); ?>
bind("user_id", $user_id);
$db->bind("action", $action);
$db->bind("ip_address", $ip_address);
$db->bind("status", $status);
// Execute
$db->query("INSERT INTO action_log(user_id,action,ip_address,status) VALUES(:user_id,:action,:ip_address,:status)");
}
function getAllSubdirectories($base) {
$dir_array = array();
if (!is_dir($base)) {
return $dir_array;
}
if ($dh = opendir($base)) {
while (($file = readdir($dh)) !== false) {
if ($file == '.' || $file == '..')
continue;
if (is_dir($base . '/' . $file)) {
$dir_array[] = $file;
} else {
array_merge($dir_array, getAllSubdirectories($base . '/' . $file));
}
}
closedir($dh);
return $dir_array;
}
}
function get_title($request){
global $hooks;
global $menu_array;
$current_page = $_SERVER['REQUEST_URI'];
if($_SESSION['role'] == 0){
$menuarray = $menu_array;
}else{
$menuarray = json_decode(getActiveGroup($_SESSION["user_id"], "menu_json"),true);
}
foreach ($menuarray as $key => $value) {
if($current_page == $value["url"]){
return $value[$request];
}elseif(isset($value["sub"])){
foreach ($value["sub"] as $key => $sub) {
if($current_page == $sub["url"]){
if($sub[$request] == ""){
return $hooks->do_action("the_title");
}else{
return $sub[$request];
}
}
}
}
}
if($request == 'label'){
return $hooks->do_action("the_title");
}else{
return $_SERVER['REQUEST_URI'];
}
}
function has_sub($array) {
if (array_key_exists("sub", $array)) {
return true;
} else {
return false;
}
}
function the_sub($array) {
ksort($array);
$current_page = $_SERVER['REQUEST_URI'];
foreach ($array as $key => $value) {
?>
>">">