diff --git a/src/messenger/webim/default.css b/src/messenger/webim/default.css index a8ea9231..3e23db28 100644 --- a/src/messenger/webim/default.css +++ b/src/messenger/webim/default.css @@ -213,11 +213,18 @@ img.left { text-decoration: none; } +.submenu a.inner { padding-left: 0px; } +.submenu span.small { font-size: 80%; padding-left: 5px; } + .submenu .active a { background: url(images/li.gif) no-repeat left 1px; color: #555; } +.submenu .active a.inner { + background: none; +} + .submenu a:hover { text-decoration: underline; } diff --git a/src/messenger/webim/js/source/common.js b/src/messenger/webim/js/source/common.js index 4a002ad1..13422cbc 100644 --- a/src/messenger/webim/js/source/common.js +++ b/src/messenger/webim/js/source/common.js @@ -12,7 +12,7 @@ //- onComplete, obj, params, $apply$ //- threadParams, servl, frequency, user, threadid, token -//- updaterOptions, url, company, agentservl, noclients, wroot +//- updaterOptions, url, company, agentservl, noclients, wroot, havemenu var Class = { diff --git a/src/messenger/webim/js/source/users.js b/src/messenger/webim/js/source/users.js index c0539941..cbc759f2 100644 --- a/src/messenger/webim/js/source/users.js +++ b/src/messenger/webim/js/source/users.js @@ -332,5 +332,7 @@ var webimRoot = ""; EventHelper.register(window, 'onload', function(){ webimRoot = updaterOptions.wroot; new Ajax.ThreadListUpdater(({table:$("threadlist"),status:$("connstatus")}).extend(updaterOptions || {})); - togglemenu(); + if(!updaterOptions.havemenu) { + togglemenu(); + } }); diff --git a/src/messenger/webim/js/users.js b/src/messenger/webim/js/users.js index 21561f41..997340b9 100644 --- a/src/messenger/webim/js/users.js +++ b/src/messenger/webim/js/users.js @@ -1 +1 @@ -sq.hi=mn.nn();mn.sn(sq.hi,sq.lq,{qn:function(pq){this.oq(pq);this.pq.onComplete=this.et.on(this);this.pq.jr=this.ft.on(this);this.pq.hr=this._q.on(this);this.pq.timeout=(3363+1637);this.frequency=(this.pq.frequency||2);this.gt={} ;this.$t();} ,ft:function(_t,mu){if(this.pq.lu)this.pq.lu("offline, reconnecting");this.qu();this.ru=setTimeout(this.$t.on(this),01750);} ,_q:function(_t){if(this.pq.lu)this.pq.lu("timeout, reconnecting");this.qu();this.ru=setTimeout(this.$t.on(this),(818+182));} ,qu:function(){if(this.gt.pq)this.gt.pq.onComplete=undefined;clearTimeout(this.ru);} ,$t:function(){if(this.pq.ii)this.pq.fq=(this.pq.ii)();this.gt=new sq.vq(this.pq.url,this.pq);} ,et:function(eu){try{var ju=sq.uq(eu);if(ju){(this.pq.ku||sq.kq)(ju);} else{if(this.pq.lu)this.pq.lu("reconnecting");} } catch(e){} this.ru=setTimeout(this.$t.on(this),this.frequency*(616+384));} } );var ji={ki:function(link,title,li,oi,width,height,pi){return'<a href="'+link+'"'+(pi!=null?' class="'+pi+'"':'')+' target="_blank" title="'+title+'" onclick="this.newWindow = window.open(\''+link+'\', \''+li+'\', \'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width='+width+',height='+height+',resizable=1\');this.newWindow.focus();this.newWindow.opener=window;return false;">'+oi+'</a>';} ,di:function(content){return'<table class="inner"><tr>'+content+'</tr></table>';} ,ei:function(fi,gi,id,ai,bi,ci,xt,vi){var wi=2;var link=gi+"?thread="+id;var xi='<td>';if(bi||ai){xi+=ji.ki((vi||!ai)?link:link+"&viewonly=true",localized[bi?0:1],"ImCenter"+id,fi,(475+165),0740,null);} else{xi+='<a href="#">'+fi+'</a>';} xi+='</td>';if(bi){xi+='<td class="icon">';xi+=ji.ki(link,localized[0],"ImCenter"+id,'<img src="'+ht+'/images/tbliclspeak.gif" width="15" height="15" border="0" alt="'+localized[0]+'">',(471+169),0x1e0,null);xi+='</td>';wi++;} if(ai){xi+='<td class="icon">';xi+=ji.ki(link+"&viewonly=true",localized[1],"ImCenter"+id,'<img src="'+ht+'/images/tbliclread.gif" width="15" height="15" border="0" alt="'+localized[1]+'">',(520+120),(382+98),null);xi+='</td>';wi++;} if(xt!=""){xi+='</tr><tr><td class="firstmessage" colspan="'+wi+'"><a href="javascript:void(0)" title="'+xt+'" onclick="alert(this.title);return false;">';xi+=xt.length>0x1e?xt.substring(0,(28+2))+'...':xt;xi+='</a></td>';} return ji.di(xi);} ,yi:function(id,zi){return'<td class="icon">'+ji.ki(ht+'/operator/ban.php?'+(zi?'id='+zi:'thread='+id),localized[2],"ban"+id,'<img src="'+ht+'/images/ban.gif" width="15" height="15" border="0" alt="'+localized[2]+'">',(534+186),0x1e0,null)+'</td>';} } ;sq.$i=mn.nn();mn.sn(sq.$i,sq.lq,{qn:function(pq){this.oq(pq);this.pq.ii=this.ii.on(this);this.pq.lu=this.lu.on(this);this.pq.ku=this.ku.on(this);this.pq._i=0;this.mj=new Object();this.nj=0;this.t=this.pq.qj;this.rj=new sq.hi(this.pq);} ,ii:function(){return"company="+this.pq.company+"&since="+this.pq._i;} ,nu:function(pu){this.pq.status.innerHTML=pu;} ,lu:function(s){this.nu(s);} ,sj:function(uh){var id,tj,uj,ai=false,bi=false,hj=false,ci=null,zi=null;for(var i=0;i<uh.attributes.length;i++){var ij=uh.attributes[i];if(ij.nodeName=="id")id=ij.nodeValue;else if(ij.nodeName=="stateid")tj=ij.nodeValue;else if(ij.nodeName=="state")uj=ij.nodeValue;else if(ij.nodeName=="canopen")bi=true;else if(ij.nodeName=="canview")ai=true;else if(ij.nodeName=="canban")hj=true;else if(ij.nodeName=="ban")ci=ij.nodeValue;else if(ij.nodeName=="banid")zi=ij.nodeValue;} function jj(ds,kj,id,lj){var ws=ls.fs(id,kj,ds);if(ws)ws.innerHTML=lj;} var kj=ls.os("thr"+id,this.t);if(tj=="closed"){if(kj){this.t.deleteRow(kj.rowIndex);} this.mj[id]=null;return;} var oj=qs.rs(uh,"name");var pj=qs.rs(uh,"addr");var dj=qs.rs(uh,"time");var ej=qs.rs(uh,"agent");var fj=qs.rs(uh,"modified");var xt=qs.rs(uh,"message");var gj='<td>'+qs.rs(uh,"useragent")+'</td>';if(ci!=null){gj='<td>'+qs.rs(uh,"reason")+'</td>';} if(hj){gj+=ji.yi(id,zi);} gj=ji.di(gj);var aj=ls.os("t"+tj,this.t);var bj=ls.os("t"+tj+"end",this.t);if(kj!=null&&(kj.rowIndex<=aj.rowIndex||kj.rowIndex>=bj.rowIndex)){this.t.deleteRow(kj.rowIndex);this.mj[id]=null;kj=null;} if(kj==null){kj=this.t.insertRow(aj.rowIndex+1);kj.className=(ci=="blocked"&&tj!="chat")?"ban":"in"+tj;kj.id="thr"+id;this.mj[id]=new Array(dj,fj,tj);ls.insertCell(kj,"name","visitor",null,null,ji.ei(oj,this.pq.agentservl,id,ai,bi,ci,xt,tj!='chat'));ls.insertCell(kj,"contid","visitor","center",null,pj);ls.insertCell(kj,"state","visitor","center",null,uj);ls.insertCell(kj,"op","visitor","center",null,ej);ls.insertCell(kj,"time","visitor","center",null,this.cj(dj));ls.insertCell(kj,"wait","visitor","center",null,(tj!='chat'?this.cj(fj):'-'));ls.insertCell(kj,"etc","visitor","center",null,gj);if(tj=='wait'||tj=='prio')return true;} else{this.mj[id]=new Array(dj,fj,tj);kj.className=(ci=="blocked"&&tj!="chat")?"ban":"in"+tj;jj(this.t,kj,"name",ji.ei(oj,this.pq.agentservl,id,ai,bi,ci,xt,tj!='chat'));jj(this.t,kj,"contid",pj);jj(this.t,kj,"state",uj);jj(this.t,kj,"op",ej);jj(this.t,kj,"time",this.cj(dj));jj(this.t,kj,"wait",(tj!='chat'?this.cj(fj):'-'));jj(this.t,kj,"etc",gj);} return false;} ,vj:function(){function wj(t,id){var aj=$(id);var bj=$(id+"end");if(aj==null||bj==null){return false;} return aj.rowIndex+1<bj.rowIndex;} var xj=$("statustd");if(xj){var yj=wj(this.t,"twait")||wj(this.t,"tprio")||wj(this.t,"tchat");xj.innerHTML=yj?"":this.pq.noclients;xj.height=yj?(4+1):(25+5);} } ,cj:function(zj){var $j=Math.floor(((new Date()).getTime()-zj-this.nj)/(642+358));var _j=Math.floor($j/074);var mk="";$j=$j%(49+11);if($j<012)$j="0"+$j;if(_j>=0x3c){var nk=Math.floor(_j/(40+20));_j=_j%(40+20);if(_j<012)_j="0"+_j;mk=nk+":";} return mk+_j+":"+$j;} ,qk:function(){for(var i in this.mj){if(this.mj[i]!=null){var value=this.mj[i];var kj=ls.os("thr"+i,this.t);if(kj!=null){function jj(ds,kj,id,lj){var ws=ls.fs(id,kj,ds);if(ws)ws.innerHTML=lj;} jj(this.t,kj,"time",this.cj(value[0]));jj(this.t,kj,"wait",(value[2]!='chat'?this.cj(value[1]):'-'));} } } } ,ku:function(rk){var sk=false;if(rk.tagName=='threads'){var tk=qs.ks(rk,"time");var uk=qs.ks(rk,"revision");if(tk)this.nj=(new Date()).getTime()-tk;if(uk)this.pq._i=uk;for(var i=0;i<rk.childNodes.length;i++){var uh=rk.childNodes[i];if(uh.tagName=='thread')if(this.sj(uh))sk=true;} this.vj();this.qk();this.nu("Up to date");if(sk){$s(ht+'/sounds/new_user.wav');window.focus();} } else if(rk.tagName=='error'){this.nu(qs.rs(rk,"descr"));} else{this.nu("reconnecting");} } } );function hk(){if($("sidebar")&&$("wcontent")&&$("togglemenu")){if($("wcontent").className=="contentnomenu"){$("sidebar").style.display="block";$("wcontent").className="contentinner";$("togglemenu").innerHTML=localized[(3+1)];} else{$("sidebar").style.display="none";$("wcontent").className="contentnomenu";$("togglemenu").innerHTML=localized[3];} } } er.lr({'#togglemenu':function(ti){ti.onclick=function(){hk();} ;} } );var ht="";kr.lr(window,'onload',function(){ht=updaterOptions.wroot;new sq.$i(({qj:$("threadlist"),status:$("connstatus")} ).un(updaterOptions||{} ));hk();} ); \ No newline at end of file +sq.hi=mn.nn();mn.sn(sq.hi,sq.lq,{qn:function(pq){this.oq(pq);this.pq.onComplete=this.et.on(this);this.pq.jr=this.ft.on(this);this.pq.hr=this._q.on(this);this.pq.timeout=(3363+1637);this.frequency=(this.pq.frequency||2);this.gt={} ;this.$t();} ,ft:function(_t,mu){if(this.pq.lu)this.pq.lu("offline, reconnecting");this.qu();this.ru=setTimeout(this.$t.on(this),01750);} ,_q:function(_t){if(this.pq.lu)this.pq.lu("timeout, reconnecting");this.qu();this.ru=setTimeout(this.$t.on(this),(818+182));} ,qu:function(){if(this.gt.pq)this.gt.pq.onComplete=undefined;clearTimeout(this.ru);} ,$t:function(){if(this.pq.ii)this.pq.fq=(this.pq.ii)();this.gt=new sq.vq(this.pq.url,this.pq);} ,et:function(eu){try{var ju=sq.uq(eu);if(ju){(this.pq.ku||sq.kq)(ju);} else{if(this.pq.lu)this.pq.lu("reconnecting");} } catch(e){} this.ru=setTimeout(this.$t.on(this),this.frequency*(616+384));} } );var ji={ki:function(link,title,li,oi,width,height,pi){return'<a href="'+link+'"'+(pi!=null?' class="'+pi+'"':'')+' target="_blank" title="'+title+'" onclick="this.newWindow = window.open(\''+link+'\', \''+li+'\', \'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width='+width+',height='+height+',resizable=1\');this.newWindow.focus();this.newWindow.opener=window;return false;">'+oi+'</a>';} ,di:function(content){return'<table class="inner"><tr>'+content+'</tr></table>';} ,ei:function(fi,gi,id,ai,bi,ci,xt,vi){var wi=2;var link=gi+"?thread="+id;var xi='<td>';if(bi||ai){xi+=ji.ki((vi||!ai)?link:link+"&viewonly=true",localized[bi?0:1],"ImCenter"+id,fi,(475+165),0740,null);} else{xi+='<a href="#">'+fi+'</a>';} xi+='</td>';if(bi){xi+='<td class="icon">';xi+=ji.ki(link,localized[0],"ImCenter"+id,'<img src="'+ht+'/images/tbliclspeak.gif" width="15" height="15" border="0" alt="'+localized[0]+'">',(471+169),0x1e0,null);xi+='</td>';wi++;} if(ai){xi+='<td class="icon">';xi+=ji.ki(link+"&viewonly=true",localized[1],"ImCenter"+id,'<img src="'+ht+'/images/tbliclread.gif" width="15" height="15" border="0" alt="'+localized[1]+'">',(520+120),(382+98),null);xi+='</td>';wi++;} if(xt!=""){xi+='</tr><tr><td class="firstmessage" colspan="'+wi+'"><a href="javascript:void(0)" title="'+xt+'" onclick="alert(this.title);return false;">';xi+=xt.length>0x1e?xt.substring(0,(28+2))+'...':xt;xi+='</a></td>';} return ji.di(xi);} ,yi:function(id,zi){return'<td class="icon">'+ji.ki(ht+'/operator/ban.php?'+(zi?'id='+zi:'thread='+id),localized[2],"ban"+id,'<img src="'+ht+'/images/ban.gif" width="15" height="15" border="0" alt="'+localized[2]+'">',(534+186),0x1e0,null)+'</td>';} } ;sq.$i=mn.nn();mn.sn(sq.$i,sq.lq,{qn:function(pq){this.oq(pq);this.pq.ii=this.ii.on(this);this.pq.lu=this.lu.on(this);this.pq.ku=this.ku.on(this);this.pq._i=0;this.mj=new Object();this.nj=0;this.t=this.pq.qj;this.rj=new sq.hi(this.pq);} ,ii:function(){return"company="+this.pq.company+"&since="+this.pq._i;} ,nu:function(pu){this.pq.status.innerHTML=pu;} ,lu:function(s){this.nu(s);} ,sj:function(uh){var id,tj,uj,ai=false,bi=false,hj=false,ci=null,zi=null;for(var i=0;i<uh.attributes.length;i++){var ij=uh.attributes[i];if(ij.nodeName=="id")id=ij.nodeValue;else if(ij.nodeName=="stateid")tj=ij.nodeValue;else if(ij.nodeName=="state")uj=ij.nodeValue;else if(ij.nodeName=="canopen")bi=true;else if(ij.nodeName=="canview")ai=true;else if(ij.nodeName=="canban")hj=true;else if(ij.nodeName=="ban")ci=ij.nodeValue;else if(ij.nodeName=="banid")zi=ij.nodeValue;} function jj(ds,kj,id,lj){var ws=ls.fs(id,kj,ds);if(ws)ws.innerHTML=lj;} var kj=ls.os("thr"+id,this.t);if(tj=="closed"){if(kj){this.t.deleteRow(kj.rowIndex);} this.mj[id]=null;return;} var oj=qs.rs(uh,"name");var pj=qs.rs(uh,"addr");var dj=qs.rs(uh,"time");var ej=qs.rs(uh,"agent");var fj=qs.rs(uh,"modified");var xt=qs.rs(uh,"message");var gj='<td>'+qs.rs(uh,"useragent")+'</td>';if(ci!=null){gj='<td>'+qs.rs(uh,"reason")+'</td>';} if(hj){gj+=ji.yi(id,zi);} gj=ji.di(gj);var aj=ls.os("t"+tj,this.t);var bj=ls.os("t"+tj+"end",this.t);if(kj!=null&&(kj.rowIndex<=aj.rowIndex||kj.rowIndex>=bj.rowIndex)){this.t.deleteRow(kj.rowIndex);this.mj[id]=null;kj=null;} if(kj==null){kj=this.t.insertRow(aj.rowIndex+1);kj.className=(ci=="blocked"&&tj!="chat")?"ban":"in"+tj;kj.id="thr"+id;this.mj[id]=new Array(dj,fj,tj);ls.insertCell(kj,"name","visitor",null,null,ji.ei(oj,this.pq.agentservl,id,ai,bi,ci,xt,tj!='chat'));ls.insertCell(kj,"contid","visitor","center",null,pj);ls.insertCell(kj,"state","visitor","center",null,uj);ls.insertCell(kj,"op","visitor","center",null,ej);ls.insertCell(kj,"time","visitor","center",null,this.cj(dj));ls.insertCell(kj,"wait","visitor","center",null,(tj!='chat'?this.cj(fj):'-'));ls.insertCell(kj,"etc","visitor","center",null,gj);if(tj=='wait'||tj=='prio')return true;} else{this.mj[id]=new Array(dj,fj,tj);kj.className=(ci=="blocked"&&tj!="chat")?"ban":"in"+tj;jj(this.t,kj,"name",ji.ei(oj,this.pq.agentservl,id,ai,bi,ci,xt,tj!='chat'));jj(this.t,kj,"contid",pj);jj(this.t,kj,"state",uj);jj(this.t,kj,"op",ej);jj(this.t,kj,"time",this.cj(dj));jj(this.t,kj,"wait",(tj!='chat'?this.cj(fj):'-'));jj(this.t,kj,"etc",gj);} return false;} ,vj:function(){function wj(t,id){var aj=$(id);var bj=$(id+"end");if(aj==null||bj==null){return false;} return aj.rowIndex+1<bj.rowIndex;} var xj=$("statustd");if(xj){var yj=wj(this.t,"twait")||wj(this.t,"tprio")||wj(this.t,"tchat");xj.innerHTML=yj?"":this.pq.noclients;xj.height=yj?(4+1):(25+5);} } ,cj:function(zj){var $j=Math.floor(((new Date()).getTime()-zj-this.nj)/(642+358));var _j=Math.floor($j/074);var mk="";$j=$j%(49+11);if($j<012)$j="0"+$j;if(_j>=0x3c){var nk=Math.floor(_j/(40+20));_j=_j%(40+20);if(_j<012)_j="0"+_j;mk=nk+":";} return mk+_j+":"+$j;} ,qk:function(){for(var i in this.mj){if(this.mj[i]!=null){var value=this.mj[i];var kj=ls.os("thr"+i,this.t);if(kj!=null){function jj(ds,kj,id,lj){var ws=ls.fs(id,kj,ds);if(ws)ws.innerHTML=lj;} jj(this.t,kj,"time",this.cj(value[0]));jj(this.t,kj,"wait",(value[2]!='chat'?this.cj(value[1]):'-'));} } } } ,ku:function(rk){var sk=false;if(rk.tagName=='threads'){var tk=qs.ks(rk,"time");var uk=qs.ks(rk,"revision");if(tk)this.nj=(new Date()).getTime()-tk;if(uk)this.pq._i=uk;for(var i=0;i<rk.childNodes.length;i++){var uh=rk.childNodes[i];if(uh.tagName=='thread')if(this.sj(uh))sk=true;} this.vj();this.qk();this.nu("Up to date");if(sk){$s(ht+'/sounds/new_user.wav');window.focus();} } else if(rk.tagName=='error'){this.nu(qs.rs(rk,"descr"));} else{this.nu("reconnecting");} } } );function hk(){if($("sidebar")&&$("wcontent")&&$("togglemenu")){if($("wcontent").className=="contentnomenu"){$("sidebar").style.display="block";$("wcontent").className="contentinner";$("togglemenu").innerHTML=localized[(3+1)];} else{$("sidebar").style.display="none";$("wcontent").className="contentnomenu";$("togglemenu").innerHTML=localized[3];} } } er.lr({'#togglemenu':function(ti){ti.onclick=function(){hk();} ;} } );var ht="";kr.lr(window,'onload',function(){ht=updaterOptions.wroot;new sq.$i(({qj:$("threadlist"),status:$("connstatus")} ).un(updaterOptions||{} ));if(!updaterOptions.havemenu){hk();} } ); \ No newline at end of file diff --git a/src/messenger/webim/locales/en/properties b/src/messenger/webim/locales/en/properties index 5dee9356..7b998c8c 100644 --- a/src/messenger/webim/locales/en/properties +++ b/src/messenger/webim/locales/en/properties @@ -362,6 +362,7 @@ topMenu.admin=Home topMenu.logoff=Exit topMenu.main=Home topMenu.users=Visitors +topMenu.users.nomenu=without menu translate.direction=Direction: translate.show.all=All strings translate.show.foradmin=Strings for administrator diff --git a/src/messenger/webim/operator/users.php b/src/messenger/webim/operator/users.php index cd869324..9a0940a8 100644 --- a/src/messenger/webim/operator/users.php +++ b/src/messenger/webim/operator/users.php @@ -20,6 +20,7 @@ $operator = check_login(); notify_operator_alive($operator['operatorid']); $page = array(); +$page['havemenu'] = isset($_GET['nomenu']) ? "0" : "1"; prepare_menu($operator); start_html_output(); diff --git a/src/messenger/webim/view/inc_menu.php b/src/messenger/webim/view/inc_menu.php index a5ef1fed..028415ef 100644 --- a/src/messenger/webim/view/inc_menu.php +++ b/src/messenger/webim/view/inc_menu.php @@ -13,7 +13,7 @@ function tpl_menu() { global $page, $webimroot, $errors; <h2><?php echo getlocal('right.main') ?></h2> <ul class="submenu"> <li<?php menuli("main")?>><a href='<?php echo $webimroot ?>/operator/index.php'><?php echo getlocal('topMenu.main') ?></a></li> - <li<?php menuli("users")?>><a href='<?php echo $webimroot ?>/operator/users.php'><?php echo getlocal('topMenu.users') ?></a></li> + <li<?php menuli("users")?>><a href='<?php echo $webimroot ?>/operator/users.php'><?php echo getlocal('topMenu.users') ?></a> <span class="small">(<a class="inner" href='<?php echo $webimroot ?>/operator/users.php?nomenu'><?php echo getlocal('topMenu.users.nomenu') ?></a>)</span></li> <li<?php menuli("history")?>><a href='<?php echo $webimroot ?>/operator/history.php'><?php echo getlocal('page_analysis.search.title') ?></a></li> <?php if(isset($page['showstat']) && $page['showstat']) { ?> <li<?php menuli("statistics")?>><a href='<?php echo $webimroot ?>/operator/statistics.php'><?php echo getlocal('statistics.title') ?></a></li> diff --git a/src/messenger/webim/view/pending_users.php b/src/messenger/webim/view/pending_users.php index 06ca94b4..44551af8 100644 --- a/src/messenger/webim/view/pending_users.php +++ b/src/messenger/webim/view/pending_users.php @@ -31,7 +31,7 @@ var localized = new Array( var updaterOptions = { url:"<?php echo $webimroot ?>/operator/update.php",wroot:"<?php echo $webimroot ?>", agentservl:"<?php echo $webimroot ?>/operator/agent.php", - noclients:"<?php echo getlocal("clients.no_clients") ?>" }; + noclients:"<?php echo getlocal("clients.no_clients") ?>", havemenu: <?php echo $page['havemenu'] ?>, }; //--></script> <script type="text/javascript" language="javascript" src="<?php echo $webimroot ?>/js/users.js?v=160a1"></script> <?php