steffen: server/kolab-webadmin/kolab-webadmin/www/admin/sharedfolder index.php, 1.2, 1.3 sf.php, 1.6, 1.7
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/sharedfolder
In directory doto:/tmp/cvs-serv9059/kolab-webadmin/www/admin/sharedfolder
Modified Files:
index.php sf.php
Log Message:
more gettext
Index: index.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/sharedfolder/index.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- index.php 21 Jun 2004 01:46:39 -0000 1.2
+++ index.php 18 Jul 2004 01:15:52 -0000 1.3
@@ -17,7 +17,7 @@
$sidx = 'sf';
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 Shared Folders ($count Folders)";
+ $title = _("Manage Shared Folders ($count Folders)");
$template = 'sflistall.tpl';
ldap_sort($ldap->connection,$result,'cn');
$entry = ldap_first_entry($ldap->connection, $result);
Index: sf.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/sharedfolder/sf.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- sf.php 16 Jul 2004 17:18:03 -0000 1.6
+++ sf.php 18 Jul 2004 01:15:52 -0000 1.7
@@ -1,10 +1,16 @@
<?php
+/*
+ (c) 2004 Klarlvdalens 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');
require_once('admin/include/form.class.php');
-
/**** Authentication etc. ***/
$errors = array();
$messages = array();
@@ -13,7 +19,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');
@@ -39,14 +45,14 @@
list($u, $p ) = split( ' ', $acl, 2 );
if( !strncmp( "group:", $u, 6 ) ) $u = substr( $u, 6 );
//debug( "u=$u, p=$p" );
- $form->entries['acl_'.$aclcount] = array( 'name' => 'Permission for UID/GID',
+ $form->entries['acl_'.$aclcount] = array( 'name' => _('Permission for UID/GID'),
'type' => 'aclselect',
'user' => $u,
'perm' => $p
);
$aclcount++;
}
- $form->entries['acl_'.$aclcount] = array( 'name' => 'Permission for UID/GID',
+ $form->entries['acl_'.$aclcount] = array( 'name' => _('Permission for UID/GID'),
'type' => 'aclselect',
'user' => '',
'perm' => 'all'
@@ -87,7 +93,7 @@
}
}
}
- $errors[] = "No UID or GID $uid";
+ $errors[] = _("No UID or GID $uid");
return false;
}
@@ -98,24 +104,24 @@
/**** 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' => 'Folder Name',
+$entries = array( 'cn' => array( 'name' => _('Folder Name'),
'validation' => 'notempty',
- 'comment' => 'Required' ),
- 'homeserver' => array( 'name' => 'Folder Location',
+ 'comment' => _('Required') ),
+ 'homeserver' => array( 'name' => _('Folder Location'),
'validation' => 'notempty',
- 'comment' => ($action=='create')?'Required, non volatile':'Non volatile',
+ 'comment' => ($action=='create')?_('Required, non volatile'):_('Non volatile'),
'value' => $_SESSION['fqhostname'] ),
- 'userquota' => array( 'name' => 'Quota Limit',
- 'comment' => 'KBytes (empty for unlimited)' ),
- 'acl_0' => array( 'name' => 'Permission for UID/GID',
+ 'userquota' => array( 'name' => _('Quota Limit'),
+ 'comment' => _('KBytes (empty for unlimited)') ),
+ 'acl_0' => array( 'name' => _('Permission for UID/GID'),
'type' => 'aclselect',
'user' => 'anyone',
'perm' => 'all' ));
@@ -128,7 +134,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"));
}
}
@@ -138,7 +144,7 @@
switch( $action ) {
case 'create':
$form->entries['action']['value'] = 'firstsave';
- $heading = 'Add Shared Folder';
+ $heading = _('Add Shared Folder');
$content = $form->outputForm();
break;
case 'firstsave':
@@ -188,17 +194,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[] = 'Shared folder updated';
+ $messages[] = _('Shared folder 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[] = 'Shared folder updated';
+ array_push($errors, _("LDAP Error: could not modify object $dn: ")
+ .ldap_error($ldap->connection));
+ else $messages[] = _('Shared folder updated');
}
}
} else {
@@ -206,8 +214,9 @@
$dn = "cn=".$ldap_object['cn'].",".$sf_root;
$ldap_object['homeserver'] = trim($_POST['homeserver']);
if ($dn && !ldap_add($ldap->connection, $dn, $ldap_object))
- array_push($errors, "LDAP Error: could not add object ".$dn." ".ldap_error($ldap->connection));
- else $messages[] = 'Shared folder '.$cn.' added';
+ array_push($errors, _("LDAP Error: could not add object $dn: ")
+ .ldap_error($ldap->connection));
+ else $messages[] = _("Shared folder '$cn' added");
}
if ($errors) {
//print("<div class=\"maintitle\"> Create New Address Book Entry </div>\n");
@@ -219,7 +228,7 @@
$form->entries['dn'] = array( 'type' => 'hidden', 'value' => $dn );
$form->entries['cn']['attrs'] = 'readonly';
$form->entries['homeserver']['attrs'] = 'readonly';
- $heading = 'Modify Shared Folder';
+ $heading = _('Modify Shared Folder');
$result = $ldap->search( $dn, '(objectClass=sharedfolder)' );
if( $result ) {
$ldap_object = ldap_get_entries( $ldap->connection, $result );
@@ -243,10 +252,10 @@
$form->entries['dn'] = array( 'type' => 'hidden', 'value' => $dn );
$form->entries['cn']['attrs'] = 'readonly';
$form->entries['homeserver']['attrs'] = 'readonly';
- $heading = 'Modify Shared Folder';
+ $heading = _('Modify Shared Folder');
$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;
@@ -260,22 +269,22 @@
foreach( $form->entries as $key => $val ) {
$form->entries[$key]['attrs'] = 'readonly';
}
- $form->submittext = 'Delete';
- $heading = 'Delete Shared Folder';
+ $form->submittext = _('Delete');
+ $heading = _('Delete Shared Folder');
$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;
case 'kill':
if (!$errors) {
if( $ldap->deleteObject($dn) ) {
- $messages[] = 'Shared folder '.$_REQUEST['cn'].' marked for deletion';
- $heading = 'Entry Deleted';
+ $messages[] = _('Shared folder ').$_REQUEST['cn']._(' marked for deletion');
+ $heading = _('Entry Deleted');
$contenttemplate = 'sfdeleted.tpl';
} else {
- array_push($errors, "LDAP Error: could mark ".$dn." for deletion: ".ldap_error($link));
+ array_push($errors, _("LDAP Error: could mark $dn for deletion: ").ldap_error($link));
}
}
break;
More information about the commits
mailing list