steffen: server/kolab-webadmin/kolab-webadmin/www/admin/distributionlist index.php, 1.1, 1.2 list.php, 1.7, 1.8

cvs at intevation.de cvs at intevation.de
Sun Jul 18 03:15:54 CEST 2004


Author: steffen

Update of /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/distributionlist
In directory doto:/tmp/cvs-serv9059/kolab-webadmin/www/admin/distributionlist

Modified Files:
	index.php list.php 
Log Message:
more gettext

Index: index.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/distributionlist/index.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- index.php	17 May 2004 15:24:26 -0000	1.1
+++ index.php	18 Jul 2004 01:15:51 -0000	1.2
@@ -1,6 +1,6 @@
 <?php
 /*
- (c) 2004 Klarlvdalens Datakonsult AB
+ (c) 2004 Klarälvdalens Datakonsult AB
  (c) 2003 Tassilo Erlewein <tassilo.erlewein at erfrakon.de>
  (c) 2003 Martin Konold <martin.konold at erfrakon.de>
  This program is Free Software under the GNU General Public License (>=v2).
@@ -17,7 +17,7 @@
 $sidx = 'distlist';
 
 if( $auth->group() != 'maintainer' && $auth->group() != 'admin') {
-   array_push($errors, "Error: You don't have Permissions to access this Menu");
+   array_push($errors, _("Error: You don't have Permissions to access this Menu") );
 }
 
 require_once('admin/include/menu.php');
@@ -35,7 +35,7 @@
   $result = ldap_search($ldap->connection, $base_dn, $filter);
   if( $result ) {
 	$count = ldap_count_entries($ldap->connection, $result);
-	$title = "Manage Distribution Lists ($count Lists)";
+	$title = _("Manage Distribution Lists ($count Lists)");
 	$template = 'distlistall.tpl';
 	ldap_sort($ldap->connection,$result,'cn');
 	$entry = ldap_first_entry($ldap->connection, $result);
@@ -44,7 +44,7 @@
 	  $dn = ldap_get_dn($ldap->connection,$entry);
 	  $cn = $attrs['cn'][0];
 	  $deleteflag = $attrs['deleteflag'][0];
-	  $homeserver = 'not yet implemented';
+	  $homeserver = _('not yet implemented');
 	  $entries[] = array( 'dn' => $dn,
 						  'cn' => $cn,
 						  'deleted' => $deleteflag );

Index: list.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/distributionlist/list.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- list.php	14 Jul 2004 00:49:06 -0000	1.7
+++ list.php	18 Jul 2004 01:15:51 -0000	1.8
@@ -1,4 +1,11 @@
 <?php
+/*
+ (c) 2004 Klarälvdalens Datakonsult AB
+
+ This program is Free Software under the GNU General Public License (>=v2).
+ Read the file COPYING that comes with this packages for details.
+*/
+
 require_once('admin/include/mysmarty.php');
 require_once('admin/include/headers.php');
 require_once('admin/include/authenticate.php');
@@ -13,7 +20,7 @@
 $valid_actions = array('firstsave','save','modify','create','delete','kill');
 
 if( $auth->group() != 'maintainer' && $auth->group() != 'admin') {
-   array_push($errors, "Error: You don't have Permissions to access this Menu");
+   array_push($errors, _("Error: You don't have Permissions to access this Menu") );
 }
 
 require_once('admin/include/menu.php');
@@ -37,7 +44,7 @@
 	for( $i = 0; $i < $kolab['postfix-mydomain']['count']; $i++ ) {
 	  $domain = $kolab['postfix-mydomain'][$i];
 	  if( $ldap->countMail( $_SESSION['base_dn'], $value.'@'.$domain ) > 0 ) {	
-		return 'User or distribution list with this email address already exists';
+		return _('User or distribution list with this email address already exists');
 	  }
 	}
   }
@@ -81,26 +88,26 @@
 /**** Form/data handling ***/
 if (!empty($_REQUEST['action']) && 
     in_array($_REQUEST['action'],$valid_actions)) $action = trim($_REQUEST['action']);
-else array_push($errors, "Error: need valid action to proceed");
+else array_push($errors, _("Error: need valid action to proceed") );
 
 $dn="";
 if (!empty($_REQUEST['dn'])) $dn = trim($_REQUEST['dn']);
 
 if (!$errors && $auth->group() != 'maintainer' && $auth->group() != 'admin') 
-	 array_push($errors, "Error: You don't have the required Permissions");
+	 array_push($errors, _("Error: You don't have the required Permissions") );
 
-$entries = array( 'cn' => array( 'name' => 'List Name',
+$entries = array( 'cn' => array( 'name' => _('List Name'),
 								 'validation' => 'notempty',
-								 'comment' => 'Required' ),
-				  'members' => array( 'name' => 'Members',
+								 'comment' => _('Required') ),
+				  'members' => array( 'name' => _('Members'),
 									  'type' => 'textarea',
-									  'comment' => 'One UID per line',
+									  'comment' => _('One UID per line'),
 									  'validation' => 'checkemaillist'));
 
 $entries['hidden'] = array( 'name' => 'Hidden',
 							'type' => 'checkbox',
 							'value' => false,
-							'comment' => 'Check here to make this distribution list available only to authenticated users');
+							'comment' => _('Check here to make this distribution list available only to authenticated users'));
 
 $entries['action'] = array( 'name' => 'action',
 							'type' => 'hidden' );
@@ -109,7 +116,7 @@
   if( $_REQUEST['dn'] ) {
 	$dn = $_REQUEST['dn'];
   } else {  
-	array_push($errors, "Error: DN required for $action operation");	
+	array_push($errors, _("Error: DN required for $action operation") );
   }
 }
 
@@ -119,7 +126,7 @@
   switch( $action ) {
   case 'create':
 	$form->entries['action']['value'] = 'firstsave';
-	$heading = 'Add Distribution List'; 
+	$heading = _('Add Distribution List');
 	$content = $form->outputForm();
 	break;
   case 'firstsave':
@@ -148,7 +155,7 @@
 		  if( $memberdn ) {
 			$ldap_object['member'][] = $memberdn;
 		  } else {
-			$errors[] = "No such UID $a";
+			$errors[] = _("No such UID $a");
 			break;
 		  }
 		}
@@ -164,17 +171,19 @@
 				  ($oldattrs=ldap_get_attributes($ldap->connection,$entry))) {
 				if (!ldap_add($ldap->connection,$newdn, $ldap_object) 
 					|| !ldap_delete($ldap->connection,$dn)) {
-				  array_push($errors, "LDAP Error: Could not rename ".$dn.
-							 " to ".$newdn." ".ldap_error($ldap->connection));
+				  array_push($errors, _("LDAP Error: Could not rename $dn to $newdn: ")
+							 .ldap_error($ldap->connection));
 				} else {
-				  $messages[] = 'Distribution List updated';
+				  $messages[] = _('Distribution List updated');
 				}
 				$dn = $newdn;
-			  } else array_push($errors,"LDAP Error: Could not read ".$dn." ".ldap_error($ldap->connection));
+			  } else array_push($errors, _("LDAP Error: Could not read $dn: ")
+								.ldap_error($ldap->connection));
 			} else {
 			  if (!ldap_modify($ldap->connection, $dn, $ldap_object))
-				array_push($errors, "LDAP Error: Could not modify object ".$dn." ".ldap_error($ldap->connection)); 
-			  else $messages[] = 'Distribution List updated';
+				array_push($errors, _("LDAP Error: Could not modify object $dn: ")
+						   .ldap_error($ldap->connection)); 
+			  else $messages[] = _('Distribution List updated');
 			}
 		  } 
 		} else {
@@ -183,7 +192,8 @@
 			if( !$ldap_object['member'] ) unset($ldap_object['member']); 
 			$dn = "cn=".$ldap_object['cn'].",".$dl_root;
 			if ($dn && !ldap_add($ldap->connection, $dn, $ldap_object)) {
-			  array_push($errors, "LDAP Error: Could not add object ".$dn." ".ldap_error($ldap->connection));
+			  array_push($errors, _("LDAP Error: Could not add object $dn: ")
+						 .ldap_error($ldap->connection));
 			  debug("dn is $dn");
 			  debug_var_dump( $ldap_object );
 			}
@@ -200,16 +210,17 @@
 				  $ldap_object['cn'] = $newcn; 
 				  $ldap_object['dn'] = 'cn='.$ldap->escape($newcn).','.$dl_root;
 				  if (!ldap_rename($ldap->connection, $dn, 'cn='.$ldap->escape($newcn), $dl_root,true)) {
-					$errors[] = "LDAP Error: Could not modify object $dn ".ldap_error($ldap->connection);
+					$errors[] = _("LDAP Error: Could not modify object $dn: ")
+					  .ldap_error($ldap->connection);
 				  }
-				  $error[] = "Mid-air collision detected, email address $mail renamed to $newmail";
+				  $error[] = _("Mid-air collision detected, email address $mail renamed to $newmail");
 				  break;
 				}
 			  }
 			}
 		  }
 		  if( !$errors ) {
-			$messages[] = 'Distribution List '.$cn.' added';
+			$messages[] = _("Distribution List '$cn' added");
 		  }
 		}
 		if ($errors) {
@@ -221,7 +232,7 @@
 		  $form->entries['action']['value'] = 'save';
 		  $form->entries['dn'] = array( 'type' => 'hidden', 'value' => $dn );
 		  $form->entries['cn']['attrs'] = 'readonly';
-		  $heading = 'Modify Distribution List';
+		  $heading = _('Modify Distribution List');
 		  fill_form_for_modify( $form, $ldap_object );
 		  $content = $form->outputForm();		
 		}
@@ -237,10 +248,10 @@
 		$form->entries['action']['value'] = 'save';
 		$form->entries['dn'] = array( 'type' => 'hidden', 'value' => $dn );
 		$form->entries['cn']['attrs'] = 'readonly';
-		$heading = 'Modify Distribution List'; 
+		$heading = _('Modify Distribution List');
 		$content = $form->outputForm();
 	  } else {
-		array_push($errors, "Error: Multiple results returned for DN $dn");		
+		array_push($errors, _("Error: Multiple results returned for DN '$dn'"));
 	  }
 	}
 	break;
@@ -254,11 +265,11 @@
 		foreach( $form->entries as $key => $val ) {
 		  $form->entries[$key]['attrs'] = 'readonly';
 		}
-		$form->submittext = 'Delete';
-		$heading = 'Delete Distribution List'; 
+		$form->submittext = _('Delete');
+		$heading = _('Delete Distribution List'); 
 		$content = $form->outputForm();
 	  } else {
-		array_push($errors, "Error: Multiple results returned for DN $dn");		
+		array_push($errors, _("Error: Multiple results returned for DN '$dn'"));
 	  }
 	}
 	break;
@@ -266,11 +277,11 @@
 	if (!$errors) {
 	  /* Just delete the object and let kolabd clean up */
 	  if( ldap_delete($ldap->connection, $dn ) ) {
-		$messages[] = 'Distribution List '.$_REQUEST['cn'].' deleted';
-		$heading = 'Entry Deleted';
+		$messages[] = _('Distribution List ').$_REQUEST['cn']._(' deleted');
+		$heading = _('Entry Deleted');
 		$contenttemplate = 'sfdeleted.tpl';
 	  } else {
-		array_push($errors, "LDAP Error: could delete ".$dn.": ".ldap_error($link));		
+		array_push($errors, _("LDAP Error: could delete $dn: ").ldap_error($link));		
 	  }
 	}
 	break;





More information about the commits mailing list