diff --git a/preferences/inc/class.uiaclprefs.inc.php b/preferences/inc/class.uiaclprefs.inc.php index cf6c559cc8..e1b766dc71 100644 --- a/preferences/inc/class.uiaclprefs.inc.php +++ b/preferences/inc/class.uiaclprefs.inc.php @@ -44,6 +44,14 @@ { $GLOBALS['egw']->translation->add_app($acl_app); } + // make acl called via sidebox menu of an app, to behave like a part of that app + $referer = $_POST['referer']; + if (!$referer) + { + list(,$referer) = explode($GLOBALS['egw_info']['server']['webserver_url'],$_SERVER['HTTP_REFERER']); + if (!$referer) $referer = '/preferences/index.php'; + } + //echo '
'."referer='$referer'
\n"; $GLOBALS['egw_info']['flags']['currentapp'] = $acl_app; @@ -70,19 +78,16 @@ return; } - $owner_name = $GLOBALS['egw']->accounts->id2name($owner); // get owner name for title - if($no_privat_grants = $GLOBALS['egw']->accounts->get_type($owner) == 'g') - { - $owner_name = lang('Group').' ('.$owner_name.')'; - } - else // admin setting acl-rights is handled as group-rights => no private grants !! + $owner_name = $GLOBALS['egw']->common->grab_owner_name($owner); + if($no_privat_grants = $GLOBALS['egw']->accounts->get_type($owner) != 'g') { + // admin setting acl-rights is handled as with group-rights => no private grants !! $no_privat_grants = $owner != $GLOBALS['egw_info']['user']['account_id']; } $this->acl =& CreateObject('phpgwapi.acl',(int)$owner); $this->acl->read_repository(); - if ($_POST['submit']) + if ($_POST['save'] || $_POST['apply']) { $processed = $_POST['processed']; $to_remove = unserialize(urldecode($processed)); @@ -139,13 +144,17 @@ } $this->acl->save_repository(); } + if ($_POST['save'] || $_POST['cancel']) + { + $GLOBALS['egw']->redirect_link($referer); + } $GLOBALS['egw_info']['flags']['app_header'] = lang('%1 - Preferences',$GLOBALS['egw_info']['apps'][$acl_app]['title']).' - '.lang('acl').': '.$owner_name; $GLOBALS['egw']->common->egw_header(); echo parse_navbar(); $this->template =& CreateObject('phpgwapi.Template',$GLOBALS['egw']->common->get_tpl_dir($acl_app)); $templates = Array ( - 'preferences' => 'preference_acl.tpl', + 'preferences' => '../../../preferences/templates/default/acl.tpl', 'row_colspan' => 'preference_colspan.tpl', 'acl_row' => 'preference_acl_row.tpl' ); @@ -162,13 +171,16 @@ 'query' => $query, 'owner' => $owner, 'acl_app' => $acl_app, + 'referer' => $referer, ); $var = Array( 'errors' => '', 'title' => '
+
+
+
+ |
+ {nmr}
+