steffen: server/kolab-webadmin/kolab-webadmin/www/admin/administrator admin.php, 1.2, 1.3 index.php, 1.1, 1.2

cvs at intevation.de cvs at intevation.de
Sun Jul 18 02:30:33 CEST 2004


Author: steffen

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

Modified Files:
	admin.php index.php 
Log Message:
started to gettextize php files

Index: admin.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/administrator/admin.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- admin.php	16 Jul 2004 17:18:03 -0000	1.2
+++ admin.php	18 Jul 2004 00:30:31 -0000	1.3
@@ -28,7 +28,7 @@
   if( is_unique( 'uid', $value ) ) {
 	return '';
   } else {
-	return 'Administrator with this UID already exists';
+	return _('Administrator with this UID already exists');
   }
 }
 
@@ -37,15 +37,15 @@
   global $action;
   if( $action == "firstsave" ) {
     if( $key == 'password_0' ) {
-      if( $value == '' ) return 'Password is empty';
+      if( $value == '' ) return _('Password is empty');
     } else if( $key == 'password_1' ) {
       if( $value != $_POST['password_0'] ) {
-        return 'Passwords dont match';
+        return _('Passwords dont match');
       }
     }
   } else {
     if( $value != $_POST['password_0'] ) {
-      return 'Passwords dont match';
+      return _('Passwords dont match');
     }
   }
   return '';
@@ -114,39 +114,39 @@
 // Get request data
 if (!empty($_REQUEST['action']) &&
     in_array($_REQUEST['action'],$valid_actions)) $action = trim(urldecode($_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(urldecode($_REQUEST['dn']));
 
 // Check auth
 if (!$errors && $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") );
 }   
 
 // Fill in data
 if ($action == "create") {
-  $comment_mail_0 = 'Required, non volatile' ;
-  $comment_password = 'Required';
+  $comment_mail_0 = _('Required, non volatile');
+  $comment_password = _('Required');
 } else {
-  $comment_mail_0 = 'non volatile' ;
-  $comment_password = 'Leave blank to keep password unchanged';
+  $comment_mail_0 = _('non volatile');
+  $comment_password = _('Leave blank to keep password unchanged');
 }
 
-$entries = array( 'firstname' => array( 'name' => 'First Name',
+$entries = array( 'firstname' => array( 'name' => _('First Name'),
 					'validation' => 'notempty',
-					'comment' => 'Required' ),
-		  'lastname' => array( 'name' => 'Last Name',
+					'comment' => _('Required') ),
+		  'lastname' => array( 'name' => _('Last Name'),
 				       'validation' => 'notempty',
-				       'comment' => 'Required' ),
-		  'password_0' => array( 'name' => 'Password',
+				       'comment' => _('Required') ),
+		  'password_0' => array( 'name' => _('Password'),
 					 'type' => 'password',
 					 'validation' => 'checkpw',
 					 'comment' => $comment_password ),
-		  'password_1' => array( 'name' => 'Verify Password',
+		  'password_1' => array( 'name' => _('Verify Password'),
 					 'type' => 'password',
 					 'validation' => 'checkpw',
 					 'comment' => $comment_password ),
-		  'uid' => array( 'name' => 'Unique User ID',
+		  'uid' => array( 'name' => _('Unique User ID'),
 				     'validation' => 'notempty',
 				     'comment' => $comment_mail_0 ));
 
@@ -156,7 +156,7 @@
 if( $dn ) {
   $ldap_object = $ldap->read( $dn );
   if( !$ldap_object ) {
-    array_push($errors, "LDAP Error: No such dn: $dn: ".ldap_error($ldap->connection));
+    array_push($errors, _("LDAP Error: No such dn: $dn: ").ldap_error($ldap->connection));
   }
 }
 
@@ -201,10 +201,10 @@
 				 ($oldattrs=ldap_get_attributes($ldap->connection,$entry))) {
 			   $ldap_object['uid'] = $oldattrs['uid'][0];
 			   if (!ldap_add($ldap->connection,$newdn, $ldap_object) )
-				 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));
 			   if( !$errors ) {
 				 if( !ldap_delete($ldap->connection,$dn)) {
-				   array_push($errors, "LDAP Error: could not remove old entry $dn: ".ldap_error($ldap->connection));
+				   array_push($errors, _("LDAP Error: could not remove old entry $dn: ").ldap_error($ldap->connection));
 				 }
 			   }
 			   if( !$errors ) {
@@ -212,28 +212,28 @@
 				 $groupdn = 'cn=admin,'.$domain_dn;
 				 if( !ldap_mod_delete($ldap->connection,$groupdn,
 									  array( 'member' => $dn ) ) ) {
-				   $errors[] = "LDAP Error: Could not remove old group entry $dn: "
+				   $errors[] = _("LDAP Error: Could not remove old group entry $dn: ")
 					 .ldap_error($ldap->connection());
 				 }
 				 if( !$errors && ldap_mod_add( $ldap->connection,
 											   $groupdn,
 											   array( 'member' => $newdn ) ) ) {
-				   $errors[] = "LDAP Error: Could not add new group entry $newdn: "
+				   $errors[] = _("LDAP Error: Could not add new group entry $newdn: ")
 					 .ldap_error($ldap->connection());
 				 }
 			   }			   
 			   $dn = $newdn;
-			 } else array_push($errors,"LDAP Error: could not read $dn "
+			 } 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 "
+			   array_push($errors, _("LDAP Error: could not modify object $dn ")
 						  .ldap_error($ldap->connection));
 			 }
 		   }
 		 }
-		 $heading = 'Modify Administrator';
-		 $messages[] = 'Administrator '.$ldap_object['dn'].' successfully modified';
+		 $heading = _('Modify Administrator');
+		 $messages[] = _('Administrator ').$ldap_object['dn']._(' successfully modified');
 		 $form->setValues();
 		 $form->entries['action']['value'] = 'save';
 		 $content = $form->outputForm();
@@ -245,22 +245,22 @@
 		   debug("Calling ldap_add with dn=$dn");
 		   // Add object to db
 		   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));
 
 		   // Add object to admin group
 		   if( $dn && !ldap_mod_add($ldap->connection, 'cn=admin,'.$domain_dn, 
 									array( 'member' => $dn ) ) ) {
-			 array_push($errors, "LDAP Error: could not add object $dn to maintainer group".ldap_error($ldap->connection));			 
+			 array_push($errors, _("LDAP Error: could not add object $dn to maintainer group: ").ldap_error($ldap->connection));
 		   }
 		   if( !$errors ) {
-			 $messages[] = 'Administrator '.$ldap_object['dn'].' successfully created';
-			 $heading = 'Create New Administrator';
+			 $messages[] = _('Administrator ').$ldap_object['dn']._(' successfully created');
+			 $heading = _('Create New Administrator');
 			 $form->entries['action']['value'] = 'firstsave';
 			 $content = $form->outputForm();
 			 break;
 		   }
 		 } else {
-		   $heading = 'Create New Administrator';
+		   $heading = _('Create New Administrator');
 		   $blacklist = array('mail');
 		   $form->entries['action']['value'] = 'firstsave';
 		   $form->outputForm();
@@ -271,7 +271,7 @@
      break;
    }
  case 'create':
-   $heading = 'Create New Administrator';
+   $heading = _('Create New Administrator');
    if( !$dn ) {
      $form->entries['action']['value'] = 'firstsave';
    } else {
@@ -280,13 +280,13 @@
    $content = $form->outputForm();
    break;
  case 'modify':
-   $heading = 'Modify Administrator';
+   $heading = _('Modify Administrator');
    fill_form_for_modify( $form, $ldap_object );
    $form->entries['action']['value'] = 'save';
    $content = $form->outputForm();
    break;
  case 'delete':
-   $heading = 'Delete Administrator';
+   $heading = _('Delete Administrator');
    foreach( $form->entries as $k => $v ) {
      if( $v['type'] != 'hidden' ) {
        $form->entries[$k]['attrs'] = 'readonly';
@@ -294,27 +294,27 @@
    }
    fill_form_for_modify( $form, $ldap_object );
    $form->entries['action']['value'] = 'kill';
-   $form->submittext = 'Delete';
+   $form->submittext = _('Delete');
    $content = $form->outputForm();
    break;
  case 'kill':
-   if (!$dn) array_push($errors, "Error: need dn for delete operation");
+   if (!$dn) array_push($errors, _("Error: need dn for delete operation"));
    elseif ($auth->group() != "admin") 
-     array_push($errors, "Error: you need administrative permissions to delete administrators");
+     array_push($errors, _("Error: you need administrative permissions to delete administrators"));
    
    if (!$errors) {
 	 if(!ldap_mod_del($ldap->connection, 'cn=admin,'.domain_dn(), array('member' => $dn ) )) {
-	   $errors[] = "LDAP Error: Could not remove $dn from admin group: "
+	   $errors[] = _("LDAP Error: Could not remove $dn from admin group: ")
 		 .ldap_error($ldap->connection);
 	 }
 	 if( !$errors ) {
 	   if( !$ldap->deleteObject($dn) ) {
-		 array_push($errors, "LDAP Error: could not mark ".$dn." for deletion ".ldap_error($ldap->connection));
+		 array_push($errors, _("LDAP Error: could not mark $dn for deletion ").ldap_error($ldap->connection));
 	   }
 	 }
    }
    if( !$errors ) {
-	 $heading = "Administrator Deleted";
+	 $heading = _('Administrator Deleted');
 	 $contenttemplate = 'admindeleted.tpl';
    }
    break;

Index: index.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/administrator/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 00:30:31 -0000	1.2
@@ -9,7 +9,7 @@
 $sidx = 'administrator';
 
 if( $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');
@@ -36,7 +36,7 @@
   $result = ldap_list($ldap->connection, $base_dn, $filter, array( 'uid', 'sn', 'cn', 'deleteflag' ));
 
   if( $result ) {
-	$title = 'Manage Administrators ('.count($maintainers).' Administrators)';
+	$title = _('Manage Administrators (').count($maintainers)._(' Administrators)');
 	// if there are more than 2000 entries, split in 26 categories for every letter,
 	// or if more than 50, put in groups, or else just show all.
 	if (false && $count > 2000) {





More information about the commits mailing list