diff --git a/htdocs/collection.php b/htdocs/collection.php index 3eac0a49..617fcff8 100644 --- a/htdocs/collection.php +++ b/htdocs/collection.php @@ -8,7 +8,7 @@ require_once("interactive-page.php"); $user_no = ( isset($_GET['user_no']) ? intval($_GET['user_no']) : 0 ); if ( !$session->AllowedTo("Admin") && ($user_no == 0 || $user_no != $session->user_no) ) { - $c->messages[] = "You may only review the contents of your own collections in this interface."; + $c->messages[] = i18n('You may only review the contents of your own collections in this interface.'); include("page-header.php"); include("page-footer.php"); exit(0); diff --git a/htdocs/tools.php b/htdocs/tools.php index d2d05c97..a1e4eda8 100644 --- a/htdocs/tools.php +++ b/htdocs/tools.php @@ -29,10 +29,6 @@ if(isset($_POST['import_from_directory'])){ } -include("page-header.php"); -$Tools = new Tools(); - -$Tools->render(); class Tools { function render(){ @@ -132,17 +128,17 @@ class Tools { if ( check_string($ics) ) { $path = "/".substr($file,0,-4).$path_ics; dbg_error_log( "importFromDirectory", "importing to $path"); - include_once("caldav-PUT-functions.php"); + require_once("caldav-PUT-functions.php"); if ( $user = getUserByName(substr($file,0,-4),'importFromDirectory',__LINE__,__FILE__)) { $user_no = $user->user_no; } if(controlRequestContainer(substr($file,0,-4),$user_no, $path,false) === -1) continue; import_collection($ics,$user_no,$path,1); - $c->messages[] = sprintf(translate("all events of user %s were deleted and replaced by those from file %s"),substr($file,0,-4),$dir.'/'.$file); + $c->messages[] = sprintf(translate('all events of user %s were deleted and replaced by those from file %s'),substr($file,0,-4),$dir.'/'.$file); } else { - $c->messages[] = sprintf(translate("the file %s is not UTF-8 encoded, please check error for more details"),$dir.'/'.$file); + $c->messages[] = sprintf(translate('the file %s is not UTF-8 encoded, please check error for more details'),$dir.'/'.$file); } } } @@ -151,5 +147,8 @@ class Tools { } } -include("page-footer.php"); +$Tools = new Tools(); +include("page-header.php"); +$Tools->render(); +include("page-footer.php"); diff --git a/inc/DAViCalUser.php b/inc/DAViCalUser.php index 917dda3e..f85d3411 100644 --- a/inc/DAViCalUser.php +++ b/inc/DAViCalUser.php @@ -464,7 +464,7 @@ EOSQL; $c->messages[] = sprintf(translate('Calendar "%s" for user "%s" was created.'), $path_ics, $this->Get('username')); } else { - $c->messages[] = sprintf(translate('The file is not UTF-8 encoded, please check the error for more details.') ); + $c->messages[] = i18n('The file is not UTF-8 encoded, please check the error for more details.'); } } return true; diff --git a/inc/caldav-PUT-functions.php b/inc/caldav-PUT-functions.php index 4a02a8d7..39516dad 100644 --- a/inc/caldav-PUT-functions.php +++ b/inc/caldav-PUT-functions.php @@ -40,7 +40,7 @@ function rollback_on_error( $caldav_context, $user_no, $path, $message='', $erro } global $c; - $c->messages[] = sprintf('Status: %d, Message: %s, User: %d, Path: %s', $error_no, $message, $user_no, $path); + $c->messages[] = sprintf(translate('Status: %d, Message: %s, User: %d, Path: %s'), $error_no, $message, $user_no, $path); } diff --git a/inc/drivers_ldap.php b/inc/drivers_ldap.php index 733f6964..a4f82da0 100644 --- a/inc/drivers_ldap.php +++ b/inc/drivers_ldap.php @@ -63,7 +63,7 @@ class ldapDrivers $this->connect=ldap_connect($host); if (! $this->connect){ - $c->messages[] = sprintf(i18n( "drivers_ldap : Unable to connect to LDAP with port %s on host %s"), $port,$host ); + $c->messages[] = sprintf(translate( 'drivers_ldap : Unable to connect to LDAP with port %s on host %s'), $port, $host ); $this->valid=false; return ; } @@ -73,12 +73,12 @@ class ldapDrivers // Start TLS if desired (requires protocol version 3) if (isset($config['startTLS'])) { if (!ldap_set_option($this->connect, LDAP_OPT_PROTOCOL_VERSION, 3)) { - $c->messages[] = sprintf(i18n( "drivers_ldap : Failed to set LDAP to use protocol version 3, TLS not supported") ); + $c->messages[] = i18n('drivers_ldap : Failed to set LDAP to use protocol version 3, TLS not supported'); $this->valid=false; return; } if (!ldap_start_tls($this->connect)) { - $c->messages[] = sprintf(i18n( "drivers_ldap : Could not start TLS: ldap_start_tls() failed") ); + $c->messages[] = i18n('drivers_ldap : Could not start TLS: ldap_start_tls() failed'); $this->valid=false; return; } @@ -129,8 +129,12 @@ class ldapDrivers foreach($this->baseDNUsers as $baseDNUsers) { $entry = $query($this->connect,$baseDNUsers,$this->filterUsers,$attributes); - if (!ldap_first_entry($this->connect,$entry)) - $c->messages[] = sprintf(i18n("Error NoUserFound with filter >%s<, attributes >%s< , dn >%s<"),$this->filterUsers,join(', ',$attributes), $baseDNUsers); + if (!ldap_first_entry($this->connect,$entry)) { + $c->messages[] = sprintf(translate('Error NoUserFound with filter >%s<, attributes >%s< , dn >%s<'), + $this->filterUsers, + join(', ', $attributes), + $baseDNUsers); + } for($i = ldap_first_entry($this->connect,$entry); $i && $arr = ldap_get_attributes($this->connect,$i); diff --git a/inc/drivers_squid_pam.php b/inc/drivers_squid_pam.php index 772cd9a0..a4a0de74 100644 --- a/inc/drivers_squid_pam.php +++ b/inc/drivers_squid_pam.php @@ -39,7 +39,7 @@ class squidPamDrivers { global $c; if (! file_exists($config)){ - $c->messages[] = sprintf(i18n( "drivers_squid_pam : Unable to find %s file"), $config ); + $c->messages[] = sprintf(i18n( 'drivers_squid_pam : Unable to find %s file'), $config ); $this->valid=false; return ; }