Rework javascript

This commit is contained in:
Deon George 2009-08-22 21:30:50 +10:00
parent 26fa2ba2c5
commit b93b92f430
72 changed files with 561 additions and 3131 deletions

View File

@ -164,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

@ -60,10 +60,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

@ -28,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

@ -27,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'));
@ -58,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";
@ -95,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

@ -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

@ -36,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">';
@ -50,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'));
@ -83,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>',
@ -208,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

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';
}
}
}
}
}

View File

@ -10,8 +10,96 @@ 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) {
function includeHTML(component,html) {
if (typeof(component) != 'object' || typeof(html) != 'string') return;
component.innerHTML = html;
@ -27,12 +115,12 @@ function includeHTML(component, html) {
&& 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.setAttribute(scripts[i].attributes[j].nodeName,scripts[i].attributes[j].nodeValue);
}
}
}
scriptclone.text = scripts[i].text;
scripts[i].parentNode.replaceChild(scriptclone, scripts[i]);
scripts[i].parentNode.replaceChild(scriptclone,scripts[i]);
eval(scripts[i].innerHTML);
}
}
@ -63,15 +151,6 @@ function cancelHttpRequest() {
}
}
// 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);
@ -87,10 +166,10 @@ function makeHttpRequest(url,parameters,meth,successCallbackFunctionName,errorCa
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
http_request = new ActiveXObject('Msxml2.XMLHTTP');
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
http_request = new ActiveXObject('Microsoft.XMLHTTP');
} catch (e) {}
}
}
@ -102,13 +181,12 @@ function makeHttpRequest(url,parameters,meth,successCallbackFunctionName,errorCa
http_request.onreadystatechange = window['alertHttpRequest'];
if (meth == 'GET') url = url + '?' + parameters;
http_request.open(meth, url, true);
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");
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

@ -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();
}

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

@ -78,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>',
@ -90,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

@ -78,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" />';
@ -147,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

@ -69,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

@ -57,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));
@ -67,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);
@ -188,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()">';
@ -211,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>';
@ -223,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());
@ -264,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());
@ -282,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());
@ -310,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());
@ -358,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);
@ -377,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);
@ -414,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()">';
@ -441,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>';
@ -494,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'));
@ -522,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()">';
@ -546,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>';
@ -582,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>',
@ -597,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);
@ -609,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);
@ -632,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));
@ -642,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());
@ -665,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));
@ -675,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());
@ -705,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

@ -92,7 +92,7 @@ if (! $_SESSION[APPCONFIG]->getValue('appearance','hide_debug_info')) {
poststr += "&global=on" + encodeURI(xx);
<?php } ?>
obj.innerHTML = '<img src="<?php echo IMGDIR ?>/ajax-spinner.gif" /> <?php echo _('Loading') ?>...';
makePOSTRequest('cmd.php',poststr,'alertCacheContents','cancelCacheContents');
makeHttpRequest('cmd.php',poststr,'POST','alertCacheContents','cancelCacheContents');
}
function close(key,xx) {

View File

@ -53,15 +53,8 @@ if (count($request['template']->getLDAPmodify(true))) {
echo "\n\n";
# If we skip objectclass changes, but there are new must/may attrs provided by the new objectclass, they need to be skip.
$mustattrs = array();
foreach ($request['template']->getAttribute('objectclass')->getValues() as $value) {
$soc = $app['server']->getSchemaObjectClass($value);
$mustattrs = getMustAttrs($request['template']->getAttribute('objectclass')->getValues());
if ($soc)
foreach ($soc->getMustAttrs() as $sma)
array_push($mustattrs,$sma->getName());
}
$counter = 0;
foreach ($request['template']->getLDAPmodify(true) as $attribute) {
$counter++;
@ -123,31 +116,39 @@ if (count($request['template']->getLDAPmodify(true))) {
if ($attribute->getName() == 'objectclass') {
$input_onclick = '';
# If there are attributes being force deleted...
if (count($request['template']->getForceDeleteAttrs()) > 0) {
$input_onclick = 'onclick="if (this.checked) {';
# And this OC is being skipped, then these attributes can be optionally deleted.
foreach ($request['template']->getForceDeleteAttrs() as $ad_name) {
$input_onclick .= sprintf("document.getElementById('skip_array_%s').disabled = false;",$ad_name->getName());
# Only if it is not a must attr by this objectclass now staying
if (! in_array($ad_name->getName(),getMustAttrs($attribute->getOldValues())))
$input_onclick .= sprintf("document.getElementById('skip_array_%s').disabled = false;",$ad_name->getName());
$input_onclick .= sprintf("document.getElementById('skip_array_%s').checked = true;",$ad_name->getName());
$input_onclick .= "\n";
}
$input_onclick .= '} else {';
# Otherwise the attributes must be deleted.
foreach ($request['template']->getForceDeleteAttrs() as $ad_name) {
$input_onclick .= sprintf("document.getElementById('skip_array_%s').checked = false;",$ad_name->getName());
$input_onclick .= sprintf("document.getElementById('skip_array_%s').disabled = true;",$ad_name->getName());
$input_onclick .= "\n";
}
$input_onclick .= '};';
$input_onclick .= '};';
}
# If the attributes arent force deleted...
if ($input_onclick)
$input_onclick .= 'if (this.checked) {';
else
$input_onclick = 'onclick="if (this.checked) {';
# IE: There are new objectclasses that result in new values.
foreach ($request['template']->getLDAPmodify(true) as $skipattr) {
if (! $skipattr->getOldValues()) {
if (! in_array($skipattr->getName(),$mustattrs))
@ -216,4 +217,20 @@ if (count($request['template']->getLDAPmodify(true))) {
printf(' <a href="%s">%s</a>.',htmlspecialchars($href),_('Go back'));
echo '</center>';
}
function getMustAttrs($oclasses) {
global $app;
$mustattrs = array();
foreach ($oclasses as $value) {
$soc = $app['server']->getSchemaObjectClass($value);
if ($soc)
foreach ($soc->getMustAttrs() as $sma)
array_push($mustattrs,$sma->getName());
}
return $mustattrs;
}
?>

View File

@ -65,20 +65,13 @@ class AJAXTree extends HTMLTree {
if ($last_child)
$nb += 2;
$imgs['expand'] = array(JSDIR.'phplayersmenu/menuimages/tree_expand.png',
JSDIR.'phplayersmenu/menuimages/tree_expand.png',
JSDIR.'phplayersmenu/menuimages/tree_expand_corner.png',
($level > 0) ? JSDIR.'phplayersmenu/menuimages/tree_expand_corner.png' : JSDIR.'phplayersmenu/menuimages/tree_expand_corner_first.png');
$imgs['expand'] = array('tree_expand.png','tree_expand.png','tree_expand_corner.png',
($level > 0) ? 'tree_expand_corner.png' : 'tree_expand_corner_first.png');
$imgs['collapse'] = array(JSDIR.'phplayersmenu/menuimages/tree_collapse.png',
JSDIR.'phplayersmenu/menuimages/tree_collapse.png',
JSDIR.'phplayersmenu/menuimages/tree_collapse_corner.png',
($level > 0) ? JSDIR.'phplayersmenu/menuimages/tree_collapse_corner.png' : JSDIR.'phplayersmenu/menuimages/tree_collapse_corner_first.png');
$imgs['collapse'] = array('tree_collapse.png','tree_collapse.png','tree_collapse_corner.png',
($level > 0) ? 'tree_collapse_corner.png' : 'tree_collapse_corner_first.png');
$imgs['tree'] = array(JSDIR.'phplayersmenu/menuimages/tree_split.png',
JSDIR.'phplayersmenu/menuimages/tree_split.png',
JSDIR.'phplayersmenu/menuimages/tree_corner.png',
JSDIR.'phplayersmenu/menuimages/tree_corner.png');
$imgs['tree'] = array('tree_split.png','tree_split.png','tree_corner.png','tree_corner.png');
/** Information on array[$nb]
* nb == 1 => the node is the first child
@ -104,25 +97,25 @@ class AJAXTree extends HTMLTree {
echo $this->get_indentation($code);
if (! $child_count)
printf('<img align="top" border="0" class="imgs" id="jt%snode" src="%s" alt="--" />',$node_id,$imgs['tree'][$nb]);
printf('<img align="top" border="0" class="imgs" id="jt%snode" src="%s/%s" alt="--" />',$node_id,IMGDIR,$imgs['tree'][$nb]);
else {
printf('<a href="#" onclick="return opencloseTreeNode(\'%s\',\'%s\');">',$node_id,$parms['openclose']);
printf('<a href="#" onclick="return opencloseTreeNode(\'%s\',\'%s\',\'%s\');">',$node_id,$parms['openclose'],IMGDIR);
if ($entry->isOpened())
printf('<img align="top" border="0" class="imgs" id="jt%snode" src="%s" alt="+-" />',$node_id,$imgs['collapse'][$nb]);
printf('<img align="top" border="0" class="imgs" id="jt%snode" src="%s/%s" alt="+-" />',$node_id,IMGDIR,$imgs['collapse'][$nb]);
else
printf('<img align="top" border="0" class="imgs" id="jt%snode" src="%s" alt="+-" />',$node_id,$imgs['expand'][$nb]);
printf('<img align="top" border="0" class="imgs" id="jt%snode" src="%s/%s" alt="+-" />',$node_id,IMGDIR,$imgs['expand'][$nb]);
echo '</a>';
}
printf('<a href="%s" onclick="return displayAJ(\'BODY\',\'%s\',\'%s\');" title="%s" >',$href,$parms['edit'],_('Retrieving DN'),htmlspecialchars($item));
printf('<a href="%s" onclick="return ajDISPLAY(\'BODY\',\'%s\',\'%s\');" title="%s" >',$href,$parms['edit'],_('Retrieving DN'),htmlspecialchars($item));
printf('<span class="dnicon"><img align="top" border="0" class="imgs" id="jt%sfolder" src="%s/%s" alt="->" /></span>',$node_id,IMGDIR,$entry->getIcon($server));
echo '</a>';
echo '&nbsp;';
printf('<a href="%s" onclick="return displayAJ(\'BODY\',\'%s\',\'%s\');" title="%s" class="phplm">',$href,$parms['edit'],_('Retrieving DN'),htmlspecialchars($item));
printf('<a href="%s" onclick="return ajDISPLAY(\'BODY\',\'%s\',\'%s\');" title="%s" class="phplm">',$href,$parms['edit'],_('Retrieving DN'),htmlspecialchars($item));
echo $this->get_formatted_dn($entry,$level-1);
echo ($child_count ? (sprintf(' (%s%s)',$child_count,($entry->isSizeLimited() ? '+' : ''))) : '');
echo '</a>';
@ -199,11 +192,11 @@ class AJAXTree extends HTMLTree {
for ($i=0; $i<strlen($code); $i++) {
switch ($code[$i]) {
case '0':
$indent .= sprintf('<img align="top" border="0" class="imgs" src="%s/phplayersmenu/menuimages/tree_space.png" alt=" " />',JSDIR);
$indent .= sprintf('<img align="top" border="0" class="imgs" src="%s/tree_space.png" alt=" " />',IMGDIR);
break;
case '1':
$indent .= sprintf('<img align="top" border="0" class="imgs" src="%s/phplayersmenu/menuimages/tree_vertline.png" alt="| " />',JSDIR);
$indent .= sprintf('<img align="top" border="0" class="imgs" src="%s/tree_vertline.png" alt="| " />',IMGDIR);
break;
}
}
@ -218,8 +211,8 @@ class AJAXTree extends HTMLTree {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',33,0,__FILE__,__LINE__,__METHOD__,$fargs);
printf('<script type="text/javascript" language="javascript" src="%sphplayersmenu/libjs/layersmenu-browser_detection.js"></script>',JSDIR);
printf('<script type="text/javascript" language="javascript" src="%sajaxtree.js"></script>',JSDIR);
printf('<script type="text/javascript" language="javascript" src="%slayersmenu-browser_detection.js"></script>',JSDIR);
printf('<script type="text/javascript" language="javascript" src="%sajax_tree.js"></script>',JSDIR);
}
/**
@ -237,7 +230,7 @@ class AJAXTree extends HTMLTree {
if (! $server->isReadOnly() && ! $entry->isLeaf() && (count($entry->getChildren()) > 10) && $this->getServer()->isShowCreateEnabled()
&& $_SESSION[APPCONFIG]->getValue('appearance','show_top_create'))
$output = $this->draw_create_new_entry($entry,$level,JSDIR.'phplayersmenu/menuimages/tree_split.png');
$output = $this->draw_create_new_entry($entry,$level,IMGDIR.'/tree_split.png');
return $output;
}
@ -256,7 +249,7 @@ class AJAXTree extends HTMLTree {
$output = '';
if (! $server->isReadOnly() && ! $entry->isLeaf() && $this->getServer()->isShowCreateEnabled())
$output = $this->draw_create_new_entry($entry,$level,JSDIR.'phplayersmenu/menuimages/tree_corner.png');
$output = $this->draw_create_new_entry($entry,$level,IMGDIR.'/tree_corner.png');
return $output;
}
@ -280,7 +273,7 @@ class AJAXTree extends HTMLTree {
$output .= '&nbsp;';
if (isAjaxEnabled())
$output .= sprintf('<a href="cmd.php?%s" title="%s" class="phplm" onclick="return displayAJ(\'BODY\',\'%s\',\'%s\');">',
$output .= sprintf('<a href="cmd.php?%s" title="%s" class="phplm" onclick="return ajDISPLAY(\'BODY\',\'%s\',\'%s\');">',
htmlspecialchars($href),_('Create new entry here'),
htmlspecialchars($href),_('Loading'));
else

View File

@ -308,7 +308,7 @@ class HTMLTree extends Tree {
$href_parms = htmlspecialchars(sprintf('cmd=%s&server_id=%s%s',$menu['cmd'],$server->getIndex(),isset($menu['href']) ? $menu['href'] : ''));
if (isAjaxEnabled())
return sprintf('<a href="cmd.php?%s" onclick="return displayAJ(\'%s\',\'%s\',\'%s\');" title="%s %s"><img src="%s/%s" alt="%s" /><br />%s</a>',
return sprintf('<a href="cmd.php?%s" onclick="return ajDISPLAY(\'%s\',\'%s\',\'%s\');" title="%s %s"><img src="%s/%s" alt="%s" /><br />%s</a>',
$href_parms,$menu['div'],$href_parms,$menu['ajax'],$menu['title'],$server->getName(),IMGDIR,$menu['img'],$menu['name'],$menu['name']);
else
return sprintf('<a href="cmd.php?%s" title="%s %s"><img src="%s/%s" alt="%s" /><br />%s</a>',
@ -513,9 +513,9 @@ class HTMLTree extends Tree {
echo '<tr class="option"><td class="spacer"></td>';
if (isAjaxEnabled()) {
printf('<td class="icon"><a href="cmd.php?%s" onclick="return displayAJ(\'BODY\',\'%s\',\'%s\');" title="%s %s"><img src="%s/%s" alt="%s" /></a></td>',
printf('<td class="icon"><a href="cmd.php?%s" onclick="return ajDISPLAY(\'BODY\',\'%s\',\'%s\');" title="%s %s"><img src="%s/%s" alt="%s" /></a></td>',
$href_parm,$href_parm,_('Loading Login'),_('Login to'),$server->getName(),IMGDIR,'login.png',_('login'));
printf('<td class="logged_in" colspan="%s"><a href="cmd.php?%s" onclick="return displayAJ(\'BODY\',\'%s\',\'%s\');" title="%s %s">%s</a></td>',
printf('<td class="logged_in" colspan="%s"><a href="cmd.php?%s" onclick="return ajDISPLAY(\'BODY\',\'%s\',\'%s\');" title="%s %s">%s</a></td>',
$this->getDepth()+3-2,$href_parm,$href_parm,_('Loading Login'),_('Login to'),$server->getName(),_('login'));
} else {

View File

@ -233,41 +233,6 @@ class QueryRender extends PageRender {
);
}
# Display the Javascript that enables us to show/hide DV entries
echo '<script type="text/javascript" language="javascript">';
echo "
function showthis(key,item) {
select = document.getElementById(key+item);
if (select.style.display == '')
return false;
hideall(key,item);
return false;
};
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';
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 = '';
item = document.getElementById('CTL'+items[x]);
item.style.background = '#F0F0F0';
}
}
}
";
echo '</script>';
echo "\n\n";
$this->drawBaseTabs();
$ado = $this->template->getAttrDisplayOrder();
$counter = 0;
@ -434,7 +399,7 @@ function hideall(key,except) {
# Is mass action enabled.
if ($_SESSION[APPCONFIG]->getValue('mass','enabled')) {
printf('<tr class="%s">',++$j%2 ? 'odd' : 'even');
printf('<td><input type="checkbox" name="allbox" value="1" onclick="CheckAll(1,%s);" /></td>',$counter);
printf('<td><input type="checkbox" name="allbox" value="1" onclick="CheckAll(1,\'massform_\',%s);" /></td>',$counter);
printf('<td colspan=%s>',2+count(explode(',',$ado)));
echo '<select name="cmd" onChange="if (this.value) submit();" style="font-size: 12px">';
@ -463,31 +428,8 @@ function hideall(key,except) {
echo "\n\n";
}
if (get_request('format','REQUEST',false,'table') == 'table') {
echo '<script type="text/javascript" language="javascript">'."\n";
echo "
function CheckAll(setbgcolor,form) {
htmlform = document.getElementById('massform_'+form);
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';
}
}
}
}
}
";
echo '</script>';
}
if (get_request('format','REQUEST',false,'table') == 'table')
printf('<script type="text/javascript" language="javascript" src="%sCheckAll.js"></script>',JSDIR);
}
public function drawSubTitle($subtitle=null) {
@ -546,7 +488,7 @@ function CheckAll(setbgcolor,form) {
if (! $show = get_request('show','REQUEST'))
$show = ($counter++ === 0 ? $this->getAjaxRef($base) : null);
printf('<td id="CTL%s" onclick="return showthis(\'DN\',\'%s\');" style="background-color: %s;">%s</td>',
printf('<td id="CTL%s" onclick="return ajSHOWTHIS(\'DN\',\'%s\',\'CTL\');" style="background-color: %s;">%s</td>',
$this->getAjaxRef($base),
$this->getAjaxRef($base),
($show == $this->getAjaxRef($base) ? '#F0F0F0' : '#E0E0E0'),
@ -588,7 +530,7 @@ function CheckAll(setbgcolor,form) {
$query_string = htmlspecialchars(sprintf('%s&format=%s&show=%s&focusbase=%s',array_to_query_string($_GET,array('format','meth')),$f,$this->getAjaxRef($base),$base));
if (isAjaxEnabled())
printf('<a href="cmd.php?%s" onclick="return displayAJ(\'BODY\',\'%s\',\'%s\');">%s</a>',
printf('<a href="cmd.php?%s" onclick="return ajDISPLAY(\'BODY\',\'%s\',\'%s\');">%s</a>',
$query_string,$query_string,_('Loading Search'),_($f));
else
printf('<a href="cmd.php?%s">%s</a>',$query_string,_($f));

View File

@ -56,7 +56,7 @@ class TemplateRender extends PageRender {
$this->layout['hint'] = sprintf('<td class="icon"><img src="%s/light.png" alt="%s" /></td><td colspan="3"><span class="hint">%%s</span></td>',
IMGDIR,_('Hint'));
$this->layout['action'] = '<td class="icon"><img src="%s/%s" alt="%s" /></td><td><a href="cmd.php?%s" title="%s">%s</a></td>';
$this->layout['actionajax'] = '<td class="icon"><img src="%s/%s" alt="%s" /></td><td><a href="cmd.php?%s" title="%s" onclick="return displayAJ(\'BODY\',\'%s\',\'%s\');">%s</a></td>';
$this->layout['actionajax'] = '<td class="icon"><img src="%s/%s" alt="%s" /></td><td><a href="cmd.php?%s" title="%s" onclick="return ajDISPLAY(\'BODY\',\'%s\',\'%s\');">%s</a></td>';
# If we dont want to render this template automatically, we'll return here.
if ($norender)
@ -657,7 +657,7 @@ class TemplateRender extends PageRender {
else {
if (isAjaxEnabled())
printf('<td><input type="radio" name="template" value="%s" id="%s" onclick="return displayAJ(\'BODY\',\'%s&amp;template=%s\',\'%s\');" /></td>',
printf('<td><input type="radio" name="template" value="%s" id="%s" onclick="return ajDISPLAY(\'BODY\',\'%s&amp;template=%s\',\'%s\');" /></td>',
htmlspecialchars($details->getID()),htmlspecialchars($details->getID()),htmlspecialchars($href_parms),$details->getID(),_('Retieving DN'));
else
printf('<td><input type="radio" name="template" value="%s" id="%s" onclick="document.forms.template_choice_form.submit()" /></td>',
@ -694,7 +694,7 @@ class TemplateRender extends PageRender {
echo '<tr>';
if (isAjaxEnabled())
printf('<td><input type="radio" name="template" value="none" id="none" onclick="return displayAJ(\'BODY\',\'%s&amp;template=%s\',\'%s\');" /></td>',
printf('<td><input type="radio" name="template" value="none" id="none" onclick="return ajDISPLAY(\'BODY\',\'%s&amp;template=%s\',\'%s\');" /></td>',
htmlspecialchars($href_parms),'none',_('Retieving DN'));
else
echo '<td><input type="radio" name="template" value="none" id="none" onclick="document.forms.template_choice_form.submit()" /></td>';
@ -1308,7 +1308,7 @@ class TemplateRender extends PageRender {
return '';
$href = sprintf('cmd=add_attr_form&%s',$this->url_base);
$layout = '<td class="icon"><img src="%s/%s" alt="%s" /></td><td><a href="cmd.php?%s" title="%s" onclick="getDiv(\'ADD\').style.display = \'block\';return displayAJ(\'ADD\',\'%s\',\'%s\');">%s</a></td>';
$layout = '<td class="icon"><img src="%s/%s" alt="%s" /></td><td><a href="cmd.php?%s" title="%s" onclick="getDiv(\'ADD\').style.display = \'block\';return ajDISPLAY(\'ADD\',\'%s\',\'%s\');">%s</a></td>';
if (isAjaxEnabled())
return sprintf($layout,IMGDIR,'add.png',_('Add'),
@ -1674,7 +1674,9 @@ class TemplateRender extends PageRender {
printf('<!-- START: %s -->',__METHOD__);
echo "\n";
printf('<script type="text/javascript" language="javascript" src="%stemplaterender.js"></script>',JSDIR);
printf('<script type="text/javascript" language="javascript" src="%sTemplateRender.js"></script>',JSDIR);
printf('<script type="text/javascript" language="javascript" src="%stoAscii.js"></script>',JSDIR);
printf('<script type="text/javascript" language="javascript" src="%sdnChooserPopup.js"></script>',JSDIR);
echo "\n";
printf('<!-- START: MAIN FORM VALIDATION: %s -->',__METHOD__);
@ -2117,7 +2119,7 @@ function fillRec(id,value) {
$this->getServerID(),rawurlencode($this->template->getDN()),rawurlencode($attribute->getName(false))));
if (isAjaxEnabled())
return sprintf('(<a href="cmd.php?%s" title="%s %s" onclick="return displayAJ(\'ADDVALUE%s\',\'%s&amp;raw=1\',\'%s\');">%s</a>)',
return sprintf('(<a href="cmd.php?%s" title="%s %s" onclick="return ajDISPLAY(\'ADDVALUE%s\',\'%s&amp;raw=1\',\'%s\');">%s</a>)',
$href_parm,_('Add an additional value to attribute'),$attribute->getName(false),$attribute->getName(),
$href_parm,_('Add Value to Attribute'),_('add value'));
else
@ -2135,7 +2137,7 @@ function fillRec(id,value) {
$this->getServerID(),rawurlencode($this->template->getDN()),rawurlencode($attribute->getName()));
if (isAjaxEnabled())
return sprintf('(<a href="cmd.php?%s" title="%s: %s" onclick="return displayAJ(\'BODY\',\'%s\',\'%s\');">%s</a>)',
return sprintf('(<a href="cmd.php?%s" title="%s: %s" onclick="return ajDISPLAY(\'BODY\',\'%s\',\'%s\');">%s</a>)',
htmlspecialchars($href),_('Modify members for'),$this->template->getDN(),
htmlspecialchars($href),_('Modify group membership'),
_('modify group members'));

View File

@ -356,14 +356,14 @@ function cmd_control_pane($type) {
'purge'=>array(
'title'=>_('Purge caches'),
'enable'=>$_SESSION[APPCONFIG]->isCommandAvailable('script','purge_cache'),
'link'=>sprintf('href="cmd.php?cmd=purge_cache" onclick="return displayAJ(\'BODY\',\'cmd=purge_cache\',\'%s\');" title="%s"',
'link'=>sprintf('href="cmd.php?cmd=purge_cache" onclick="return ajDISPLAY(\'BODY\',\'cmd=purge_cache\',\'%s\');" title="%s"',
_('Clearing cache'),_('Purge caches')),
'image'=>sprintf('<img src="%s/trash-big.png" alt="%s" />',IMGDIR,_('Purge caches'))),
'hide_debug_info'=>array(
'title'=>_('Show Cache'),
'enable'=>$_SESSION[APPCONFIG]->isCommandAvailable('script','show_cache'),
'link'=>sprintf('href="cmd.php?cmd=show_cache" onclick="return displayAJ(\'BODY\',\'cmd=show_cache\',\'%s\');" title="%s"',
'link'=>sprintf('href="cmd.php?cmd=show_cache" onclick="return ajDISPLAY(\'BODY\',\'cmd=show_cache\',\'%s\');" title="%s"',
_('Loading'),_('Show Cache'),_('Show Cache')),
'image'=>sprintf('<img src="%s/debug-cache.png" alt="%s" />',IMGDIR,_('Show Cache'))),
);

View File

@ -113,19 +113,15 @@ class page {
else
printf('<title>%s - %s</title>',$this->_app['title'],app_version());
echo '<link rel="shortcut icon" href="images/favicon.ico" type="image/vnd.microsoft.icon" />';
# Style sheet.
printf('<link type="text/css" rel="stylesheet" href="%s" />',$this->_app['urlcss']);
echo '<link rel="shortcut icon" href="images/favicon.ico" type="image/vnd.microsoft.icon" />';
if (defined('JSDIR')) {
printf('<link type="text/css" rel="stylesheet" media="all" href="%sjscalendar/calendar-blue.css" title="blue" />',JSDIR);
printf('<link type="text/css" rel="stylesheet" href="%s/phplayersmenu/layerstreemenu.css" />',JSDIR);
echo "\n";
printf('<script type="text/javascript" src="%spla_ajax.js"></script>',JSDIR);
printf('<script type="text/javascript" src="%stree_hide.js"></script>',JSDIR);
printf('<script type="text/javascript" src="%sentry_chooser.js"></script>',JSDIR);
printf('<script type="text/javascript" src="%sto_ascii.js"></script>',JSDIR);
printf('<script type="text/javascript" src="%sjscalendar/calendar.js"></script>',JSDIR);
printf('<script type="text/javascript" language="javascript" src="%sajax_functions.js"></script>',JSDIR);
printf('<script type="text/javascript" language="javascript" src="%sjscalendar/calendar.js"></script>',JSDIR);
echo "\n";
}