mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
make preferences called via sidebox menu of an app, to behave like a part of that app
This commit is contained in:
parent
709ef070c9
commit
6d33f91046
@ -50,7 +50,7 @@
|
|||||||
$this->appname = $appname;
|
$this->appname = $appname;
|
||||||
}
|
}
|
||||||
|
|
||||||
function save_session($appname,$type,$show_help,$prefix,$notifies='')
|
function save_session($appname,$type,$show_help,$prefix,$notifies='',$referer='')
|
||||||
{
|
{
|
||||||
$GLOBALS['egw']->session->appsession('session_data','preferences',array(
|
$GLOBALS['egw']->session->appsession('session_data','preferences',array(
|
||||||
'type' => $type, // save our state in the app-session
|
'type' => $type, // save our state in the app-session
|
||||||
@ -58,6 +58,7 @@
|
|||||||
'prefix' => $prefix,
|
'prefix' => $prefix,
|
||||||
'appname' => $appname, // we use this to reset prefix on appname-change
|
'appname' => $appname, // we use this to reset prefix on appname-change
|
||||||
'notifies' => $notifies,
|
'notifies' => $notifies,
|
||||||
|
'referer' => $referer ? $referer : $this->session_data['referer'],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,9 +33,21 @@
|
|||||||
|
|
||||||
function index()
|
function index()
|
||||||
{
|
{
|
||||||
|
// make preferences called via sidebox menu of an app, to behave like a part of that app
|
||||||
|
list(,$referer) = explode($GLOBALS['egw_info']['server']['webserver_url'],$_SERVER['HTTP_REFERER']);
|
||||||
|
if (!$referer) $referer = '/preferences/index.php';
|
||||||
|
if (!preg_match('/(preferences.php|menuaction=preferences.uisettings.index)+/i',$referer))
|
||||||
|
{
|
||||||
|
$this->bo->session_data['referer'] = $referer;
|
||||||
|
}
|
||||||
|
echo '<p align="right">'."referer='{$this->bo->session_data['referer']}'</p>\n";
|
||||||
|
if (substr($this->bo->session_data['referer'],0,strlen('/preferences')) != '/preferences')
|
||||||
|
{
|
||||||
|
$GLOBALS['egw_info']['flags']['currentapp'] = $_GET['appname'];
|
||||||
|
}
|
||||||
if($_POST['cancel'])
|
if($_POST['cancel'])
|
||||||
{
|
{
|
||||||
$GLOBALS['egw']->redirect_link('/preferences/index.php');
|
$GLOBALS['egw']->redirect_link($this->bo->session_data['referer']);
|
||||||
}
|
}
|
||||||
if (substr($_SERVER['PHP_SELF'],-15) == 'preferences.php')
|
if (substr($_SERVER['PHP_SELF'],-15) == 'preferences.php')
|
||||||
{
|
{
|
||||||
@ -117,7 +129,7 @@
|
|||||||
|
|
||||||
if(!$this->is_admin() || $error)
|
if(!$this->is_admin() || $error)
|
||||||
{
|
{
|
||||||
$GLOBALS['egw']->redirect_link('/preferences/index.php');
|
$GLOBALS['egw']->redirect_link($this->bo->session_data['referer']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($GLOBALS['type'] == 'user' && $_GET['appname'] == 'preferences' && $user['show_help'] != '')
|
if($GLOBALS['type'] == 'user' && $_GET['appname'] == 'preferences' && $user['show_help'] != '')
|
||||||
@ -126,7 +138,7 @@
|
|||||||
}
|
}
|
||||||
if($_POST['save'])
|
if($_POST['save'])
|
||||||
{
|
{
|
||||||
$GLOBALS['egw']->redirect_link('/preferences/index.php');
|
$GLOBALS['egw']->redirect_link($this->bo->session_data['referer']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user