diff --git a/admin/inc/class.uiconfig.inc.php b/admin/inc/class.uiconfig.inc.php index aa63f59581..105fbb1c81 100644 --- a/admin/inc/class.uiconfig.inc.php +++ b/admin/inc/class.uiconfig.inc.php @@ -34,7 +34,7 @@ class uiconfig { egw::redirect_link('/index.php'); } - $referer = $_POST['submit'] || $_POST['cancel'] ? $_POST['referer'] : + $referer = $_POST['submit'] || $_POST['save'] || $_POST['apply'] || $_POST['cancel'] ? $_POST['referer'] : common::get_referer('/admin/index.php',$_POST['referer']); list(,$show_app) = explode('/',$referer); if (!$show_app) $show_app = 'admin'; @@ -102,15 +102,17 @@ class uiconfig $t->set_block('config','body','body'); $t->set_block('config','footer','footer'); + // fix footer submit buttons to just {submit} {cancel} + $t->set_var('footer', preg_replace('/]+value="{lang_(submit|cancel)}"[^>]*>/', '{$1}', $t->get_var('footer'))); + $c = new config($config_appname); $c->read_repository(); - - if ($_POST['cancel'] || $_POST['submit'] && $GLOBALS['egw']->acl->check('site_config_access',2,'admin')) + if ($_POST['cancel'] || ($_POST['submit'] || $_POST['save'] || $_POST['apply']) && $GLOBALS['egw']->acl->check('site_config_access',2,'admin')) { egw::redirect_link($referer); } - if ($_POST['submit']) + if ($_POST['submit'] || $_POST['save'] || $_POST['apply']) { /* Load hook file with functions to validate each config (one/none/all) */ $GLOBALS['egw']->hooks->single('config_validate',$appname); @@ -149,7 +151,7 @@ class uiconfig $c->save_repository(); - if(!$errors) + if(!$errors && !$_POST['apply']) { egw::redirect_link($referer); } @@ -219,7 +221,6 @@ class uiconfig */ case 'selected': $configs = array(); - $config = ''; $newvals = explode(' ',$newval); $setting = end($newvals); for ($i=0;$i<(count($newvals) - 1); $i++) @@ -257,11 +258,11 @@ class uiconfig break; } } - $t->set_var('lang_submit', $GLOBALS['egw']->acl->check('site_config_access',2,'admin') ? lang('Cancel') : lang('Save')); - $t->set_var('lang_cancel', lang('Cancel')); - - // set currentapp to our calling app, to show the right sidebox-menu -// $GLOBALS['egw_info']['flags']['currentapp'] = $show_app; + $t->set_var('submit', '
'); // render the page $GLOBALS['egw']->framework->render( diff --git a/phpgwapi/inc/class.html.inc.php b/phpgwapi/inc/class.html.inc.php index 81d2e90481..36353b8e2f 100644 --- a/phpgwapi/inc/class.html.inc.php +++ b/phpgwapi/inc/class.html.inc.php @@ -648,6 +648,23 @@ egw_LAB.wait(function() { return "\n"; } + static protected $default_background_images = array( + 'save' => '/save(&|\[|\]|$)/', + 'apply' => '/apply(&|\[|\]|$)/', + 'cancel' => '/cancel(&|\[|\]|$)/', + 'delete' => '/delete(&|\[|\]|$)/', + 'edit' => '/edit(&|\[|\]|$)/', + 'next' => '/(next|continue)(&|\[|\]|$)/', + 'finish' => '/finish(&|\[|\]|$)/', + 'back' => '/(back|previous)(&|\[|\]|$)/', + 'copy' => '/copy(&|\[|\]|$)/', + 'more' => '/more(&|\[|\]|$)/', + 'check' => '/check(&|\[|\]|$)/', + 'ok' => '/ok(&|\[|\]|$)/', + 'close' => '/close(&|\[|\]|$)/', + 'add' => '/(add(&|\[|\]|$)|create)/', // customfields use create* + ); + /** * represents html's button (input type submit or input type button or image) * @@ -672,7 +689,7 @@ egw_LAB.wait(function() { { $image = str_replace(array('.gif','.GIF','.png','.PNG'),'',$image); - if (!($path = $GLOBALS['egw']->common->image($app,$image))) + if (!($path = common::image($app,$image))) { $path = $image; // name may already contain absolut path } @@ -696,13 +713,22 @@ egw_LAB.wait(function() { } if ($onClick) $options .= ' onclick="'.str_replace('"','\\"',$onClick).'"'; - // '; } /**