[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1752] trunk



Revision: 1752
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1752&view=rev
Author:   einhverfr
Date:     2007-10-14 10:31:23 -0700 (Sun, 14 Oct 2007)

Log Message:
-----------
Moving menus to unorderded lists.  CSS still need a few changes, but this is waiting on permission to use nice + and - graphics.

Modified Paths:
--------------
    trunk/LedgerSMB/Session/DB.pm
    trunk/LedgerSMB.pm
    trunk/UI/login.js
    trunk/UI/menu/expanding.css
    trunk/UI/menu/expanding.html
    trunk/scripts/login.pl
    trunk/scripts/menu.pl

Modified: trunk/LedgerSMB/Session/DB.pm
===================================================================
--- trunk/LedgerSMB/Session/DB.pm	2007-10-12 19:24:24 UTC (rev 1751)
+++ trunk/LedgerSMB/Session/DB.pm	2007-10-14 17:31:23 UTC (rev 1752)
@@ -34,12 +34,13 @@
 sub session_check {
     use Time::HiRes qw(gettimeofday);
     my ( $cookie, $form ) = @_;
+    print STFERR "Checking Session\n";
 
-
     my $path = ($ENV{SCRIPT_NAME});
     $path =~ s|[^/]*$||;
 
    if ($cookie eq 'Login'){
+        print STDERR "creating session\n";
         return session_create($form);
     }
     my $timeout;
@@ -179,7 +180,6 @@
     if ( !$lsmb->{timeout} ) {
         $lsmb->{timeout} = 86400;
     }
-    print STDERR "Breakpoint\n";
     $deleteExisting->execute( $login)
       || $lsmb->dberror(
         __FILE__ . ':' . __LINE__ . ': Delete from session: ' );

Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm	2007-10-12 19:24:24 UTC (rev 1751)
+++ trunk/LedgerSMB.pm	2007-10-14 17:31:23 UTC (rev 1752)
@@ -193,7 +193,7 @@
     $self->_db_init;
 
     if ($self->is_run_mode('cgi', 'mod_perl')) {
-       #check for valid session unless this is an iniital authentication
+       #check for valid session unless this is an inital authentication
        #request -- CT
        if (!Session::session_check( $cookie{"LedgerSMB"}, $self) ) {
             $self->_get_password("Session Expired");

Modified: trunk/UI/login.js
===================================================================
--- trunk/UI/login.js	2007-10-12 19:24:24 UTC (rev 1751)
+++ trunk/UI/login.js	2007-10-14 17:31:23 UTC (rev 1752)
@@ -13,7 +13,8 @@
 	var http = get_http_request_object();
         var username = document.login.login.value;
 	var password = document.login.password.value;
-	http.open("get", 'login.pl?action=authenticate', false, 
+	http.open("get", 'login.pl?action=authenticate&company='
+		+ document.login.company.value, false, 
 		username, password);
 	http.send("");
 	alert(http.status);

Modified: trunk/UI/menu/expanding.css
===================================================================
--- trunk/UI/menu/expanding.css	2007-10-12 19:24:24 UTC (rev 1751)
+++ trunk/UI/menu/expanding.css	2007-10-14 17:31:23 UTC (rev 1752)
@@ -1,11 +1,10 @@
-div.submenu {
-	display: none;
+li.menu_closed {
 }
 
-A.Menu_Closed:before {
-	content: '+';
+li.menu_closed > ul {
+	display: none;
 }
 
-A.Menu_Open:before {
-	content: '-';
+li.menu_open > ul {
+	display: block;
 }

Modified: trunk/UI/menu/expanding.html
===================================================================
--- trunk/UI/menu/expanding.html	2007-10-12 19:24:24 UTC (rev 1751)
+++ trunk/UI/menu/expanding.html	2007-10-14 17:31:23 UTC (rev 1752)
@@ -7,8 +7,16 @@
 	<meta http-equiv="Pragma" content="no-cache" />
 	<meta http-equiv="Expires" content="-1" />
 	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
-	<link rel="stylesheet" href="UI/menu/expanding.css" type="text/css" title="LedgerSMB stylesheet" />
-	<link rel="stylesheet" href="css/<?lsmb stylesheet ?>" type="text/css" title="LedgerSMB stylesheet" />
+	<!-- 
+		Please note that the below style tag is NOT in line with 
+		how we do things. However, it seems necessary in order to work 
+		around a Firefox bug in the the application of the styles. 
+		- CT
+	-->
+	<style type="text/css" media="all">
+		@import url("UI/menu/expanding.css");
+		@import url("css/<?lsmb stylesheet ?>");
+	</style>
 
 	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
 
@@ -17,23 +25,16 @@
 		<script type="text/javascript">
 
 			function SwitchMenu(id) {
-				var obj = "sub_" + id;
+				var obj = "menu_" + id;
 				if (document.getElementById) {
 					var element = document.getElementById(obj);
 					
-					if (element.style.display == "block") {
-						element.style.display = "none";
-
-					} else {
-						element.style.display = "block"; //display the block of info
-					}
-					obj = 'a_' + id;
 					element = document.getElementById(obj);
-					if (element.className == 'Menu_Open'){
+					if (element.className == 'menu_open'){
 						element.className 
-							= 'Menu_Closed';
+							= 'menu_closed';
 					} else {
-						element.className = 'Menu_Open';
+						element.className = 'menu_open';
 					}
 					return false;
 				}		
@@ -47,21 +48,30 @@
 
 		<body class="menu">
 		<img class="cornderlogo" src="images/ledgersmb_small.png" width="100" height="50" border="1" alt="LedgerSMB" />
+	<ul id="top_menu" class="menu_open">
+	<?lsmb old_level = 0 ?>
 	<?lsmb FOREACH item = menu_items ?>
 		<?lsmb href = "" ?>
+			<!-- <?lsmb item.level ?> :: <?lsmb old_level ?> -->
 		<?lsmb WHILE item.level < old_level ?>
- 			</div><?lsmb old_level = old_level - 1 ?>
+ 			</li></ul><?lsmb old_level = old_level - 1 ?>
 		<?lsmb END ?>
-		<div class="Menu" id="menu_<?lsmb item.id ?>">
+                <?lsmb IF old_level > 0 && item.level <= old_level ?></li><?lsmb END ?>
+		<?lsmb old_level = item.level ?>
+		<li id="menu_<?lsmb item.id ?>"
+				class = "<?lsmb IF (item.menu && item.open)
+					?>menu_open<?lsmb ELSIF item.menu
+					?>menu_closed<?lsmb
+					ELSE ?>menu_item<?lsmb END ?>">
 			<a href="<?lsmb IF item.module ?><?lsmb item.module 
 				?><?lsmb ELSE ?>menu.pl<?lsmb END 
 				?>?login=<?lsmb login 
-				?>&<?lsmb FOREACH arg IN item.args 
+				?>&amp;<?lsmb FOREACH arg IN item.args 
 				?><?lsmb arg 
-				?>&<?lsmb END 
+				?>&amp;<?lsmb END 
 				?><?lsmb IF item.menu 
 					?>id=<?lsmb item.id
-					?>&open=<?lsmb open 
+					?>&amp;open=<?lsmb open 
 				?><?lsmb END ?>"
 				<?lsmb IF (item.module != 'menu.pl') &&
 					('login.pl' != item.module) ?> 
@@ -75,21 +85,15 @@
 					('New Menu' != item.label) ?> 
 					onclick="return SwitchMenu('<?lsmb item.id ?>')"
 				<?lsmb END ?>
-				class = "<?lsmb IF (item.menu && item.open)
-					?>Menu_Open<?lsmb ELSIF item.menu
-					?>Menu_Closed<?lsmb
-					ELSE ?>Menu_Item<?lsmb END ?>"
 				id = "a_<?lsmb item.id ?>"
 				><?lsmb text(item.label) ?></a>
-		</div>
 		<?lsmb IF item.menu && (item.label != 'New Window') ?>
-			<div id="sub_<?lsmb item.id ?>" class="submenu"
-			<?lsmb IF item.open ?>
-				style="display: block"
-			<?lsmb END ?>>
+			<ul id="sub_<?lsmb item.id ?>" class="submenu">
 		<?lsmb END ?>
-		<?lsmb old_level = item.level ?>
 	<?lsmb END ?>
+		<?lsmb WHILE 0 < old_level ?>
+ 			</li></ul><?lsmb old_level = old_level - 1 ?>
+		<?lsmb END ?>
                 
                 
 </body>

Modified: trunk/scripts/login.pl
===================================================================
--- trunk/scripts/login.pl	2007-10-12 19:24:24 UTC (rev 1751)
+++ trunk/scripts/login.pl	2007-10-14 17:31:23 UTC (rev 1752)
@@ -25,14 +25,15 @@
 sub authenticate {
     my ($request) = @_;
     if (!$request->{dbh}){
-        $request->{company} = 'ledgersmb-taxtest';
+        if (!$request->{company}){
+             $request->{company} = $LedgerSMB::Sysconfig::default_db;
+        }
         $request->_db_init;
     }
     my $path = $ENV{SCRIPT_NAME};
     $path =~ s|[^/]*$||;
     if ($request->{dbh} || $request->{log_out}){
         print "Content-Type: text/html\n";
-##        print "Set-Cookie: LedgerSMB=Login;\n";
         print "Set-Cookie: LedgerSMB=Login; path=$path\n";
 	print "Status: 200 Success\n\n";
         if ($request->{log_out}){

Modified: trunk/scripts/menu.pl
===================================================================
--- trunk/scripts/menu.pl	2007-10-12 19:24:24 UTC (rev 1751)
+++ trunk/scripts/menu.pl	2007-10-14 17:31:23 UTC (rev 1752)
@@ -105,7 +105,6 @@
 
 sub expanding_menu {
     my ($request) = @_;
-    print STDERR 'Breakpoint\n';
     if ($request->{'open'} !~ s/:$request->{id}:/:/){
 	$request->{'open'} .= ":$request->{id}:";
     }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.