ispman/ispman-web/cgi-bin/tmpl/modules editModule.tmpl,1.5,1.6

[email protected]
Newsgroups gmane.comp.isp.ispman.cvs
Message-ID <[email protected]>
Update of /cvsroot/ispman/ispman/ispman-web/cgi-bin/tmpl/modules
In directory sc8-pr-cvs1:/tmp/cvs-serv18972

Modified Files:
	editModule.tmpl 
Log Message:
if varSortOrder is defined in ispman.conf then take that into account, or fallback to old behaviour.


Index: editModule.tmpl
===================================================================
RCS file: /cvsroot/ispman/ispman/ispman-web/cgi-bin/tmpl/modules/editModule.tmpl,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- editModule.tmpl	28 Apr 2003 14:47:25 -0000	1.5
+++ editModule.tmpl	13 Jan 2004 23:05:59 -0000	1.6
@@ -11,15 +11,39 @@
         <perl>
         my $text="";
         my $moduleinfo=$ispman->{'moduleinfo'};
-        for (keys %$moduleinfo){
-            #next unless $moduleinfo->{$_}{'ispmanQuestion'}=~/\S/;
-            $text.="<TR><TD COLSPAN=2 bgcolor=WHITE><I>$moduleinfo->{$_}{'ispmanQuestion'}</i></td></tr>\n";
-            $text.=qq|
-            <TR>
-            <TD class=menuheader>@{[($moduleinfo->{$_}{'ispmanVarAlias'})?$moduleinfo->{$_}{'ispmanVarAlias'}:$moduleinfo->{$_}{'ispmanVar'}]}</td>
-            <TD><INPUT TYPE="TEXT" NAME="$moduleinfo->{$_}{'ispmanVar'}" size=40 value="$moduleinfo->{$_}{'ispmanVal'}"></td>
-            </tr>|;
-        }
+
+		my $module=$r->param("module");
+		if ($ispman->{'Config'}{'ispmanVarSort'}{$module}){
+			my $varSort=$ispman->{'Config'}{'ispmanVarSort'}{$module};
+			my ($varDN, $ispmanQuestion, $ispmanVarAlias, $ispmanVar, $ispmanVal);
+		
+			for (@$varSort){
+				$varDN=$ispman->getConfVarDN($module, $_);
+				$varDN=~s/ //g;
+				
+				$ispmanVar=$moduleinfo->{$varDN}{'ispmanVar'};
+				$ispmanVal=$moduleinfo->{$varDN}{'ispmanVal'};
+				$ispmanQuestion=$moduleinfo->{$varDN}{'ispmanQuestion'};
+				$ispmanVarAlias=$moduleinfo->{$varDN}{'ispmanVarAlias'};
+
+				$text.="<TR><TD COLSPAN=2 bgcolor=WHITE><I>$ispmanQuestion</i></td></tr>\n";
+				$text.=qq|
+				<TR>
+				<TD class=menuheader>@{[($ispmanVarAlias)?$ispmanVarAlias:$ispmanVar]}</td>
+				<TD><INPUT TYPE="TEXT" NAME="$ispmanVar" size=40 value="$ispmanVal"></td>
+				</tr>|;
+
+			}
+		} else {
+			for (keys %$moduleinfo){
+				$text.="<TR><TD COLSPAN=2 bgcolor=WHITE><I>$moduleinfo->{$_}{'ispmanQuestion'}</i></td></tr>\n";
+				$text.=qq|
+				<TR>
+				<TD class=menuheader>@{[($moduleinfo->{$_}{'ispmanVarAlias'})?$moduleinfo->{$_}{'ispmanVarAlias'}:$moduleinfo->{$_}{'ispmanVar'}]}</td>
+				<TD><INPUT TYPE="TEXT" NAME="$moduleinfo->{$_}{'ispmanVar'}" size=40 value="$moduleinfo->{$_}{'ispmanVal'}"></td>
+				</tr>|;
+			}
+		}
         $text
         </perl>
 




-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.