?? navbarpreferencestemplate.tmpl
字號:
#encoding UTF-8## $Id: NavbarPreferencesTemplate.tmpl 3809 2007-01-19 14:16:23Z jodal $## Builds the form for chosing preferences about links on the navigation bar.## The template uses images in the /images/form/-folder.#### Copyright 2003, 2004 Norwegian University of Science and Technology#### This file is part of Network Administration Visualized (NAV)#### NAV is free software; you can redistribute it and/or modify## it under the terms of the GNU General Public License as published by## the Free Software Foundation; either version 2 of the License, or## (at your option) any later version.#### NAV 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 General Public License for more details.#### You should have received a copy of the GNU General Public License## along with NAV; if not, write to the Free Software## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA###### Authors: Magnar Sveen <magnars@idi.ntnu.no>###extends MainTemplate#block content#if $user.id == 0 #set $type = "default"#else #set $type = "personal"#end if<html> <head> <meta http-equiv="Pragma" content="no-cache"> <style type="text/css"> BODY { font-family: verdana, arial, helvetica, sans-serif; background-color: white; } table.header-active { font-size: 15px; border: 1px solid #666; background-color: #ccf; background-image: url('/images/form/fill-active.gif'); } td.header-active { border: 1px solid #69c; text-align: center; } table.header-inactive { font-size: 15px; border: 1px solid #666; background-color: #eee; background-image: url('/images/form/fill-inactive.gif'); } td.header-inactive { border: 1px solid #bcd; text-align: center; } table.options { font-size: 13px; border: 1px solid #666; background-color: #fff; } table.homemade-options { font-size: 13px; border: 1px solid #666; background-color: #eee; } tr.active { background-color: #eef; } td.active { border: 1px solid #99c; } tr.inactive { background-color: #fff; } td.inactive { border: 1px solid #ccc; } tr.dead { background-color: #fff; } td.dead { border: 1px solid #ccc; color: #999; } </style> <script language="JavaScript" type="text/javascript"> <!-- BEGIN function getObj(id) { if (document.getElementById) { return document.getElementById(id); } else if (document.all) { return document.all[id]; } } function canChangeClassName() { if (document.getElementById) { return document.getElementById("options").className; } else if (document.all) { return document.all["options"].className; } else { return false; } } function activeColumn(col) { var col = getObj(col + "-checkbox-h"); return (!col || col.checked); } function setBox(status, col, row) { getObj(col + "-table-" + row).className = status; getObj(col + "-cb-" + row).className = status; getObj(col + "-tx-" + row).className = status; } function checkBox(box, col, row) { if (!canChangeClassName() || !activeColumn(col)) return; if (box.checked) { setBox("active", col, row); } else { setBox("inactive", col, row); } } dontClickBox = false; function clickBox(col, row) { if (!activeColumn(col) || dontClickBox) { dontClickBox = false; return; } var box = getObj(col + "-checkbox-" + row); box.checked = !box.checked; checkBox(box, col, row); } function checkColumn(col) { var disabled = !activeColumn(col); var canChange = canChangeClassName(); var obj; var row = 0; while (obj = getObj(col + "-checkbox-" + row)) { obj.disabled = disabled; if (!canChange) { } else if (disabled) { setBox("dead", col, row); } else { checkBox(obj, col, row); } row++; } if (!canChange) return; if (disabled) { getObj(col + "-table-h").className = "header-inactive"; getObj(col + "-td-h").className = "header-inactive"; } else { getObj(col + "-table-h").className = "header-active"; getObj(col + "-td-h").className = "header-active"; } } clickedColumnBox = false; function clickColumn(col) { if (clickedColumnBox) { clickedColumnBox = false; return; } var box = getObj(col + "-checkbox-h"); box.checked = !box.checked; checkColumn(col); } function checkAll() { checkColumn("nb"); checkColumn("ql1"); checkColumn("ql2"); } // END --> </script> </head> <body onLoad="checkAll();">#if $user.id == 0<b>Please note:</b> You are logged in as site administrator. This means you are now changing the default preferences.All users that are not logged in, and all users that have not changed their preferences, will be affected by your changes.The navigation-bar has been temporarily changed, so you can see the changes like an anonymous user will see them.<br>#end if <form method="post" action="navigation/saveprefs"> <td colspan=2></td> <table width="100%" cellspacing="5" cellpadding="0" border="0"> <tr> <td width="33%"> <!-- HEADERS --><!-- NAVBAR --> <table id="nb-table-h" width="100%" height="50" cellspacing="5" cellpadding="5" border="0" class="header-active"> <tr> <td id="nb-td-h" nowrap class="header-active"> Navbar </td> </tr> </table><!-- NAVBAR END --> </td> <td width="33%"><!-- QUICKLINK #1 --> <table id="ql1-table-h" width="100%" height="50" cellspacing="5" cellpadding="5" border="0" class="header-active"> <tr> <td id="ql1-td-h" nowrap class="header-active" onClick="clickColumn('ql1');"> <input id="ql1-checkbox-h" type="checkbox" onClick="checkColumn('ql1'); clickedColumnBox = true;" #slurp#if $checked.has_key('qlink1') then 'checked' else ''# /> Quicklink #1 </td> </tr> </table><!-- QUICKLINK #1 END --> </td> <td width="33%"><!-- QUICKLINK #2 --> <table id="ql2-table-h" width="100%" height="50" cellspacing="5" cellpadding="5" border="0" class="header-active"> <tr> <td id="ql2-td-h" nowrap class="header-active" onClick="clickColumn('ql2');"> <input id="ql2-checkbox-h" type="checkbox" onClick="checkColumn('ql2'); clickedColumnBox = true;" #slurp#if $checked.has_key('qlink2') then 'checked' else ''# /> Quicklink #2 </td> </tr> </table><!-- QUICKLINK #2 END --> </td> </tr>#set $number = 0#if $defaultlinks <tr> <td width="33%"><!-- OPTIONS --><!-- NAVBAR --> <table id="options" width="100%" cellspacing="5" cellpadding="5" border="0" class="options">#for $link in $defaultlinks <tr id="nb-table-$number" class="inactive"> <td id="nb-cb-$number" nowrap class="inactive" width=0%> <input name="$link.id" value="navbar" id="nb-checkbox-$number" type="checkbox" onClick="checkBox(this, 'nb', $number);" class="checkbox" #slurp#set $id = "KEY" + str($link._getID()[0])#if $checked.has_key($id) and $checked[$id].count('navbar') then 'checked' else ''# /> </td> <td id="nb-tx-$number" nowrap class="inactive" width=100% onclick="clickBox('nb', $number);"> $link.name </td> </tr>#set $number = $number + 1#end for </table> <!-- NAVBAR END --> </td> <td width="33%"><!-- QUICKLINK #1 --> <table id="options" width="100%" cellspacing="5" cellpadding="5" border="0" class="options">#set $number = 0#for $link in $defaultlinks <tr id="ql1-table-$number" class="inactive"> <td id="ql1-cb-$number" nowrap class="inactive" width=0%> <input name="$link.id" value="qlink1" id="ql1-checkbox-$number" type="checkbox" onClick="checkBox(this, 'ql1', $number);" class="checkbox" #slurp#set $id = "KEY" + str($link._getID()[0])#if $checked.has_key($id) and $checked[$id].count('qlink1') then 'checked' else ''# /> </td> <td id="ql1-tx-$number" nowrap class="inactive" width=100% onclick="clickBox('ql1', $number);"> $link.name </td> </tr>#set $number = $number + 1#end for </table> <!-- QUICKLINK #1 END --> </td> <td width="33%"><!-- QUICKLINK #2 --> <table id="options" width="100%" cellspacing="5" cellpadding="5" border="0" class="options">#set $number = 0#for $link in $defaultlinks <tr id="ql2-table-$number" class="inactive"> <td id="ql2-cb-$number" nowrap class="inactive" width=0%> <input name="$link.id" value="qlink2" id="ql2-checkbox-$number" type="checkbox" onClick="checkBox(this, 'ql2', $number);" class="checkbox" #slurp#set $id = "KEY" + str($link._getID()[0])#if $checked.has_key($id) and $checked[$id].count('qlink2') then 'checked' else ''# /> </td> <td id="ql2-tx-$number" nowrap class="inactive" width=100% onclick="clickBox('ql2', $number);"> $link.name </td> </tr>#set $number = $number + 1#end for </table> <!-- QUICKLINK #2 END --> </td> </tr>#end if#if $homemadelinks <tr> <td width="33%"><!-- HOMEMADE OPTIONS --><!-- NAVBAR -->#set $startnumber = $number <table id="options" width="100%" cellspacing="5" cellpadding="5" border="0" class="homemade-options">#set $number = $startnumber#for $link in $homemadelinks <tr id="nb-table-$number" class="inactive"> <td id="nb-cb-$number" nowrap class="inactive" width=0%> <input name="$link.id" value="navbar" id="nb-checkbox-$number" type="checkbox" onClick="checkBox(this, 'nb', $number);" class="checkbox" #slurp#set $id = str($link._getID()[0])#if $checked.has_key("KEY"+$id) and $checked["KEY"+$id].count('navbar') then 'checked' else ''# /> </td> <td id="nb-tx-$number" nowrap class="inactive" width=100% onclick="clickBox('nb', $number);"> <table width="100%" border="0" cellspacing="0" cellpadding="0" style="font-size: 13px;"><tr> <td width="0%" nowrap>$link.name</td> <td width="100%" align="right"> <a href="navigation/deletelink?id=$id" title="Delete link" onClick="dontClickBox = true; return confirm('This will delete $type link $link.name!');"><img border="" alt="Delete" src="/images/form/deleteicon.gif"></a> <a href="navigation/editlink?id=$id" title="Edit link" onClick="dontClickBox = true;"><img border="" alt="Edit" src="/images/form/editicon.gif"></a> </td> </tr></table> </td> </tr>#set $number = $number + 1#end for </table><!-- NAVBAR END --> </td> <td width="33%"><!-- QUICKLINK #1 --> <table id="options" width="100%" cellspacing="5" cellpadding="5" border="0" class="homemade-options">#set $number = $startnumber#for $link in $homemadelinks <tr id="ql1-table-$number" class="inactive"> <td id="ql1-cb-$number" nowrap class="inactive" width=0%> <input name="$link.id" value="qlink1" id="ql1-checkbox-$number" type="checkbox" onClick="checkBox(this, 'ql1', $number);" class="checkbox" #slurp#set $id = str($link._getID()[0])#if $checked.has_key("KEY" + $id) and $checked["KEY" + $id].count('qlink1') then 'checked' else ''# /> </td> <td nowrap id="ql1-tx-$number" class="inactive" width=100% onclick="clickBox('ql1', $number);"> <table width="100%" border="0" cellspacing="0" cellpadding="0" style="font-size: 13px;"><tr> <td width="0%" nowrap>$link.name</td> <td width="100%" align="right"> <a href="navigation/deletelink?id=$id" title="Delete link" onClick="dontClickBox = true; return confirm('This will delete $type link $link.name!');"><img border="" alt="Delete" src="/images/form/deleteicon.gif"></a> <a href="navigation/editlink?id=$id" title="Edit $type link" onClick="dontClickBox = true;"><img border="" alt="Edit" src="/images/form/editicon.gif"></a> </td> </tr></table> </td> </tr>#set $number = $number + 1#end for </table><!-- QUICKLINK #1 END --> </td> <td width="33%"><!-- QUICKLINK #2 --> <table id="options" width="100%" cellspacing="5" cellpadding="5" border="0" class="homemade-options">#set $number = $startnumber#for $link in $homemadelinks <tr id="ql2-table-$number" class="inactive"> <td id="ql2-cb-$number" nowrap class="inactive" width=0%> <input name="$link.id" value="qlink2" id="ql2-checkbox-$number" type="checkbox" onClick="checkBox(this, 'ql2', $number);" class="checkbox" #slurp#set $id = str($link._getID()[0])#if $checked.has_key("KEY" + $id) and $checked["KEY" + $id].count('qlink2') then 'checked' else ''# /> </td> <td id="ql2-tx-$number" nowrap class="inactive" width=100% onclick="clickBox('ql2', $number);"> <table width="100%" border="0" cellspacing="0" cellpadding="0" style="font-size: 13px;"><tr> <td width="0%" nowrap>$link.name</td> <td width="100%" align="right"> <a href="navigation/deletelink?id=$id" title="Delete $type link" onClick="dontClickBox = true; return confirm('This will delete $type link $link.name!');"><img border="" alt="Delete" src="/images/form/deleteicon.gif"></a> <a href="navigation/editlink?id=$id" title="Edit $type link" onClick="dontClickBox = true;"><img border="" alt="Edit" src="/images/form/editicon.gif"></a> </td> </tr></table> </td> </tr>#set $number = $number + 1#end for </table><!-- QUICKLINK #2 END --> </td> </tr>#end if <tr> <td> <input type="button" value="Cancel" onclick="window.location='/preferences/'"> </td> <td colspan=2 align=right> <input type="button" value="Add $type link" onClick="window.location='navigation/newlink';" style="font-size: 13" /> <input type="submit" value="Save preferences" style="font-size: 13" /> </td> </tr></table></form></body>#end block
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -