Compare commits

...

61 Commits

Author SHA1 Message Date
Deon George
ee35f81ce5 Release 1.2.0.4 2009-09-20 11:49:27 +10:00
Deon George
088ebf4a2b Changed to use ldap_modify 2009-09-20 11:44:28 +10:00
Deon George
a6dc80616b Fix rendering of js_calendar on add_attr, when no previous DateAttributes existed 2009-09-20 11:44:26 +10:00
Deon George
9196bb9e41 SF Feature #2846546 - Add URL to config/config.php.example 2009-09-20 11:44:26 +10:00
Deon George
7121f560e9 SF Bug #2859242 - Call to undefined function syslog_notice() 2009-09-20 11:44:25 +10:00
Deon George
e7466c948b SF Bug #2859221 - Problem between diffrent browsers and utf-8 2009-09-20 11:44:24 +10:00
Deon George
f0a6d312ab Enable control of creating children in templates 2009-09-20 11:44:23 +10:00
Deon George
d062308f32 Added javascript for search form 2009-09-09 08:08:10 +10:00
Deon George
352a87fee8 Auto run query for unique attributes when link is clicked 2009-09-08 15:41:32 +10:00
Deon George
242d06673a SF Bug #2853633 - activating hooks gives error undefined constant DEBUG_ENABLE 2009-09-08 15:38:49 +10:00
Deon George
a3ac658756 Release 1.2.0.3 2009-09-07 00:39:38 +10:00
Deon George
e83aba595c Merge translations from launchpad for PLA 1.2.0.3 2009-09-07 00:39:06 +10:00
Deon George
3ffe6878f3 Minor updates 2009-09-07 00:13:58 +10:00
Deon George
02e9f8477a Suppress more template warnings 2009-08-30 12:11:18 +10:00
Ethan Moore
259179a1b3 Enable SASL (GSSAPI) 2009-08-29 12:19:10 +10:00
Deon George
96bad27d64 Fix: clear passwords were being encoded with blowfish by default 2009-08-29 00:11:24 +10:00
Deon George
c69cd68fcb SF Bug #2828378 - fallback_dn config option no longer works in 1.2.0 2009-08-29 00:11:23 +10:00
Deon George
9cb27e3a70 Miscellaneous minor updates 2009-08-29 00:11:23 +10:00
Deon George
52fbd24b2c Merge PickList and MultiList functions (also fixes SF Bug #2844714) 2009-08-28 20:06:13 +10:00
Deon George
f83a922589 SF Bug #2845986 - Missing config/config.php file not detected in 1.2.0.2 2009-08-28 17:18:08 +10:00
Deon George
3e446fddf4 SF Bug #2845904 - session.autostart breaks 2009-08-28 17:01:15 +10:00
Deon George
bdb423d0d3 SF Bug #2844186 - fail to add and edit entries (delete work fine) 2009-08-28 16:31:19 +10:00
Deon George
2c99cc9016 Fix export only exports 500 entries 2009-08-28 15:03:24 +10:00
Deon George
b93b92f430 Rework javascript 2009-08-22 21:30:50 +10:00
Deon George
26fa2ba2c5 Only sort children after reading additional entries 2009-08-22 13:30:30 +10:00
Deon George
76ddeccf8c Release 1.2.0.2 2009-08-21 23:42:44 +10:00
Deon George
1336fc21b6 Merge translations from launchpad for PLA 1.2.0.2 2009-08-21 23:40:21 +10:00
Deon George
356f319291 Fix up calls with ldap_read 2009-08-21 18:32:52 +10:00
Deon George
6e6a7a6e4e Multiple fixes, changes and enhancements
* mass edit selection,
* child search during edit,
* attr login with bind_id,
* performance fix broke ldapservers that dont have havesubordinate attrs),
* enable "login,class",
* enable "login,base".
2009-08-21 15:02:12 +10:00
Deon George
95aedef718 Remove CVS tags 2009-08-20 12:25:48 +10:00
Deon George
b0f9fa8806 Fix URL to favicon 2009-08-20 09:25:34 +10:00
Deon George
ec482c70fe Fix list address 2009-08-19 22:30:19 +10:00
Deon George
9fda881a8e Add size_limit to default search 2009-08-19 22:26:33 +10:00
Deon George
46c100660b Fix query default sorting and query form when no templates 2009-08-19 22:18:00 +10:00
Deon George
4c56f3e678 Fix AJAX rendering of query results 2009-08-19 21:20:51 +10:00
Deon George
ebe2cb6eda Performance improvements for the tree. 2009-08-19 21:19:35 +10:00
Deon George
5669c92371 Improvements to debug_log 2009-08-19 13:39:37 +10:00
Harri
0eaf3bb67b SF Bug #2839213 - Few localization -related bugs 2009-08-18 19:16:36 +10:00
Deon George
9f1a207eba Ammendment for SF Feature #2837687 - Invalid method for Queries 2009-08-18 19:13:50 +10:00
Deon George
5706ad1b4a Ammendment for SF Feature #2837687, dont render the only template if it is invalid 2009-08-17 16:30:05 +10:00
Deon George
ba553353b0 SF Feature #2837687 - Automatic template selection from one of one valid templates 2009-08-17 16:13:55 +10:00
Aurélien Requiem
803a4c821a SF Feature #2827191 - warnings for missing objectClass could be disabled 2009-08-17 15:09:32 +10:00
Deon George
a5b9e43a57 Fix for when renaming entries only changes case (https://bugs.launchpad.net/bugs/384157) 2009-08-17 10:52:46 +10:00
Deon George
df404d435a login,attr only applies to user sessions 2009-08-17 10:46:22 +10:00
Deon George
cf4f339b5c Fix missing encoding SambaPasswordAttributes 2009-08-14 11:47:45 +10:00
Deon George
48faaba955 Merge translations from launchpad for PLA 1.2.0.1 2009-08-13 22:04:16 +10:00
Deon George
898eabaa11 Release 1.2.0.1 2009-08-13 21:40:59 +10:00
Deon George
9eca46d0cc Fixed display of Windows AD binary attributes 2009-08-13 21:39:43 +10:00
Deon George
8a21bbee12 Fix render of ReadOnly binary attributes 2009-08-13 21:22:41 +10:00
Aurélien Requiem
59c4e7896f SF Bug #2827012 - the modification tpl for inetOrgPerson is partially invalid 2009-08-13 09:00:04 +10:00
Deon George
cc3b67b71a More login processing fixes 2009-08-12 23:54:01 +10:00
Deon George
a0816d068c Sync menu/tree processing with other projects, variable/function naming 2009-08-12 23:53:14 +10:00
Deon George
fb48055d2d Fix for when method supplies null for login details 2009-07-27 19:17:40 +10:00
Deon George
86c8f13065 Fixed missing uid.png 2009-07-27 19:16:12 +10:00
Deon George
7dd52f8219 More issues for anon login to LDAP server to get user details 2009-07-27 17:19:53 +10:00
Deon George
29cb490571 Fixes for issues introduced by commit bbe87c6e2 2009-07-27 17:18:25 +10:00
Deon George
5938302012 Fix the simple ACL configuration 2009-07-26 01:21:23 +10:00
Deon George
196aa00218 Fix for when a root_dse query doesnt return any results 2009-07-26 01:21:23 +10:00
Deon George
dc3e477778 Improve getLogin() for multiple method logins and fix anonymous logout 2009-07-26 01:21:23 +10:00
Deon George
869b9be7e9 Fix IMGDIR/CSSDIR when no config.php yet and creating setting to disable remoteurls for sflogo 2009-07-26 01:21:23 +10:00
Deon George
a1cfa2f60c SF Bug #2826569 - missing information in config.php.example 2009-07-25 20:17:36 +10:00
192 changed files with 14209 additions and 14063 deletions

View File

@@ -1 +1 @@
RELEASE-1.2.0
RELEASE-1.2.0.4

View File

@@ -6,6 +6,7 @@
/**
* The phpLDAPadmin config file
* See: http://phpldapadmin.sourceforge.net/wiki/index.php/Config.php
*
* This is where you can customise some of the phpLDAPadmin defaults
* that are defined in config_default.php.
@@ -39,7 +40,7 @@
/* Useful important configuration overrides */
/*********************************************/
/* If you are asked to put pla in debug mode, this is how you do it: */
/* If you are asked to put PLA in debug mode, this is how you do it: */
# $config->custom->debug['level'] = 255;
# $config->custom->debug['syslog'] = true;
# $config->custom->debug['file'] = '/tmp/pla_debug.log';
@@ -72,6 +73,13 @@
30 seconds or the setting of max_exection_time if this is null. */
// $config->custom->session['timelimit'] = 30;
/* Our local timezone
This is to make sure that when we ask the system for the current time, we
get the right local time. If this is not set, all time() calculations will
assume UTC if you have not set PHP date.timezone. */
// $config->custom->appearance['timezone'] = null;
# $config->custom->appearance['timezone'] = 'Australia/Melbourne';
/*********************************************/
/* Commands */
/*********************************************/
@@ -79,38 +87,55 @@
/* Command availability ; if you don't authorize a command the command
links will not be shown and the command action will not be permitted.
For better security, set also ACL in your ldap directory. */
/*
$config->custom->commands['all'] = array(
'home' => true,
'external_links' => array('feature' => true,
'forum' => true,
'bug' => true,
'donation' => true,
'help' => true,
'credits' => true),
'purge' => true,
'schema' => true,
'import' => true,
'export' => true,
'logout' => true,
'search' => array('simple_search' => true,
'predefined_search' => true,
'advanced_search' => true),
'server_refresh' => true,
'server_info' => true,
'entry_refresh' => true,
'entry_move' => true,
'entry_internal_attributes_show' => true,
'entry_delete' => array('simple_delete' => true,
'mass_delete' => false),
'entry_rename' => true,
'entry_compare' => true,
'entry_create' => true,
'attribute_add' => true,
'attribute_add_value' => true,
'attribute_delete' => true,
'attribute_delete_value' => true);
$config->custom->commands['cmd'] = array(
'entry_internal_attributes_show' => true,
'entry_refresh' => true,
'oslinks' => true,
'switch_template' => true
);
$config->custom->commands['script'] = array(
'add_attr_form' => true,
'add_oclass_form' => true,
'add_value_form' => true,
'collapse' => true,
'compare' => true,
'compare_form' => true,
'copy' => true,
'copy_form' => true,
'create' => true,
'create_confirm' => true,
'delete' => true,
'delete_attr' => true,
'delete_form' => true,
'draw_tree_node' => true,
'expand' => true,
'export' => true,
'export_form' => true,
'import' => true,
'import_form' => true,
'login' => true,
'logout' => true,
'login_form' => true,
'mass_delete' => true,
'mass_edit' => true,
'mass_update' => true,
'modify_member_form' => true,
'monitor' => true,
'purge_cache' => true,
'query_engine' => true,
'rename' => true,
'rename_form' => true,
'rdelete' => true,
'refresh' => true,
'schema' => true,
'server_info' => true,
'show_cache' => true,
'template_engine' => true,
'update_confirm' => true,
'update' => true
);
*/
/*********************************************/
@@ -128,6 +153,9 @@ $config->custom->commands['all'] = array(
/* Disable the default template. */
// $config->custom->appearance['disable_default_template'] = false;
/* Hide the warnings for invalid objectClasses/attributes in templates. */
// $config->custom->appearance['hide_template_warning'] = false;
/* Configure what objects are shown in left hand tree */
// $config->custom->appearance['tree_filter'] = '(objectclass=*)';
@@ -231,6 +259,9 @@ $config->custom->appearance['friendly_attrs'] = array(
/*********************************************/
$servers = new Datastore();
/* $servers->NewServer('ldap_pla') must be called before each new LDAP server
declaration. */
$servers->newServer('ldap_pla');
/* A convenient name that will appear in the tree viewer and throughout
@@ -270,12 +301,12 @@ $servers->setValue('server','name','My LDAP Server');
/* The DN of the user for phpLDAPadmin to bind with. For anonymous binds or
'cookie' or 'session' auth_types, LEAVE THE LOGIN_DN AND LOGIN_PASS BLANK. If
you specify a login_attr in conjunction with a cookie or session auth_type,
then you can also specify the login_dn/login_pass here for searching the
then you can also specify the bind_id/bind_pass here for searching the
directory for users (ie, if your LDAP server does not allow anonymous binds. */
// $servers->setValue('login','bind_id','');
# $servers->setValue('login','bind_id','cn=Manager,dc=example,dc=com');
/* Your LDAP password. If you specified an empty login_dn above, this MUST also
/* Your LDAP password. If you specified an empty bind_id above, this MUST also
be blank. */
// $servers->setValue('login','bind_pass','');
# $servers->setValue('login','bind_pass','secret');
@@ -323,8 +354,7 @@ $servers->setValue('server','name','My LDAP Server');
# $servers->setValue('server','sasl_authz_id_replacement','$1');
/* SASL auth security props.
See http://beepcore-tcl.sourceforge.net/tclsasl.html#anchor5 for explanation.
*/
See http://beepcore-tcl.sourceforge.net/tclsasl.html#anchor5 for explanation. */
// $servers->setValue('server','sasl_props',null);
/* Default password hashing algorithm. One of md5, ssha, sha, md5crpyt, smd5,
@@ -337,11 +367,19 @@ $servers->setValue('server','name','My LDAP Server');
and log in as that user.
Leave blank or specify 'dn' to use full DN for logging in. Note also that if
your LDAP server requires you to login to perform searches, you can enter the
DN to use when searching in 'login_dn' and 'login_pass' above. You may also
specify 'string', in which case you can provide a string to use for logging
users in. See 'login_string' directly below. */
DN to use when searching in 'bind_id' and 'bind_pass' above.
// $servers->setValue('login','attr','dn');
/* Base DNs to used for logins. If this value is not set, then the LDAP server
Base DNs are used. */
// $servers->setValue('login','base',array());
/* If 'login,attr' is used above such that phpLDAPadmin will search for your DN
at login, you may restrict the search to a specific objectClasses. EG, set this
to array('posixAccount') or array('inetOrgPerson',..), depending upon your
setup. */
// $servers->setValue('login','class',array());
/* If you specified something different from 'dn', for example 'uid', as the
login_attr above, you can optionally specify here to fall back to
authentication with dn.
@@ -351,19 +389,6 @@ $servers->setValue('server','name','My LDAP Server');
When using this feature, login_class is ignored. */
// $servers->setValue('login','fallback_dn',false);
/* If you specified 'cookie' or 'session' as the auth_type above, and you
specified 'string' for 'login_attr' above, you must provide a string here for
logging users in. If, for example, I have a lot of user entries with DNs like
"uid=dsmith,ou=People,dc=example,dc=com", then I can specify a string
"uid=<username>,ou=People,dc=example,dc=com" and my users can login with
their user names alone, ie: "dsmith" in this case. */
# $servers->setValue('login','string','uid=<username>,ou=People,dc=example,dc=com');
/* If 'login_attr' is used above such that phpLDAPadmin will search for your DN
at login, you may restrict the search to a specific objectClass. EG, set this
to 'posixAccount' or 'inetOrgPerson', depending upon your setup. */
// $servers->setValue('login','class',null);
/* Specify true If you want phpLDAPadmin to not display or permit any
modification to the LDAP server. */
// $servers->setValue('server','read_only',false);
@@ -474,6 +499,7 @@ $servers->setValue('server','name','My LDAP Server');
**************************************************************************/
/*
$servers->newServer('ldap_pla');
$servers->setValue('server','name','LDAP Server');
$servers->setValue('server','host','127.0.0.1');
$servers->setValue('server','port',389);
@@ -495,7 +521,6 @@ $servers->setValue('server','sasl_props',null);
$servers->setValue('appearance','password_hash','md5');
$servers->setValue('login','attr','dn');
$servers->setValue('login','fallback_dn',false);
$servers->setValue('login','string',null);
$servers->setValue('login','class',null);
$servers->setValue('server','read_only',false);
$servers->setValue('appearance','show_create',true);

View File

@@ -1,4 +1,3 @@
# $Header$
# This is a Test-File for characters / encoding
# 1. Change the
# ,dc=example,dc=com

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* An example of a hooks implementation.
*

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Displays a form for adding an attribute/value to an LDAP entry.
*
@@ -166,7 +164,7 @@ if (get_request('meth','REQUEST') != 'ajax') {
echo '<table class="entry" cellspacing="0" align="center" border=0>';
echo '<td valign="top" align="center">';
printf('<select name="attr" onChange="displayAJ(\'%s\',\'cmd=add_value_form&server_id=%s&dn=%s&meth=ajax&attr=\'+this.value,\'%s\',\'append\');">',
printf('<select name="attr" onChange="ajDISPLAY(\'%s\',\'cmd=add_value_form&server_id=%s&dn=%s&meth=ajax&attr=\'+this.value,\'%s\',\'append\');">',
'ADDATTR',$app['server']->getIndex(),rawurlencode(get_request('dn','REQUEST')),_('Please Wait'));
printf('<option value="%s">%s</option>','','');

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* This page will allow the adding of additional ObjectClasses to an item.
* + If the ObjectClass to be added requires additional MUST attributes to be

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Displays a form to allow the user to enter a new value to add
* to the existing list of values for a multi-valued attribute.
@@ -31,13 +29,6 @@ $request['template'] = $request['page']->getTemplate();
/*
if ($request['attribute']->isReadOnly())
error(sprintf(_('The attribute (%s) is in readonly mode.'),$request['attr']),'error','index.php');
# Check our permissions
if (! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_add_value'))
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('add attribute value')),'error','index.php');
if (($request['attribute']->getValueCount() == 0) && ! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_add'))
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('add attribute')),'error','index.php');
*/
# Render the form
@@ -169,6 +160,7 @@ if (get_request('meth','REQUEST') != 'ajax') {
echo '<table class="entry" cellspacing="0" align="center" border=0>';
$request['page']->draw('Template',$attribute);
$request['page']->draw('Javascript',$attribute);
echo '</table>';
} else {

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Main command page for phpLDAPadmin
* All pages are rendered through this script.
@@ -14,6 +12,7 @@
require_once './common.php';
$www = array();
$www['cmd'] = get_request('cmd','REQUEST');
$www['meth'] = get_request('meth','REQUEST');
@@ -39,7 +38,7 @@ switch ($www['cmd']) {
}
if (DEBUG_ENABLED)
debug_log('Ready to render page for command [%s,%s].',128,__FILE__,__LINE__,__METHOD__,$www['cmd'],$app['script_cmd']);
debug_log('Ready to render page for command [%s,%s].',128,0,__FILE__,__LINE__,__METHOD__,$www['cmd'],$app['script_cmd']);
# Create page.
# Set the index so that we render the right server tree.
@@ -62,10 +61,10 @@ if ($app['script_cmd'])
# Refresh a frame - this is so that one frame can trigger another frame to be refreshed.
if (isAjaxEnabled() && get_request('refresh','REQUEST') && get_request('refresh','REQUEST') != get_request('frame','REQUEST')) {
printf("
<script type=\"text/javascript\" language=\"javascript\">
displayAJ('%s','cmd=refresh&server_id=%s&meth=ajax&noheader=%s','%s');
</script>",get_request('refresh','REQUEST'),$app['server']->getIndex(),get_request('noheader','REQUEST',false,0),_('Auto refresh'));
echo '<script type="text/javascript" language="javascript">';
printf("ajDISPLAY('%s','cmd=refresh&server_id=%s&meth=ajax&noheader=%s','%s');",
get_request('refresh','REQUEST'),$app['server']->getIndex(),get_request('noheader','REQUEST',false,0),_('Auto refresh'));
echo '</script>';
}
# Capture the output and put into the body of the page.

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* This script alters the session variable 'tree', collapsing it
* at the dn specified in the query string.

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* This script provides a convienent method to call the proper common.php
*

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Compares two DN entries side by side.
*

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Compares two DN entries side by side.
* This is the entry form to determine which DN to compare this DN with.
@@ -30,6 +28,7 @@ $request['page']->accept();
$request['page']->drawTitle(sprintf('%s <b>%s</b>',_('Compare another DN with'),get_rdn($request['dn'])));
$request['page']->drawSubTitle();
printf('<script type="text/javascript" language="javascript" src="%sdnChooserPopup.js"></script>',JSDIR);
echo '<center>';
printf('%s <b>%s</b> %s<br />',_('Compare'),get_rdn($request['dn']),_('with '));

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Copies a given object to create a new one.
*
@@ -23,9 +21,6 @@ $ldap['SRC'] = $_SESSION[APPCONFIG]->getServer(get_request('server_id_src'));
$ldap['DST'] = $_SESSION[APPCONFIG]->getServer(get_request('server_id_dst'));
# Error checking
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_move'))
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('copy entry')),'error','index.php');
if (! trim($request['dnDST']))
error(_('You left the destination DN blank.'),'error','index.php');
@@ -92,9 +87,8 @@ if ($copy_result) {
}
function r_copy_dn($serverSRC,$serverDST,$snapshottree,$dnSRC,$dnDST,$remove) {
if (DEBUG_ENABLED)
debug_log('Entered with (%s,%s,%s,%s,%s)',1,__FILE__,__LINE__,__METHOD__,
$serverSRC->getIndex(),$serverDST->getIndex(),$snapshottree,$dnSRC,$dnDST);
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs);
$copy_message = array();
@@ -144,9 +138,8 @@ function r_copy_dn($serverSRC,$serverDST,$snapshottree,$dnSRC,$dnDST,$remove) {
}
function copy_dn($serverSRC,$serverDST,$dnSRC,$dnDST,$remove) {
if (DEBUG_ENABLED)
debug_log('Entered with (%s,%s,%s,%s)',17,__FILE__,__LINE__,__METHOD__,
$serverSRC->getIndex(),$serverDST->getIndex(),$dnSRC,$dnDST);
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs);
$request = array();
$request['pageSRC'] = new PageRender($serverSRC->getIndex(),get_request('template','REQUEST',false,'none'));
@@ -169,9 +162,8 @@ function copy_dn($serverSRC,$serverDST,$dnSRC,$dnDST,$remove) {
}
function build_tree($server,$dn,$buildtree) {
if (DEBUG_ENABLED)
debug_log('Entered with (%s,%s,%s)',1,__FILE__,__LINE__,__METHOD__,
$server->getIndex(),$dn,$buildtree);
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs);
# We search all children, not only the visible children in the tree
$children = $server->getContainerContents($dn,null,0);
@@ -183,7 +175,7 @@ function build_tree($server,$dn,$buildtree) {
}
if (DEBUG_ENABLED)
debug_log('Returning (%s)',1,__FILE__,__LINE__,__METHOD__,$buildtree);
debug_log('Returning (%s)',1,0,__FILE__,__LINE__,__METHOD__,$buildtree);
return $buildtree;
}

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Copies a given object to create a new one.
*
@@ -29,6 +27,7 @@ $request['page']->accept();
$request['page']->drawTitle(sprintf('%s <b>%s</b>',_('Copy'),get_rdn($request['dn'])));
$request['page']->drawSubTitle();
printf('<script type="text/javascript" language="javascript" src="%sdnChooserPopup.js"></script>',JSDIR);
echo '<center>';
printf('%s <b>%s</b> %s:<br /><br />',_('Copy'),get_rdn($request['dn']),_('to a new object'));
@@ -60,7 +59,7 @@ $request['children'] = $app['server']->getContainerContents($request['dn']);
if (count($request['children']) > 0) {
echo '<tr>';
printf('<td><label for="recursive">%s</label>:</td>',_('Recursive copy'));
echo '<td><input type="checkbox" id="recursive" name="recursive" onClick="toggle_disable_filter_field(this)" />';
echo '<td><input type="checkbox" id="recursive" name="recursive" onClick="copy_field_toggle(this)" />';
printf('<small>(%s)</small></td>',_('Recursively copy all children of this object as well.'));
echo '</tr>';
echo "\n";
@@ -97,21 +96,6 @@ if ($_SESSION[APPCONFIG]->getValue('appearance','show_hints'))
echo '</center>';
# Draw the javascrpt to enable/disable the filter field if this may be a recursive copy
if (count($request['children']) > 0) {
?>
<script type="text/javascript" language="javascript">
function toggle_disable_filter_field(recursive_checkbox)
{
if (recursive_checkbox.checked) {
recursive_checkbox.form.remove.disabled = false;
recursive_checkbox.form.filter.disabled = false;
} else {
recursive_checkbox.form.remove.disabled = true;
recursive_checkbox.form.remove.checked = false;
recursive_checkbox.form.filter.disabled = true;
}
}
</script>
<?php
}
if (count($request['children']) > 0)
printf('<script type="text/javascript" language="javascript" src="%sform_field_toggle_enable.js"></script>',JSDIR);
?>

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Creates a new object in LDAP.
*
@@ -19,9 +17,6 @@ if (get_request('cancel','REQUEST')) {
die();
}
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_create'))
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('create entry')),'error','index.php');
$request = array();
$request['redirect'] = get_request('redirect','POST',false,false);
@@ -41,9 +36,6 @@ if (! $request['container'])
$request['container'] = $tree->getEntry($request['template']->getContainer());
if ($request['container']->isLeaf())
error(sprintf(_('The container (%s) is a leaf.'),$request['template']->getContainer()),'error','index.php');
# Check our RDN
if (! count($request['template']->getRDNAttrs()))
error(_('The were no attributes marked as an RDN attribute.'),'error','index.php');

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Creates a new object in LDAP.
*
@@ -13,9 +11,6 @@
require './common.php';
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_create'))
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('create entry')),'error','index.php');
$request = array();
$request['redirect'] = get_request('redirect','POST',false,false);
@@ -35,9 +30,6 @@ if (! $request['container'])
$request['container'] = $tree->getEntry($request['template']->getContainer());
if ($request['container']->isLeaf())
error(sprintf(_('The container (%s) is a leaf.'),$request['template']->getContainer()),'error','index.php');
# Check our RDN
if (! count($request['template']->getRDNAttrs()))
error(_('The were no attributes marked as an RDN attribute.'),'error','index.php');

View File

@@ -364,6 +364,89 @@ table.tree span.dnicon img {
padding-bottom: 0px;
}
/* Tree */
table.tree .treemenudiv {
display: block;
white-space: nowrap;
padding-top: 1px;
padding-bottom: 1px;
}
table.tree .phplmnormal {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #000000;
text-decoration: none;
}
table.tree a.phplmnormal:hover {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #000000;
background-color: #fff0c0;
text-decoration: none;
}
table.tree a.phplm:link {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #000000;
text-decoration: none;
}
table.tree a.phplm:visited {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #000000;
text-decoration: none;
}
table.tree a.phplm:hover {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #841212;
background-color: #fff0c0;
text-decoration: none;
}
table.tree a.phplm:active {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #ff0000;
text-decoration: none;
}
table.tree a.phplmselected:link {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #dd0000;
background-color: #ffdd76;
text-decoration: none;
}
table.tree a.phplmselected:visited {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #dd0000;
background-color: #ffdd76;
text-decoration: none;
}
table.tree a.phplmselected:hover {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #841212;
background-color: #fff0c0;
text-decoration: none;
}
table.tree a.phplmselected:active {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #ff0000;
text-decoration: none;
}
/* Standard Form */
table.forminput {
background-color: #F9F9FA;

View File

@@ -363,6 +363,89 @@ table.tree a:hover {
color: #204A87;
}
/* Tree */
table.tree .treemenudiv {
display: block;
white-space: nowrap;
padding-top: 1px;
padding-bottom: 1px;
}
table.tree .phplmnormal {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #000000;
text-decoration: none;
}
table.tree a.phplmnormal:hover {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #000000;
background-color: #fff0c0;
text-decoration: none;
}
table.tree a.phplm:link {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #000000;
text-decoration: none;
}
table.tree a.phplm:visited {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #000000;
text-decoration: none;
}
table.tree a.phplm:hover {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #841212;
background-color: #fff0c0;
text-decoration: none;
}
table.tree a.phplm:active {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #ff0000;
text-decoration: none;
}
table.tree a.phplmselected:link {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #dd0000;
background-color: #ffdd76;
text-decoration: none;
}
table.tree a.phplmselected:visited {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #dd0000;
background-color: #ffdd76;
text-decoration: none;
}
table.tree a.phplmselected:hover {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #841212;
background-color: #fff0c0;
text-decoration: none;
}
table.tree a.phplmselected:active {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #ff0000;
text-decoration: none;
}
/* Standard Form */
table.forminput {
background-color: #EEEEEC;

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Deletes a DN and presents a "job's done" message.
*
@@ -20,9 +18,6 @@ $request['dn'] = get_request('dn','REQUEST',true);
if (! $app['server']->dnExists($request['dn']))
error(sprintf('%s (%s)',_('No such entry.'),'<b>'.pretty_print_dn($request['dn']).'</b>'),'error','index.php');
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_delete','simple_delete'))
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('delete entry')),'error','index.php');
# Delete the entry.
$result = $app['server']->delete($request['dn']);

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Deletes an attribute from an entry with NO confirmation.
*
@@ -13,9 +11,6 @@
require './common.php';
if (! $_SESSION[APPCONFIG]->isCommandAvailable('attribute_delete'))
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('delete attribute')),'error','index.php');
$request = array();
$request['dn'] = get_request('dn','REQUEST',true);
$request['attr'] = get_request('attr','REQUEST',true);

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Displays a last chance confirmation form to delete a DN.
*

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Download a binary value attribute to the user.
* A server ID, DN and Attribute must be provided in the GET attributes.

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Draw a portion of the LDAP tree.
*

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Display a selection (popup window) to pick a DN.
*
@@ -45,7 +43,7 @@ if (isset($app['server']) && ! is_null($request['container'])) {
foreach ($app['server']->getBaseDN() as $base) {
if (DEBUG_ENABLED)
debug_log('Comparing BaseDN [%s] with container [%s]',64,__FILE__,__LINE__,__METHOD__,$base,$request['container']);
debug_log('Comparing BaseDN [%s] with container [%s]',64,0,__FILE__,__LINE__,__METHOD__,$base,$request['container']);
if (! pla_compare_dns($request['container'],$base)) {
$parent_container = false;

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* This script alters the session variable 'tree', expanding it
* at the dn specified in the query string.

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Performs the export of data from the LDAP server
*
@@ -14,9 +12,6 @@
require './common.php';
require LIBDIR.'export_functions.php';
if (! $_SESSION[APPCONFIG]->isCommandAvailable('export'))
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('export')),'error','index.php');
# Prevent script from bailing early for long search
@set_time_limit(0);

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Export entries from the LDAP server.
*
@@ -38,6 +36,9 @@ $available_scopes = array(
$request['page'] = new PageRender($app['server']->getIndex(),get_request('template','REQUEST',false,'none'));
$request['page']->drawTitle(sprintf('<b>%s</b>',_('Export')));
printf('<script type="text/javascript" language="javascript" src="%sdnChooserPopup.js"></script>',JSDIR);
printf('<script type="text/javascript" language="javascript" src="%sform_field_toggle_enable.js"></script>',JSDIR);
echo '<br />';
echo '<center>';
echo '<form name="export_form" action="cmd.php" method="post">';
@@ -52,7 +53,7 @@ echo '<fieldset>';
printf('<legend>%s</legend>',_('Export'));
echo '<table>';
printf('<tr><td>%s</td><td>%s</td></tr>',_('Server'),server_select_list($app['server']->getIndex()));
printf('<tr><td>%s</td><td>%s</td></tr>',_('Server'),$app['server']->getName());
echo '<tr>';
printf('<td style="white-space:nowrap">%s</td>',_('Base DN'));
@@ -85,7 +86,7 @@ printf('<tr><td>%s</td><td><input type="text" name="attributes" style="width:300
printf('<tr><td>&nbsp;</td><td><input type="checkbox" name="sys_attr" id="sys_attr" %s/> <label for="sys_attr">%s</label></td></tr>',
$request['sys_attr'] ? 'checked="true" ' : '',_('Include system attributes'));
printf('<tr><td>&nbsp;</td><td><input type="checkbox" id="save_as_file" name="save_as_file" onclick="toggle_disable_field_saveas(this)" /> <label for="save_as_file">%s</label></td></tr>',
printf('<tr><td>&nbsp;</td><td><input type="checkbox" id="save_as_file" name="save_as_file" onclick="export_field_toggle(this)" /> <label for="save_as_file">%s</label></td></tr>',
_('Save as file'));
printf('<tr><td>&nbsp;</td><td><input type="checkbox" id="compress" name="compress" disabled /> <label for="compress">%s</label></td></tr>',
@@ -165,14 +166,9 @@ function get_line_end_format() {
*/
function get_user_agent_string() {
if (isset($_SERVER['HTTP_USER_AGENT']))
$return = strtolower($_SERVER['HTTP_USER_AGENT']);
return strtolower($_SERVER['HTTP_USER_AGENT']);
else
$return = '';
if (DEBUG_ENABLED)
debug_log('Entered with (), Returning (%s)',1,__FILE__,__LINE__,__METHOD__,$return);
return $return;
return '';
}
/**
@@ -215,15 +211,3 @@ function is_browser($type) {
return false;
}
?>
<script type="text/javascript" language="javascript">
<!--
function toggle_disable_field_saveas(id) {
if (id.checked) {
id.form.compress.disabled = false;
} else {
id.form.compress.disabled = true;
id.form.compress.checked = false;
}
}
-->
</script>

View File

Before

Width:  |  Height:  |  Size: 196 B

After

Width:  |  Height:  |  Size: 196 B

View File

Before

Width:  |  Height:  |  Size: 196 B

After

Width:  |  Height:  |  Size: 196 B

View File

Before

Width:  |  Height:  |  Size: 189 B

After

Width:  |  Height:  |  Size: 189 B

View File

Before

Width:  |  Height:  |  Size: 194 B

After

Width:  |  Height:  |  Size: 194 B

View File

Before

Width:  |  Height:  |  Size: 160 B

After

Width:  |  Height:  |  Size: 160 B

View File

Before

Width:  |  Height:  |  Size: 204 B

After

Width:  |  Height:  |  Size: 204 B

View File

Before

Width:  |  Height:  |  Size: 204 B

After

Width:  |  Height:  |  Size: 204 B

View File

Before

Width:  |  Height:  |  Size: 197 B

After

Width:  |  Height:  |  Size: 197 B

View File

Before

Width:  |  Height:  |  Size: 202 B

After

Width:  |  Height:  |  Size: 202 B

View File

Before

Width:  |  Height:  |  Size: 247 B

After

Width:  |  Height:  |  Size: 247 B

View File

Before

Width:  |  Height:  |  Size: 278 B

After

Width:  |  Height:  |  Size: 278 B

View File

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 207 B

View File

Before

Width:  |  Height:  |  Size: 150 B

After

Width:  |  Height:  |  Size: 150 B

View File

Before

Width:  |  Height:  |  Size: 160 B

After

Width:  |  Height:  |  Size: 160 B

View File

Before

Width:  |  Height:  |  Size: 160 B

After

Width:  |  Height:  |  Size: 160 B

View File

Before

Width:  |  Height:  |  Size: 156 B

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Imports an LDIF file to the specified LDAP server.
*
@@ -14,9 +12,6 @@
require './common.php';
require LIBDIR.'import_functions.php';
if (! $_SESSION[APPCONFIG]->isCommandAvailable('import'))
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('import')),'error','index.php');
$request = array();
$request['importer'] = new Importer($app['server']->getIndex(),'LDIF');
$request['import'] = $request['importer']->getTemplate();

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Displays a form to allow the user to upload and import
* an LDIF file.

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* phpLDAPadmin Start Page
*

22
htdocs/js/CheckAll.js Normal file
View File

@@ -0,0 +1,22 @@
function CheckAll(setbgcolor,form,index) {
htmlform = document.getElementById(form+index);
for (var i=0;i<htmlform.elements.length;i++) {
var e = htmlform.elements[i];
if (e.type == 'checkbox' && e.name != 'allbox') {
e.checked = htmlform.allbox.checked;
if (!document.layers && setbgcolor) {
var tr = document.getElementById('tr_'+e.id);
if (e.checked) {
tr.style.backgroundColor='#DDDDFF';
} else {
var id = e.id.substr(3);
tr.style.backgroundColor= id%2 ? '#E0E0E0' : '#F0F0F0';
}
}
}
}
}

192
htdocs/js/ajax_functions.js Normal file
View File

@@ -0,0 +1,192 @@
/**
* @package phpLDAPadmin
* @author The phpLDAPadmin development team
* @author Xavier Bruyet
*/
// current request
var http_div = '';
var http_request = null;
var http_request_success_callback = '';
var http_request_error_callback = '';
function ajDISPLAY(div,urlParameters,display) {
var pageDiv = getDiv(div);
if (pageDiv)
includeHTML(pageDiv,'<img src="images/ajax-progress.gif"><br><small>'+display+'...</small>');
else
return true;
makeHttpRequest('cmd.php',urlParameters+'&meth=ajax','GET','alertAJ','cancelAJ',div);
return false;
}
function ajJUMP(url,title,index,prefix) {
var attr = prefix ? document.getElementById(prefix+index).value : index;
if (attr)
url += '&viewvalue='+attr;
return ajDISPLAY('BODY',url,'Loading '+title);
}
function ajSHOWTHIS(key,except,ctl) {
select = document.getElementById(key+except);
if (select.style.display == '')
return false;
hideall(key,except,ctl);
return false;
};
function ajSHOWSCHEMA(type,key,value) {
select = document.getElementById(type);
if (value != null) {
except = value;
select.value = value;
} else {
except = select.value;
}
if (! except) {
showall(key);
} else {
objectclass = document.getElementById(key+except);
objectclass.style.display = '';
hideall(key,except);
};
return false;
};
function hideall(key,except,ctl) {
items = items();
for (x in items) {
if (! isNaN(x) && except != items[x]) {
item = document.getElementById(key+items[x]);
item.style.display = 'none';
if (ctl && (item = document.getElementById(ctl+items[x]))) {
item.style.background = '#E0E0E0';
}
} else if (! isNaN(x) && except == items[x]) {
item = document.getElementById(key+items[x]);
item.style.display = '';
if (ctl && (item = document.getElementById(ctl+items[x]))) {
item.style.background = '#F0F0F0';
}
}
}
}
function showall(key) {
items = items();
for (x in items) {
if (! isNaN(x)) {
item = document.getElementById(key+items[x]);
item.style.display = '';
}
}
}
// include html into a component
function includeHTML(component,html) {
if (typeof(component) != 'object' || typeof(html) != 'string') return;
component.innerHTML = html;
var scripts = component.getElementsByTagName('script');
if (!scripts) return;
// load scripts
for (var i = 0; i < scripts.length; i++) {
var scriptclone = document.createElement('script');
if (scripts[i].attributes.length > 0) {
for (var j in scripts[i].attributes) {
if (typeof(scripts[i].attributes[j]) != 'undefined'
&& typeof(scripts[i].attributes[j].nodeName) != 'undefined'
&& scripts[i].attributes[j].nodeValue != null
&& scripts[i].attributes[j].nodeValue != '') {
scriptclone.setAttribute(scripts[i].attributes[j].nodeName,scripts[i].attributes[j].nodeValue);
}
}
}
scriptclone.text = scripts[i].text;
scripts[i].parentNode.replaceChild(scriptclone,scripts[i]);
eval(scripts[i].innerHTML);
}
}
// callback function
function alertHttpRequest() {
if (http_request && (http_request.readyState == 4)) {
if (http_request.status == 200 || http_request.status == 401) {
response = http_request.responseText;
http_request = null;
//alert(response);
if (http_request_success_callback) {
eval(http_request_success_callback + '(response,http_div)');
}
} else {
alert('There was a problem with the request.');
cancelHttpRequest();
}
}
}
function cancelHttpRequest() {
if (http_request) {
http_request = null;
if (http_request_error_callback) {
eval(http_request_error_callback + '(http_div)');
}
}
}
function makeHttpRequest(url,parameters,meth,successCallbackFunctionName,errorCallbackFunctionName,div) {
cancelHttpRequest(div);
http_request_success_callback = successCallbackFunctionName;
http_request_error_callback = errorCallbackFunctionName;
http_div = div;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/html');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject('Msxml2.XMLHTTP');
} catch (e) {
try {
http_request = new ActiveXObject('Microsoft.XMLHTTP');
} catch (e) {}
}
}
if (!http_request) {
alert('Cannot create XMLHTTP instance.');
return false;
}
http_request.onreadystatechange = window['alertHttpRequest'];
if (meth == 'GET') url = url + '?' + parameters;
http_request.open(meth,url,true);
http_request.setRequestHeader('Content-type','application/x-www-form-urlencoded');
http_request.setRequestHeader('Content-length',parameters.length);
http_request.setRequestHeader('Connection','close');
if (meth == 'GET') parameters = null;
http_request.send(parameters);
}

View File

@@ -63,7 +63,7 @@ function alertTreeNodeContents(html) {
updateNewStyle();
}
function opencloseTreeNode(nodeid, params) {
function opencloseTreeNode(nodeid,params,imgdir) {
cancelHttpRequest(); // cancel last request
// get the node element
@@ -81,29 +81,29 @@ function opencloseTreeNode(nodeid, params) {
oldstyle = sonLayer.style.display;
oldimg = nodeLayer.src;
var action = 0; // (action = 1) => expand ; (action = 2) => collapse
if (oldimg.indexOf('js/phplayersmenu/menuimages/tree_expand.png') > -1) {
newimg = 'js/phplayersmenu/menuimages/tree_collapse.png';
if (oldimg.indexOf(imgdir+'/tree_expand.png') > -1) {
newimg = imgdir+'/tree_collapse.png';
action = 1;
} else if (oldimg.indexOf('js/phplayersmenu/menuimages/tree_expand_first.png') > -1) {
newimg = 'js/phplayersmenu/menuimages/tree_collapse_first.png';
} else if (oldimg.indexOf(imgdir+'/tree_expand_first.png') > -1) {
newimg = imgdir+'/tree_collapse_first.png';
action = 1;
} else if (oldimg.indexOf('js/phplayersmenu/menuimages/tree_expand_corner.png') > -1) {
newimg = 'js/phplayersmenu/menuimages/tree_collapse_corner.png';
} else if (oldimg.indexOf(imgdir+'/tree_expand_corner.png') > -1) {
newimg = imgdir+'/tree_collapse_corner.png';
action = 1;
} else if (oldimg.indexOf('js/phplayersmenu/menuimages/tree_expand_corner_first.png') > -1) {
newimg = 'js/phplayersmenu/menuimages/tree_collapse_corner_first.png';
} else if (oldimg.indexOf(imgdir+'/tree_expand_corner_first.png') > -1) {
newimg = imgdir+'/tree_collapse_corner_first.png';
action = 1;
} else if (oldimg.indexOf('js/phplayersmenu/menuimages/tree_collapse.png') > -1) {
newimg = 'js/phplayersmenu/menuimages/tree_expand.png';
} else if (oldimg.indexOf(imgdir+'/tree_collapse.png') > -1) {
newimg = imgdir+'/tree_expand.png';
action = 2;
} else if (oldimg.indexOf('js/phplayersmenu/menuimages/tree_collapse_first.png') > -1) {
newimg = 'js/phplayersmenu/menuimages/tree_expand_first.png';
} else if (oldimg.indexOf(imgdir+'/tree_collapse_first.png') > -1) {
newimg = imgdir+'/tree_expand_first.png';
action = 2;
} else if (oldimg.indexOf('js/phplayersmenu/menuimages/tree_collapse_corner.png') > -1) {
newimg = 'js/phplayersmenu/menuimages/tree_expand_corner.png';
} else if (oldimg.indexOf(imgdir+'/tree_collapse_corner.png') > -1) {
newimg = imgdir+'/tree_expand_corner.png';
action = 2;
} else if (oldimg.indexOf('js/phplayersmenu/menuimages/tree_collapse_corner_first.png') > -1) {
newimg = 'js/phplayersmenu/menuimages/tree_expand_corner_first.png';
} else if (oldimg.indexOf(imgdir+'/tree_collapse_corner_first.png') > -1) {
newimg = imgdir+'/tree_expand_corner_first.png';
action = 2;
}
nodeLayer.src = 'images/ajax-spinner.gif';
@@ -116,7 +116,7 @@ function opencloseTreeNode(nodeid, params) {
} else if (action == 1) {
newstyle = 'block';
if (sonLayer.innerHTML == '') {
makeGETRequest('cmd.php', params+'&cmd=draw_tree_node&action=1', 'alertTreeNodeContents', 'cancelNewStyle');
makeHttpRequest('cmd.php',params+'&cmd=draw_tree_node&action=1','GET','alertTreeNodeContents','cancelNewStyle');
} else {
updateNewStyle();
}
@@ -143,21 +143,28 @@ function cancelAJ(div) {
if (pageDiv) includeHTML(pageDiv, '');
}
function displayAJ(div,urlParameters,display) {
var pageDiv = getDiv(div);
if (pageDiv)
includeHTML(pageDiv, '<img src="images/ajax-progress.gif"><br><small>'+display+'...</small>');
else
return true;
makeGETRequest('cmd.php', urlParameters+'&meth=ajax', 'alertAJ', 'cancelAJ',div);
return false;
}
// close initial collapsed nodes
// Cant figure out why, but this runs twice in AJAX mode when using "refresh".
// Causing the collapsedNodes to be incorrect.
readCollapsedNodes();
for (k = 0; k < collapsedNodes.length; k++) {
opencloseTreeNode(collapsedNodes[k], '#');
opencloseTreeNode(collapsedNodes[k],'#','images/default');
}
var current;
function tree_unhide(whichLayer,old) {
if (current == null) current = old;
var oldtree = document.getElementById('ajSID_'+current).style;
oldtree.display = 'none';
if (document.getElementById) {
// this is the way the standards work
var newtree = document.getElementById(whichLayer).value;
var newtree_div = document.getElementById('ajSID_'+newtree).style;
newtree_div.display = 'block';
}
current = newtree;
}

View File

@@ -1,4 +1,3 @@
// $Header$
function dnChooserPopup(form_element,rdn)
{
mywindow=open('entry_chooser.php','myname','resizable=no,width=600,height=370,scrollbars=1');

View File

@@ -0,0 +1,51 @@
/**
* This function will provide a enable/disable toggle for a HTML form field
*/
function form_field_toggle_enable(field,disable,focus,rev) {
var i;
var result;
var element;
switch (field.type) {
case 'checkbox':
if (field.checked)
result = rev ? false : true;
else
result = rev ? true : false;
for (i=0;i<disable.length;i++) {
element = disable[i];
field.form[element].disabled = result;
if (focus && (disable[i] == focus))
field.form[element].focus();
}
break;
default:
alert('field: '+field.type+' disable: '+disable.length+' focus: '+focus);
}
}
/**
* Used by the copy form to enable/disable the recursive copy and delete
*/
function copy_field_toggle(field) {
var disable = ['remove','filter'];
var clear = 'remove';
form_field_toggle_enable(field,disable,'filter',true);
field.form[clear].checked = field.form[clear].checked && field.checked ? true : false;
}
/**
* Used by the export form to enable/disable compression
*/
function export_field_toggle(field) {
var disable = ['compress'];
var clear = 'compress';
form_field_toggle_enable(field,disable,'compress',true);
field.form[clear].checked = field.form[clear].checked && field.checked ? true : false;
}

View File

@@ -1,21 +0,0 @@
function trim(inputString) {
// Removes leading and trailing spaces from the passed string. Also removes
// consecutive spaces and replaces it with one space. If something besides
// a string is passed in (null, custom object, etc.) then return the input.
if (typeof inputString != "string") { return inputString; }
var retValue = inputString;
var ch = retValue.substring(0, 1);
while (ch == " ") { // Check for spaces at the beginning of the string
retValue = retValue.substring(1, retValue.length);
ch = retValue.substring(0, 1);
}
ch = retValue.substring(retValue.length-1, retValue.length);
while (ch == " ") { // Check for spaces at the end of the string
retValue = retValue.substring(0, retValue.length-1);
ch = retValue.substring(retValue.length-1, retValue.length);
}
while (retValue.indexOf(" ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+1, retValue.length); // Again, there are two spaces in each of the strings
}
return retValue; // Return the trimmed string back to the user
}

View File

@@ -1,29 +0,0 @@
function fixIEPNG( img )
{
img.style.filter =
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"
+ img.src + "', enabled=true)";
img.src="blank.gif";
}
function checkPNGs()
{
// test to see if the browser is IE
var agent = navigator.userAgent.toLowerCase();
var is_ie = (( agent.indexOf("msie") != -1 ) &&
( agent.indexOf("opera") == -1 ));
// if IE, use DirectX to correctly display a PNG
if ( !is_ie ) return;
// go through each image in the page and fix them
for ( var i = 0; i < document.images.length; i++ )
{
// only if the image is a png
var img = document.images[ i ];
if ( img.src.indexOf( "png" ) != -1 )
fixIEPNG( img );
}
}
checkPNGs();

View File

@@ -0,0 +1,46 @@
// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
// PHPLM v. 4.0.0 (C) 2007 Andreas Kasenides andreas@kasenides.org
// PHPLM v. 4.0.4 (C) 2008 Andreas Kasenides andreas@kasenides.org, Brett Zamir
/**
* @version 4.0.4
* @author PHPLM v. 4.0.4 (C) 2008 Andreas Kasenides andreas@kasenides.org
* @author PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
* @author Brett Zamir
*/
var DOM = (document.getElementById) ? 1 : 0;
var NS4 = (document.layers) ? 1 : 0;
// We need to explicitly detect Konqueror
// because Konqueror 3 sets IE = 1 ... AAAAAAAAAARGHHH!!!
var Konqueror = (navigator.userAgent.indexOf('Konqueror') > -1) ? 1 : 0;
// We need to detect Konqueror 2.2 as it does not handle the window.onresize event
var Konqueror22 = (navigator.userAgent.indexOf('Konqueror 2.2') > -1 || navigator.userAgent.indexOf('Konqueror/2.2') > -1) ? 1 : 0;
var Konqueror30 =
(
navigator.userAgent.indexOf('Konqueror 3.0') > -1
|| navigator.userAgent.indexOf('Konqueror/3.0') > -1
|| navigator.userAgent.indexOf('Konqueror 3;') > -1
|| navigator.userAgent.indexOf('Konqueror/3;') > -1
|| navigator.userAgent.indexOf('Konqueror 3)') > -1
|| navigator.userAgent.indexOf('Konqueror/3)') > -1
)
? 1 : 0;
var Konqueror31 = (navigator.userAgent.indexOf('Konqueror 3.1') > -1 || navigator.userAgent.indexOf('Konqueror/3.1') > -1) ? 1 : 0;
// We need to detect Konqueror 3.2 and 3.3 as they are affected by the see-through effect only for 2 form elements
var Konqueror32 = (navigator.userAgent.indexOf('Konqueror 3.2') > -1 || navigator.userAgent.indexOf('Konqueror/3.2') > -1) ? 1 : 0;
var Konqueror33 = (navigator.userAgent.indexOf('Konqueror 3.3') > -1 || navigator.userAgent.indexOf('Konqueror/3.3') > -1) ? 1 : 0;
var Opera = (navigator.userAgent.indexOf('Opera') > -1) ? 1 : 0;
var Opera5 = (navigator.userAgent.indexOf('Opera 5') > -1 || navigator.userAgent.indexOf('Opera/5') > -1) ? 1 : 0;
var Opera6 = (navigator.userAgent.indexOf('Opera 6') > -1 || navigator.userAgent.indexOf('Opera/6') > -1) ? 1 : 0;
var Opera56 = Opera5 || Opera6;
var Opera7 = (navigator.userAgent.indexOf('Opera 7') > -1 || navigator.userAgent.indexOf('Opera/7') > -1) ? 1 : 0;
var Opera8 = (navigator.userAgent.indexOf('Opera 8') > -1 || navigator.userAgent.indexOf('Opera/8') > -1) ? 1 : 0;
var Opera9 = (navigator.userAgent.indexOf('Opera 9') > -1 || navigator.userAgent.indexOf('Opera/9') > -1) ? 1 : 0;
var IE = (navigator.userAgent.indexOf('MSIE') > -1) ? 1 : 0;
IE = IE && !Opera;
var IE5 = IE && DOM;
var IE4 = (document.all) ? 1 : 0;
IE4 = IE4 && IE && !DOM;

View File

@@ -1,27 +1,18 @@
/* This function submits the form
* when Save Changes button is pressed.
* see modify_member_form.php
*/
function submitForm(formId) {
var formObj = document.getElementById(formId);
formObj.submit();
}
var m1 = document.member.notmembers;
var m2 = document.member.members;
/* This function generates hidden input array from new group members
* when submit button is pressed.
* see modify_member_form.php
*/
function update_new_values(memberattr,formId) {
function update_new_values(memberattr) {
el = document.getElementById("dnu");
for (i=0;i<m2.length;i++) {
el.innerHTML =
el.innerHTML +
"<input type='hidden' name='new_values[" + memberattr + "][" +
i + "]' value='" + m2.options[i].text + "' />";
"<input type='hidden' name='new_values[" + memberattr + "][" + i + "]' value='" + m2.options[i].text + "' />";
}
submitForm(formId);
}
@@ -29,8 +20,8 @@ function update_new_values(memberattr,formId) {
* see modify_member_form.php
*/
function one2two() {
m1len = m1.length ;
for (i=0;i<m1len;i++) {
if (m1.options[i].selected == true) {
m2len = m2.length;
@@ -49,8 +40,8 @@ function one2two() {
* see modify_member_form.php
*/
function two2one() {
m2len = m2.length ;
for (i=0;i<m2len;i++){
if (m2.options[i].selected == true) {
m1len = m1.length;
@@ -69,8 +60,8 @@ function two2one() {
* see modify_member_form.php
*/
function all2two() {
m1len = m1.length ;
for (i=0;i<m1len;i++) {
m2len = m2.length;
m2.options[m2len]= new Option(m1.options[i].text);
@@ -85,8 +76,8 @@ function all2two() {
* see modify_member_form.php
*/
function all2one() {
m2len = m2.length ;
for (i=0;i<m2len;i++) {
m1len = m1.length;
m1.options[m1len]= new Option(m2.options[i].text);

View File

@@ -1,504 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@@ -1,24 +0,0 @@
Copyright (C) 2001-2004 Marco Pratesi
PHP Layers Menu is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
PHP Layers Menu is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A copy of version 2.1 of the GNU Lesser General Public License
is available in the file COPYING.
Marco Pratesi
http://www.marcopratesi.it/
This is taken from phplayersmenu-3.2.0-rc

View File

@@ -1,81 +0,0 @@
table.tree .treemenudiv {
display: block;
white-space: nowrap;
padding-top: 1px;
padding-bottom: 1px;
}
table.tree .phplmnormal {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #000000;
text-decoration: none;
}
table.tree a.phplmnormal:hover {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #000000;
background-color: #fff0c0;
text-decoration: none;
}
table.tree a.phplm:link {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #000000;
text-decoration: none;
}
table.tree a.phplm:visited {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #000000;
text-decoration: none;
}
table.tree a.phplm:hover {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #841212;
background-color: #fff0c0;
text-decoration: none;
}
table.tree a.phplm:active {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #ff0000;
text-decoration: none;
}
table.tree a.phplmselected:link {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #dd0000;
background-color: #ffdd76;
text-decoration: none;
}
table.tree a.phplmselected:visited {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #dd0000;
background-color: #ffdd76;
text-decoration: none;
}
table.tree a.phplmselected:hover {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #841212;
background-color: #fff0c0;
text-decoration: none;
}
table.tree a.phplmselected:active {
font-family: bitstream vera sans, luxi sans, verdana, geneva, arial, helvetica, sans-serif;
font-size: 13px;
color: #ff0000;
text-decoration: none;
}

View File

@@ -1,567 +0,0 @@
<?php
// vim: set expandtab tabstop=4 shiftwidth=4:
// This code that was derived from the original PHPLIB Template class
// is copyright by Kristian Koehntopp, NetUSE AG and was released
// under the LGPL.
//
// Authors: Kristian Koehntopp <kris@koehntopp.de> (original from PHPLIB)
// Bjoern Schotte <bjoern@rent-a-phpwizard.de> (PEARification)
// Martin Jansen <mj@php.net> (PEAR conformance)
//
// $Id$
//
//require_once "PEAR.php";
/**
* Converted PHPLIB Template class
*
* For those who want to use PHPLIB's fine template class,
* here's a PEAR conforming class with the original PHPLIB
* template code from phplib-stable CVS. Original author
* was Kristian Koehntopp <kris@koehntopp.de>
*
* @author Bjoern Schotte <bjoern@rent-a-phpwizard.de>
* @author Martin Jansen <mj@php.net> (PEAR conformance)
* @version 1.0
*/
class Template_PHPLIB
{
/**
* If set, echo assignments
* @var bool
*/
public $debug = false;
/**
* $file[handle] = "filename";
* @var array
*/
public $file = array();
/**
* fallback paths that should be defined in a child class
* @var array
*/
public $file_fallbacks = array();
/**
* Relative filenames are relative to this pathname
* @var string
*/
public $root = "";
/*
* $_varKeys[key] = "key"
* @var array
*/
public $_varKeys = array();
/**
* $_varVals[key] = "value";
* @var array
*/
public $_varVals = array();
/**
* "remove" => remove undefined variables
* "comment" => replace undefined variables with comments
* "keep" => keep undefined variables
* @var string
*/
public $unknowns = "remove";
/**
* "yes" => halt, "report" => report error, continue, "no" => ignore error quietly
* @var string
*/
public $haltOnError = "report";
/**
* The last error message is retained here
* @var string
* @see halt
*/
public $_lastError = "";
/**
* Constructor
*
* @access public
* @param string template root directory
* @param string how to handle unknown variables
* @param array fallback paths
*/
function Template_PHPLIB($root = ".", $unknowns = "remove", $fallback="")
{
$this->setRoot($root);
$this->setUnknowns($unknowns);
if (is_array($fallback)) $this->file_fallbacks = $fallback;
}
/**
* Sets the template directory
*
* @access public
* @param string new template directory
* @return bool
*/
function setRoot($root)
{
if (!is_dir($root)) {
$this->halt("setRoot: $root is not a directory.");
return false;
}
$this->root = $root;
return true;
}
/**
* What to do with unknown variables
*
* three possible values:
*
* - "remove" will remove unknown variables
* (don't use this if you define CSS in your page)
* - "comment" will replace undefined variables with comments
* - "keep" will keep undefined variables as-is
*
* @access public
* @param string unknowns
*/
function setUnknowns($unknowns = "keep")
{
$this->unknowns = $unknowns;
}
/**
* Set appropriate template files
*
* With this method you set the template files you want to use.
* Either you supply an associative array with key/value pairs
* where the key is the handle for the filname and the value
* is the filename itself, or you define $handle as the file name
* handle and $filename as the filename if you want to define only
* one template.
*
* @access public
* @param mixed handle for a filename or array with handle/name value pairs
* @param string name of template file
* @return bool
*/
function setFile($handle, $filename = "")
{
if (!is_array($handle)) {
if ($filename == "") {
$this->halt("setFile: For handle $handle filename is empty.");
return false;
}
$this->file[$handle] = $this->_filename($filename);
} else {
reset($handle);
while (list($h, $f) = each($handle)) {
$this->file[$h] = $this->_filename($f);
}
}
}
/**
* Set a block in the appropriate template handle
*
* By setting a block like that:
*
* &lt;!-- BEGIN blockname --&gt;
* html code
* &lt;!-- END blockname --&gt;
*
* you can easily do repeating HTML code, i.e. output
* database data nice formatted into a HTML table where
* each DB row is placed into a HTML table row which is
* defined in this block.
* It extracts the template $handle from $parent and places
* variable {$name} instead.
*
* @access public
* @param string parent handle
* @param string block name handle
* @param string variable substitution name
*/
function setBlock($parent, $handle, $name = "")
{
if (!$this->_loadFile($parent)) {
$this->halt("setBlock: unable to load $parent.");
return false;
}
if ($name == "") {
$name = $handle;
}
$str = $this->getVar($parent);
$reg = "/[ \t]*<!--\s+BEGIN $handle\s+-->\s*?\n?(\s*.*?\n?)\s*<!--\s+END $handle\s+-->\s*?\n?/sm";
preg_match_all($reg, $str, $m);
$str = preg_replace($reg, "{" . "$name}", $str);
if (isset($m[1][0])) $this->setVar($handle, $m[1][0]);
$this->setVar($parent, $str);
}
/**
* Set corresponding substitutions for placeholders
*
* @access public
* @param string name of a variable that is to be defined or an array of variables with value substitution as key/value pairs
* @param string value of that variable
* @param boolean if true, the value is appended to the variable's existing value
*/
function setVar($varname, $value = "", $append = false)
{
if (!is_array($varname)) {
if (!empty($varname))
if ($this->debug) print "scalar: set *$varname* to *$value*<br>\n";
$this->_varKeys[$varname] = $this->_varname($varname);
($append) ? $this->_varVals[$varname] .= $value : $this->_varVals[$varname] = $value;
} else {
reset($varname);
while (list($k, $v) = each($varname)) {
if (!empty($k))
if ($this->debug) print "array: set *$k* to *$v*<br>\n";
$this->_varKeys[$k] = $this->_varname($k);
($append) ? $this->_varVals[$k] .= $v : $this->_varVals[$k] = $v;
}
}
}
/**
* Substitute variables in handle $handle
*
* @access public
* @param string name of handle
* @return mixed string substituted content of handle
*/
function subst($handle)
{
if (!$this->_loadFile($handle)) {
$this->halt("subst: unable to load $handle.");
return false;
}
return @str_replace($this->_varKeys, $this->_varVals, $this->getVar($handle));
}
/**
* Same as subst but printing the result
*
* @access public
* @brother subst
* @param string handle of template
* @return bool always false
*/
function pSubst($handle)
{
print $this->subst($handle);
return false;
}
/**
* Parse handle into target
*
* Parses handle $handle into $target, eventually
* appending handle at $target if $append is defined
* as TRUE.
*
* @access public
* @param string target handle to parse into
* @param string which handle should be parsed
* @param boolean append it to $target or not?
* @return string parsed handle
*/
function parse($target, $handle, $append = false)
{
if (!is_array($handle)) {
$str = $this->subst($handle);
($append) ? $this->setVar($target, $this->getVar($target) . $str) : $this->setVar($target, $str);
} else {
reset($handle);
while (list(, $h) = each($handle)) {
$str = $this->subst($h);
$this->setVar($target, $str);
}
}
return $str;
}
/**
* Same as parse, but printing it.
*
* @access public
* @brother parse
* @param string target to parse into
* @param string handle which should be parsed
* @param should $handle be appended to $target?
* @return bool
*/
function pParse($target, $handle, $append = false)
{
print $this->finish($this->parse($target, $handle, $append));
return false;
}
/**
* Return all defined variables and their values
*
* @access public
* @return array with all defined variables and their values
*/
function getVars()
{
reset($this->_varKeys);
while (list($k, ) = each($this->_varKeys)) {
$result[$k] = $this->getVar($k);
}
return $result;
}
/**
* Return one or more specific variable(s) with their values.
*
* @access public
* @param mixed array with variable names or one variable name as a string
* @return mixed array of variable names with their values or value of one specific variable
*/
function getVar($varname)
{
if (!is_array($varname)) {
if (isset($this->_varVals[$varname])) {
return $this->_varVals[$varname];
} else {
return "";
}
} else {
reset($varname);
while (list($k, ) = each($varname)) {
$result[$k] = (isset($this->_varVals[$k])) ? $this->_varVals[$k] : "";
}
return $result;
}
}
/**
* Get undefined values of a handle
*
* @access public
* @param string handle name
* @return mixed false if an error occured or the undefined values
*/
function getUndefined($handle)
{
if (!$this->_loadFile($handle)) {
$this->halt("getUndefined: unable to load $handle.");
return false;
}
preg_match_all("/{([^ \t\r\n}]+)}/", $this->getVar($handle), $m);
$m = $m[1];
if (!is_array($m)) {
return false;
}
reset($m);
while (list(, $v) = each($m)) {
if (!isset($this->_varKeys[$v])) {
$result[$v] = $v;
}
}
if (isset($result) && count($result)) {
return $result;
} else {
return false;
}
}
/**
* Finish string
*
* @access public
* @param string string to finish
* @return finished, i.e. substituted string
*/
function finish($str)
{
switch ($this->unknowns) {
case "remove":
$str = preg_replace('/{[^ \t\r\n}]+}/', "", $str);
break;
case "comment":
$str = preg_replace('/{([^ \t\r\n}]+)}/', "<!-- Template $handle: Variable \\1 undefined -->", $str);
break;
}
return $str;
}
/**
* Print variable to the browser
*
* @access public
* @param string name of variable to print
*/
function p($varname)
{
print $this->finish($this->getVar($varname));
}
/**
* Get finished variable
*
* @access public public
* @param string variable to get
* @return string string with finished variable
*/
function get($varname)
{
return $this->finish($this->getVar($varname));
}
/**
* Complete filename
*
* Complete filename, i.e. testing it for slashes
*
* @access private
* @param string filename to be completed
* @return string completed filename
*/
function _filename($filename)
{
// if (substr($filename, 0, 1) != "/") {
// $filename = $this->root."/".$filename;
// }
if (file_exists($filename)) return $filename;
if (is_array($this->file_fallbacks) && count($this->file_fallbacks) > 0) {
reset($this->file_fallbacks);
while (list(,$v) = each($this->file_fallbacks)) {
if (file_exists($v.basename($filename))) return $v.basename($filename);
}
$this->halt(sprintf("filename: file %s does not exist in the fallback paths %s.",$filename,implode(",",$this->file_fallbacks)));
return false;
} else {
$this->halt(sprintf("filename: file %s does not exist.",$filename));
return false;
}
return $filename;
}
/**
* Protect a replacement variable
*
* @access private
* @param string name of replacement variable
* @return string replaced variable
*/
function _varname($varname)
{
return "{".$varname."}";
}
/**
* load file defined by handle if it is not loaded yet
*
* @access private
* @param string handle
* @return bool FALSE if error, true if all is ok
*/
function _loadFile($handle)
{
if (isset($this->_varKeys[$handle]) and !empty($this->_varVals[$handle])) {
return true;
}
if (!isset($this->file[$handle])) {
$this->halt("loadfile: $handle is not a valid handle.");
return false;
}
$filename = $this->file[$handle];
if (function_exists("file_get_contents")) {
$str = file_get_contents($filename);
} else {
if (!$fp = @fopen($filename,"r")) {
$this->halt("loadfile: couldn't open $filename");
return false;
}
$str = fread($fp,filesize($filename));
fclose($fp);
}
if ($str=='') {
$this->halt("loadfile: While loading $handle, $filename does not exist or is empty.");
return false;
}
$this->setVar($handle, $str);
return true;
}
/**
* Error function. Halt template system with message to show
*
* @access public
* @param string message to show
* @return bool
*/
function halt($msg)
{
$this->_lastError = $msg;
if ($this->haltOnError != "no") {
// return $this->haltMsg($msg);
$this->haltMsg($msg);
}
if ($this->haltOnError == "yes") {
die("<b>Halted.</b>");
}
return false;
}
/**
* printf error message to show
*
* @access public
* @param string message to show
* @return object PEAR error object
*/
function haltMsg($msg)
{
// PEAR::raiseError(sprintf("<b>Template Error:</b> %s<br>\n", $msg));
printf("<b>Template Error:</b> %s<br>\n", $msg);
}
}
?>

View File

@@ -1,959 +0,0 @@
<?php
// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
/**
* This file contains the code of the LayersMenuCommon class.
* @package PHPLayersMenu
*/
/**
* This is the "common" class of the PHP Layers Menu library.
*
* You need to include PEAR.php and DB.php if (and only if) you want to use the DB support provided by ths class.
*
* @version 3.2.0-rc
* @package PHPLayersMenu
*/
class LayersMenuCommon
{
/**
* The name of the package
* @access private
* @var string
*/
public $_packageName;
/**
* The version of the package
* @access private
* @var string
*/
public $version;
/**
* The copyright of the package
* @access private
* @var string
*/
public $copyright;
/**
* The author of the package
* @access private
* @var string
*/
public $author;
/**
* URL to be prepended to the menu hrefs
* @access private
* @var string
*/
public $prependedUrl = '';
/**
* Do you want that code execution halts on error?
* @access private
* @var string
*/
public $haltOnError = 'yes';
/**
* The base directory where the package is installed
* @access private
* @var string
*/
public $dirroot;
/**
* The "libjs" directory of the package
* @access private
* @var string
*/
public $libjsdir;
/**
* The directory where images related to the menu can be found
* @access private
* @var string
*/
public $imgdir;
/**
* The http path corresponding to imgdir
* @access private
* @var string
*/
public $imgwww;
/**
* The directory where icons of menu items can be found
* @access private
* @var string
*/
public $icondir;
/**
* The http path corresponding to icondir
* @access private
* @var string
*/
public $iconwww;
/**
* This array may contain width and height of all icons
* @access private
* @var integer
*/
public $iconsize = array();
/**
* If this var is false, width and height of icons have to be detected; if this var is true, width and height of icons are not detected and are retrieved from the iconsize array
* @access private
* @var boolean
*/
public $issetIconsize = false;
/**
* The directory where templates can be found
* @access private
* @var string
*/
public $tpldir;
/**
* The string containing the menu structure
* @access private
* @var string
*/
public $menuStructure;
/**
* It counts nodes for all menus
* @access private
* @var integer
*/
public $_nodesCount;
/**
* A multi-dimensional array to store informations for each menu entry
* @access private
* @var array
*/
public $tree;
/**
* A multi-dimensional array used only with the DB support; for each $menu_name, it stores the $cnt associated to each item id
*
* This array is needed for selection of the current item
* through the corresponding id (see the DB table structure)
* as, internally, items are stored, sorted and addressed in terms of $cnt
*
* @access private
* @var array
*/
public $treecnt;
/**
* The maximum hierarchical level of menu items
* @access private
* @var integer
*/
public $_maxLevel;
/**
* An array that counts the number of first level items for each menu
* @access private
* @var array
*/
public $_firstLevelCnt;
/**
* An array containing the number identifying the first item of each menu
* @access private
* @var array
*/
public $_firstItem;
/**
* An array containing the number identifying the last item of each menu
* @access private
* @var array
*/
public $_lastItem;
/**
* Data Source Name: the connection string for PEAR DB
* @access private
* @var string
*/
public $dsn = 'pgsql://dbuser:dbpass@dbhost/dbname';
/**
* DB connections are either persistent or not persistent
* @access private
* @var boolean
*/
public $persistent = false;
/**
* Name of the table storing data describing the menu
* @access private
* @var string
*/
public $tableName = 'phplayersmenu';
/**
* Name of the i18n table corresponding to $tableName
* @access private
* @var string
*/
public $tableName_i18n = 'phplayersmenu_i18n';
/**
* Names of fields of the table storing data describing the menu
*
* default field names correspond to the same field names foreseen
* by the menu structure format
*
* @access private
* @var array
*/
public $tableFields = array(
'id' => 'id',
'parent_id' => 'parent_id',
'text' => 'text',
'href' => 'href',
'title' => 'title',
'icon' => 'icon',
'target' => 'target',
'orderfield' => 'orderfield',
'expanded' => 'expanded'
);
/**
* Names of fields of the i18n table corresponding to $tableName
* @access private
* @var array
*/
public $tableFields_i18n = array(
'language' => 'language',
'id' => 'id',
'text' => 'text',
'title' => 'title'
);
/**
* A temporary array to store data retrieved from the DB and to perform the depth-first search
* @access private
* @var array
*/
public $_tmpArray = array();
/**
* The constructor method; it initializates the menu system
* @return void
*/
function LayersMenuCommon()
{
$this->_packageName = 'PHP Layers Menu';
$this->version = '3.2.0-rc';
$this->copyright = '(C) 2001-2004';
$this->author = 'Marco Pratesi - http://www.marcopratesi.it/';
$this->prependedUrl = '';
$this->dirroot = './';
$this->libjsdir = './libjs/';
$this->imgdir = './menuimages/';
$this->imgwww = 'menuimages/';
$this->icondir = './menuicons/';
$this->iconwww = 'menuicons/';
$this->tpldir = './templates/';
$this->menuStructure = '';
$this->separator = '|';
$this->_nodesCount = 0;
$this->tree = array();
$this->treecnt = array();
$this->_maxLevel = array();
$this->_firstLevelCnt = array();
$this->_firstItem = array();
$this->_lastItem = array();
}
/**
* The method to set the prepended URL
* @access public
* @return boolean
*/
function setPrependedUrl($prependedUrl)
{
// We do not perform any check
$this->prependedUrl = $prependedUrl;
return true;
}
/**
* The method to set the dirroot directory
* @access public
* @return boolean
*/
function setDirrootCommon($dirroot)
{
if (!is_dir($dirroot)) {
$this->error("setDirroot: $dirroot is not a directory.");
return false;
}
if (substr($dirroot, -1) != '/') {
$dirroot .= '/';
}
$oldlength = strlen($this->dirroot);
$foobar = strpos($this->libjsdir, $this->dirroot);
if (!($foobar === false || $foobar != 0)) {
$this->libjsdir = $dirroot . substr($this->libjsdir, $oldlength);
}
$foobar = strpos($this->imgdir, $this->dirroot);
if (!($foobar === false || $foobar != 0)) {
$this->imgdir = $dirroot . substr($this->imgdir, $oldlength);
}
$foobar = strpos($this->icondir, $this->dirroot);
if (!($foobar === false || $foobar != 0)) {
$this->icondir = $dirroot . substr($this->icondir, $oldlength);
}
$foobar = strpos($this->tpldir, $this->dirroot);
if (!($foobar === false || $foobar != 0)) {
$this->tpldir = $dirroot . substr($this->tpldir, $oldlength);
}
$this->dirroot = $dirroot;
return true;
}
/**
* The method to set the libjsdir directory
* @access public
* @return boolean
*/
function setLibjsdir($libjsdir)
{
if ($libjsdir != '' && substr($libjsdir, -1) != '/') {
$libjsdir .= '/';
}
if ($libjsdir == '' || (substr($libjsdir, 0, 1) != '/' && substr($libjsdir, 1, 1) != ':')) {
// libjsdir != /.../...
// and libjsdir != C:\...\...
$foobar = strpos($libjsdir, $this->dirroot);
if ($foobar === false || $foobar != 0) {
$libjsdir = $this->dirroot . $libjsdir;
}
}
if (!is_dir($libjsdir)) {
$this->error("setLibjsdir: $libjsdir is not a directory.");
return false;
}
$this->libjsdir = $libjsdir;
return true;
}
/**
* The method to set the imgdir directory
* @access public
* @return boolean
*/
function setImgdir($imgdir)
{
if ($imgdir != '' && substr($imgdir, -1) != '/') {
$imgdir .= '/';
}
if ($imgdir == '' || (substr($imgdir, 0, 1) != '/' && substr($imgdir, 1, 1) != ':')) {
$foobar = strpos($imgdir, $this->dirroot);
if ($foobar === false || $foobar != 0) {
$imgdir = $this->dirroot . $imgdir;
}
}
if (!is_dir($imgdir)) {
$this->error("setImgdir: $imgdir is not a directory.");
return false;
}
$this->imgdir = $imgdir;
return true;
}
/**
* The method to set imgwww
* @access public
* @return void
*/
function setImgwww($imgwww)
{
if ($imgwww != '' && substr($imgwww, -1) != '/') {
$imgwww .= '/';
}
$this->imgwww = $imgwww;
}
/**
* The method to set the icondir directory
* @access public
* @return boolean
*/
function setIcondir($icondir)
{
if ($icondir != '' && substr($icondir, -1) != '/') {
$icondir .= '/';
}
if ($icondir == '' || (substr($icondir, 0, 1) != '/' && substr($icondir, 1, 1) != ':')) {
$foobar = strpos($icondir, $this->dirroot);
if ($foobar === false || $foobar != 0) {
$icondir = $this->dirroot . $icondir;
}
}
if (!is_dir($icondir)) {
$this->error("setIcondir: $icondir is not a directory.");
return false;
}
$this->icondir = $icondir;
return true;
}
/**
* The method to set iconwww
* @access public
* @return void
*/
function setIconwww($iconwww)
{
if ($iconwww != '' && substr($iconwww, -1) != '/') {
$iconwww .= '/';
}
$this->iconwww = $iconwww;
}
/**
* The method to set the iconsize array
* @access public
* @return void
*/
function setIconsize($width, $height)
{
$this->iconsize['width'] = ($width == (int) $width) ? $width : 0;
$this->iconsize['height'] = ($height == (int) $height) ? $height : 0;
$this->issetIconsize = true;
}
/**
* The method to unset the iconsize array
* @access public
* @return void
*/
function unsetIconsize()
{
unset($this->iconsize['width']);
unset($this->iconsize['height']);
$this->issetIconsize = false;
}
/**
* The method to set the tpldir directory
* @access public
* @return boolean
*/
function setTpldirCommon($tpldir)
{
if ($tpldir != '' && substr($tpldir, -1) != '/') {
$tpldir .= '/';
}
if ($tpldir == '' || (substr($tpldir, 0, 1) != '/' && substr($tpldir, 1, 1) != ':')) {
$foobar = strpos($tpldir, $this->dirroot);
if ($foobar === false || $foobar != 0) {
$tpldir = $this->dirroot . $tpldir;
}
}
if (!is_dir($tpldir)) {
$this->error("setTpldir: $tpldir is not a directory.");
return false;
}
$this->tpldir = $tpldir;
return true;
}
/**
* The method to read the menu structure from a file
* @access public
* @param string $tree_file the menu structure file
* @return boolean
*/
function setMenuStructureFile($tree_file)
{
if (!($fd = fopen($tree_file, 'r'))) {
$this->error("setMenuStructureFile: unable to open file $tree_file.");
return false;
}
$this->menuStructure = '';
while ($buffer = fgets($fd, 4096)) {
$buffer = ereg_replace(chr(13), '', $buffer); // Microsoft Stupidity Suppression
$this->menuStructure .= $buffer;
}
fclose($fd);
if ($this->menuStructure == '') {
$this->error("setMenuStructureFile: $tree_file is empty.");
return false;
}
return true;
}
/**
* The method to set the menu structure passing it through a string
* @access public
* @param string $tree_string the menu structure string
* @return boolean
*/
function setMenuStructureString($tree_string)
{
$this->menuStructure = ereg_replace(chr(13), '', $tree_string); // Microsoft Stupidity Suppression
if ($this->menuStructure == '') {
$this->error('setMenuStructureString: empty string.');
return false;
}
return true;
}
/**
* The method to set the value of separator
* @access public
* @return void
*/
function setSeparator($separator)
{
$this->separator = $separator;
}
/**
* The method to set parameters for the DB connection
* @access public
* @param string $dns Data Source Name: the connection string for PEAR DB
* @param bool $persistent DB connections are either persistent or not persistent
* @return boolean
*/
function setDBConnParms($dsn, $persistent=false)
{
if (!is_string($dsn)) {
$this->error('initdb: $dsn is not an string.');
return false;
}
if (!is_bool($persistent)) {
$this->error('initdb: $persistent is not a boolean.');
return false;
}
$this->dsn = $dsn;
$this->persistent = $persistent;
return true;
}
/**
* The method to set the name of the table storing data describing the menu
* @access public
* @param string
* @return boolean
*/
function setTableName($tableName)
{
if (!is_string($tableName)) {
$this->error('setTableName: $tableName is not a string.');
return false;
}
$this->tableName = $tableName;
return true;
}
/**
* The method to set the name of the i18n table corresponding to $tableName
* @access public
* @param string
* @return boolean
*/
function setTableName_i18n($tableName_i18n)
{
if (!is_string($tableName_i18n)) {
$this->error('setTableName_i18n: $tableName_i18n is not a string.');
return false;
}
$this->tableName_i18n = $tableName_i18n;
return true;
}
/**
* The method to set names of fields of the table storing data describing the menu
* @access public
* @param array
* @return boolean
*/
function setTableFields($tableFields)
{
if (!is_array($tableFields)) {
$this->error('setTableFields: $tableFields is not an array.');
return false;
}
if (count($tableFields) == 0) {
$this->error('setTableFields: $tableFields is a zero-length array.');
return false;
}
reset ($tableFields);
while (list($key, $value) = each($tableFields)) {
$this->tableFields[$key] = ($value == '') ? "''" : $value;
}
return true;
}
/**
* The method to set names of fields of the i18n table corresponding to $tableName
* @access public
* @param array
* @return boolean
*/
function setTableFields_i18n($tableFields_i18n)
{
if (!is_array($tableFields_i18n)) {
$this->error('setTableFields_i18n: $tableFields_i18n is not an array.');
return false;
}
if (count($tableFields_i18n) == 0) {
$this->error('setTableFields_i18n: $tableFields_i18n is a zero-length array.');
return false;
}
reset ($tableFields_i18n);
while (list($key, $value) = each($tableFields_i18n)) {
$this->tableFields_i18n[$key] = ($value == '') ? "''" : $value;
}
return true;
}
/**
* The method to parse the current menu structure and correspondingly update related variables
* @access public
* @param string $menu_name the name to be attributed to the menu
* whose structure has to be parsed
* @return void
*/
function parseStructureForMenu(
$menu_name = '' // non consistent default...
)
{
$this->_maxLevel[$menu_name] = 0;
$this->_firstLevelCnt[$menu_name] = 0;
$this->_firstItem[$menu_name] = $this->_nodesCount + 1;
$cnt = $this->_firstItem[$menu_name];
$menuStructure = $this->menuStructure;
/* *********************************************** */
/* Partially based on a piece of code taken from */
/* TreeMenu 1.1 - Bjorge Dijkstra (bjorge@gmx.net) */
/* *********************************************** */
while ($menuStructure != '') {
$before_cr = strcspn($menuStructure, "\n");
$buffer = substr($menuStructure, 0, $before_cr);
$menuStructure = substr($menuStructure, $before_cr+1);
if (substr($buffer, 0, 1) == '#') {
continue; // commented item line...
}
$tmp = rtrim($buffer);
$node = explode($this->separator, $tmp);
for ($i=count($node); $i<=7; $i++) {
$node[$i] = '';
}
$this->tree[$cnt]['level'] = strlen($node[0]);
$this->tree[$cnt]['text'] = $node[1];
$this->tree[$cnt]['href'] = $node[2];
$this->tree[$cnt]['title'] = $node[3];
$this->tree[$cnt]['icon'] = $node[4];
$this->tree[$cnt]['target'] = $node[5];
$this->tree[$cnt]['expanded'] = $node[6];
$this->tree[$cnt]['children'] = $node[7];
$cnt++;
}
/* *********************************************** */
$this->_lastItem[$menu_name] = count($this->tree);
$this->_nodesCount = $this->_lastItem[$menu_name];
$this->tree[$this->_lastItem[$menu_name]+1]['level'] = 0;
$this->_postParse($menu_name);
}
/**
* The method to parse the current menu table and correspondingly update related variables
* @access public
* @param string $menu_name the name to be attributed to the menu
* whose structure has to be parsed
* @param string $language i18n language; either omit it or pass
* an empty string ('') if you do not want to use any i18n table
* @return void
*/
function scanTableForMenu(
$menu_name = '', // non consistent default...
$language = ''
)
{
$this->_maxLevel[$menu_name] = 0;
$this->_firstLevelCnt[$menu_name] = 0;
unset($this->tree[$this->_nodesCount+1]);
$this->_firstItem[$menu_name] = $this->_nodesCount + 1;
/* BEGIN BENCHMARK CODE
$time_start = $this->_getmicrotime();
/* END BENCHMARK CODE */
$db = DB::connect($this->dsn, $this->persistent);
if (DB::isError($db)) {
$this->error('scanTableForMenu: ' . $db->getMessage());
}
$dbresult = $db->query('
SELECT ' .
$this->tableFields['id'] . ' AS id, ' .
$this->tableFields['parent_id'] . ' AS parent_id, ' .
$this->tableFields['text'] . ' AS text, ' .
$this->tableFields['href'] . ' AS href, ' .
$this->tableFields['title'] . ' AS title, ' .
$this->tableFields['icon'] . ' AS icon, ' .
$this->tableFields['target'] . ' AS target, ' .
$this->tableFields['expanded'] . ' AS expanded
FROM ' . $this->tableName . '
WHERE ' . $this->tableFields['id'] . ' <> 1
ORDER BY ' . $this->tableFields['orderfield'] . ', ' . $this->tableFields['text'] . ' ASC
');
$this->_tmpArray = array();
while ($dbresult->fetchInto($row, DB_FETCHMODE_ASSOC)) {
$this->_tmpArray[$row['id']]['parent_id'] = $row['parent_id'];
$this->_tmpArray[$row['id']]['text'] = $row['text'];
$this->_tmpArray[$row['id']]['href'] = $row['href'];
$this->_tmpArray[$row['id']]['title'] = $row['title'];
$this->_tmpArray[$row['id']]['icon'] = $row['icon'];
$this->_tmpArray[$row['id']]['target'] = $row['target'];
$this->_tmpArray[$row['id']]['expanded'] = $row['expanded'];
}
if ($language != '') {
$dbresult = $db->query('
SELECT ' .
$this->tableFields_i18n['id'] . ' AS id, ' .
$this->tableFields_i18n['text'] . ' AS text, ' .
$this->tableFields_i18n['title'] . ' AS title
FROM ' . $this->tableName_i18n . '
WHERE ' . $this->tableFields_i18n['id'] . ' <> 1
AND ' . $this->tableFields_i18n['language'] . ' = ' . "'$language'" . '
');
while ($dbresult->fetchInto($row, DB_FETCHMODE_ASSOC)) {
if (isset($this->_tmpArray[$row['id']])) {
$this->_tmpArray[$row['id']]['text'] = $row['text'];
$this->_tmpArray[$row['id']]['title'] = $row['title'];
}
}
}
unset($dbresult);
unset($row);
$this->_depthFirstSearch($menu_name, $this->_tmpArray, 1, 1);
/* BEGIN BENCHMARK CODE
$time_end = $this->_getmicrotime();
$time = $time_end - $time_start;
print "TIME ELAPSED = $time\n<br>";
/* END BENCHMARK CODE */
$this->_lastItem[$menu_name] = count($this->tree);
$this->_nodesCount = $this->_lastItem[$menu_name];
$this->tree[$this->_lastItem[$menu_name]+1]['level'] = 0;
$this->_postParse($menu_name);
}
function _getmicrotime()
{
list($usec, $sec) = explode(' ', microtime());
return ((float) $usec + (float) $sec);
}
/**
* Recursive method to perform the depth-first search of the tree data taken from the current menu table
* @access private
* @param string $menu_name the name to be attributed to the menu
* whose structure has to be parsed
* @param array $tmpArray the temporary array that stores data to perform
* the depth-first search
* @param integer $parent_id id of the item whose children have
* to be searched for
* @param integer $level the hierarchical level of children to be searched for
* @return void
*/
function _depthFirstSearch($menu_name, $tmpArray, $parent_id=1, $level=1)
{
reset ($tmpArray);
while (list($id, $foobar) = each($tmpArray)) {
if ($foobar['parent_id'] == $parent_id) {
unset($tmpArray[$id]);
unset($this->_tmpArray[$id]);
$cnt = count($this->tree) + 1;
$this->tree[$cnt]['level'] = $level;
$this->tree[$cnt]['text'] = $foobar['text'];
$this->tree[$cnt]['href'] = $foobar['href'];
$this->tree[$cnt]['title'] = $foobar['title'];
$this->tree[$cnt]['icon'] = $foobar['icon'];
$this->tree[$cnt]['target'] = $foobar['target'];
$this->tree[$cnt]['expanded'] = $foobar['expanded'];
$this->tree[$cnt]['children'] = $foobar['children'];
$this->treecnt[$menu_name][$id] = $cnt;
unset($foobar);
if ($id != $parent_id) {
$this->_depthFirstSearch($menu_name, $this->_tmpArray, $id, $level+1);
}
}
}
}
/**
* A method providing parsing needed after both file/string parsing and DB table parsing
* @access private
* @param string $menu_name the name of the menu for which the parsing
* has to be performed
* @return void
*/
function _postParse(
$menu_name = '' // non consistent default...
)
{
for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) { // this counter scans all nodes of the new menu
$this->tree[$cnt]['child_of_root_node'] = ($this->tree[$cnt]['level'] == 1);
$this->tree[$cnt]['parsed_text'] = stripslashes($this->tree[$cnt]['text']);
$this->tree[$cnt]['parsed_href'] = (ereg_replace(' ', '', $this->tree[$cnt]['href']) == '') ? '#' : $this->prependedUrl . $this->tree[$cnt]['href'];
$this->tree[$cnt]['parsed_title'] = ($this->tree[$cnt]['title'] == '') ? '' : ' title="' . stripslashes($this->tree[$cnt]['title']) . '"';
$fooimg = $this->icondir . $this->tree[$cnt]['icon'];
if ($this->tree[$cnt]['icon'] != '' && (substr($this->tree[$cnt]['icon'], 0, 7) == 'http://' || substr($this->tree[$cnt]['icon'], 0, 8) == 'https://')) {
$this->tree[$cnt]['parsed_icon'] = $this->tree[$cnt]['icon'];
if ($this->issetIconsize) {
$this->tree[$cnt]['iconwidth'] = $this->iconsize['width'];
$this->tree[$cnt]['iconheight'] = $this->iconsize['height'];
} else {
$foobar = getimagesize($this->tree[$cnt]['icon']);
$this->tree[$cnt]['iconwidth'] = $foobar[0];
$this->tree[$cnt]['iconheight'] = $foobar[1];
}
} elseif ($this->tree[$cnt]['icon'] != '' && file_exists($fooimg)) {
$this->tree[$cnt]['parsed_icon'] = $this->iconwww . $this->tree[$cnt]['icon'];
if ($this->issetIconsize) {
$this->tree[$cnt]['iconwidth'] = $this->iconsize['width'];
$this->tree[$cnt]['iconheight'] = $this->iconsize['height'];
} else {
$foobar = getimagesize($fooimg);
$this->tree[$cnt]['iconwidth'] = $foobar[0];
$this->tree[$cnt]['iconheight'] = $foobar[1];
}
} else {
$this->tree[$cnt]['parsed_icon'] = '';
}
$this->tree[$cnt]['parsed_target'] = ($this->tree[$cnt]['target'] == '') ? '' : ' target="' . $this->tree[$cnt]['target'] . '"';
// $this->tree[$cnt]['expanded'] = ($this->tree[$cnt]['expanded'] == '') ? 0 : $this->tree[$cnt]['expanded'];
$this->_maxLevel[$menu_name] = max($this->_maxLevel[$menu_name], $this->tree[$cnt]['level']);
if ($this->tree[$cnt]['level'] == 1) {
$this->_firstLevelCnt[$menu_name]++;
}
}
}
/**
* A method to replace strings in all URLs (hrefs) of a menu
* @access public
* @param string $menu_name the name of the menu for which the replacement
* has to be performed
* @param string $string the string to be replaced
* @param string $value the replacement string
* @return void
*/
function replaceStringInUrls($menu_name, $string, $value)
{
for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) { // this counter scans all nodes of the new menu
$this->tree[$cnt]['parsed_href'] = str_replace($string, $value, $this->tree[$cnt]['parsed_href']);
}
}
/**
* A method to set the same target for all links of a menu
* @access public
* @param string $menu_name the name of the menu for which the targets
* have to be set
* @param string $target the target to be set for all links
* of the $menu_name menu
* @return void
*/
function setLinksTargets($menu_name, $target)
{
for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) { // this counter scans all nodes of the new menu
$this->tree[$cnt]['parsed_target'] = ' target="' . $target . '"';
}
}
/**
* A method to select the current item of $menu_name in terms of $cnt, i.e., very likely, in terms of its line number in the corresponding menu structure file (excluding from the count commented out lines, if any)
* @access public
* @param string $menu_name the name of the menu for which the current item
* has to be selected
* @param integer $count the line number of the current item
* in the corresponding menu structure file
* (excluding from the count commented out lines, if any)
* @return void
*/
function setSelectedItemByCount($menu_name, $count)
{
if ($count < 1) {
$this->error("setSelectedItemByCount: the \$count argument is $count, but \$count can not be lower than 1");
return;
}
if ($count > $this->_lastItem[$menu_name] - $this->_firstItem[$menu_name] + 1) {
$this->error("setSelectedItemByCount: the \$count argument is $count and is larger than the number of items of the '$menu_name' menu");
return;
}
$cnt = $this->_firstItem[$menu_name] + $count - 1;
$this->tree[$cnt]['selected'] = true;
}
/**
* A method to select the current item of $menu_name in terms of the corresponding id (see the DB table structure); obviously, this method can be used only together with the DB support
* @access public
* @param string $menu_name the name of the menu for which the current item
* has to be selected
* @param integer $id the id of the current item in the corresponding DB table
* @return void
*/
function setSelectedItemById($menu_name, $id)
{
if (!isset($this->treecnt[$menu_name][$id])) {
$this->error("setSelectedItemById: there is not any item with \$id = $id in the '$menu_name' menu");
return;
}
$cnt = $this->treecnt[$menu_name][$id];
$this->tree[$cnt]['selected'] = true;
}
/**
* A method to select the current item of $menu_name specifying a string that occurs in the current URL
* @access public
* @param string $menu_name the name of the menu for which the current item
* has to be selected
* @param string $url a string that occurs in the current URL
* @return void
*/
function setSelectedItemByUrl($menu_name, $url)
{
for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) { // this counter scans all nodes of the new menu
if (!(strpos($this->tree[$cnt]['parsed_href'], $url) === false)) {
$this->tree[$cnt]['selected'] = true;
break;
}
}
}
/**
* A method to select the current item of $menu_name specifying a regular expression that matches (a substring of) the current URL; just the same as the setSelectedItemByUrl() method, but using eregi() instead of strpos()
* @access public
* @param string $menu_name the name of the menu for which the current item
* has to be selected
* @param string $url_eregi the regular expression that matches
* (a substring of) the current URL
* @return void
*/
function setSelectedItemByUrlEregi($menu_name, $url_eregi)
{
for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) { // this counter scans all nodes of the new menu
if (eregi($url_eregi, $this->tree[$cnt]['parsed_href'])) {
$this->tree[$cnt]['selected'] = true;
break;
}
}
}
/**
* Method to handle errors
* @access private
* @param string $errormsg the error message
* @return void
*/
function error($errormsg)
{
print "<b>LayersMenu Error:</b> $errormsg<br />\n";
if ($this->haltOnError == 'yes') {
die("<b>Halted.</b><br />\n");
}
}
} /* END OF CLASS */
?>

View File

@@ -1,398 +0,0 @@
<?php
// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
/**
* This file contains the code of the TreeMenu class.
* @package PHPLayersMenu
*/
/**
* This is the TreeMenu class of the PHP Layers Menu library.
*
* This class depends on the LayersMenuCommon class and on the PEAR conforming version of the PHPLib Template class, i.e. on HTML_Template_PHPLIB
*
* @version 3.2.0-rc
* @package PHPLayersMenu
*/
class TreeMenu extends LayersMenuCommon
{
/**
* Type of images used for the Tree Menu
* @access private
* @var string
*/
public $treeMenuImagesType;
/**
* Prefix for filenames of images of a theme
* @access private
* @var string
*/
public $treeMenuTheme;
/**
* An array where we store the Tree Menu code for each menu
* @access private
* @var array
*/
public $_treeMenu;
/**
* The constructor method; it initializates the menu system
* @return void
*/
function TreeMenu()
{
$this->LayersMenuCommon();
$this->treeMenuImagesType = 'png';
$this->treeMenuTheme = '';
$this->_treeMenu = array();
$this->_nodesCount = 0;
$this->tree = array();
$this->_maxLevel = array();
$this->_firstLevelCnt = array();
$this->_firstItem = array();
$this->_lastItem = array();
}
/**
* The method to set the dirroot directory
* @access public
* @return boolean
*/
function setDirroot($dirroot)
{
return $this->setDirrootCommon($dirroot);
}
/**
* The method to set the type of images used for the Tree Menu
* @access public
* @return void
*/
function setTreeMenuImagesType($treeMenuImagesType)
{
$this->treeMenuImagesType = $treeMenuImagesType;
}
/**
* The method to set the prefix for filenames of images of a theme
* @access public
* @return void
*/
function setTreeMenuTheme($treeMenuTheme)
{
$this->treeMenuTheme = $treeMenuTheme;
}
/**
* Method to prepare a new Tree Menu.
*
* This method processes items of a menu to prepare and return
* the corresponding Tree Menu code.
*
* @access public
* @param string $menu_name the name of the menu whose items have to be processed
* @return string
*/
function newTreeMenu(
$menu_name = '' // non consistent default...
)
{
/* If cookies were disabled, build the url parameter for the session id.
It will be append to the url to be redirect */
$id_session_param = '';
if (SID != '')
$id_session_param = sprintf('&%s=%s',session_name(),session_id());
global $ldapserver;
if (!isset($this->_firstItem[$menu_name]) || !isset($this->_lastItem[$menu_name])) {
$this->error("newTreeMenu: the first/last item of the menu '$menu_name' is not defined; please check if you have parsed its menu data.");
return 0;
}
$this->_treeMenu[$menu_name] = '';
$img_collapse = $this->imgwww . $this->treeMenuTheme . 'tree_collapse.' . $this->treeMenuImagesType;
$alt_collapse = '--';
$img_collapse_corner = $this->imgwww . $this->treeMenuTheme . 'tree_collapse_corner.' . $this->treeMenuImagesType;
$alt_collapse_corner = '--';
$img_collapse_corner_first = $this->imgwww . $this->treeMenuTheme . 'tree_collapse_corner_first.' . $this->treeMenuImagesType;
$alt_collapse_corner_first = '--';
$img_collapse_first = $this->imgwww . $this->treeMenuTheme . 'tree_collapse_first.' . $this->treeMenuImagesType;
$alt_collapse_first = '--';
$img_corner = $this->imgwww . $this->treeMenuTheme . 'tree_corner.' . $this->treeMenuImagesType;
$alt_corner = '`-';
$img_expand = $this->imgwww . $this->treeMenuTheme . 'tree_expand.' . $this->treeMenuImagesType;
$alt_expand = '+-';
$img_expand_corner = $this->imgwww . $this->treeMenuTheme . 'tree_expand_corner.' . $this->treeMenuImagesType;
$alt_expand_corner = '+-';
$img_expand_corner_first = $this->imgwww . $this->treeMenuTheme . 'tree_expand_corner_first.' . $this->treeMenuImagesType;
$alt_expand_corner_first = '+-';
$img_expand_first = $this->imgwww . $this->treeMenuTheme . 'tree_expand_first.' . $this->treeMenuImagesType;
$alt_expand_first = '+-';
$img_folder_closed = $this->imgwww . $this->treeMenuTheme . 'tree_folder_closed.' . $this->treeMenuImagesType;
$alt_folder_closed = '->';
$img_folder_open = $this->imgwww . $this->treeMenuTheme . 'tree_folder_open.' . $this->treeMenuImagesType;
$alt_folder_open = '->';
$img_leaf = $this->imgwww . $this->treeMenuTheme . 'tree_leaf.' . $this->treeMenuImagesType;
$alt_leaf = '->';
$img_space = $this->imgwww . $this->treeMenuTheme . 'tree_space.' . $this->treeMenuImagesType;
$alt_space = ' ';
$img_split = $this->imgwww . $this->treeMenuTheme . 'tree_split.' . $this->treeMenuImagesType;
$alt_split = '|-';
$img_split_first = $this->imgwww . $this->treeMenuTheme . 'tree_split_first.' . $this->treeMenuImagesType;
$alt_split_first = '|-';
$img_vertline = $this->imgwww . $this->treeMenuTheme . 'tree_vertline.' . $this->treeMenuImagesType;
$alt_vertline = '| ';
for ($i=0; $i<=$this->_maxLevel[$menu_name]; $i++) {
$levels[$i] = 0;
}
// Find last nodes of subtrees
$last_level = $this->_maxLevel[$menu_name];
for ($i=$this->_lastItem[$menu_name]; $i>=$this->_firstItem[$menu_name]; $i--) {
if ($this->tree[$i]['level'] < $last_level) {
for ($j=$this->tree[$i]['level']+1; $j<=$this->_maxLevel[$menu_name]; $j++) {
$levels[$j] = 0;
}
}
if ($levels[$this->tree[$i]['level']] == 0) {
$levels[$this->tree[$i]['level']] = 1;
$this->tree[$i]['last_item'] = 1;
} else {
$this->tree[$i]['last_item'] = 0;
}
$last_level = $this->tree[$i]['level'];
}
$toggle = '';
$toggle_function_name = 'toggle' . $menu_name;
for ($cnt=$this->_firstItem[$menu_name]; $cnt<=$this->_lastItem[$menu_name]; $cnt++) {
if ($this->tree[$cnt]['text'] == '---') {
continue; // separators are significant only for layers-based menus
}
if (isset($this->tree[$cnt]['selected']) && $this->tree[$cnt]['selected']) {
$linkstyle = 'phplmselected';
} else {
$linkstyle = 'phplm';
}
$this->_treeMenu[$menu_name] .= '<div id="jt' . $cnt . '" class="treemenudiv">' . "\n";
// vertical lines from higher levels
for ($i=0; $i<$this->tree[$cnt]['level']-1; $i++) {
if ($levels[$i] == 1) {
$img = $img_vertline;
$alt = $alt_vertline;
} else {
$img = $img_space;
$alt = $alt_space;
}
$this->_treeMenu[$menu_name] .= '<img align="top" border="0" class="imgs" src="' . $img . '" alt="' . $alt . '" />';
}
$not_a_leaf = ($cnt<$this->_lastItem[$menu_name] && $this->tree[$cnt+1]['level']>$this->tree[$cnt]['level']) || (isset($this->tree[$cnt]['children']) && $this->tree[$cnt]['children']);
if ($this->tree[$cnt]['last_item'] == 1) {
// corner at end of subtree or t-split
if ($not_a_leaf) {
if ($cnt == $this->_firstItem[$menu_name]) {
if ($this->tree[$cnt]['last_item'] && $this->tree[$cnt]['children']) {
// Xavier Bruyet : 2006.09.28
// Display for the first time the tree without the root node expanded
$img = $img_expand_corner_first;
$alt = $alt_expand_corner_first;
// @todo: nasty hack, should really do this better.
$parsed_href = preg_replace('/template_engine/','expand',$this->tree[$cnt]['parsed_href']);
$this->_treeMenu[$menu_name] .= '<a href="' . $parsed_href . '"><img align="top" border="0" class="imgs" id="jt' . $cnt . 'node" src="' . $img . '" alt="' . $alt . '" /></a>';
} else {
$img = $img_collapse_corner_first;
$alt = $alt_collapse_corner_first;
$this->_treeMenu[$menu_name] .= '<a onmousedown="' . $toggle_function_name . "('" . $cnt . "')" . '"><img align="top" border="0" class="imgs" id="jt' . $cnt . 'node" src="' . $img . '" alt="' . $alt . '" /></a>';
}
} else {
if ($this->tree[$cnt]['last_item'] && $this->tree[$cnt]['children']) {
$img = $img_expand_corner;
$alt = $alt_expand_corner;
// @todo: nasty hack, should really do this better.
$parsed_href = preg_replace('/template_engine/','expand',$this->tree[$cnt]['parsed_href']);
$this->_treeMenu[$menu_name] .= '<a href="' . $parsed_href . '"><img align="top" border="0" class="imgs" id="jt' . $cnt . 'node" src="' . $img . '" alt="' . $alt . '" /></a>';
} else {
$img = $img_collapse_corner;
$alt = $alt_collapse_corner;
$this->_treeMenu[$menu_name] .= '<a onmousedown="' . $toggle_function_name . "('" . $cnt . "')" . '"><img align="top" border="0" class="imgs" id="jt' . $cnt . 'node" src="' . $img . '" alt="' . $alt . '" /></a>';
}
}
} else {
$this->_treeMenu[$menu_name] .= '<img align="top" border="0" class="imgs" src="' . $img_corner . '" alt="' . $alt_corner . '" />';
}
$levels[$this->tree[$cnt]['level']-1] = 0;
} else {
if ($not_a_leaf) {
if ($cnt == $this->_firstItem[$menu_name]) {
$img = $img_collapse_first;
$alt = $alt_collapse_first;
$this->_treeMenu[$menu_name] .= '<a onmousedown="' . $toggle_function_name . "('" . $cnt . "');" . '"><img align="top" border="0" class="imgs" id="jt' . $cnt . 'node" src="' . $img . '" alt="' . $alt . '" /></a>';
} else {
if (! $this->tree[$cnt]['last_item'] && $this->tree[$cnt]['children']) {
$img = $img_expand;
$alt = $alt_expand;
// @todo: nasty hack, should really do this better.
$parsed_href = preg_replace('/template_engine/','expand',$this->tree[$cnt]['parsed_href']);
$this->_treeMenu[$menu_name] .= '<a href="' . $parsed_href . '"><img align="top" border="0" class="imgs" id="jt' . $cnt . 'node" src="' . $img . '" alt="' . $alt . '" /></a>';
} else {
$img = $img_collapse;
$alt = $alt_collapse;
$this->_treeMenu[$menu_name] .= '<a onmousedown="' . $toggle_function_name . "('" . $cnt . "');" . '"><img align="top" border="0" class="imgs" id="jt' . $cnt . 'node" src="' . $img . '" alt="' . $alt . '" /></a>';
}
}
} else {
if ($cnt == $this->_firstItem[$menu_name]) {
$img = $img_split_first;
$alt = $alt_split_first;
} else {
$img = $img_split;
$alt = $alt_split;
}
$this->_treeMenu[$menu_name] .= '<img align="top" border="0" class="imgs" id="jt' . $cnt . 'node" src="' . $img . '" alt="' . $alt . '" />';
}
$levels[$this->tree[$cnt]['level']-1] = 1;
}
if ($this->tree[$cnt]['parsed_href'] == '' || $this->tree[$cnt]['parsed_href'] == '#') {
$a_href_open_img = '';
$a_href_close_img = '';
$a_href_open = '<a class="phplmnormal">';
$a_href_close = '</a>';
} else {
$a_href_open_img = '<a href="' . $this->tree[$cnt]['parsed_href'] . '"' . $this->tree[$cnt]['parsed_title'] . $this->tree[$cnt]['parsed_target'] . '>';
$a_href_close_img = '</a>';
$a_href_open = '<a name="' . sprintf('%s_%s%s',$ldapserver->server_id,rawurlencode($this->tree[$cnt]['title']),$id_session_param) . '" href="' . $this->tree[$cnt]['parsed_href'] . '"' . $this->tree[$cnt]['parsed_title'] . $this->tree[$cnt]['parsed_target'] . ' class="' . $linkstyle . '">';
$a_href_close = '</a>';
}
if ($not_a_leaf) {
// $this->_treeMenu[$menu_name] .= $a_href_open_img . '<img align="top" border="0" class="imgs" id="jt' . $cnt . 'folder" src="' . $img_folder_open . '" alt="' . $alt_folder_open . '" />' . $a_href_close_img;
$this->_treeMenu[$menu_name] .= $a_href_open_img . '<img align="top" border="0" class="imgs" id="jt' . $cnt . 'folder" src="' . ($this->tree[$cnt]['parsed_icon'] ? $this->tree[$cnt]['parsed_icon'] : $img_folder_open) . '" alt="' . $alt_folder_open . '" />' . $a_href_close_img;
} else {
if ($this->tree[$cnt]['parsed_icon'] != '') {
// $this->_treeMenu[$menu_name] .= $a_href_open_img . '<img align="top" border="0" src="' . $this->tree[$cnt]['parsed_icon'] . '" width="' . $this->tree[$cnt]['iconwidth'] . '" height="' . $this->tree[$cnt]['iconheight'] . '" alt="' . $alt_leaf . '" />' . $a_href_close_img;
$this->_treeMenu[$menu_name] .= $a_href_open_img . '<img align="top" border="0" src="' . $this->tree[$cnt]['parsed_icon'] . '" alt="' . $alt_leaf . '" />' . $a_href_close_img;
} else {
$this->_treeMenu[$menu_name] .= $a_href_open_img . '<img align="top" border="0" class="imgs" src="' . $img_leaf . '" alt="' . $alt_leaf . '" />' . $a_href_close_img;
}
}
$this->_treeMenu[$menu_name] .= '&nbsp;' . $a_href_open . $this->tree[$cnt]['text'] . $a_href_close . "\n";
$this->_treeMenu[$menu_name] .= '</div>' . "\n";
if ($cnt<$this->_lastItem[$menu_name] && $this->tree[$cnt]['level']<$this->tree[$cnt+1]['level']) {
$this->_treeMenu[$menu_name] .= '<div id="jt' . $cnt . 'son" class="treemenudiv">' . "\n";
if ($this->tree[$cnt]['expanded'] != 1) {
$toggle .= 'if (phplm_expand[' . $cnt . '] != 1) ' . $toggle_function_name . "('" . $cnt . "');\n";
} else {
$toggle .= 'if (phplm_collapse[' . $cnt . '] == 1) ' . $toggle_function_name . "('" . $cnt . "');\n";
}
}
if ($cnt>$this->_firstItem[$menu_name] && $this->tree[$cnt]['level']>$this->tree[$cnt+1]['level']) {
for ($i=max(1, $this->tree[$cnt+1]['level']); $i<$this->tree[$cnt]['level']; $i++) {
$this->_treeMenu[$menu_name] .= '</div>' . "\n";
}
}
}
/*
$this->_treeMenu[$menu_name] =
'<div class="phplmnormal">' . "\n" .
$this->_treeMenu[$menu_name] .
'</div>' . "\n";
*/
// Some (old) browsers do not support the "white-space: nowrap;" CSS property...
$this->_treeMenu[$menu_name] =
'<table cellspacing="0" cellpadding="0" border="0">' . "\n" .
'<tr>' . "\n" .
'<td class="phplmnormal" nowrap="nowrap">' . "\n" .
$this->_treeMenu[$menu_name] .
'</td>' . "\n" .
'</tr>' . "\n" .
'</table>' . "\n";
$t = new Template_PHPLIB();
$t->setFile('tplfile', $this->libjsdir . 'layerstreemenu.ijs');
$t->setVar(array(
'toggle_function_name' => $toggle_function_name,
'img_collapse' => $img_collapse,
'img_collapse_corner' => $img_collapse_corner,
'img_collapse_corner_first' => $img_collapse_corner_first,
'img_collapse_first' => $img_collapse_first,
'img_expand' => $img_expand,
'img_expand_corner' => $img_expand_corner,
'img_expand_corner_first' => $img_expand_corner_first,
'img_expand_first' => $img_expand_first,
'img_folder_closed' => $img_folder_closed,
'img_folder_open' => $img_folder_open
));
$inc = '<!-- # PHP layers menu. -->
<script type="text/javascript" language="javascript" src="js/phplayersmenu/libjs/layersmenu-browser_detection.js"></script>
<script type="text/javascript" language="javascript" src="js/phplayersmenu/libjs/layerstreemenu-cookies.js"></script>';
$toggle_function = $t->parse('out', 'tplfile');
$toggle_function =
'<script language="JavaScript" type="text/javascript">' . "\n" .
'<!--' . "\n" .
$toggle_function .
'// -->' . "\n" .
'</script>' . "\n";
$toggle =
'<script language="JavaScript" type="text/javascript">' . "\n" .
'<!--' . "\n" .
'if ((DOM && !Opera56 && !Konqueror22) || IE4) {' . "\n" .
$toggle .
'}' . "\n" .
'if (NS4) alert("Only the accessibility is provided to Netscape 4 on the JavaScript Tree Menu.\nWe *strongly* suggest you to upgrade your browser.");' . "\n" .
'// -->' . "\n" .
'</script>' . "\n";
$this->_treeMenu[$menu_name] = $inc . "\n" . $toggle_function . "\n" . $this->_treeMenu[$menu_name] . "\n" . $toggle;
return $this->_treeMenu[$menu_name];
}
/**
* Method that returns the code of the requested Tree Menu
* @access public
* @param string $menu_name the name of the menu whose Tree Menu code
* has to be returned
* @return string
*/
function getTreeMenu($menu_name)
{
return $this->_treeMenu[$menu_name];
}
/**
* Method that prints the code of the requested Tree Menu
* @access public
* @param string $menu_name the name of the menu whose Tree Menu code
* has to be printed
* @return void
*/
function printTreeMenu($menu_name)
{
print $this->_treeMenu[$menu_name];
}
} /* END OF CLASS */
?>

View File

@@ -1,33 +0,0 @@
// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
DOM = (document.getElementById) ? 1 : 0;
NS4 = (document.layers) ? 1 : 0;
// We need to explicitly detect Konqueror
// because Konqueror 3 sets IE = 1 ... AAAAAAAAAARGHHH!!!
Konqueror = (navigator.userAgent.indexOf('Konqueror') > -1) ? 1 : 0;
// We need to detect Konqueror 2.2 as it does not handle the window.onresize event
Konqueror22 = (navigator.userAgent.indexOf('Konqueror 2.2') > -1 || navigator.userAgent.indexOf('Konqueror/2.2') > -1) ? 1 : 0;
Konqueror30 =
(
navigator.userAgent.indexOf('Konqueror 3.0') > -1
|| navigator.userAgent.indexOf('Konqueror/3.0') > -1
|| navigator.userAgent.indexOf('Konqueror 3;') > -1
|| navigator.userAgent.indexOf('Konqueror/3;') > -1
|| navigator.userAgent.indexOf('Konqueror 3)') > -1
|| navigator.userAgent.indexOf('Konqueror/3)') > -1
)
? 1 : 0;
Konqueror31 = (navigator.userAgent.indexOf('Konqueror 3.1') > -1 || navigator.userAgent.indexOf('Konqueror/3.1') > -1) ? 1 : 0;
// We need to detect Konqueror 3.2 and 3.3 as they are affected by the see-through effect only for 2 form elements
Konqueror32 = (navigator.userAgent.indexOf('Konqueror 3.2') > -1 || navigator.userAgent.indexOf('Konqueror/3.2') > -1) ? 1 : 0;
Konqueror33 = (navigator.userAgent.indexOf('Konqueror 3.3') > -1 || navigator.userAgent.indexOf('Konqueror/3.3') > -1) ? 1 : 0;
Opera = (navigator.userAgent.indexOf('Opera') > -1) ? 1 : 0;
Opera5 = (navigator.userAgent.indexOf('Opera 5') > -1 || navigator.userAgent.indexOf('Opera/5') > -1) ? 1 : 0;
Opera6 = (navigator.userAgent.indexOf('Opera 6') > -1 || navigator.userAgent.indexOf('Opera/6') > -1) ? 1 : 0;
Opera56 = Opera5 || Opera6;
IE = (navigator.userAgent.indexOf('MSIE') > -1) ? 1 : 0;
IE = IE && !Opera;
IE5 = IE && DOM;
IE4 = (document.all) ? 1 : 0;
IE4 = IE4 && IE && !DOM;

View File

@@ -1,70 +0,0 @@
// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
function setLMCookie(name, value)
{
document.cookie = name + '=' + value + ';path=/';
}
function getLMCookie(name)
{
foobar = document.cookie.split(name + '=');
if (foobar.length < 2) {
return null;
}
tempString = foobar[1];
if (tempString.indexOf(';') == -1) {
return tempString;
}
yafoobar = tempString.split(';');
return yafoobar[0];
}
function parseExpandString()
{
expandString = getLMCookie('phplm_expand');
phplm_expand = new Array();
if (expandString) {
expanded = expandString.split('|');
for (i=0; i<expanded.length-1; i++) {
phplm_expand[expanded[i]] = 1;
}
}
}
function parseCollapseString()
{
collapseString = getLMCookie('phplm_collapse');
phplm_collapse = new Array();
if (collapseString) {
collapsed = collapseString.split('|');
for (i=0; i<collapsed.length-1; i++) {
phplm_collapse[collapsed[i]] = 1;
}
}
}
parseExpandString();
parseCollapseString();
function saveExpandString()
{
expandString = '';
for (i=0; i<phplm_expand.length; i++) {
if (phplm_expand[i] == 1) {
expandString += i + '|';
}
}
setLMCookie('phplm_expand', expandString);
}
function saveCollapseString()
{
collapseString = '';
for (i=0; i<phplm_collapse.length; i++) {
if (phplm_collapse[i] == 1) {
collapseString += i + '|';
}
}
setLMCookie('phplm_collapse', collapseString);
}

View File

@@ -1,52 +0,0 @@
// PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
function {toggle_function_name}(nodeid)
{
if ((!DOM || Opera56 || Konqueror22) && !IE4) {
return;
}
layersMoved = 0;
parseExpandString();
parseCollapseString();
if (!IE4) {
sonLayer = document.getElementById('jt' + nodeid + 'son');
nodeLayer = document.getElementById('jt' + nodeid + 'node');
//folderLayer = document.getElementById('jt' + nodeid + 'folder');
} else {
sonLayer = document.all('jt' + nodeid + 'son');
nodeLayer = document.all('jt' + nodeid + 'node');
//folderLayer = document.all('jt' + nodeid + 'folder');
}
if (sonLayer.style.display == 'none') {
sonLayer.style.display = 'block';
if (nodeLayer.src.indexOf('{img_expand}') > -1) {
nodeLayer.src = '{img_collapse}';
} else if (nodeLayer.src.indexOf('{img_expand_first}') > -1) {
nodeLayer.src = '{img_collapse_first}';
} else if (nodeLayer.src.indexOf('{img_expand_corner}') > -1) {
nodeLayer.src = '{img_collapse_corner}';
} else {
nodeLayer.src = '{img_collapse_corner_first}';
}
//folderLayer.src = '{img_folder_open}';
phplm_expand[nodeid] = 1;
phplm_collapse[nodeid] = 0;
} else {
sonLayer.style.display = 'none';
if (nodeLayer.src.indexOf('{img_collapse}') > -1) {
nodeLayer.src = '{img_expand}';
} else if (nodeLayer.src.indexOf('{img_collapse_first}') > -1) {
nodeLayer.src = '{img_expand_first}';
} else if (nodeLayer.src.indexOf('{img_collapse_corner}') > -1) {
nodeLayer.src = '{img_expand_corner}';
} else {
nodeLayer.src = '{img_expand_corner_first}';
}
//folderLayer.src = '{img_folder_closed}';
phplm_expand[nodeid] = 0;
phplm_collapse[nodeid] = 1;
}
saveExpandString();
saveCollapseString();
}

View File

@@ -1,116 +0,0 @@
// $Header$
/**
* @package phpLDAPadmin
* @author The phpLDAPadmin development team
* @author Xavier Bruyet
*/
// current request
var http_div = '';
var http_request = null;
var http_request_success_callback = '';
var http_request_error_callback = '';
// include html into a component
function includeHTML(component, html) {
if (typeof(component) != 'object' || typeof(html) != 'string') return;
component.innerHTML = html;
var scripts = component.getElementsByTagName('script');
if (!scripts) return;
// load scripts
for (var i = 0; i < scripts.length; i++) {
var scriptclone = document.createElement('script');
if (scripts[i].attributes.length > 0) {
for (var j in scripts[i].attributes) {
if (typeof(scripts[i].attributes[j]) != 'undefined'
&& typeof(scripts[i].attributes[j].nodeName) != 'undefined'
&& scripts[i].attributes[j].nodeValue != null
&& scripts[i].attributes[j].nodeValue != '') {
scriptclone.setAttribute(scripts[i].attributes[j].nodeName, scripts[i].attributes[j].nodeValue);
}
}
}
scriptclone.text = scripts[i].text;
scripts[i].parentNode.replaceChild(scriptclone, scripts[i]);
eval(scripts[i].innerHTML);
}
}
// callback function
function alertHttpRequest() {
if (http_request && (http_request.readyState == 4)) {
if (http_request.status == 200 || http_request.status == 401) {
response = http_request.responseText;
http_request = null;
//alert(response);
if (http_request_success_callback) {
eval(http_request_success_callback + '(response,http_div)');
}
} else {
alert('There was a problem with the request.');
cancelHttpRequest();
}
}
}
function cancelHttpRequest() {
if (http_request) {
http_request = null;
if (http_request_error_callback) {
eval(http_request_error_callback + '(http_div)');
}
}
}
// request
function makeGETRequest(url,parameters,successCallbackFunctionName,errorCallbackFunctionName,div) {
makeHttpRequest(url,parameters,'GET',successCallbackFunctionName,errorCallbackFunctionName,div);
}
function makePOSTRequest(url,parameters,successCallbackFunctionName,errorCallbackFunctionName,div) {
makeHttpRequest(url,parameters,'POST',successCallbackFunctionName,errorCallbackFunctionName,div);
}
function makeHttpRequest(url,parameters,meth,successCallbackFunctionName,errorCallbackFunctionName,div) {
cancelHttpRequest(div);
http_request_success_callback = successCallbackFunctionName;
http_request_error_callback = errorCallbackFunctionName;
http_div = div;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/html');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Cannot create XMLHTTP instance.');
return false;
}
http_request.onreadystatechange = window['alertHttpRequest'];
if (meth == 'GET') url = url + '?' + parameters;
http_request.open(meth, url, true);
http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http_request.setRequestHeader("Content-length", parameters.length);
http_request.setRequestHeader("Connection", "close");
if (meth == 'GET') parameters = null;
http_request.send(parameters);
}

View File

@@ -1,76 +0,0 @@
// File: search_util.js
// Purpose:
// This JavaScript file defines some functions used by the two search forms for
// auto-populating the base DN dynamically when a server is selected from the
// drop-down.
// $Header$
//the array to store the server
var servers = new Array();
//---------------------------------------------------------------------
// Definition of the object server
//---------------------------------------------------------------------
//constructor of the server
//param id the id of the server
//param name the name of the server
//param base_dn the base dn of the server
function server(id,name,base_dn){
//the properties of the object
this.id =id;
this.name = name;
this.base_dn = base_dn;
// the method of the server
this.getId=getId;
this.setId=setId;
this.getName = getName;
this.setName = setName;
this.setBaseDn = setBaseDn;
this.getBaseDn = getBaseDn;
}
// set the id of the server
function setId(id){
this.id = id;
}
//return the id of the server
function getId(){
return this.id;
}
// set the name of the server
function setName(name){
this.name = name;
}
// return the name of the server
function getName(){
return this.name;
}
// return the base dn of the server
function getBaseDn(){
return this.base_dn;
}
// set the base dn of the server
function setBaseDn(base_dn){
this.base_dn = base_dn;
}
//-----------------------------------------------------------------------
// End of the definition of the server
//-----------------------------------------------------------------------
// add a server object to the array of server
function addToServersList(obj_server){
servers[servers.length] = obj_server;
}

0
htdocs/js/to_ascii.js → htdocs/js/toAscii.js Executable file → Normal file
View File

View File

@@ -1,27 +0,0 @@
var current;
function tree_unhide(whichLayer,old) {
if (current == null) current = old;
var oldtree = document.getElementById('ajSID_'+current).style;
oldtree.display = 'none';
if (document.getElementById) {
// this is the way the standards work
var newtree = document.getElementById(whichLayer).value;
var newtree_div = document.getElementById('ajSID_'+newtree).style;
newtree_div.display = 'block';
/*
} else if (document.all) {
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display ? '':'block';
} else if (document.layers) {
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display ? '':'block';
*/
}
current = newtree;
}

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Log the user in.
*

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Displays the login form for a server for users who specify 'cookie' or 'session' for their auth_type.
*
@@ -53,6 +51,7 @@ if ($app['server']->getAuthType() == 'http') {
header('Status: 401 Unauthorized'); // http 1.1 method
return;
# HTML Login Form
} else {
echo '<form action="cmd.php" method="post" name="login_form">';
@@ -79,7 +78,7 @@ if ($app['server']->getAuthType() == 'http') {
# If Anon bind allowed, then disable the form if the user choose to bind anonymously.
if ($app['server']->isAnonBindAllowed())
printf('<tr><td colspan="2"><small><b>%s</b></small> <input type="checkbox" name="anonymous_bind" onclick="toggle_disable_login_fields(this)" id="anonymous_bind_checkbox" /></td></tr>',
printf('<tr><td colspan="2"><small><b>%s</b></small> <input type="checkbox" name="anonymous_bind" onclick="form_field_toggle_enable(this,[\'login\',\'password\'],\'login\')" id="anonymous_bind_checkbox" /></td></tr>',
_('Anonymous'));
printf('<tr><td colspan="2"><center><input type="submit" name="submit" value="%s" /></center></td></tr>',
@@ -91,23 +90,9 @@ if ($app['server']->getAuthType() == 'http') {
echo '<br/>';
echo '<script type="text/javascript" language="javascript">document.getElementById(\'login\').focus()</script>';
echo '<script type="text/javascript" language="javascript">document.getElementById("login").focus()</script>';
if ($app['server']->isAnonBindAllowed() ) {
?>
<script type="text/javascript" language="javascript">
function toggle_disable_login_fields(anon_checkbox) {
if (anon_checkbox.checked) {
anon_checkbox.form.login.disabled = true;
anon_checkbox.form.password.disabled = true;
} else {
anon_checkbox.form.login.disabled = false;
anon_checkbox.form.login.focus();
anon_checkbox.form.password.disabled = false;
}
}
</script>
<?php
}
if ($app['server']->isAnonBindAllowed())
printf('<script type="text/javascript" language="javascript" src="%sform_field_toggle_enable.js"></script>',JSDIR);
}
?>

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Log the user out of the application.
*

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Displays a last chance confirmation form to delete a DN.
*

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Displays a form to allow the user to modify group members.
*
@@ -65,7 +63,7 @@ printf('%s <b>%s</b> %s <b>%s</b>:',
$possible_members = array();
for ($i=0;$i<count($possible_values);$i++) {
if (preg_match("/^".$request['attr']."$/i",$_SESSION[APPCONFIG]->getValue('modify_member','posixgroupattr')))
$possible_members[$i] = $possible_values[$i][$_SESSION[APPCONFIG]->getValue('modify_member','posixattr')];
$possible_members[$i] = $possible_values[$i][$_SESSION[APPCONFIG]->getValue('modify_member','posixattr')][0];
else
$possible_members[$i] = $possible_values[$i][$_SESSION[APPCONFIG]->getValue('modify_member','attr')];
}
@@ -80,6 +78,8 @@ usort($possible_members,'pla_compare_dns');
# Modifications will be sent to update_confirm which takes care of rest of the processing
echo '<br />';
echo '<br />';
printf('<script type="text/javascript" language="javascript" src="%smodify_member.js"></script>',JSDIR);
echo '<form action="cmd.php" method="post" class="add_value" name="member">';
if ($_SESSION[APPCONFIG]->getValue('confirm','update'))
echo '<input type="hidden" name="cmd" value="update_confirm" />';
@@ -149,18 +149,10 @@ printf('<input type="hidden" name="new_values[%s][]" value="" />',htmlspecialcha
echo '</div>';
# Submit values to update_confirm.php and when clicked, run addSelected
printf('<input type="submit" name="save" value="%s" onClick="update_new_values(\'%s\',\'modifymember\')" />',_('Save changes'),$request['attr']);
printf('<input type="submit" name="save" value="%s" onClick="update_new_values(\'%s\')" />',_('Save changes'),$request['attr']);
echo '</td></tr>';
echo '</table>';
echo '</form>';
# Variables for Javascript function that moves members from left to right
echo '<script type="text/javascript" language="javascript">';
echo 'var m1 = document.member.notmembers;';
echo 'var m2 = document.member.members;';
echo '</script>';
printf('<script type="text/javascript" src="%smodify_member.js"></script>',JSDIR);
echo '</body></html>';
?>

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Displays the information from the monitor context
*

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Check the password used by an entry.
*
@@ -71,8 +69,8 @@ echo '</form>';
# Pull our password from the form that opened this window.
if ($request['componentid']) {
echo '<script type="text/javascript">';
printf('var c = window.opener.document.getElementById(\'%s\');',$request['componentid']);
printf('var h = document.getElementById(\'%s\');','hash');
printf('var c = window.opener.document.getElementById("%s");',$request['componentid']);
printf('var h = document.getElementById("%s");','hash');
echo 'if (c && h) { h.value = c.value; }';
echo '</script>';
}

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Purge our session cache details
*

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Query render engine.
*

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Recursively deletes the specified DN and all of its children
*
@@ -13,9 +11,6 @@
require './common.php';
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_delete','simple_delete'))
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('delete entry')),'error','index.php');
$request = array();
$request['dn'] = get_request('dn','REQUEST',true);

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* This script deletes the session variable 'tree', which will result in re-querying
* the LDAP server to grab the contents of all LDAP entries starting from the base.
@@ -32,7 +30,7 @@ if (get_request('purge','REQUEST')) {
$entry = $tree->getEntry($value);
}
$tree->readChildren($value);
$tree->readChildren($value,true);
$entry->open();
}

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Renames a DN to a different name.
*
@@ -20,9 +18,6 @@ $request['rdnDST'] = get_request('new_rdn','REQUEST');
$request['container'] = $app['server']->getContainer($request['dnSRC']);
# Error checking
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_rename'))
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('rename entry')),'error','index.php');
if (! $app['server']->isBranchRenameEnabled()) {
# We search all children, not only the visible children in the tree
$children = $app['server']->getContainerContents($request['dnSRC'],null,0,'(objectClass=*)',LDAP_DEREF_NEVER);

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Displays a form for renaming an LDAP entry.
*

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Displays the schema for the specified server
*
@@ -59,7 +57,7 @@ foreach ($entry['schema_types'] as $item => $value) {
} else {
if (isAjaxEnabled())
printf('<a href="cmd.php?%s" onClick="return displayAJ(\'BODY\',\'%s\',\'Loading %s\');" title="Loading %s">%s</a>',
printf('<a href="cmd.php?%s" onClick="return ajDISPLAY(\'BODY\',\'%s\',\'Loading %s\');" title="Loading %s">%s</a>',
htmlspecialchars($entry['href'][$item]),htmlspecialchars($entry['href'][$item]),$value,$value,$value);
else
printf('<a href="cmd.php?%s">%s</a>',htmlspecialchars($entry['href'][$item]),_($value));
@@ -69,64 +67,6 @@ foreach ($entry['schema_types'] as $item => $value) {
echo '</center>';
echo '<br />';
if (isAjaxEnabled()) {
echo '<script type="text/javascript" language="javascript">'."\n";
echo "function showthis(type,key,value) {
select = document.getElementById(type);
if (value != null) {
attr = value;
select.value = value;
} else {
attr = select.value;
}
if (! attr) {
showall(key);
} else {
objectclass = document.getElementById(key+attr);
objectclass.style.display = '';
hideall(key,attr);
};
return false;
};
function showall(key) {
items = items();
for (x in items) {
if (! isNaN(x)) {
item = document.getElementById(key+items[x]);
item.style.display = '';
}
}
}
function hideall(key,except) {
items = items();
for (x in items) {
if (! isNaN(x) && except != items[x]) {
item = document.getElementById(key+items[x]);
item.style.display = 'none';
} else if (! isNaN(x) && except == items[x]) {
item = document.getElementById(key+items[x]);
item.style.display = '';
}
}
}
function ajJump(html,title,index,prefix) {
if (prefix)
attr = document.getElementById('vv'+index).value;
else
attr = index;
if (attr)
html = html+'&viewvalue='+attr;
return displayAJ('BODY',html,'Loading '+title);
}";
echo '</script>';
}
switch($entry['view']) {
case 'syntaxes':
$highlight_oid = get_request('highlight_oid','GET',false,false);
@@ -190,19 +130,8 @@ switch($entry['view']) {
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
if (isAjaxEnabled()) {
echo '<script type="text/javascript" language="javascript">'."\n";
echo "function items() {
var \$items = new Array();";
$counter = 0;
foreach ($sattrs as $attr) {
printf(' items[%s] = "%s";',$counter++,$attr->getName());
echo "\n";
}
echo '
return items;
}';
echo '</script>';
echo '<select name="viewvalue" onChange="showthis(\'attributes\',\'at\')" id="attributes">';
drawJSItems($sattrs);
echo '<select name="viewvalue" onChange="ajSHOWSCHEMA(\'attributes\',\'at\')" id="attributes">';
} else
echo '<select name="viewvalue" onChange="submit()">';
@@ -213,7 +142,7 @@ switch($entry['view']) {
echo '</select>';
if (isAjaxEnabled())
printf('<input type="button" value="%s" onClick="showthis(\'attributes\',\'at\')"/>',_('Go'));
printf('<input type="button" value="%s" onClick="ajSHOWSCHEMA(\'attributes\',\'at\')"/>',_('Go'));
else
printf('<input type="submit" value="%s" />',_('Go'));
echo '</form>';
@@ -225,7 +154,7 @@ switch($entry['view']) {
$entry['viewed'] = true;
if (isAjaxEnabled() && $entry['value'])
printf('<div id="at%s" style="display: %s">',$attr->getName(),strcasecmp($entry['value'],$attr->getName()) ? 'none' : '');
printf('<div id="at%s" style="display: %s">',$attr->getName(),strcasecmp($entry['value'],$attr->getName()) ? 'none' : 'block');
else
printf('<div id="at%s">',$attr->getName());
@@ -266,7 +195,7 @@ switch($entry['view']) {
else {
$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['attributes'],strtolower($attr->getSupAttribute())));
if (isAjaxEnabled())
printf('<a href="cmd.php?%s" onClick="return showthis(\'attributes\',\'at\',\'%s\');">%s</a>',
printf('<a href="cmd.php?%s" onClick="return ajSHOWSCHEMA(\'attributes\',\'at\',\'%s\');">%s</a>',
$href,strtolower($attr->getSupAttribute()),$attr->getSupAttribute());
else
printf('<a href="cmd.php?%s">%s</a>',$href,$attr->getSupAttribute());
@@ -284,7 +213,7 @@ switch($entry['view']) {
else {
$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['matching_rules'],$attr->getEquality()));
if (isAjaxEnabled())
printf('<a href="cmd.php?%s" onClick="return ajJump(\'%s\',\'%s\',\'%s\');">%s</a>',
printf('<a href="cmd.php?%s" onClick="return ajJUMP(\'%s\',\'%s\',\'%s\');">%s</a>',
$href,$href,_('Matching Rules'),$attr->getEquality(),$attr->getEquality());
else
printf('<a href="cmd.php?%s">%s</a>',$href,$attr->getEquality());
@@ -312,7 +241,7 @@ switch($entry['view']) {
} else {
$href = htmlspecialchars(sprintf('%s&highlight_oid=%s',$entry['href']['syntaxes'],$attr->getSyntaxOID()));
if (isAjaxEnabled())
printf('<a href="cmd.php?%s" onClick="return ajJump(\'%s\',\'%s\',\'%s\');">%s (%s)</a>',
printf('<a href="cmd.php?%s" onClick="return ajJUMP(\'%s\',\'%s\',\'%s\');">%s (%s)</a>',
$href,$href,_('Syntaxes'),'',$attr->getType(),$attr->getSyntaxOID());
else
printf('<a href="cmd.php?%s">%s (%s)</a>',$href,$attr->getType(),$attr->getSyntaxOID());
@@ -360,7 +289,7 @@ switch($entry['view']) {
foreach ($attr->getAliases() as $alias) {
$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['attributes'],strtolower($alias)));
if (isAjaxEnabled())
printf('<a href="cmd.php?%s" onClick="return showthis(\'attributes\',\'at\',\'%s\');">%s</a>',
printf('<a href="cmd.php?%s" onClick="return ajSHOWSCHEMA(\'attributes\',\'at\',\'%s\');">%s</a>',
$href,strtolower($alias),$alias);
else
printf('<a href="cmd.php?%s">%s</a>',$href,$alias);
@@ -379,7 +308,7 @@ switch($entry['view']) {
foreach ($attr->getUsedInObjectClasses() as $objectclass) {
$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($objectclass)));
if (isAjaxEnabled())
printf('<a href="cmd.php?%s" onClick="return ajJump(\'%s\',\'%s\',\'%s\');">%s</a> ',
printf('<a href="cmd.php?%s" onClick="return ajJUMP(\'%s\',\'%s\',\'%s\');">%s</a> ',
$href,$href,_('ObjectClasses'),strtolower($objectclass),$objectclass);
else
printf('<a href="cmd.php?%s">%s</a> ',$href,$objectclass);
@@ -416,20 +345,8 @@ switch($entry['view']) {
echo '<input type="hidden" name="view" value="matching_rules" />';
if (isAjaxEnabled()) {
echo '<script type="text/javascript" language="javascript">'."\n";
echo "function items() {
var \$items = new Array();";
$counter = 0;
foreach ($schema_matching_rules as $rule) {
printf(' items[%s] = "%s";',$counter++,$rule->getName());
echo "\n";
}
echo '
return items;
}
';
echo '</script>';
echo '<select name="viewvalue" onChange="showthis(\'matchingrules\',\'mr\')" id="matchingrules">';
drawJSItems($schema_matching_rules);
echo '<select name="viewvalue" onChange="ajSHOWSCHEMA(\'matchingrules\',\'mr\')" id="matchingrules">';
} else
echo '<select name="viewvalue" onChange="submit()">';
@@ -443,7 +360,7 @@ switch($entry['view']) {
echo '</select>';
if (isAjaxEnabled())
printf('<input type="button" value="%s" onClick="showthis(\'matchingrules\',\'mr\')"/>',_('Go'));
printf('<input type="button" value="%s" onClick="ajSHOWSCHEMA(\'matchingrules\',\'mr\')"/>',_('Go'));
else
printf('<input type="submit" value="%s" />',_('Go'));
echo '</form>';
@@ -496,7 +413,7 @@ switch($entry['view']) {
echo '</select><br />';
if (isAjaxEnabled())
printf('<input type="button" value="%s" onClick="return ajJump(\'cmd=schema&amp;view=attributes&amp;server_id=%s\',\'%s\',\'%s\',\'vv\');"/>',
printf('<input type="button" value="%s" onClick="return ajJUMP(\'cmd=schema&amp;view=attributes&amp;server_id=%s\',\'%s\',\'%s\',\'vv\');"/>',
_('Go'),$app['server']->getIndex(),_('Attributes'),$rule->getName());
else
printf('<input type="submit" value="%s" />',_('Go'));
@@ -524,19 +441,8 @@ switch($entry['view']) {
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
if (isAjaxEnabled()) {
echo '<script type="text/javascript" language="javascript">'."\n";
echo "function items() {
var \$items = new Array();";
$counter = 0;
foreach ($socs as $oclass) {
printf(' items[%s] = "%s";',$counter++,$oclass->getName());
echo "\n";
}
echo '
return items;
}';
echo '</script>';
echo '<select name="viewvalue" onChange="showthis(\'objectclasses\',\'oc\')" id="objectclasses">';
drawJSItems($socs);
echo '<select name="viewvalue" onChange="ajSHOWSCHEMA(\'objectclasses\',\'oc\')" id="objectclasses">';
} else
echo '<select name="viewvalue" onChange="submit()">';
@@ -548,7 +454,7 @@ switch($entry['view']) {
echo '</select>';
if (isAjaxEnabled())
printf('<input type="button" value="%s" onClick="showthis(\'objectclasses\',\'oc\')"/>',_('Go'));
printf('<input type="button" value="%s" onClick="ajSHOWSCHEMA(\'objectclasses\',\'oc\')"/>',_('Go'));
else
printf('<input type="submit" value="%s" />',_('Go'));
echo '</form>';
@@ -584,7 +490,7 @@ switch($entry['view']) {
foreach ($oclass->getSupClasses() as $i => $object_class) {
$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($object_class)));
if (isAjaxEnabled())
printf('<a href="cmd.php?%s" onClick="return showthis(\'objectclasses\',\'oc\',\'%s\');">%s</a>',
printf('<a href="cmd.php?%s" onClick="return ajSHOWSCHEMA(\'objectclasses\',\'oc\',\'%s\');">%s</a>',
$href,strtolower($object_class),$object_class);
else
printf('<a href="cmd.php?%s&viewvalue=%s" title="%s">%s</a>',
@@ -599,7 +505,7 @@ switch($entry['view']) {
if (strcasecmp($oclass->getName(),'top') == 0) {
$href = htmlspecialchars($entry['href']['objectclasses']);
if (isAjaxEnabled())
printf('<a href="cmd.php?%s" onClick="return showthis(\'objectclasses\',\'oc\',\'\');">all</a>',
printf('<a href="cmd.php?%s" onClick="return ajSHOWSCHEMA(\'objectclasses\',\'oc\',\'\');">all</a>',
$href);
else
printf('(<a href="cmd.php?%s">all</a>)',$href);
@@ -611,7 +517,7 @@ switch($entry['view']) {
foreach ($oclass->getChildObjectClasses() as $i => $object_class) {
$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($object_class)));
if (isAjaxEnabled())
printf('<a href="cmd.php?%s" title="%s" onClick="return showthis(\'objectclasses\',\'oc\',\'%s\');">%s</a>',
printf('<a href="cmd.php?%s" title="%s" onClick="return ajSHOWSCHEMA(\'objectclasses\',\'oc\',\'%s\');">%s</a>',
$href,_('Jump to this objectClass definition'),strtolower($object_class),$object_class);
else
printf('<a href="cmd.php?%s" title="%s">%s</a>',$href,_('Jump to this objectClass definition'),$object_class);
@@ -634,7 +540,7 @@ switch($entry['view']) {
echo '<li>';
$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['attributes'],$attr->getName()));
if (isAjaxEnabled())
printf('<a href="cmd.php?%s" onClick="return ajJump(\'%s\',\'%s\',\'%s\');">%s</a>',
printf('<a href="cmd.php?%s" onClick="return ajJUMP(\'%s\',\'%s\',\'%s\');">%s</a>',
$href,$href,_('Attributes'),$attr->getName(),$attr->getName(false));
else
printf('<a href="cmd.php?%s">%s</a>',$href,$attr->getName(false));
@@ -644,7 +550,7 @@ switch($entry['view']) {
$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($attr->getSource())));
printf('<small>(%s ',_('Inherited from'));
if (isAjaxEnabled())
printf('<a href="cmd.php?%s" title="%s" onClick="return showthis(\'objectclasses\',\'oc\',\'%s\');">%s</a>',
printf('<a href="cmd.php?%s" title="%s" onClick="return ajSHOWSCHEMA(\'objectclasses\',\'oc\',\'%s\');">%s</a>',
$href,_('Jump to this objectClass definition'),strtolower($attr->getSource()),$attr->getSource());
else
printf('<a href="cmd.php?%s">%s</a>',$href,$attr->getSource());
@@ -667,7 +573,7 @@ switch($entry['view']) {
echo '<li>';
$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['attributes'],$attr->getName()));
if (isAjaxEnabled())
printf('<a href="cmd.php?%s" onClick="return ajJump(\'%s\',\'%s\',\'%s\');">%s</a>',
printf('<a href="cmd.php?%s" onClick="return ajJUMP(\'%s\',\'%s\',\'%s\');">%s</a>',
$href,$href,_('Attributes'),$attr->getName(),$attr->getName(false));
else
printf('<a href="cmd.php?%s">%s</a>',$href,$attr->getName(false));
@@ -677,7 +583,7 @@ switch($entry['view']) {
$href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($attr->getSource())));
printf('<small>(%s ',_('Inherited from'));
if (isAjaxEnabled())
printf('<a href="cmd.php?%s" title="%s" onClick="return showthis(\'objectclasses\',\'oc\',\'%s\');">%s</a>',
printf('<a href="cmd.php?%s" title="%s" onClick="return ajSHOWSCHEMA(\'objectclasses\',\'oc\',\'%s\');">%s</a>',
$href,_('Jump to this objectClass definition'),strtolower($attr->getSource()),$attr->getSource());
else
printf('<a href="cmd.php?%s">%s</a>',$href,$attr->getSource());
@@ -707,4 +613,22 @@ switch($entry['view']) {
if (! is_null($entry['value']) && ! $entry['viewed'])
error(sprintf(_('No such schema item: "%s"'),$entry['value']),'error','index.php');
function drawJSItems($object) {
echo '<script type="text/javascript" language="javascript">'."\n";
echo "
function items() {
var \$items = new Array();";
$counter = 0;
foreach ($object as $attr) {
printf(' items[%s] = "%s";',$counter++,$attr->getName());
echo "\n";
}
echo '
return items;
}';
echo '</script>';
}
?>

View File

@@ -1,6 +1,4 @@
<?php
// $Header$
/**
* Fetches and displays all information that it can from the specified server
*

Some files were not shown because too many files have changed in this diff Show More