forked from kevinowino869/mitrobill
url using getUrl
This commit is contained in:
@ -74,10 +74,10 @@ class Package
|
||||
|
||||
if (!$p['enabled']) {
|
||||
if (!isset($admin) || !isset($admin['id']) || empty($admin['id'])) {
|
||||
r2(U . 'home', 'e', Lang::T('Plan Not found'));
|
||||
r2(getUrl('home'), 'e', Lang::T('Plan Not found'));
|
||||
}
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) {
|
||||
r2(U . 'dashboard', 'e', Lang::T('You do not have permission to access this page'));
|
||||
r2(getUrl('dashboard'), 'e', Lang::T('You do not have permission to access this page'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ class Paginator
|
||||
$adjacents = "2";
|
||||
$page = _get('p', 1);
|
||||
$page = (empty($page) ? 1 : $page);
|
||||
$url = U . implode('/', $routes);
|
||||
$url = getUrl(implode('/', $routes));
|
||||
if (count($search) > 0) {
|
||||
$url .= '&' . http_build_query($search);
|
||||
}
|
||||
@ -83,7 +83,7 @@ class Paginator
|
||||
{
|
||||
global $routes;
|
||||
global $_L;
|
||||
$url = U . implode('/', $routes);
|
||||
$url = getUrl(implode('/', $routes));
|
||||
$query = urlencode($query);
|
||||
$adjacents = "2";
|
||||
$page = (int)(empty(_get('p')) ? 1 : _get('p'));
|
||||
@ -169,7 +169,7 @@ class Paginator
|
||||
{
|
||||
global $routes;
|
||||
global $_L;
|
||||
$url = U . $routes['0'] . '/' . $routes['1'] . '/';
|
||||
$url = getUrl($routes['0'] . '/' . $routes['1'] . '/');
|
||||
$adjacents = "2";
|
||||
$page = (int)(!isset($routes['2']) ? 1 : $routes['2']);
|
||||
$pagination = "";
|
||||
@ -277,7 +277,7 @@ class Paginator
|
||||
{
|
||||
global $routes;
|
||||
global $_L;
|
||||
$url = U . $routes['0'] . '/' . $routes['1'] . '/';
|
||||
$url = getUrl($routes['0'] . '/' . $routes['1'] . '/');
|
||||
$adjacents = "2";
|
||||
$page = (int)(!isset($routes['2']) ? 1 : $routes['2']);
|
||||
$pagination = "";
|
||||
|
@ -109,4 +109,20 @@ class Text
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function url(...$data){
|
||||
global $config;
|
||||
$url = implode("", $data);
|
||||
if ($config['url_canonical'] != 'Yes') {
|
||||
$u = str_replace('?_route=', '', U);
|
||||
$pos = strpos($url, '&');
|
||||
if ($pos === false) {
|
||||
return $u . $url;
|
||||
} else {
|
||||
return $u . substr($url, 0, $pos) . '?' . substr($url, $pos + 1);
|
||||
}
|
||||
} else {
|
||||
return U . $url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ class User
|
||||
global $config;
|
||||
if ($config['maintenance_mode'] == true) {
|
||||
if ($config['maintenance_mode_logout'] == true) {
|
||||
r2(U . 'logout', 'd', '');
|
||||
r2(getUrl('logout'), 'd', '');
|
||||
} else {
|
||||
displayMaintenanceMessage();
|
||||
}
|
||||
@ -226,7 +226,7 @@ class User
|
||||
global $config;
|
||||
if ($config['maintenance_mode'] == true) {
|
||||
if ($config['maintenance_mode_logout'] == true) {
|
||||
r2(U . 'logout', 'd', '');
|
||||
r2(getUrl('logout'), 'd', '');
|
||||
} else {
|
||||
displayMaintenanceMessage();
|
||||
}
|
||||
|
Reference in New Issue
Block a user