diff --git a/htdocs/add_attr_form.php b/htdocs/add_attr_form.php index c5093cc..565b0b7 100644 --- a/htdocs/add_attr_form.php +++ b/htdocs/add_attr_form.php @@ -164,7 +164,7 @@ if (get_request('meth','REQUEST') != 'ajax') { echo ''; echo ''; printf('',_('Recursive copy')); - echo '',_('Recursively copy all children of this object as well.')); echo ''; echo "\n"; @@ -95,21 +96,6 @@ if ($_SESSION[APPCONFIG]->getValue('appearance','show_hints')) echo ''; # Draw the javascrpt to enable/disable the filter field if this may be a recursive copy -if (count($request['children']) > 0) { -?> - - 0) + printf('',JSDIR); ?> diff --git a/htdocs/css/default/style.css b/htdocs/css/default/style.css index a5b2d5a..7b2a369 100644 --- a/htdocs/css/default/style.css +++ b/htdocs/css/default/style.css @@ -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; diff --git a/htdocs/css/tango/style.css b/htdocs/css/tango/style.css index 950a153..fb84aa4 100644 --- a/htdocs/css/tango/style.css +++ b/htdocs/css/tango/style.css @@ -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; diff --git a/htdocs/export_form.php b/htdocs/export_form.php index b1d5229..b008aa9 100755 --- a/htdocs/export_form.php +++ b/htdocs/export_form.php @@ -36,6 +36,9 @@ $available_scopes = array( $request['page'] = new PageRender($app['server']->getIndex(),get_request('template','REQUEST',false,'none')); $request['page']->drawTitle(sprintf('%s',_('Export'))); +printf('',JSDIR); +printf('',JSDIR); + echo '
'; echo '
'; echo '
'; @@ -50,7 +53,7 @@ echo '
'; printf('%s',_('Export')); echo '
'; - printf('', 'ADDATTR',$app['server']->getIndex(),rawurlencode(get_request('dn','REQUEST')),_('Please Wait')); printf('','',''); diff --git a/htdocs/cmd.php b/htdocs/cmd.php index e87fb5e..0c86a7c 100644 --- a/htdocs/cmd.php +++ b/htdocs/cmd.php @@ -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(" -",get_request('refresh','REQUEST'),$app['server']->getIndex(),get_request('noheader','REQUEST',false,0),_('Auto refresh')); + echo ''; } # Capture the output and put into the body of the page. diff --git a/htdocs/compare_form.php b/htdocs/compare_form.php index 7e0839d..45ac25e 100644 --- a/htdocs/compare_form.php +++ b/htdocs/compare_form.php @@ -28,6 +28,7 @@ $request['page']->accept(); $request['page']->drawTitle(sprintf('%s %s',_('Compare another DN with'),get_rdn($request['dn']))); $request['page']->drawSubTitle(); +printf('',JSDIR); echo '
'; printf('%s %s %s
',_('Compare'),get_rdn($request['dn']),_('with ')); diff --git a/htdocs/copy_form.php b/htdocs/copy_form.php index 023a5df..858a9ce 100644 --- a/htdocs/copy_form.php +++ b/htdocs/copy_form.php @@ -27,6 +27,7 @@ $request['page']->accept(); $request['page']->drawTitle(sprintf('%s %s',_('Copy'),get_rdn($request['dn']))); $request['page']->drawSubTitle(); +printf('',JSDIR); echo '
'; printf('%s %s %s:

',_('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 '
:'; + echo ''; printf('(%s)
'; -printf('',_('Server'),server_select_list($app['server']->getIndex())); +printf('',_('Server'),$app['server']->getName()); echo ''; printf('',_('Base DN')); @@ -83,7 +86,7 @@ printf('', $request['sys_attr'] ? 'checked="true" ' : '',_('Include system attributes')); -printf('', +printf('', _('Save as file')); printf('', @@ -208,15 +211,3 @@ function is_browser($type) { return false; } ?> - diff --git a/htdocs/js/phplayersmenu/menuimages/tree_collapse.png b/htdocs/images/default/tree_collapse.png similarity index 100% rename from htdocs/js/phplayersmenu/menuimages/tree_collapse.png rename to htdocs/images/default/tree_collapse.png diff --git a/htdocs/js/phplayersmenu/menuimages/tree_collapse_corner.png b/htdocs/images/default/tree_collapse_corner.png similarity index 100% rename from htdocs/js/phplayersmenu/menuimages/tree_collapse_corner.png rename to htdocs/images/default/tree_collapse_corner.png diff --git a/htdocs/js/phplayersmenu/menuimages/tree_collapse_corner_first.png b/htdocs/images/default/tree_collapse_corner_first.png similarity index 100% rename from htdocs/js/phplayersmenu/menuimages/tree_collapse_corner_first.png rename to htdocs/images/default/tree_collapse_corner_first.png diff --git a/htdocs/js/phplayersmenu/menuimages/tree_collapse_first.png b/htdocs/images/default/tree_collapse_first.png similarity index 100% rename from htdocs/js/phplayersmenu/menuimages/tree_collapse_first.png rename to htdocs/images/default/tree_collapse_first.png diff --git a/htdocs/js/phplayersmenu/menuimages/tree_corner.png b/htdocs/images/default/tree_corner.png similarity index 100% rename from htdocs/js/phplayersmenu/menuimages/tree_corner.png rename to htdocs/images/default/tree_corner.png diff --git a/htdocs/js/phplayersmenu/menuimages/tree_expand.png b/htdocs/images/default/tree_expand.png similarity index 100% rename from htdocs/js/phplayersmenu/menuimages/tree_expand.png rename to htdocs/images/default/tree_expand.png diff --git a/htdocs/js/phplayersmenu/menuimages/tree_expand_corner.png b/htdocs/images/default/tree_expand_corner.png similarity index 100% rename from htdocs/js/phplayersmenu/menuimages/tree_expand_corner.png rename to htdocs/images/default/tree_expand_corner.png diff --git a/htdocs/js/phplayersmenu/menuimages/tree_expand_corner_first.png b/htdocs/images/default/tree_expand_corner_first.png similarity index 100% rename from htdocs/js/phplayersmenu/menuimages/tree_expand_corner_first.png rename to htdocs/images/default/tree_expand_corner_first.png diff --git a/htdocs/js/phplayersmenu/menuimages/tree_expand_first.png b/htdocs/images/default/tree_expand_first.png similarity index 100% rename from htdocs/js/phplayersmenu/menuimages/tree_expand_first.png rename to htdocs/images/default/tree_expand_first.png diff --git a/htdocs/js/phplayersmenu/menuimages/tree_folder_closed.png b/htdocs/images/default/tree_folder_closed.png similarity index 100% rename from htdocs/js/phplayersmenu/menuimages/tree_folder_closed.png rename to htdocs/images/default/tree_folder_closed.png diff --git a/htdocs/js/phplayersmenu/menuimages/tree_folder_open.png b/htdocs/images/default/tree_folder_open.png similarity index 100% rename from htdocs/js/phplayersmenu/menuimages/tree_folder_open.png rename to htdocs/images/default/tree_folder_open.png diff --git a/htdocs/js/phplayersmenu/menuimages/tree_leaf.png b/htdocs/images/default/tree_leaf.png similarity index 100% rename from htdocs/js/phplayersmenu/menuimages/tree_leaf.png rename to htdocs/images/default/tree_leaf.png diff --git a/htdocs/js/phplayersmenu/menuimages/tree_space.png b/htdocs/images/default/tree_space.png similarity index 100% rename from htdocs/js/phplayersmenu/menuimages/tree_space.png rename to htdocs/images/default/tree_space.png diff --git a/htdocs/js/phplayersmenu/menuimages/tree_split.png b/htdocs/images/default/tree_split.png similarity index 100% rename from htdocs/js/phplayersmenu/menuimages/tree_split.png rename to htdocs/images/default/tree_split.png diff --git a/htdocs/js/phplayersmenu/menuimages/tree_split_first.png b/htdocs/images/default/tree_split_first.png similarity index 100% rename from htdocs/js/phplayersmenu/menuimages/tree_split_first.png rename to htdocs/images/default/tree_split_first.png diff --git a/htdocs/js/phplayersmenu/menuimages/tree_vertline.png b/htdocs/images/default/tree_vertline.png similarity index 100% rename from htdocs/js/phplayersmenu/menuimages/tree_vertline.png rename to htdocs/images/default/tree_vertline.png diff --git a/htdocs/images/tango/tree_collapse.png b/htdocs/images/tango/tree_collapse.png new file mode 100644 index 0000000..1c9be75 Binary files /dev/null and b/htdocs/images/tango/tree_collapse.png differ diff --git a/htdocs/images/tango/tree_collapse_corner.png b/htdocs/images/tango/tree_collapse_corner.png new file mode 100644 index 0000000..b3328ad Binary files /dev/null and b/htdocs/images/tango/tree_collapse_corner.png differ diff --git a/htdocs/images/tango/tree_collapse_corner_first.png b/htdocs/images/tango/tree_collapse_corner_first.png new file mode 100644 index 0000000..122b980 Binary files /dev/null and b/htdocs/images/tango/tree_collapse_corner_first.png differ diff --git a/htdocs/images/tango/tree_collapse_first.png b/htdocs/images/tango/tree_collapse_first.png new file mode 100644 index 0000000..5c43876 Binary files /dev/null and b/htdocs/images/tango/tree_collapse_first.png differ diff --git a/htdocs/images/tango/tree_corner.png b/htdocs/images/tango/tree_corner.png new file mode 100644 index 0000000..541c5b3 Binary files /dev/null and b/htdocs/images/tango/tree_corner.png differ diff --git a/htdocs/images/tango/tree_expand.png b/htdocs/images/tango/tree_expand.png new file mode 100644 index 0000000..e94aecf Binary files /dev/null and b/htdocs/images/tango/tree_expand.png differ diff --git a/htdocs/images/tango/tree_expand_corner.png b/htdocs/images/tango/tree_expand_corner.png new file mode 100644 index 0000000..4293f76 Binary files /dev/null and b/htdocs/images/tango/tree_expand_corner.png differ diff --git a/htdocs/images/tango/tree_expand_corner_first.png b/htdocs/images/tango/tree_expand_corner_first.png new file mode 100644 index 0000000..5de11a6 Binary files /dev/null and b/htdocs/images/tango/tree_expand_corner_first.png differ diff --git a/htdocs/images/tango/tree_expand_first.png b/htdocs/images/tango/tree_expand_first.png new file mode 100644 index 0000000..034b88e Binary files /dev/null and b/htdocs/images/tango/tree_expand_first.png differ diff --git a/htdocs/images/tango/tree_folder_closed.png b/htdocs/images/tango/tree_folder_closed.png new file mode 100644 index 0000000..f1bfd01 Binary files /dev/null and b/htdocs/images/tango/tree_folder_closed.png differ diff --git a/htdocs/images/tango/tree_folder_open.png b/htdocs/images/tango/tree_folder_open.png new file mode 100644 index 0000000..4190b96 Binary files /dev/null and b/htdocs/images/tango/tree_folder_open.png differ diff --git a/htdocs/images/tango/tree_leaf.png b/htdocs/images/tango/tree_leaf.png new file mode 100644 index 0000000..6f999fb Binary files /dev/null and b/htdocs/images/tango/tree_leaf.png differ diff --git a/htdocs/images/tango/tree_space.png b/htdocs/images/tango/tree_space.png new file mode 100644 index 0000000..fbdfa6a Binary files /dev/null and b/htdocs/images/tango/tree_space.png differ diff --git a/htdocs/images/tango/tree_split.png b/htdocs/images/tango/tree_split.png new file mode 100644 index 0000000..1a49fab Binary files /dev/null and b/htdocs/images/tango/tree_split.png differ diff --git a/htdocs/images/tango/tree_split_first.png b/htdocs/images/tango/tree_split_first.png new file mode 100644 index 0000000..e915d03 Binary files /dev/null and b/htdocs/images/tango/tree_split_first.png differ diff --git a/htdocs/images/tango/tree_vertline.png b/htdocs/images/tango/tree_vertline.png new file mode 100644 index 0000000..261ff13 Binary files /dev/null and b/htdocs/images/tango/tree_vertline.png differ diff --git a/htdocs/js/CheckAll.js b/htdocs/js/CheckAll.js new file mode 100644 index 0000000..0f91f10 --- /dev/null +++ b/htdocs/js/CheckAll.js @@ -0,0 +1,22 @@ +function CheckAll(setbgcolor,form,index) { + htmlform = document.getElementById(form+index); + + for (var i=0;i
'+display+'...'); + 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); } - diff --git a/htdocs/js/ajaxtree.js b/htdocs/js/ajax_tree.js similarity index 63% rename from htdocs/js/ajaxtree.js rename to htdocs/js/ajax_tree.js index 5946a88..3b9a50d 100644 --- a/htdocs/js/ajaxtree.js +++ b/htdocs/js/ajax_tree.js @@ -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, '
'+display+'...'); - 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; } diff --git a/htdocs/js/entry_chooser.js b/htdocs/js/dnChooserPopup.js similarity index 100% rename from htdocs/js/entry_chooser.js rename to htdocs/js/dnChooserPopup.js diff --git a/htdocs/js/form_field_toggle_enable.js b/htdocs/js/form_field_toggle_enable.js new file mode 100644 index 0000000..f26d1eb --- /dev/null +++ b/htdocs/js/form_field_toggle_enable.js @@ -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 -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; diff --git a/htdocs/js/modify_member.js b/htdocs/js/modify_member.js index 8ab0678..e7fd34d 100644 --- a/htdocs/js/modify_member.js +++ b/htdocs/js/modify_member.js @@ -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"; + ""; } - - 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 - Copyright (C) - - 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. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/htdocs/js/phplayersmenu/LICENSE b/htdocs/js/phplayersmenu/LICENSE deleted file mode 100644 index 9b15f32..0000000 --- a/htdocs/js/phplayersmenu/LICENSE +++ /dev/null @@ -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 diff --git a/htdocs/js/phplayersmenu/layerstreemenu.css b/htdocs/js/phplayersmenu/layerstreemenu.css deleted file mode 100644 index f59cd29..0000000 --- a/htdocs/js/phplayersmenu/layerstreemenu.css +++ /dev/null @@ -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; -} diff --git a/htdocs/js/phplayersmenu/lib/PHPLIB.php b/htdocs/js/phplayersmenu/lib/PHPLIB.php deleted file mode 100644 index 636a7ee..0000000 --- a/htdocs/js/phplayersmenu/lib/PHPLIB.php +++ /dev/null @@ -1,567 +0,0 @@ - (original from PHPLIB) -// Bjoern Schotte (PEARification) -// Martin Jansen (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 - * - * @author Bjoern Schotte - * @author Martin Jansen (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: - * - * <!-- BEGIN blockname --> - * html code - * <!-- END blockname --> - * - * 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*?\n?(\s*.*?\n?)\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*
\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*
\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}]+)}/', "", $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("Halted."); - } - - 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("Template Error: %s
\n", $msg)); - printf("Template Error: %s
\n", $msg); - } -} -?> diff --git a/htdocs/js/phplayersmenu/lib/layersmenu-common.inc.php b/htdocs/js/phplayersmenu/lib/layersmenu-common.inc.php deleted file mode 100644 index b06b1ec..0000000 --- a/htdocs/js/phplayersmenu/lib/layersmenu-common.inc.php +++ /dev/null @@ -1,959 +0,0 @@ - '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
"; -/* 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 "LayersMenu Error: $errormsg
\n"; - if ($this->haltOnError == 'yes') { - die("Halted.
\n"); - } -} - -} /* END OF CLASS */ - -?> diff --git a/htdocs/js/phplayersmenu/lib/treemenu.inc.php b/htdocs/js/phplayersmenu/lib/treemenu.inc.php deleted file mode 100644 index 3fe5016..0000000 --- a/htdocs/js/phplayersmenu/lib/treemenu.inc.php +++ /dev/null @@ -1,398 +0,0 @@ -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] .= '
' . "\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] .= '' . $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] .= '' . $alt . ''; - } else { - $img = $img_collapse_corner_first; - $alt = $alt_collapse_corner_first; - $this->_treeMenu[$menu_name] .= '' . $alt . ''; - } - } 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] .= '' . $alt . ''; - } else { - $img = $img_collapse_corner; - $alt = $alt_collapse_corner; - $this->_treeMenu[$menu_name] .= '' . $alt . ''; - } - } - } else { - $this->_treeMenu[$menu_name] .= '' . $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] .= '' . $alt . ''; - } 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] .= '' . $alt . ''; - } else { - $img = $img_collapse; - $alt = $alt_collapse; - - $this->_treeMenu[$menu_name] .= '' . $alt . ''; - } - } - } 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] .= '' . $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_href_close = ''; - } else { - $a_href_open_img = 'tree[$cnt]['parsed_title'] . $this->tree[$cnt]['parsed_target'] . '>'; - $a_href_close_img = ''; - $a_href_open = 'tree[$cnt]['parsed_title'] . $this->tree[$cnt]['parsed_target'] . ' class="' . $linkstyle . '">'; - $a_href_close = ''; - } - - if ($not_a_leaf) { -// $this->_treeMenu[$menu_name] .= $a_href_open_img . '' . $alt_folder_open . '' . $a_href_close_img; - $this->_treeMenu[$menu_name] .= $a_href_open_img . '' . $alt_folder_open . '' . $a_href_close_img; - } else { - if ($this->tree[$cnt]['parsed_icon'] != '') { -// $this->_treeMenu[$menu_name] .= $a_href_open_img . '' . $alt_leaf . '' . $a_href_close_img; - $this->_treeMenu[$menu_name] .= $a_href_open_img . '' . $alt_leaf . '' . $a_href_close_img; - } else { - $this->_treeMenu[$menu_name] .= $a_href_open_img . '' . $alt_leaf . '' . $a_href_close_img; - } - } - $this->_treeMenu[$menu_name] .= ' ' . $a_href_open . $this->tree[$cnt]['text'] . $a_href_close . "\n"; - $this->_treeMenu[$menu_name] .= '
' . "\n"; - - if ($cnt<$this->_lastItem[$menu_name] && $this->tree[$cnt]['level']<$this->tree[$cnt+1]['level']) { - $this->_treeMenu[$menu_name] .= '
' . "\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] .= '
' . "\n"; - } - } - } - -/* - $this->_treeMenu[$menu_name] = - '
' . "\n" . - $this->_treeMenu[$menu_name] . - '
' . "\n"; -*/ - // Some (old) browsers do not support the "white-space: nowrap;" CSS property... - $this->_treeMenu[$menu_name] = - '
%s%s
%s%s
%s
%s
 
 
 
' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '
' . "\n" . - $this->_treeMenu[$menu_name] . - '
' . "\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 = ' - - '; - - $toggle_function = $t->parse('out', 'tplfile'); - $toggle_function = - '' . "\n"; - - $toggle = - '' . "\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 */ - -?> diff --git a/htdocs/js/phplayersmenu/libjs/layersmenu-browser_detection.js b/htdocs/js/phplayersmenu/libjs/layersmenu-browser_detection.js deleted file mode 100644 index 79896a0..0000000 --- a/htdocs/js/phplayersmenu/libjs/layersmenu-browser_detection.js +++ /dev/null @@ -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; - diff --git a/htdocs/js/phplayersmenu/libjs/layerstreemenu-cookies.js b/htdocs/js/phplayersmenu/libjs/layerstreemenu-cookies.js deleted file mode 100644 index ea36afc..0000000 --- a/htdocs/js/phplayersmenu/libjs/layerstreemenu-cookies.js +++ /dev/null @@ -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 -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(); -} - diff --git a/htdocs/js/to_ascii.js b/htdocs/js/toAscii.js old mode 100755 new mode 100644 similarity index 100% rename from htdocs/js/to_ascii.js rename to htdocs/js/toAscii.js diff --git a/htdocs/js/tree_hide.js b/htdocs/js/tree_hide.js deleted file mode 100644 index 3d73a9d..0000000 --- a/htdocs/js/tree_hide.js +++ /dev/null @@ -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; -} diff --git a/htdocs/login_form.php b/htdocs/login_form.php index 9c0c181..b0916ec 100644 --- a/htdocs/login_form.php +++ b/htdocs/login_form.php @@ -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('%s ', + printf('%s ', _('Anonymous')); printf('
', @@ -90,23 +90,9 @@ if ($app['server']->getAuthType() == 'http') { echo '
'; - echo ''; + echo ''; - if ($app['server']->isAnonBindAllowed() ) { -?> - -isAnonBindAllowed()) + printf('',JSDIR); } ?> diff --git a/htdocs/modify_member_form.php b/htdocs/modify_member_form.php index 5a4d2aa..d436e4f 100644 --- a/htdocs/modify_member_form.php +++ b/htdocs/modify_member_form.php @@ -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 '
'; echo '
'; + +printf('',JSDIR); echo ''; if ($_SESSION[APPCONFIG]->getValue('confirm','update')) echo ''; @@ -147,18 +149,10 @@ printf('',htmlspecialcha echo ''; # Submit values to update_confirm.php and when clicked, run addSelected -printf('',_('Save changes'),$request['attr']); +printf('',_('Save changes'),$request['attr']); echo ''; echo ''; echo ''; - -# Variables for Javascript function that moves members from left to right -echo ''; -printf('',JSDIR); - echo ''; ?> diff --git a/htdocs/password_checker.php b/htdocs/password_checker.php index 3ddf7b8..26e4fd4 100644 --- a/htdocs/password_checker.php +++ b/htdocs/password_checker.php @@ -69,8 +69,8 @@ echo ''; # Pull our password from the form that opened this window. if ($request['componentid']) { echo ''; } diff --git a/htdocs/schema.php b/htdocs/schema.php index 33e3e02..3f7e771 100644 --- a/htdocs/schema.php +++ b/htdocs/schema.php @@ -57,7 +57,7 @@ foreach ($entry['schema_types'] as $item => $value) { } else { if (isAjaxEnabled()) - printf('%s', + printf('%s', htmlspecialchars($entry['href'][$item]),htmlspecialchars($entry['href'][$item]),$value,$value,$value); else printf('%s',htmlspecialchars($entry['href'][$item]),_($value)); @@ -67,64 +67,6 @@ foreach ($entry['schema_types'] as $item => $value) { echo ''; echo '
'; -if (isAjaxEnabled()) { - echo ''; -} - switch($entry['view']) { case 'syntaxes': $highlight_oid = get_request('highlight_oid','GET',false,false); @@ -188,19 +130,8 @@ switch($entry['view']) { printf('',$app['server']->getIndex()); if (isAjaxEnabled()) { - echo ''; - echo ''; } else echo ''; if (isAjaxEnabled()) - printf('',_('Go')); + printf('',_('Go')); else printf('',_('Go')); echo ''; @@ -223,7 +154,7 @@ switch($entry['view']) { $entry['viewed'] = true; if (isAjaxEnabled() && $entry['value']) - printf('
',$attr->getName(),strcasecmp($entry['value'],$attr->getName()) ? 'none' : ''); + printf('
',$attr->getName(),strcasecmp($entry['value'],$attr->getName()) ? 'none' : 'block'); else printf('
',$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('%s', + printf('%s', $href,strtolower($attr->getSupAttribute()),$attr->getSupAttribute()); else printf('%s',$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('%s', + printf('%s', $href,$href,_('Matching Rules'),$attr->getEquality(),$attr->getEquality()); else printf('%s',$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('%s (%s)', + printf('%s (%s)', $href,$href,_('Syntaxes'),'',$attr->getType(),$attr->getSyntaxOID()); else printf('%s (%s)',$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('%s', + printf('%s', $href,strtolower($alias),$alias); else printf('%s',$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('%s ', + printf('%s ', $href,$href,_('ObjectClasses'),strtolower($objectclass),$objectclass); else printf('%s ',$href,$objectclass); @@ -414,20 +345,8 @@ switch($entry['view']) { echo ''; if (isAjaxEnabled()) { - echo ''; - echo ''; } else echo ''; if (isAjaxEnabled()) - printf('',_('Go')); + printf('',_('Go')); else printf('',_('Go')); echo ''; @@ -494,7 +413,7 @@ switch($entry['view']) { echo '
'; if (isAjaxEnabled()) - printf('', + printf('', _('Go'),$app['server']->getIndex(),_('Attributes'),$rule->getName()); else printf('',_('Go')); @@ -522,19 +441,8 @@ switch($entry['view']) { printf('',$app['server']->getIndex()); if (isAjaxEnabled()) { - echo ''; - echo ''; } else echo ''; if (isAjaxEnabled()) - printf('',_('Go')); + printf('',_('Go')); else printf('',_('Go')); echo ''; @@ -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('%s', + printf('%s', $href,strtolower($object_class),$object_class); else printf('%s', @@ -597,7 +505,7 @@ switch($entry['view']) { if (strcasecmp($oclass->getName(),'top') == 0) { $href = htmlspecialchars($entry['href']['objectclasses']); if (isAjaxEnabled()) - printf('all', + printf('all', $href); else printf('(all)',$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('%s', + printf('%s', $href,_('Jump to this objectClass definition'),strtolower($object_class),$object_class); else printf('%s',$href,_('Jump to this objectClass definition'),$object_class); @@ -632,7 +540,7 @@ switch($entry['view']) { echo '
  • '; $href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['attributes'],$attr->getName())); if (isAjaxEnabled()) - printf('%s', + printf('%s', $href,$href,_('Attributes'),$attr->getName(),$attr->getName(false)); else printf('%s',$href,$attr->getName(false)); @@ -642,7 +550,7 @@ switch($entry['view']) { $href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($attr->getSource()))); printf('(%s ',_('Inherited from')); if (isAjaxEnabled()) - printf('%s', + printf('%s', $href,_('Jump to this objectClass definition'),strtolower($attr->getSource()),$attr->getSource()); else printf('%s',$href,$attr->getSource()); @@ -665,7 +573,7 @@ switch($entry['view']) { echo '
  • '; $href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['attributes'],$attr->getName())); if (isAjaxEnabled()) - printf('%s', + printf('%s', $href,$href,_('Attributes'),$attr->getName(),$attr->getName(false)); else printf('%s',$href,$attr->getName(false)); @@ -675,7 +583,7 @@ switch($entry['view']) { $href = htmlspecialchars(sprintf('%s&viewvalue=%s',$entry['href']['objectclasses'],strtolower($attr->getSource()))); printf('(%s ',_('Inherited from')); if (isAjaxEnabled()) - printf('%s', + printf('%s', $href,_('Jump to this objectClass definition'),strtolower($attr->getSource()),$attr->getSource()); else printf('%s',$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 ''; +} ?> diff --git a/htdocs/show_cache.php b/htdocs/show_cache.php index ea41f97..5ce6cd3 100644 --- a/htdocs/show_cache.php +++ b/htdocs/show_cache.php @@ -92,7 +92,7 @@ if (! $_SESSION[APPCONFIG]->getValue('appearance','hide_debug_info')) { poststr += "&global=on" + encodeURI(xx); obj.innerHTML = ' ...'; - makePOSTRequest('cmd.php',poststr,'alertCacheContents','cancelCacheContents'); + makeHttpRequest('cmd.php',poststr,'POST','alertCacheContents','cancelCacheContents'); } function close(key,xx) { diff --git a/htdocs/update_confirm.php b/htdocs/update_confirm.php index df60697..d15c92f 100644 --- a/htdocs/update_confirm.php +++ b/htdocs/update_confirm.php @@ -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(' %s.',htmlspecialchars($href),_('Go back')); echo ''; } + +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; +} ?> diff --git a/lib/AJAXTree.php b/lib/AJAXTree.php index dac0288..d9a40b4 100644 --- a/lib/AJAXTree.php +++ b/lib/AJAXTree.php @@ -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('--',$node_id,$imgs['tree'][$nb]); + printf('--',$node_id,IMGDIR,$imgs['tree'][$nb]); else { - printf('',$node_id,$parms['openclose']); + printf('',$node_id,$parms['openclose'],IMGDIR); if ($entry->isOpened()) - printf('+-',$node_id,$imgs['collapse'][$nb]); + printf('+-',$node_id,IMGDIR,$imgs['collapse'][$nb]); else - printf('+-',$node_id,$imgs['expand'][$nb]); + printf('+-',$node_id,IMGDIR,$imgs['expand'][$nb]); echo ''; } - printf('',$href,$parms['edit'],_('Retrieving DN'),htmlspecialchars($item)); + printf('',$href,$parms['edit'],_('Retrieving DN'),htmlspecialchars($item)); printf('->',$node_id,IMGDIR,$entry->getIcon($server)); echo ''; echo ' '; - printf('',$href,$parms['edit'],_('Retrieving DN'),htmlspecialchars($item)); + printf('',$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 ''; @@ -199,11 +192,11 @@ class AJAXTree extends HTMLTree { for ($i=0; $i',JSDIR); + $indent .= sprintf('  ',IMGDIR); break; case '1': - $indent .= sprintf('| ',JSDIR); + $indent .= sprintf('| ',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('',JSDIR); - printf('',JSDIR); + printf('',JSDIR); + printf('',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 .= ' '; if (isAjaxEnabled()) - $output .= sprintf('', + $output .= sprintf('', htmlspecialchars($href),_('Create new entry here'), htmlspecialchars($href),_('Loading')); else diff --git a/lib/HTMLTree.php b/lib/HTMLTree.php index 2985a3e..5918f01 100644 --- a/lib/HTMLTree.php +++ b/lib/HTMLTree.php @@ -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('%s
    %s
    ', + return sprintf('%s
    %s
    ', $href_parms,$menu['div'],$href_parms,$menu['ajax'],$menu['title'],$server->getName(),IMGDIR,$menu['img'],$menu['name'],$menu['name']); else return sprintf('%s
    %s
    ', @@ -513,9 +513,9 @@ class HTMLTree extends Tree { echo ''; if (isAjaxEnabled()) { - printf('%s', + printf('%s', $href_parm,$href_parm,_('Loading Login'),_('Login to'),$server->getName(),IMGDIR,'login.png',_('login')); - printf('%s', + printf('%s', $this->getDepth()+3-2,$href_parm,$href_parm,_('Loading Login'),_('Login to'),$server->getName(),_('login')); } else { diff --git a/lib/QueryRender.php b/lib/QueryRender.php index 74a7caf..fa4a637 100644 --- a/lib/QueryRender.php +++ b/lib/QueryRender.php @@ -233,41 +233,6 @@ class QueryRender extends PageRender { ); } - # Display the Javascript that enables us to show/hide DV entries - echo ''; - 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('',++$j%2 ? 'odd' : 'even'); - printf('',$counter); + printf('',$counter); printf('',2+count(explode(',',$ado))); echo '', + printf('', htmlspecialchars($details->getID()),htmlspecialchars($details->getID()),htmlspecialchars($href_parms),$details->getID(),_('Retieving DN')); else printf('', @@ -694,7 +694,7 @@ class TemplateRender extends PageRender { echo ''; if (isAjaxEnabled()) - printf('', + printf('', htmlspecialchars($href_parms),'none',_('Retieving DN')); else echo ''; @@ -1308,7 +1308,7 @@ class TemplateRender extends PageRender { return ''; $href = sprintf('cmd=add_attr_form&%s',$this->url_base); - $layout = '%s%s'; + $layout = '%s%s'; if (isAjaxEnabled()) return sprintf($layout,IMGDIR,'add.png',_('Add'), @@ -1674,7 +1674,9 @@ class TemplateRender extends PageRender { printf('',__METHOD__); echo "\n"; - printf('',JSDIR); + printf('',JSDIR); + printf('',JSDIR); + printf('',JSDIR); echo "\n"; printf('',__METHOD__); @@ -2117,7 +2119,7 @@ function fillRec(id,value) { $this->getServerID(),rawurlencode($this->template->getDN()),rawurlencode($attribute->getName(false)))); if (isAjaxEnabled()) - return sprintf('(%s)', + return sprintf('(%s)', $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('(%s)', + return sprintf('(%s)', htmlspecialchars($href),_('Modify members for'),$this->template->getDN(), htmlspecialchars($href),_('Modify group membership'), _('modify group members')); diff --git a/lib/functions.php b/lib/functions.php index 3bcbc63..198f0b0 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -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('%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('%s',IMGDIR,_('Show Cache'))), ); diff --git a/lib/page.php b/lib/page.php index 22da741..01eeeb5 100644 --- a/lib/page.php +++ b/lib/page.php @@ -113,19 +113,15 @@ class page { else printf('%s - %s',$this->_app['title'],app_version()); + echo ''; # Style sheet. printf('',$this->_app['urlcss']); - echo ''; if (defined('JSDIR')) { printf('',JSDIR); - printf('',JSDIR); echo "\n"; - printf('',JSDIR); - printf('',JSDIR); - printf('',JSDIR); - printf('',JSDIR); - printf('',JSDIR); + printf('',JSDIR); + printf('',JSDIR); echo "\n"; }