[Weberp-svn] SF.net SVN: weberp:[9434] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2012-07-17 21:30:44
|
Revision: 9434 http://weberp.svn.sourceforge.net/weberp/?rev=9434&view=rev Author: tim_schofield Date: 2012-07-17 21:30:37 +0000 (Tue, 17 Jul 2012) Log Message: ----------- Turn the menu into a pop up window Modified Paths: -------------- trunk/css/silverwolf/sub.css trunk/includes/MiscFunctions.php trunk/includes/footer.inc trunk/includes/header.inc trunk/includes/session.inc trunk/index.php trunk/javascripts/FormFunctions.js trunk/javascripts/script.js Modified: trunk/css/silverwolf/sub.css =================================================================== --- trunk/css/silverwolf/sub.css 2012-07-17 07:38:02 UTC (rev 9433) +++ trunk/css/silverwolf/sub.css 2012-07-17 21:30:37 UTC (rev 9434) @@ -11,13 +11,13 @@ left: 0px; background: black; opacity: 0.4; - z-index: 1; + z-index: 2; } div.unmask { position: absolute; display: none; - z-index: 1; + z-index: 2; } div.inputbox { @@ -33,10 +33,32 @@ background: #000000; color: #FFFFFF; opacity: 0.95; - z-index: 2; + z-index: 3; overflow:auto; } +div.menubox { + font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif; + font-size:10px; + border-radius: 7px; + position: absolute; + display: none; + top: 10%; + right: 30%; + bottom: 40%; + left: 10%; + background: #E7E6FF; + border: solid #A49999 1px; + border-radius: 5px; + -moz-box-shadow: 5px 5px 5px #B1B1B1; + -webkit-box-shadow: 5px 5px 5px #B1B1B1; + box-shadow: 5px 5px 5px #B1B1B1; + color: #000000; + opacity: 0.95; + z-index: 1; + overflow:auto; +} + div.helpbox { font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif; font-size:12px; @@ -184,7 +206,7 @@ border-radius: 10px; width: 95%; text-align: center; - margin: 0 auto; + margin: 0 auto; } div.warn { @@ -194,7 +216,7 @@ border-radius: 10px; width: 95%; text-align: center; - margin: 0 auto; + margin: 0 auto; } div.success { @@ -204,7 +226,7 @@ border-radius: 10px; width: 95%; text-align: center; - margin: 0 auto; + margin: 0 auto; } div.info { @@ -213,86 +235,57 @@ border: 1px solid navy; width: 95%; text-align: center; - margin: 0 auto; + margin: 0 auto; } -ul.menu { - list-style:none; - margin:0; - padding-top:10px; - opacity:0.9; -} - -ul.menu * { - margin:0; - padding:0; -} - -ul.menu a { - display:block; - color:#000; - text-decoration:none; -} - -ul.menu li { - position:relative; +#vtab0 { + width:12%; float:left; - margin-right:2px; + padding-left:1px; + padding-top:1px; } -ul.menu ul { - position:absolute; - top:26px; - left:0; - background:#d1d1d1; - display:none; - opacity:0.9; +#vtab0 li { list-style:none; + border-left:1px solid #6D6D6D; + border-top:1px solid #6D6D6D; + border-bottom:1px solid #6D6D6D; + border-top-left-radius: 5px; + border-bottom-left-radius: 5px; + padding: 3px; + margin-bottom: 1px; + font-weight:normal; + background: #B8B3B3; + cursor: pointer; } -ul.menu ul li { - position:relative; - border:1px solid #aaa; - border-top:none; - width:248px; - margin:0; +#vtab0 li:hover { + background-color:#A7A7A7; } -ul.menu ul li a { - display:block; - padding:3px 7px 5px; - background-color:#d1d1d1; +#tabContent { + border:1px solid #6D6D6D; + border-top-right-radius: 5px; + border-bottom-right-radius: 5px; + height: 98%; + margin-top: 1px; + margin-right: 1px; + margin-left: 12%; + background: #EBFFE3; } -ul.menu ul li a:hover { - background-color:#c5c5c5; +div.vtInfo { + display:none; + height:98%; + overflow:auto; } -ul.menu ul ul { - left:248px; - top:-1px; +div.content { + border: #48f solid 3px; + clear: left; + padding: 1em; } -ul.menu .menulink { - border:1px solid #aaa; - padding:5px 7px 7px; - font-weight:bold; - background:#d1d1d1; - width:234px; -} - -ul.menu .menulink:hover, ul.menu .menuhover { - background:#d1d1d1; -} - -ul.menu .sub { - background:#d1d1d1 236px 8px no-repeat; -} - -ul.menu .topline { - border-top:1px solid #aaa; -} - table { margin: 0 auto; } @@ -354,7 +347,9 @@ th.header { font-weight: normal; background: #90979B; - text-shadow: 1px 1px #646464; + background: -moz-linear-gradient(left, #EEE7E7, #324D5D); + background: -webkit-linear-gradient(left, #EEE7E7, #324D5D); + text-shadow: 1px 1px #324D5D; border: solid #A49999 1px; border-radius: 5px; font-size: 16px; @@ -382,6 +377,38 @@ text-align: right; } +button.menuButton { + margin-top: 10px; + border: 1px solid #ffffff; + background: #000000; + padding: 10px 10px; + width: 10%; + -webkit-border-radius: 26px; + -moz-border-radius: 26px; + border-radius: 26px; + color: #ffffff; + font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "Geneva", "Verdana", "sans-serif"; + font-size: 10px; + vertical-align: middle; + cursor: hand; +} + +button.menuButton:hover { + margin-top: 10px; + border: 1px solid #ffffff; + background: #0000B6; + padding: 10px 10px; + width: 10%; + -webkit-border-radius: 26px; + -moz-border-radius: 26px; + border-radius: 26px; + color: #ffffff; + font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "Geneva", "Verdana", "sans-serif"; + font-size: 10px; + vertical-align: middle; + cursor: hand; +} + button { border: 1px solid #ffffff; background: transparent; @@ -556,4 +583,19 @@ img.ButtonIcon { width: 14px; -} \ No newline at end of file +} + +* {padding:0; margin:0} +#wrapper {width:750px; padding:25px; margin:0 auto} +#leftcolumn {float:left; width:25px; padding:10px;} +.dropdown {display:block; position:relative} +.dropdown dt {width:90px; border:2px solid #9ac1c9; padding:4px; font-weight:bold; cursor:pointer; background:url(images/header.gif)} +.dropdown .upperdd {border-bottom:none} +.dropdown .bottomdd {border-top:2px solid #9ac1c9;border-bottom:none;border-left:none;border-right:none} +.dropdown dt:hover {background:url(images/header_over.gif)} +.dropdown dd {position:absolute; top:0; overflow:hidden; width:310px; display:none; background:#fff; opacity:0} +.dropdown ul {width:306px; border:2px solid #9ac1c9; list-style:none} +.dropdown li {display:inline} +.dropdown a, .dropdown a:active, .dropdown a:visited {display:block; padding:2px; color:#333; text-decoration:none; background:#eaf0f2; width:302px} +.dropdown a:hover {background:#d9e1e4; color:#000} +.dropdown .underline {border-bottom:1px solid #b9d6dc;z-index:5} \ No newline at end of file Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2012-07-17 07:38:02 UTC (rev 9433) +++ trunk/includes/MiscFunctions.php 2012-07-17 21:30:37 UTC (rev 9434) @@ -330,10 +330,15 @@ if ($Title=='') { $Title = $Caption; } + $Script=basename($Script); $PathArray = explode('?', $Script); $PageSecurity = $_SESSION['PageSecurityArray'][$PathArray[0]]; if ((in_array($PageSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PageSecurity))) { - return '<a class="' . $Class . '" onclick="return OpenSubWindow(\'' . $Script.'\')" href="" title="' . $Title . '">' . $Caption . '</a>'; + if ($Class=='') { + return '<a onclick="return OpenSubWindow(\'' . $Script.'\');" href="" title="' . $Title . '">' . $Caption . '</a>'; + } else { + return '<a class="' . $Class . '" onclick="return OpenSubWindow(\'' . $Script.'\');" href="" title="' . $Title . '">' . $Caption . '</a>'; + } } } Modified: trunk/includes/footer.inc =================================================================== --- trunk/includes/footer.inc 2012-07-17 07:38:02 UTC (rev 9433) +++ trunk/includes/footer.inc 2012-07-17 21:30:37 UTC (rev 9434) @@ -27,14 +27,23 @@ echo '<br /><div style="text-align: right"><button class="dialog_button" type="submit" onclick="CloseDialog()">' . _('OK') . '</button></div>'; echo '</div>'; } -$URLArray=explode('/', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8')); -$GetData=''; + +if (isset($_SESSION['CurrentPage'])) { + array_push($_SESSION['History'], $_SESSION['CurrentPage']); +} + +if (isset($_GET['Back'])) { + $Discard=array_pop($_SESSION['History']); + unset($_GET['Back']); +} +unset($_SESSION['CurrentPage']); +$_SESSION['CurrentPage']=basename(htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8')); if (sizeOf($_GET)>0) { foreach ($_GET as $name=>$value) { - $GetData.='&'.$name.'='.$value; + $_SESSION['CurrentPage'].='&'.$name.'='.$value; } } -array_push($_SESSION['History'], array_pop($URLArray).'?'.$GetData); +echo $_SESSION['CurrentPage']; echo '</body>'; echo '</html>'; ?> \ No newline at end of file Modified: trunk/includes/header.inc =================================================================== --- trunk/includes/header.inc 2012-07-17 07:38:02 UTC (rev 9433) +++ trunk/includes/header.inc 2012-07-17 21:30:37 UTC (rev 9434) @@ -37,7 +37,7 @@ $DefaultManualLink = $rootpath . '/doc/Manual/ManualContents.php'. $ViewTopic . $BookMark; -if (mb_substr($_SESSION['Language'],0,2) !='en'){ +if (mb_substr($_SESSION['Language'],0,2) !='en' and file_exists('locale/' . $_SESSION['Language'] . '/Manual/ManualContents.php')){ $DeafaulManualLink='locale/' . $_SESSION['Language'] . '/Manual/ManualContents.php'; } @@ -45,9 +45,18 @@ echo $ProjectName . ' - ' . $title; echo '<div onClick="CloseSubWindow()" class="exit" title="Close this form">X</div>'; echo '<div onClick="OpenHelpWindow(\''.$DefaultManualLink.'\'); " class="exit" title="Show help for this function">?</div>'; -if (sizeOf($_SESSION['History'])>0) { - echo '<div class="exit">'.InternalLink('',$_SESSION['History'][sizeOf($_SESSION['History'])-1], html_entity_decode('<'), 'BackButton', _('Return to previous page')) . '</div>'; +if (isset($_SESSION['History']) and sizeOf($_SESSION['History'])>0) { + if (strstr($_SESSION['History'][sizeOf($_SESSION['History'])-1], '?')) { + echo '<div class="exit">'.InternalLink('',$_SESSION['History'][sizeOf($_SESSION['History'])-1].'&Back=True', html_entity_decode('<'), 'BackButton', _('Return to previous page')) . '</div>'; + } else { + echo '<div class="exit">'.InternalLink('',$_SESSION['History'][sizeOf($_SESSION['History'])-1].'?Back=True', html_entity_decode('<'), 'BackButton', _('Return to previous page')) . '</div>'; + } } +if (isset($_SESSION['Future']) and sizeOf($_SESSION['Future'])>0) { + echo '<div class="exit">'.InternalLink('',$_SESSION['History'][sizeOf($_SESSION['History'])-1], html_entity_decode('>'), 'BackButton', _('Return to previous page')) . '</div>'; +} echo '</div>'; - +print_r($_SESSION['History']); +echo '<br />'; +print_r($_SESSION['CurrentPage']); ?> \ No newline at end of file Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2012-07-17 07:38:02 UTC (rev 9433) +++ trunk/includes/session.inc 2012-07-17 21:30:37 UTC (rev 9434) @@ -209,6 +209,7 @@ * cause name clashes) */ $_SESSION['History']=array(); + $_SESSION['Future']=array(); function findLogoFile($CompanyDir, $PathPrefix) { $dir = $PathPrefix.'companies/' . $CompanyDir . '/'; Modified: trunk/index.php =================================================================== --- trunk/index.php 2012-07-17 07:38:02 UTC (rev 9433) +++ trunk/index.php 2012-07-17 21:30:37 UTC (rev 9434) @@ -5,9 +5,53 @@ $title = $ProjectName . ' - ' . _('Main Dashboard'); include('includes/main_header.inc'); + +echo '<button onclick="showMenu(this)" class="menuButton">Show Menu</button>'; + echo '<div id="Mask"></div>'; -echo '<div id="SubWindow"></div>'; +echo '<div id="SubWindow"><div id="contents"></div></div>'; +include('includes/MainMenuLinksArray.php'); + +echo '<div id="MenuContent" class="menubox"> + <div id="vtab0">'; + +$i=1; +foreach ($ModuleList as $Module) { + echo '<li id="1vtab1" class="MenuTab" onclick="showTab(\'vtab'.$i.'\', this)">' . $Module . '</li>'; + $i++; +} +echo '</div>'; + +echo '<div id="tabContent">'; +$i=1; +foreach ($ModuleLink as $Module) { + echo '<div id="vtab'.$i.'" class="vtInfo">'; + echo '<div id="leftcolumn"> + <dl id="dropdown'.$i.'" class="dropdown">'; + $j=1; + foreach ($MenuItems[$Module] as $name=>$value) { + echo '<dt id="'.$Module.$j.'-ddheader" class="upperdd" onmouseover="ddMenu(\''.$Module.$j.'\',1)" onmouseout="ddMenu(\''.$Module.$j.'\',-1)">' . $name . '</dt> + <dd id="'.$Module.$j.'-ddcontent" onmouseover="cancelHide(\''.$Module.$j.'\')" onmouseout="ddMenu(\''.$Module.$j.'\',-1)"> + <ul>'; + $k=0; + foreach ($MenuItems[$Module][$name]['Caption'] as $Caption) { + echo '<li>' . InternalLink('', $MenuItems[$Module][$name]['URL'][$k], $Caption, 'underline') . '</li>'; + $k++; + } + echo '</ul> + </dd>'; + $j++; + } + echo '<dt class="bottomdd"></dt>'; + echo '</dl> + </div>'; + echo '</div>'; + $i++; +} + +echo '</div></div>'; + echo '<table width="100%"><tr><td>'; include('dashboard/CompanyInfo.php'); echo '</td><td>'; Modified: trunk/javascripts/FormFunctions.js =================================================================== --- trunk/javascripts/FormFunctions.js 2012-07-17 07:38:02 UTC (rev 9433) +++ trunk/javascripts/FormFunctions.js 2012-07-17 21:30:37 UTC (rev 9434) @@ -6,6 +6,16 @@ return false; } +function MakePageVisible(w) { + w.style.display='block'; + return false; +} + +function MakePageInVisible() { + document.getElementById("contents").style.display='none'; + return false; +} + function ChangeButtonText(button, text) { if (document.getElementById) { if (button) { @@ -53,7 +63,7 @@ return; } -function SubmitForm(FormName, Target='') { +function SubmitForm(FormName, Target) { if (Target=='') { Target=FormName.action; } @@ -79,7 +89,7 @@ return false; } -function SubmitSearchForm(FormName,Target='') { +function SubmitSearchForm(FormName,Target) { if (Target=='') { var Target=FormName.action; } @@ -107,6 +117,7 @@ function OpenSubWindow(TargetURL) { document.getElementById("Mask").setAttribute("class", "mask"); document.getElementById("SubWindow").setAttribute("class", "inputbox"); +// ExpandWindow(51, 51, 51, 51, 1, 1, 1, 1, document.getElementById("contents")); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 @@ -114,14 +125,34 @@ } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { - document.getElementById("SubWindow").innerHTML=xmlhttp.responseText; + document.getElementById("contents").innerHTML=xmlhttp.responseText; } +// MakePageInVisible(); } xmlhttp.open("GET",TargetURL,true); xmlhttp.send(); return false; } +function ExpandWindow(StartL, StartR, StartT, StartB, EndL, EndR, EndT, EndB, w) { + function Expand() { + StartL=StartL-5; + StartR=StartR-5; + StartT=StartT-5; + StartB=StartB-5; + document.getElementById("SubWindow").style.left = StartL+'%'; // pseudo-property code: Move right by 10px + document.getElementById("SubWindow").style.right = StartR+'%'; // pseudo-property code: Move right by 10px + document.getElementById("SubWindow").style.top = StartT+'%'; // pseudo-property code: Move right by 10px + document.getElementById("SubWindow").style.bottom = StartB+'%'; // pseudo-property code: Move right by 10px + if ((StartL>EndL) && (StartR>EndR) && (StartT>EndT) && (StartB>EndB)) { + setTimeout(Expand,1); // call doMove() in 20 msec + } else { + MakePageVisible(w); + } + } + Expand(); +} + function OpenSearchWindow(TargetURL, CallingURL) { document.getElementById("SearchMask").setAttribute("class", "mask"); document.getElementById("SearchWindow").setAttribute("class", "searchwindow"); @@ -166,7 +197,8 @@ function CloseSubWindow() { document.getElementById("Mask").setAttribute("class", "unmask"); - document.getElementById("SubWindow").innerHTML=""; + document.getElementById("contents").innerHTML=""; + document.getElementById("SubWindow").innerHTML="<div id=\"contents\"></div>"; document.getElementById("SubWindow").removeAttribute("class", "inputbox"); } @@ -186,4 +218,49 @@ document.getElementById("DialogMask").style.zIndex=-1; document.getElementById("messagebox").innerHTML=""; document.getElementById("messagebox").removeAttribute("class", "inputbox"); -} \ No newline at end of file +} + +function showTab(IDS, tab) { + var tabs = getElementsByClass('vtInfo',document.getElementById('tabContent'),'div'); + var alltabs = getElementsByClass('MenuTab',document.getElementById('vtab0'),'li'); + if (typeof tab !== 'object') { + tab = document.getElementById(tab); + } + for (var i=0; i<alltabs.length; i++) { + alltabs[i].style.backgroundColor = tab.style.backgroundColor; + } + for (var i=0; i<tabs.length; i++) { + tabs[i].style.display = 'none'; + } + tab.style.backgroundColor='#EBFFE3'; + document.getElementById(IDS).style.display = 'block'; +} + +function showMenu(b) { + if (b.innerHTML=='Hide Menu') { + document.getElementById("MenuContent").style.display = 'none'; + b.innerHTML = 'Show Menu'; + } else { + document.getElementById("MenuContent").style.display = 'block'; + b.innerHTML = 'Hide Menu'; + } +} + +// Following from: http://www.dustindiaz.com/getelementsbyclass/ +function getElementsByClass(searchClass,node,tag) { + var classElements = new Array(); + if ( node == null ) + node = document; + if ( tag == null ) + tag = '*'; + var els = node.getElementsByTagName(tag); + var elsLen = els.length; + var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)"); + for (i = 0, j = 0; i < elsLen; i++) { + if ( pattern.test(els[i].className) ) { + classElements[j] = els[i]; + j++; + } + } + return classElements; +} Modified: trunk/javascripts/script.js =================================================================== --- trunk/javascripts/script.js 2012-07-17 07:38:02 UTC (rev 9433) +++ trunk/javascripts/script.js 2012-07-17 21:30:37 UTC (rev 9434) @@ -1,33 +1,62 @@ -var menu=function(){ - var t=15,z=50,s=6,a; - function dd(n){this.n=n; this.h=[]; this.c=[]} - dd.prototype.init=function(p,c){ - a=c; var w=document.getElementById(p), s=w.getElementsByTagName('ul'), l=s.length, i=0; - for(i;i<l;i++){ - var h=s[i].parentNode; this.h[i]=h; this.c[i]=s[i]; - h.onmouseover=new Function(this.n+'.st('+i+',true)'); - h.onmouseout=new Function(this.n+'.st('+i+')'); - } - } - dd.prototype.st=function(x,f){ - var c=this.c[x], h=this.h[x], p=h.getElementsByTagName('a')[0]; - clearInterval(c.t); c.style.overflow='hidden'; - if(f){ - p.className+=' '+a; - if(!c.mh){c.style.display='block'; c.style.height=''; c.mh=c.offsetHeight; c.style.height=0} - if(c.mh==c.offsetHeight){c.style.overflow='visible'} - else{c.style.zIndex=z; z++; c.t=setInterval(function(){sl(c,1)},t)} - }else{p.className=p.className.replace(a,''); c.t=setInterval(function(){sl(c,-1)},t)} - } - function sl(c,f){ - var h=c.offsetHeight; - if((h<=0&&f!=1)||(h>=c.mh&&f==1)){ - if(f==1){c.style.filter=''; c.style.opacity=1; c.style.overflow='visible'} - clearInterval(c.t); return - } - var d=(f==1)?Math.ceil((c.mh-h)/s):Math.ceil(h/s), o=h/c.mh; - c.style.opacity=o; c.style.filter='alpha(opacity='+(o*100)+')'; - c.style.height=h+(d*f)+'px' - } - return{dd:dd} -}(); \ No newline at end of file +var DDSPEED = 10; +var DDTIMER = 15; +var OFFSET = -2; +var ZINT = 100; + +function ddMenu(id,d){ + var h = document.getElementById(id + '-ddheader'); + var c = document.getElementById(id + '-ddcontent'); + clearInterval(c.timer); + if(d == 1){ + clearTimeout(h.timer); + c.style.display = 'block'; + if(c.maxh && c.maxh <= c.offsetHeight){return} + else if(!c.maxh){ + c.style.left = (h.offsetWidth + OFFSET) + 'px'; + c.style.height = 'auto'; + c.maxh = c.offsetHeight; + c.style.height = '0px'; + } + ZINT = ZINT + 1; + c.style.zIndex = ZINT; + c.timer = setInterval(function(){ddSlide(c,1)},DDTIMER); + }else{ + h.timer = setTimeout(function(){ddCollapse(c)},50); + } +} + +function ddCollapse(c){ + c.timer = setInterval(function(){ddSlide(c,-1)},DDTIMER); +} + +function cancelHide(id){ + var h = document.getElementById(id + '-ddheader'); + var c = document.getElementById(id + '-ddcontent'); + clearTimeout(h.timer); + clearInterval(c.timer); + if(c.offsetHeight < c.maxh){ + c.timer = setInterval(function(){ddSlide(c,1)},DDTIMER); + } +} + +function ddSlide(c,d){ + var currh = c.offsetHeight; + var dist; + if(d == 1){ + dist = Math.round((c.maxh - currh) / DDSPEED); + }else{ + dist = Math.round(currh / DDSPEED); + } + if(dist <= 1 && d == 1){ + dist = 1; + } + c.style.height = currh + (dist * d) + 'px'; + c.style.opacity = currh / c.maxh; + c.style.filter = 'alpha(opacity=' + (currh * 100 / c.maxh) + ')'; + if(currh > (c.maxh - 2) && d == 1){ + clearInterval(c.timer); + }else if(dist < 1 && d != 1){ + clearInterval(c.timer); + c.style.display = 'none'; + } +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |