#!/usr/bin/env python
# -*- coding: UTF-8 -*-



##################################################
## DEPENDENCIES
import sys
import os
import os.path
from os.path import getmtime, exists
import time
import types
import __builtin__
from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion
from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple
from Cheetah.Template import Template
from Cheetah.DummyTransaction import DummyTransaction
from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList
from Cheetah.CacheRegion import CacheRegion
import Cheetah.Filters as Filters
import Cheetah.ErrorCatchers as ErrorCatchers
from MainTemplate import MainTemplate

##################################################
## MODULE CONSTANTS
try:
    True, False
except NameError:
    True, False = (1==1), (1==0)
VFFSL=valueFromFrameOrSearchList
VFSL=valueFromSearchList
VFN=valueForName
currentTime=time.time
__CHEETAH_version__ = '2.0.1'
__CHEETAH_versionTuple__ = (2, 0, 1, 'final', 0)
__CHEETAH_genTime__ = 1225031611.862015
__CHEETAH_genTimestamp__ = 'Sun Oct 26 14:33:31 2008'
__CHEETAH_src__ = 'NavbarPreferencesTemplate.tmpl'
__CHEETAH_srcLastModified__ = 'Fri Jan 19 14:16:23 2007'
__CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine'

if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
    raise AssertionError(
      'This template was compiled with Cheetah version'
      ' %s. Templates compiled before version %s must be recompiled.'%(
         __CHEETAH_version__, RequiredCheetahVersion))

##################################################
## CLASSES

class NavbarPreferencesTemplate(MainTemplate):

    ##################################################
    ## CHEETAH GENERATED METHODS


    def __init__(self, *args, **KWs):

        MainTemplate.__init__(self, *args, **KWs)
        if not self._CHEETAH__instanceInitialized:
            cheetahKWArgs = {}
            allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
            for k,v in KWs.items():
                if k in allowedKWs: cheetahKWArgs[k] = v
            self._initCheetahInstance(**cheetahKWArgs)
        

    def content(self, **KWS):



        ## CHEETAH: generated from #block content at line 30, col 1.
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        write('''
''')
        if VFFSL(SL,"user.id",True) == 0: # generated from line 32, col 1
            type = "default"
        else: # generated from line 34, col 1
            type = "personal"
        write('''
<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 VFFSL(SL,"user.id",True) == 0: # generated from line 194, col 1
            write('''
<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>

''')
        write('''
  <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;" ''')
        if VFN(VFFSL(SL,"checked",True),"has_key",False)('qlink1') : # generated from line 230, col 1
            _v =  'checked' 
            if _v is not None: write(_filter(_v))
        else:
            _v =  ''
            if _v is not None: write(_filter(_v))
        write(''' /> 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;" ''')
        if VFN(VFFSL(SL,"checked",True),"has_key",False)('qlink2') : # generated from line 246, col 1
            _v =  'checked' 
            if _v is not None: write(_filter(_v))
        else:
            _v =  ''
            if _v is not None: write(_filter(_v))
        write(''' /> Quicklink #2
      </td>
    </tr>
  </table>

<!-- QUICKLINK #2 END -->

    </td>
  </tr>
''')
        number = 0
        if VFFSL(SL,"defaultlinks",True): # generated from line 256, col 1
            write('''  <tr>
    <td width="33%">

<!-- OPTIONS -->
<!-- NAVBAR -->

  <table id="options" width="100%" cellspacing="5" cellpadding="5" border="0" class="options">
''')
            for link in VFFSL(SL,"defaultlinks",True): # generated from line 264, col 1
                write('''    <tr id="nb-table-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 265, col 22
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 265, col 22.
                write('''" class="inactive">
      <td id="nb-cb-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 266, col 21
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 266, col 21.
                write('''" nowrap class="inactive" width=0%>
        <input name="''')
                _v = VFFSL(SL,"link.id",True) # '$link.id' on line 267, col 22
                if _v is not None: write(_filter(_v, rawExpr='$link.id')) # from line 267, col 22.
                write('''" value="navbar" id="nb-checkbox-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 267, col 63
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 267, col 63.
                write('''" type="checkbox" onClick="checkBox(this, \'nb\', ''')
                _v = VFFSL(SL,"number",True) # '$number' on line 267, col 118
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 267, col 118.
                write(''');" class="checkbox" ''')
                id = "KEY" + str(VFN(VFFSL(SL,"link",True),"_getID",False)()[0])
                if VFN(VFFSL(SL,"checked",True),"has_key",False)(VFFSL(SL,"id",True)) and VFN(VFFSL(SL,"checked",True)[VFFSL(SL,"id",True)],"count",False)('navbar') : # generated from line 269, col 1
                    _v =  'checked' 
                    if _v is not None: write(_filter(_v))
                else:
                    _v =  ''
                    if _v is not None: write(_filter(_v))
                write(''' />
      </td>
      <td id="nb-tx-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 271, col 21
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 271, col 21.
                write('''" nowrap class="inactive" width=100% onclick="clickBox(\'nb\', ''')
                _v = VFFSL(SL,"number",True) # '$number' on line 271, col 89
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 271, col 89.
                write(''');">
        ''')
                _v = VFFSL(SL,"link.name",True) # '$link.name' on line 272, col 9
                if _v is not None: write(_filter(_v, rawExpr='$link.name')) # from line 272, col 9.
                write('''
      </td>
    </tr>
''')
                number = VFFSL(SL,"number",True) + 1
            write('''  </table>
  

<!-- NAVBAR END -->

    </td>
    <td width="33%">

<!-- QUICKLINK #1 -->

  <table id="options" width="100%" cellspacing="5" cellpadding="5" border="0" class="options">
''')
            number = 0
            for link in VFFSL(SL,"defaultlinks",True): # generated from line 289, col 1
                write('''    <tr id="ql1-table-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 290, col 23
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 290, col 23.
                write('''" class="inactive">
      <td id="ql1-cb-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 291, col 22
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 291, col 22.
                write('''" nowrap class="inactive" width=0%>
        <input name="''')
                _v = VFFSL(SL,"link.id",True) # '$link.id' on line 292, col 22
                if _v is not None: write(_filter(_v, rawExpr='$link.id')) # from line 292, col 22.
                write('''" value="qlink1" id="ql1-checkbox-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 292, col 64
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 292, col 64.
                write('''" type="checkbox" onClick="checkBox(this, \'ql1\', ''')
                _v = VFFSL(SL,"number",True) # '$number' on line 292, col 120
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 292, col 120.
                write(''');" class="checkbox" ''')
                id = "KEY" + str(VFN(VFFSL(SL,"link",True),"_getID",False)()[0])
                if VFN(VFFSL(SL,"checked",True),"has_key",False)(VFFSL(SL,"id",True)) and VFN(VFFSL(SL,"checked",True)[VFFSL(SL,"id",True)],"count",False)('qlink1') : # generated from line 294, col 1
                    _v =  'checked' 
                    if _v is not None: write(_filter(_v))
                else:
                    _v =  ''
                    if _v is not None: write(_filter(_v))
                write(''' />
      </td>
      <td id="ql1-tx-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 296, col 22
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 296, col 22.
                write('''" nowrap class="inactive" width=100% onclick="clickBox(\'ql1\', ''')
                _v = VFFSL(SL,"number",True) # '$number' on line 296, col 91
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 296, col 91.
                write(''');">
        ''')
                _v = VFFSL(SL,"link.name",True) # '$link.name' on line 297, col 9
                if _v is not None: write(_filter(_v, rawExpr='$link.name')) # from line 297, col 9.
                write('''
      </td>
    </tr>
''')
                number = VFFSL(SL,"number",True) + 1
            write('''  </table>
  

<!-- QUICKLINK #1 END -->


    </td>
    <td width="33%">


<!-- QUICKLINK #2 -->

  <table id="options" width="100%" cellspacing="5" cellpadding="5" border="0" class="options">
''')
            number = 0
            for link in VFFSL(SL,"defaultlinks",True): # generated from line 316, col 1
                write('''    <tr id="ql2-table-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 317, col 23
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 317, col 23.
                write('''" class="inactive">
      <td id="ql2-cb-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 318, col 22
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 318, col 22.
                write('''" nowrap class="inactive" width=0%>
        <input name="''')
                _v = VFFSL(SL,"link.id",True) # '$link.id' on line 319, col 22
                if _v is not None: write(_filter(_v, rawExpr='$link.id')) # from line 319, col 22.
                write('''" value="qlink2" id="ql2-checkbox-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 319, col 64
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 319, col 64.
                write('''" type="checkbox" onClick="checkBox(this, \'ql2\', ''')
                _v = VFFSL(SL,"number",True) # '$number' on line 319, col 120
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 319, col 120.
                write(''');" class="checkbox" ''')
                id = "KEY" + str(VFN(VFFSL(SL,"link",True),"_getID",False)()[0])
                if VFN(VFFSL(SL,"checked",True),"has_key",False)(VFFSL(SL,"id",True)) and VFN(VFFSL(SL,"checked",True)[VFFSL(SL,"id",True)],"count",False)('qlink2') : # generated from line 321, col 1
                    _v =  'checked' 
                    if _v is not None: write(_filter(_v))
                else:
                    _v =  ''
                    if _v is not None: write(_filter(_v))
                write(''' />
      </td>
      <td id="ql2-tx-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 323, col 22
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 323, col 22.
                write('''" nowrap class="inactive" width=100% onclick="clickBox(\'ql2\', ''')
                _v = VFFSL(SL,"number",True) # '$number' on line 323, col 91
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 323, col 91.
                write(''');">
        ''')
                _v = VFFSL(SL,"link.name",True) # '$link.name' on line 324, col 9
                if _v is not None: write(_filter(_v, rawExpr='$link.name')) # from line 324, col 9.
                write('''
      </td>
    </tr>
''')
                number = VFFSL(SL,"number",True) + 1
            write('''  </table>
  

<!-- QUICKLINK #2 END -->

    </td>
  </tr>
''')
        if VFFSL(SL,"homemadelinks",True): # generated from line 337, col 1
            write('''  <tr>
    <td width="33%">

<!-- HOMEMADE OPTIONS -->
<!-- NAVBAR -->
''')
            startnumber = VFFSL(SL,"number",True)
            write('''
  <table id="options" width="100%" cellspacing="5" cellpadding="5" border="0" class="homemade-options">
''')
            number = VFFSL(SL,"startnumber",True)
            for link in VFFSL(SL,"homemadelinks",True): # generated from line 347, col 1
                write('''    <tr id="nb-table-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 348, col 22
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 348, col 22.
                write('''" class="inactive">
      <td id="nb-cb-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 349, col 21
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 349, col 21.
                write('''" nowrap class="inactive" width=0%>
        <input name="''')
                _v = VFFSL(SL,"link.id",True) # '$link.id' on line 350, col 22
                if _v is not None: write(_filter(_v, rawExpr='$link.id')) # from line 350, col 22.
                write('''" value="navbar" id="nb-checkbox-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 350, col 63
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 350, col 63.
                write('''" type="checkbox" onClick="checkBox(this, \'nb\', ''')
                _v = VFFSL(SL,"number",True) # '$number' on line 350, col 118
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 350, col 118.
                write(''');" class="checkbox" ''')
                id = str(VFN(VFFSL(SL,"link",True),"_getID",False)()[0])
                if VFN(VFFSL(SL,"checked",True),"has_key",False)("KEY"+VFFSL(SL,"id",True)) and VFN(VFFSL(SL,"checked",True)["KEY"+VFFSL(SL,"id",True)],"count",False)('navbar') : # generated from line 352, col 1
                    _v =  'checked' 
                    if _v is not None: write(_filter(_v))
                else:
                    _v =  ''
                    if _v is not None: write(_filter(_v))
                write(''' />
      </td>
      <td id="nb-tx-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 354, col 21
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 354, col 21.
                write('''" nowrap class="inactive" width=100% onclick="clickBox(\'nb\', ''')
                _v = VFFSL(SL,"number",True) # '$number' on line 354, col 89
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 354, col 89.
                write(''');">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" style="font-size: 13px;"><tr>
          <td width="0%" nowrap>''')
                _v = VFFSL(SL,"link.name",True) # '$link.name' on line 356, col 33
                if _v is not None: write(_filter(_v, rawExpr='$link.name')) # from line 356, col 33.
                write('''</td>
          <td width="100%" align="right">
            <a href="navigation/deletelink?id=''')
                _v = VFFSL(SL,"id",True) # '$id' on line 358, col 47
                if _v is not None: write(_filter(_v, rawExpr='$id')) # from line 358, col 47.
                write('''" title="Delete link" onClick="dontClickBox = true; return confirm(\'This will delete ''')
                _v = VFFSL(SL,"type",True) # '$type' on line 358, col 135
                if _v is not None: write(_filter(_v, rawExpr='$type')) # from line 358, col 135.
                write(''' link ''')
                _v = VFFSL(SL,"link.name",True) # '$link.name' on line 358, col 146
                if _v is not None: write(_filter(_v, rawExpr='$link.name')) # from line 358, col 146.
                write('''!\');"><img border="" alt="Delete" src="/images/form/deleteicon.gif"></a>
            <a href="navigation/editlink?id=''')
                _v = VFFSL(SL,"id",True) # '$id' on line 359, col 45
                if _v is not None: write(_filter(_v, rawExpr='$id')) # from line 359, col 45.
                write('''" title="Edit link" onClick="dontClickBox = true;"><img border="" alt="Edit" src="/images/form/editicon.gif"></a>
          </td>
        </tr></table>
      </td>
    </tr>
''')
                number = VFFSL(SL,"number",True) + 1
            write('''  </table>

<!-- NAVBAR END -->

    </td>
    <td width="33%">

<!-- QUICKLINK #1 -->

  <table id="options" width="100%" cellspacing="5" cellpadding="5" border="0" class="homemade-options">
''')
            number = VFFSL(SL,"startnumber",True)
            for link in VFFSL(SL,"homemadelinks",True): # generated from line 377, col 1
                write('''    <tr id="ql1-table-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 378, col 23
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 378, col 23.
                write('''" class="inactive">
      <td id="ql1-cb-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 379, col 22
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 379, col 22.
                write('''" nowrap class="inactive" width=0%>
        <input name="''')
                _v = VFFSL(SL,"link.id",True) # '$link.id' on line 380, col 22
                if _v is not None: write(_filter(_v, rawExpr='$link.id')) # from line 380, col 22.
                write('''" value="qlink1" id="ql1-checkbox-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 380, col 64
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 380, col 64.
                write('''" type="checkbox" onClick="checkBox(this, \'ql1\', ''')
                _v = VFFSL(SL,"number",True) # '$number' on line 380, col 120
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 380, col 120.
                write(''');" class="checkbox" ''')
                id = str(VFN(VFFSL(SL,"link",True),"_getID",False)()[0])
                if VFN(VFFSL(SL,"checked",True),"has_key",False)("KEY" + VFFSL(SL,"id",True)) and VFN(VFFSL(SL,"checked",True)["KEY" + VFFSL(SL,"id",True)],"count",False)('qlink1') : # generated from line 382, col 1
                    _v =  'checked' 
                    if _v is not None: write(_filter(_v))
                else:
                    _v =  ''
                    if _v is not None: write(_filter(_v))
                write(''' />
      </td>
      <td nowrap id="ql1-tx-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 384, col 29
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 384, col 29.
                write('''" class="inactive" width=100% onclick="clickBox(\'ql1\', ''')
                _v = VFFSL(SL,"number",True) # '$number' on line 384, col 91
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 384, col 91.
                write(''');">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" style="font-size: 13px;"><tr>
          <td width="0%" nowrap>''')
                _v = VFFSL(SL,"link.name",True) # '$link.name' on line 386, col 33
                if _v is not None: write(_filter(_v, rawExpr='$link.name')) # from line 386, col 33.
                write('''</td>
          <td width="100%" align="right">
            <a href="navigation/deletelink?id=''')
                _v = VFFSL(SL,"id",True) # '$id' on line 388, col 47
                if _v is not None: write(_filter(_v, rawExpr='$id')) # from line 388, col 47.
                write('''" title="Delete link" onClick="dontClickBox = true; return confirm(\'This will delete ''')
                _v = VFFSL(SL,"type",True) # '$type' on line 388, col 135
                if _v is not None: write(_filter(_v, rawExpr='$type')) # from line 388, col 135.
                write(''' link ''')
                _v = VFFSL(SL,"link.name",True) # '$link.name' on line 388, col 146
                if _v is not None: write(_filter(_v, rawExpr='$link.name')) # from line 388, col 146.
                write('''!\');"><img border="" alt="Delete" src="/images/form/deleteicon.gif"></a>
            <a href="navigation/editlink?id=''')
                _v = VFFSL(SL,"id",True) # '$id' on line 389, col 45
                if _v is not None: write(_filter(_v, rawExpr='$id')) # from line 389, col 45.
                write('''" title="Edit ''')
                _v = VFFSL(SL,"type",True) # '$type' on line 389, col 62
                if _v is not None: write(_filter(_v, rawExpr='$type')) # from line 389, col 62.
                write(''' link" onClick="dontClickBox = true;"><img border="" alt="Edit" src="/images/form/editicon.gif"></a>
          </td>
        </tr></table>
      </td>
    </tr>
''')
                number = VFFSL(SL,"number",True) + 1
            write('''  </table>

<!-- QUICKLINK #1 END -->

    </td>
    <td width="33%">

<!-- QUICKLINK #2 -->

  <table id="options" width="100%" cellspacing="5" cellpadding="5" border="0" class="homemade-options">
''')
            number = VFFSL(SL,"startnumber",True)
            for link in VFFSL(SL,"homemadelinks",True): # generated from line 407, col 1
                write('''    <tr id="ql2-table-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 408, col 23
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 408, col 23.
                write('''" class="inactive">
      <td id="ql2-cb-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 409, col 22
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 409, col 22.
                write('''" nowrap class="inactive" width=0%>
        <input name="''')
                _v = VFFSL(SL,"link.id",True) # '$link.id' on line 410, col 22
                if _v is not None: write(_filter(_v, rawExpr='$link.id')) # from line 410, col 22.
                write('''" value="qlink2" id="ql2-checkbox-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 410, col 64
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 410, col 64.
                write('''" type="checkbox" onClick="checkBox(this, \'ql2\', ''')
                _v = VFFSL(SL,"number",True) # '$number' on line 410, col 120
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 410, col 120.
                write(''');" class="checkbox" ''')
                id = str(VFN(VFFSL(SL,"link",True),"_getID",False)()[0])
                if VFN(VFFSL(SL,"checked",True),"has_key",False)("KEY" + VFFSL(SL,"id",True)) and VFN(VFFSL(SL,"checked",True)["KEY" + VFFSL(SL,"id",True)],"count",False)('qlink2') : # generated from line 412, col 1
                    _v =  'checked' 
                    if _v is not None: write(_filter(_v))
                else:
                    _v =  ''
                    if _v is not None: write(_filter(_v))
                write(''' />
      </td>
      <td id="ql2-tx-''')
                _v = VFFSL(SL,"number",True) # '$number' on line 414, col 22
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 414, col 22.
                write('''" nowrap class="inactive" width=100% onclick="clickBox(\'ql2\', ''')
                _v = VFFSL(SL,"number",True) # '$number' on line 414, col 91
                if _v is not None: write(_filter(_v, rawExpr='$number')) # from line 414, col 91.
                write(''');">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" style="font-size: 13px;"><tr>
          <td width="0%" nowrap>''')
                _v = VFFSL(SL,"link.name",True) # '$link.name' on line 416, col 33
                if _v is not None: write(_filter(_v, rawExpr='$link.name')) # from line 416, col 33.
                write('''</td>
          <td width="100%" align="right">
            <a href="navigation/deletelink?id=''')
                _v = VFFSL(SL,"id",True) # '$id' on line 418, col 47
                if _v is not None: write(_filter(_v, rawExpr='$id')) # from line 418, col 47.
                write('''" title="Delete ''')
                _v = VFFSL(SL,"type",True) # '$type' on line 418, col 66
                if _v is not None: write(_filter(_v, rawExpr='$type')) # from line 418, col 66.
                write(''' link" onClick="dontClickBox = true; return confirm(\'This will delete ''')
                _v = VFFSL(SL,"type",True) # '$type' on line 418, col 141
                if _v is not None: write(_filter(_v, rawExpr='$type')) # from line 418, col 141.
                write(''' link ''')
                _v = VFFSL(SL,"link.name",True) # '$link.name' on line 418, col 152
                if _v is not None: write(_filter(_v, rawExpr='$link.name')) # from line 418, col 152.
                write('''!\');"><img border="" alt="Delete" src="/images/form/deleteicon.gif"></a>
            <a href="navigation/editlink?id=''')
                _v = VFFSL(SL,"id",True) # '$id' on line 419, col 45
                if _v is not None: write(_filter(_v, rawExpr='$id')) # from line 419, col 45.
                write('''" title="Edit ''')
                _v = VFFSL(SL,"type",True) # '$type' on line 419, col 62
                if _v is not None: write(_filter(_v, rawExpr='$type')) # from line 419, col 62.
                write(''' link" onClick="dontClickBox = true;"><img border="" alt="Edit" src="/images/form/editicon.gif"></a>
          </td>
        </tr></table>
      </td>
    </tr>
''')
                number = VFFSL(SL,"number",True) + 1
            write('''  </table>

<!-- QUICKLINK #2 END -->

    </td>
  </tr>
''')
        write('''  <tr>
    <td>
      <input type="button" value="Cancel" onclick="window.location=\'/preferences/\'">
    </td>
    <td colspan=2 align=right>
      <input type="button" value="Add ''')
        _v = VFFSL(SL,"type",True) # '$type' on line 438, col 39
        if _v is not None: write(_filter(_v, rawExpr='$type')) # from line 438, col 39.
        write(''' 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 - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        

    def writeBody(self, **KWS):



        ## CHEETAH: main method generated for this template
        trans = KWS.get("trans")
        if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
            trans = self.transaction # is None unless self.awake() was called
        if not trans:
            trans = DummyTransaction()
            _dummyTrans = True
        else: _dummyTrans = False
        write = trans.response().write
        SL = self._CHEETAH__searchList
        _filter = self._CHEETAH__currentFilter
        
        ########################################
        ## START - generated method body
        
        #  $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>
        # 
        write('''

''')
        self.content(trans=trans)
        
        ########################################
        ## END - generated method body
        
        return _dummyTrans and trans.response().getvalue() or ""
        
    ##################################################
    ## CHEETAH GENERATED ATTRIBUTES


    _CHEETAH__instanceInitialized = False

    _CHEETAH_version = __CHEETAH_version__

    _CHEETAH_versionTuple = __CHEETAH_versionTuple__

    _CHEETAH_genTime = __CHEETAH_genTime__

    _CHEETAH_genTimestamp = __CHEETAH_genTimestamp__

    _CHEETAH_src = __CHEETAH_src__

    _CHEETAH_srcLastModified = __CHEETAH_srcLastModified__

    _mainCheetahMethod_for_NavbarPreferencesTemplate= 'writeBody'

## END CLASS DEFINITION

if not hasattr(NavbarPreferencesTemplate, '_initCheetahAttributes'):
    templateAPIClass = getattr(NavbarPreferencesTemplate, '_CHEETAH_templateClass', Template)
    templateAPIClass._addCheetahPlumbingCodeToClass(NavbarPreferencesTemplate)


# CHEETAH was developed by Tavis Rudd and Mike Orr
# with code, advice and input from many other volunteers.
# For more information visit http://www.CheetahTemplate.org/

##################################################
## if run from command line:
if __name__ == '__main__':
    from Cheetah.TemplateCmdLineIface import CmdLineIface
    CmdLineIface(templateObj=NavbarPreferencesTemplate()).run()


