#!/usr/bin/env python




##################################################
## DEPENDENCIES
import sys
import os
import os.path
try:
    import builtins as builtin
except ImportError:
    import __builtin__ as builtin
from os.path import getmtime, exists
import time
import types
from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion
from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple
from Cheetah.Template import Template
from Cheetah.DummyTransaction import *
from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList
from Cheetah.CacheRegion import CacheRegion
import Cheetah.Filters as Filters
import Cheetah.ErrorCatchers as ErrorCatchers
from Plugins.Extensions.OpenWebif.controllers.i18n import tstrings

##################################################
## MODULE CONSTANTS
VFFSL=valueFromFrameOrSearchList
VFSL=valueFromSearchList
VFN=valueForName
currentTime=time.time
__CHEETAH_version__ = '2.4.4'
__CHEETAH_versionTuple__ = (2, 4, 4, 'development', 0)
__CHEETAH_genTime__ = 1644610943.107895
__CHEETAH_genTimestamp__ = 'Fri Feb 11 20:22:23 2022'
__CHEETAH_src__ = '/home/nonsolosat/openpli-dreambox-oe-core/build/tmp/work/dm7080-oe-linux/enigma2-plugin-extensions-openwebif/gitAUTOINC+81b15e17ab-r0/git/plugin/controllers/views/ajax/settings.tmpl'
__CHEETAH_srcLastModified__ = 'Fri Feb 11 20:05:52 2022'
__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 settings(Template):

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


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

        super(settings, self).__init__(*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 respond(self, trans=None):



        ## CHEETAH: main method generated for this template
        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(u'''<style>
#packagelist {padding:0;}
#packagelist li.installed {font-weight:bold;}
#packagelist li {list-style-type:none;margin:4px 0;}
#packagelist li i {margin:0 10px;}
#packagelist .g {color:green;}
#packagelist .r {color:red;}
#searchpkd {margin:5px 5px; display:inline-block;}
#packagelist li div {display:inline-table;}
#packagelist li div span {font-weight:initial;font-size:smaller;}
</style>
<div id="content_main" class="ui-widget-content" style="min-height: 500px;background-image:none;">
\t<div id="info">
\t\t<div style="display:table; width: 100%; zoom: 1;">
\t\t\t<div style="display:table-cell;width:220px;">
\t\t\t\t<h3 class="ui-widget-header">''')
        _v = VFFSL(SL,"tstrings",True)['settings'] # u"$tstrings['settings']" on line 17, col 34
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['settings']")) # from line 17, col 34.
        write(u'''</h3>
\t\t\t\t<ol class="sellist" id="slist">
\t\t\t\t<li id=\'themesbtn\' data-id="owsettings" class="ui-selected">''')
        _v = VFFSL(SL,"tstrings",True)['tstr_ow_settings'] # u"$tstrings['tstr_ow_settings']" on line 19, col 65
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['tstr_ow_settings']")) # from line 19, col 65.
        write(u'''</li>
\t\t\t\t<li id=\'bookmarksbtn\' data-id="bookmarks" class="ui-selected">''')
        _v = VFFSL(SL,"tstrings",True)['bookmarks'] # u"$tstrings['bookmarks']" on line 20, col 67
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['bookmarks']")) # from line 20, col 67.
        write(u'''</li>
\t\t\t\t<li id=\'pkgbtn\' data-id="packages" class="ui-selected">''')
        _v = VFFSL(SL,"tstrings",True)['packages'] # u"$tstrings['packages']" on line 21, col 60
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['packages']")) # from line 21, col 60.
        write(u'''</li>
''')
        for sec in VFFSL(SL,"configsections",True): # generated from line 22, col 5
            write(u"""\t\t\t\t\t<li id='""")
            _v = VFFSL(SL,"sec",True)["key"] # u'$sec["key"]' on line 23, col 14
            if _v is not None: write(_filter(_v, rawExpr=u'$sec["key"]')) # from line 23, col 14.
            write(u"""' data-id='ajax/config?section=""")
            _v = VFFSL(SL,"sec",True)["key"] # u'$sec["key"]' on line 23, col 56
            if _v is not None: write(_filter(_v, rawExpr=u'$sec["key"]')) # from line 23, col 56.
            write(u"""'>""")
            _v = VFFSL(SL,"sec",True)["description"] # u'$sec["description"]' on line 23, col 69
            if _v is not None: write(_filter(_v, rawExpr=u'$sec["description"]')) # from line 23, col 69.
            write(u'''</li>
''')
        write(u'''\t\t\t\t</ol>
\t\t\t</div>
\t\t\t<div class="ui-widget-header" style="display:table-cell;background: none;border-bottom:none;border-top:none;border-left:none;width:1px;"></div>
\t\t\t<div style="display:table-cell;">
\t\t\t\t<div style="width: 100%; zoom: 1;">
\t\t\t\t\t<div id="scontent"></div>
\t\t\t\t\t</div>
\t\t<div id=\'osettings\' style="display:none;">
\t\t\t<div id="content_main2">
\t\t\t\t<h3 class="ui-widget-header">''')
        _v = VFFSL(SL,"tstrings",True)['tstr_ow_browser_settings'] # u"$tstrings['tstr_ow_browser_settings']" on line 34, col 34
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['tstr_ow_browser_settings']")) # from line 34, col 34.
        write(u'''</h3>
\t\t\t\t<table id="configuration">
\t\t\t\t<tr><td>''')
        _v = VFFSL(SL,"tstrings",True)['tstr_theme'] # u"$tstrings['tstr_theme']" on line 36, col 13
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['tstr_theme']")) # from line 36, col 13.
        write(u'''</td><td>
\t\t\t\t<select name="selectheme" id="selectheme" style="min-width: 150px;margin: 5px;border:none;font-size: 1em;">
''')
        for stheme in VFFSL(SL,"themes",True): # generated from line 38, col 5
            if VFFSL(SL,"stheme",True) == VFFSL(SL,"theme",True): # generated from line 39, col 6
                write(u'''\t\t\t\t\t\t<option selected="selected">''')
                _v = VFFSL(SL,"stheme",True) # u'$stheme' on line 40, col 35
                if _v is not None: write(_filter(_v, rawExpr=u'$stheme')) # from line 40, col 35.
                write(u'''</option>
''')
            else: # generated from line 41, col 6
                write(u'''\t\t\t\t\t\t<option>''')
                _v = VFFSL(SL,"stheme",True) # u'$stheme' on line 42, col 15
                if _v is not None: write(_filter(_v, rawExpr=u'$stheme')) # from line 42, col 15.
                write(u'''</option>
''')
        write(u'''\t\t\t\t</select>
\t\t\t\t</td></tr>
\t\t\t\t<tr><td>''')
        _v = VFFSL(SL,"tstrings",True)['zapbeforestream'] # u"$tstrings['zapbeforestream']" on line 47, col 13
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['zapbeforestream']")) # from line 47, col 13.
        write(u'''</td><td>
''')
        if VFFSL(SL,"zapstream",True): # generated from line 48, col 5
            write(u'''\t\t\t\t<input type="checkbox" name="zapstream" checked="checked"/>
''')
        else: # generated from line 50, col 5
            write(u'''\t\t\t\t<input type="checkbox" name="zapstream"/>
''')
        write(u'''\t\t\t\t</td></tr>
\t\t\t\t<tr><td>''')
        _v = VFFSL(SL,"tstrings",True)['show_picons'] # u"$tstrings['show_picons']" on line 54, col 13
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['show_picons']")) # from line 54, col 13.
        write(u'''</td><td>
''')
        if VFFSL(SL,"showpicons",True): # generated from line 55, col 5
            write(u'''\t\t\t\t<input type="checkbox" name="showpicons" checked="checked"/>
''')
        else: # generated from line 57, col 5
            write(u'''\t\t\t\t<input type="checkbox" name="showpicons"/>
''')
        write(u'''\t\t\t\t</td></tr>
\t\t\t\t<tr><td>''')
        _v = VFFSL(SL,"tstrings",True)['show_details_in_channel_list'] # u"$tstrings['show_details_in_channel_list']" on line 61, col 13
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['show_details_in_channel_list']")) # from line 61, col 13.
        write(u'''</td><td>
''')
        if VFFSL(SL,"showchanneldetails",True): # generated from line 62, col 5
            write(u'''\t\t\t\t<input type="checkbox" name="showchanneldetails" checked="checked"/>
''')
        else: # generated from line 64, col 5
            write(u'''\t\t\t\t<input type="checkbox" name="showchanneldetails"/>
''')
        write(u'''\t\t\t\t</td></tr>
\t\t\t\t<tr><td>''')
        _v = VFFSL(SL,"tstrings",True)['show_iptv_channels_in_selection'] # u"$tstrings['show_iptv_channels_in_selection']" on line 68, col 13
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['show_iptv_channels_in_selection']")) # from line 68, col 13.
        write(u'''</td><td>
''')
        if VFFSL(SL,"showiptvchannelsinselection",True): # generated from line 69, col 5
            write(u'''\t\t\t\t<input type="checkbox" name="showiptvchannelsinselection" checked="checked"/>
''')
        else: # generated from line 71, col 5
            write(u'''\t\t\t\t<input type="checkbox" name="showiptvchannelsinselection"/>
''')
        write(u'''\t\t\t\t</td></tr>
\t\t\t\t<tr><td>''')
        _v = VFFSL(SL,"tstrings",True)['use_channel_name_for_screenshots'] # u"$tstrings['use_channel_name_for_screenshots']" on line 75, col 13
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['use_channel_name_for_screenshots']")) # from line 75, col 13.
        write(u'''</td><td>
''')
        if VFFSL(SL,"screenshotchannelname",True): # generated from line 76, col 5
            write(u'''\t\t\t\t<input type="checkbox" name="screenshotchannelname" checked="checked"/>
''')
        else: # generated from line 78, col 5
            write(u'''\t\t\t\t<input type="checkbox" name="screenshotchannelname"/>
''')
        write(u'''\t\t\t\t</td></tr>
\t\t\t\t<tr><td>''')
        _v = VFFSL(SL,"tstrings",True)['tstr_moviedb'] # u"$tstrings['tstr_moviedb']" on line 82, col 13
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['tstr_moviedb']")) # from line 82, col 13.
        write(u'''</td><td>
\t\t\t\t<select name="selectmoviedb" id="selectmoviedb" style="min-width: 150px;margin: 5px;border:none;font-size: 1em;">
''')
        for smoviedb in VFFSL(SL,"moviedbs",True): # generated from line 84, col 5
            if VFFSL(SL,"smoviedb",True) == VFFSL(SL,"moviedb",True): # generated from line 85, col 6
                write(u'''\t\t\t\t\t\t<option selected="selected">''')
                _v = VFFSL(SL,"smoviedb",True) # u'$smoviedb' on line 86, col 35
                if _v is not None: write(_filter(_v, rawExpr=u'$smoviedb')) # from line 86, col 35.
                write(u'''</option>
''')
            else: # generated from line 87, col 6
                write(u'''\t\t\t\t\t\t<option>''')
                _v = VFFSL(SL,"smoviedb",True) # u'$smoviedb' on line 88, col 15
                if _v is not None: write(_filter(_v, rawExpr=u'$smoviedb')) # from line 88, col 15.
                write(u'''</option>
''')
        write(u'''\t\t\t\t</select>
\t\t\t\t</td></tr>
\t\t\t\t<tr><td>''')
        _v = VFFSL(SL,"tstrings",True)['tstr_spinner'] # u"$tstrings['tstr_spinner']" on line 93, col 13
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['tstr_spinner']")) # from line 93, col 13.
        write(u'''</td><td>
\t\t\t\t<span class="spinner">
\t\t\t\t<fieldset style="border:none;" id="fsspinner">
\t\t\t\t<label for="fa-spinner"><i class="fa fa-spinner"></i></label>
\t\t\t\t<input type="radio" name="Spin" id="fa-spinner">
\t\t\t\t<label for="fa-spin1"><i class="fa fa-spin1"></i></label>
\t\t\t\t<input type="radio" name="Spin" id="fa-spin1">
\t\t\t\t<label for="fa-spin2"><i class="fa fa-spin2"></i></label>
\t\t\t\t<input type="radio" name="Spin" id="fa-spin2">
\t\t\t\t<label for="fa-spin3"><i class="fa fa-spin3"></i></label>
\t\t\t\t<input type="radio" name="Spin" id="fa-spin3">
\t\t\t\t<label for="fa-spin4"><i class="fa fa-spin4"></i></label>
\t\t\t\t<input type="radio" name="Spin" id="fa-spin4">
\t\t\t\t<label for="fa-spin5"><i class="fa fa-spin5"></i></label>
\t\t\t\t<input type="radio" name="Spin" id="fa-spin5">
\t\t\t\t<label for="fa-spin6"><i class="fa fa-spin6"></i></label>
\t\t\t\t<input type="radio" name="Spin" id="fa-spin6">
\t\t\t\t</fieldset>
\t\t\t\t</span>
\t\t\t\t</td></tr>
\t\t\t\t<tr><td>''')
        _v = VFFSL(SL,"tstrings",True)['playlistformat'] # u"$tstrings['playlistformat']" on line 113, col 13
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['playlistformat']")) # from line 113, col 13.
        write(u'''</td><td>
\t\t\t\t<span class="pl">
\t\t\t\t<fieldset style="border:none;" id="fspl">
\t\t\t\t<label for="m3u">M3U</label>
\t\t\t\t<input type="radio" name="PL" id="m3u">
\t\t\t\t<label for="xspf">XSPF</label>
\t\t\t\t<input type="radio" name="PL" id="xspf">
\t\t\t\t</fieldset>
\t\t\t\t</span>
\t\t\t\t</td></tr>
\t\t\t\t<tr><td>''')
        _v = VFFSL(SL,"tstrings",True)['showallpackages'] # u"$tstrings['showallpackages']" on line 123, col 13
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['showallpackages']")) # from line 123, col 13.
        write(u'''</td><td>
''')
        if VFFSL(SL,"showallpackages",True): # generated from line 124, col 5
            write(u'''\t\t\t\t<input type="checkbox" name="showallpackages" checked="checked"/>
''')
        else: # generated from line 126, col 5
            write(u'''\t\t\t\t<input type="checkbox" name="showallpackages"/>
''')
        write(u'''\t\t\t\t</td></tr>
\t\t\t\t<tr><td>''')
        _v = VFFSL(SL,"tstrings",True)['tstr_smallremote'] # u"$tstrings['tstr_smallremote']" on line 130, col 13
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['tstr_smallremote']")) # from line 130, col 13.
        write(u'''</td><td>
\t\t\t\t<select name="selectsmallremote" id="selectsmallremote" style="min-width: 150px;margin: 5px;border:none;font-size: 1em;">
''')
        for sr in VFFSL(SL,"smallremotes",True): # generated from line 132, col 5
            if VFFSL(SL,"sr",True)[0] == VFFSL(SL,"smallremote",True): # generated from line 133, col 6
                write(u'''\t\t\t\t\t\t<option value="''')
                _v = VFFSL(SL,"sr",True)[0] # u'$sr[0]' on line 134, col 22
                if _v is not None: write(_filter(_v, rawExpr=u'$sr[0]')) # from line 134, col 22.
                write(u'''" selected="selected">''')
                _v = VFFSL(SL,"sr",True)[1] # u'$sr[1]' on line 134, col 50
                if _v is not None: write(_filter(_v, rawExpr=u'$sr[1]')) # from line 134, col 50.
                write(u'''</option>
''')
            else: # generated from line 135, col 6
                write(u'''\t\t\t\t\t\t<option value="''')
                _v = VFFSL(SL,"sr",True)[0] # u'$sr[0]' on line 136, col 22
                if _v is not None: write(_filter(_v, rawExpr=u'$sr[0]')) # from line 136, col 22.
                write(u'''">''')
                _v = VFFSL(SL,"sr",True)[1] # u'$sr[1]' on line 136, col 30
                if _v is not None: write(_filter(_v, rawExpr=u'$sr[1]')) # from line 136, col 30.
                write(u'''</option>
''')
        write(u'''\t\t\t\t</select>
\t\t\t\t</td></tr>
''')
        if VFFSL(SL,"getVar",False)("responsivedesign", "") != "": # generated from line 141, col 5
            write(u'''\t\t\t\t\t<tr><td>''')
            _v = VFFSL(SL,"tstrings",True)['use_modern_design'] # u"$tstrings['use_modern_design']" on line 142, col 14
            if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['use_modern_design']")) # from line 142, col 14.
            write(u'''</td><td>
''')
            if VFFSL(SL,"responsivedesign",True): # generated from line 143, col 6
                write(u'''\t\t\t\t\t<input type="checkbox" name="responsivedesign" checked="checked"/>
''')
            else: # generated from line 145, col 6
                write(u'''\t\t\t\t\t<input type="checkbox" name="responsivedesign"/>
''')
            write(u'''\t\t\t\t\t</td></tr>
''')
        write(u'''\t\t\t\t</table>
\t\t\t</div>
\t\t</div>
\t\t<div id=\'packages\' style="display:none;">
\t\t\t<div id="content_main2">
\t\t\t\t<h3 class="ui-widget-header">''')
        _v = VFFSL(SL,"tstrings",True)['packages'] # u"$tstrings['packages']" on line 155, col 34
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['packages']")) # from line 155, col 34.
        write(u'''</h3>
\t\t\t\t<div>
\t\t\t\t\t<span id="tb2">
\t\t\t\t\t<input class="pkgbtn" type="radio" id="pkgbtn1" name="tb2" checked="checked" /><label for="pkgbtn1">''')
        _v = VFFSL(SL,"tstrings",True)['update'] # u"$tstrings['update']" on line 158, col 106
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['update']")) # from line 158, col 106.
        write(u'''</label>
\t\t\t\t\t<input class="pkgbtn" type="radio" id="pkgbtn2" name="tb2" /><label for="pkgbtn2">''')
        _v = VFFSL(SL,"tstrings",True)['installed'] # u"$tstrings['installed']" on line 159, col 88
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['installed']")) # from line 159, col 88.
        write(u'''</label>
\t\t\t\t\t<input class="pkgbtn" type="radio" id="pkgbtn3" name="tb2" /><label for="pkgbtn3">''')
        _v = VFFSL(SL,"tstrings",True)['all'] # u"$tstrings['all']" on line 160, col 88
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['all']")) # from line 160, col 88.
        write(u'''</label>
\t\t\t\t\t<input class="pkgbtn" type="radio" id="pkgbtn4" name="tb2" /><label for="pkgbtn4">''')
        _v = VFFSL(SL,"tstrings",True)['more'] # u"$tstrings['more']" on line 161, col 88
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['more']")) # from line 161, col 88.
        write(u'''</label>
\t\t\t\t\t</span>
\t\t\t\t\t<div id="searchpkd"><label for="searchpk">Search:</label><input id="searchpk" value="..." class=\'ui-widget ui-widget-content ui-corner-all\'>
\t\t\t\t\t<label for="showdetails">''')
        _v = VFFSL(SL,"tstrings",True)['showdetails'] # u"$tstrings['showdetails']" on line 164, col 31
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['showdetails']")) # from line 164, col 31.
        write(u'''</label>
\t\t\t\t\t<input type="checkbox" name="showdetails" checked="checked"/>
\t\t\t\t\t</div>
\t\t\t\t</div>
\t\t\t\t<div id="pkgmore">
\t\t\t\t\t<br><br>
\t\t\t\t\t<button id="updatefeed">''')
        _v = VFFSL(SL,"tstrings",True)['update_feed'] # u"$tstrings['update_feed']" on line 170, col 30
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['update_feed']")) # from line 170, col 30.
        write(u'''</button>
\t\t\t\t\t<br><br>
\t\t\t\t\t<button id="upgrade">''')
        _v = VFFSL(SL,"tstrings",True)['upgrade_packages'] # u"$tstrings['upgrade_packages']" on line 172, col 27
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['upgrade_packages']")) # from line 172, col 27.
        write(u'''</button>
\t\t\t\t\t<br><br>
\t\t\t\t\t<div id="pkgupload">
\t\t\t\t\t\t<button id="selectfile">''')
        _v = VFFSL(SL,"tstrings",True)['select_ipk_upload'] # u"$tstrings['select_ipk_upload']" on line 175, col 31
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['select_ipk_upload']")) # from line 175, col 31.
        write(u'''</button>
\t\t\t\t\t\t<br><br>
\t\t\t\t\t\t''')
        _v = VFFSL(SL,"tstrings",True)['uploaded_files'] # u"$tstrings['uploaded_files']" on line 177, col 7
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['uploaded_files']")) # from line 177, col 7.
        write(u''':<br>
\t\t\t\t\t\t<ul id=\'tmpfiles\'></ul>
\t\t\t\t\t\t<br><br>
\t\t\t\t\t\t<form id="uploadpkg" style="display:none" action"uploadpkg"="" method="post" enctype="multipart/form-data" encoding="multipart/form-data">
\t\t\t\t\t\t<input type="file" name="rfile" id="rfile" maxlength="100000">
\t\t\t\t\t\t<input type="hidden" name="filename" id="filename">
\t\t\t\t\t\t</form>
\t\t\t\t\t</div>
\t\t\t\t\t<textarea id="resulttext" style=\'height:300px;width:100%\'>
\t\t\t\t\t</textarea>
\t\t\t\t</div>
\t\t\t\t<div id="tblpackages">
\t\t\t\t\t<ul id="packagelist"><div id=\'spinner\'><div class=\'fa fa-spinner fa-spin\'></div></div></ul>
\t\t\t\t</div>
\t\t\t</div>
\t\t</div>
\t\t<div id=\'bookmarks\' style="display:none;">
\t\t\t<div id="content_main2">
\t\t\t\t<h3 class="ui-widget-header">''')
        _v = VFFSL(SL,"tstrings",True)['bookmarks'] # u"$tstrings['bookmarks']" on line 195, col 34
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['bookmarks']")) # from line 195, col 34.
        write(u'''</h3>
\t\t\t\t<table id="configuration">
\t\t\t\t<tr><td>''')
        _v = VFFSL(SL,"tstrings",True)['bookmark'] # u"$tstrings['bookmark']" on line 197, col 13
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['bookmark']")) # from line 197, col 13.
        write(u'''</td><td>&nbsp;</td></tr>
''')
        for location in VFFSL(SL,"locations",True): # generated from line 198, col 5
            write(u'''\t\t\t\t\t<tr><td>''')
            _v = VFFSL(SL,"location",True) # u'$location' on line 199, col 14
            if _v is not None: write(_filter(_v, rawExpr=u'$location')) # from line 199, col 14.
            write(u'''</td><td><a href=\'#\' onclick="deleteBookmark(\'''')
            _v = VFFSL(SL,"location",True) # u'$location' on line 199, col 69
            if _v is not None: write(_filter(_v, rawExpr=u'$location')) # from line 199, col 69.
            write(u'''\'); return false;" title=""><div><i class="fa fa-trash-o"></i></div></a></td></tr>
''')
        write(u'''\t\t\t\t<tr><td><input type="text" id="addbookmarktext" value=""></td><td><a href=\'#\' onclick="addBookmark(); return false;" title=""><div><i class="fa fa-plus"></i></div></a></td></tr>
\t\t\t\t</table>
\t\t\t</div>
\t\t</div>
\t\t</div>
\t\t</div>
\t</div>
</div>
<script type="text/javascript">
var str_db = "''')
        _v = VFFSL(SL,"tstrings",True)['delete_bookmark'] # u"$tstrings['delete_bookmark']" on line 210, col 15
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['delete_bookmark']")) # from line 210, col 15.
        write(u'''";
var str_upl = "''')
        _v = VFFSL(SL,"tstrings",True)['upload_package'] # u"$tstrings['upload_package']" on line 211, col 16
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['upload_package']")) # from line 211, col 16.
        write(u'''";
var str_rmp = "''')
        _v = VFFSL(SL,"tstrings",True)['remove_package'] # u"$tstrings['remove_package']" on line 212, col 16
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['remove_package']")) # from line 212, col 16.
        write(u'''";
var str_up = "''')
        _v = VFFSL(SL,"tstrings",True)['update_package'] # u"$tstrings['update_package']" on line 213, col 15
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['update_package']")) # from line 213, col 15.
        write(u'''";
var str_ip = "''')
        _v = VFFSL(SL,"tstrings",True)['install_package'] # u"$tstrings['install_package']" on line 214, col 15
        if _v is not None: write(_filter(_v, rawExpr=u"$tstrings['install_package']")) # from line 214, col 15.
        write(u'''";
''')
        if VFFSL(SL,"showallpackages",True): # generated from line 215, col 1
            write(u"""var reqfilter = '';
""")
        else: # generated from line 217, col 1
            write(u"""var reqfilter = '&filter=all';
""")
        write(u'''
// TODO minimize js

var filteredpkg;
var filterval=\'\';


function deleteBookmark(bm) {
\tif (confirm(str_db + \' ( \' + bm + \') ?\') === false) {
\t\treturn;
\t}

\t$.ajax({
\t\turl: "/api/removelocation?dirname=" + bm,
\t\tdataType: "json",
\t\tsuccess: function(loc) {
\t\t\tif (loc.result)
\t\t\t\tload_maincontent_spin("/ajax/settings");
\t\t\telse
\t\t\t\talert(loc.message);
\t\t}
\t});
}

function addBookmark() {
\tbm = $("#addbookmarktext").val();

\tif(bm.length==0 || bm.includes(" ")) {
\t\talert("Path Error");
\t\treturn;
\t}

\t$.ajax({
\t\turl: "/api/addlocation?dirname=" + bm,
\t\tdataType: "json",
\t\tsuccess: function(loc) {
\t\t\tif (loc.result)
\t\t\t\tload_maincontent_spin("/ajax/settings");
\t\t\telse
\t\t\t\talert(loc.message);
\t\t}
\t});
}

function prepareUpload() {
\tvar fn = $(this).val();
\tfn = fn.replace(\'C:\\\\fakepath\\\\\',\'\');
\tif (confirm(str_upl + \' ( \' + fn + \') ?\') === false) {
\t\treturn;
\t}

\tvar frm = document.forms["uploadpkg"];
\tfrm.filename.value = fn;

\t$(\'form#uploadpkg\')
\t\t.unbind(\'submit\')
\t\t.submit(function (e) 
\t{
\t\tvar formData = new FormData(this);
\t\t$.ajax({
\t\t\turl: \'/ipkg/upload\',
\t\t\ttype: \'POST\',
\t\t\tdata: formData,
\t\t\tmimeType:"multipart/form-data",
\t\t\tcontentType: false,
\t\t\tcache: false,
\t\t\tprocessData:false,
\t\t\tdataType: \'json\',
\t\t\tsuccess: function (data, textStatus, jqXHR) {
\t\t\t\tvar r = data.Result;
\t\t\t\tif (r[0]==true) {
\t\t\t\t\talert("DONE");
\t\t\t\t} else {
\t\t\t\t\talert("Upload File Error: " + r[1]);
\t\t\t\t}
\t\t\t},
\t\t\terror: function (jqXHR, textStatus, errorThrown) {
\t\t\t\talert("Upload File Error: " + errorThrown);
\t\t\t}
\t\t});
\t\te.preventDefault();
\t\ttry {
\t\t\te.unbind();
\t\t} catch(e){}
\t});
\t$(\'form#uploadpkg\').submit();
}

function getPkgFilename(){
\tvar frm = document.forms["form_uploadpkg"];
\tfrm.filename.value = frm.file.value;
}

function ShowFilterPackages()
{
\tvar row=\'\';
\tvar showdesc = $("input[name=showdetails]").is(\':checked\');
\t$.each( filteredpkg, function( key, val ) {
\t\tvar name = val[\'name\'];
\t\tvar desc = val[\'d\'];
\t\tif(filterval=== \'\' || name.toLowerCase().search(filterval.toLowerCase()) !== -1 || desc.toLowerCase().search(filterval.toLowerCase()) !== -1) {
\t\t\tvar upd = (val[\'u\'] == \'0\') ? "":val[\'u\'];
\t\t\tvar i = val[\'i\'];
\t\t\tvar sel = (i == \'1\') ? "class=\'installed\' ":"";
\t\t\tif(i == \'1\' && val[\'u\'] != \'0\')
\t\t\t\ti = \'2\';
\t\t\tvar ico = (i == \'1\') ? "fa-trash-o r":"fa-save g";
\t\t\tif(upd!=\'\') {
\t\t\t\tupd = " -> " + upd;
\t\t\t}
\t\t\trow += "<li "+sel+"data-i=\'"+i+"\' data-n=\'"+name+"\'>"+ "<i class=\'fa "+ico+"\'></i><div>" + name +" (" + val[\'v\'] + upd +")";
\t\t\tif(showdesc)
\t\t\t{
\t\t\t\trow += "<br><span>" + desc + "</span>";
\t\t\t}
\t\t\trow += "</div></li>";
\t\t}
\t});
\t$("#packagelist").html(row);

\t$(\'#packagelist > li\').click( function () {
\t\task($(this),false);
\t});

}

function FillPackages(pkgs,mode)
{

\tvar _update = $.grep(pkgs, function(v) {
\t\treturn (v.u != \'0\');
\t});
\tvar _installed = $.grep(pkgs, function(v) {
\t\treturn (v.i == \'1\');
\t});

\tif (mode == \'pkgbtn1\')
\t\tfilteredpkg = _update.slice();
\telse if (mode == \'pkgbtn2\') {
\t\tfilteredpkg = _installed.slice();
\t} else
\t\tfilteredpkg = pkgs.slice();

\t$("#packagelist").html(\'\');

\tShowFilterPackages();

}

function ask(obj,man)
{
\tvar pk = $(obj).html();
\tvar i = $(obj).data(\'i\');
\tif(!man) {
\t\tpk = $(obj).data(\'n\');
\t}

\tvar cmd = \'\';

\tif(i==\'1\') {
\t\tif (confirm(str_rmp + \' ( \' + pk + \') ?\') === true) {
\t\t\tcmd = \'remove&package=\' + pk;
\t\t}
\t} else if (i==\'2\') {
\t\tif (confirm(str_up + \' ( \' + pk + \') ?\') === true) {
\t\t\tcmd = \'install&package=\' + pk;
\t\t}
\t} else {
\t\tif (confirm(str_ip + \' ( \' + pk + \') ?\') === true) {
\t\t\tcmd = \'install&package=\' + pk;
\t\t}
\t}

\tif(cmd != \'\')
\t{
\t\tAction(\'/ipkg?command=\'+cmd,\'true\');
\t\t$("#tblpackages").hide();
\t\t$("#pkgmore").show();
\t\t$(\'#pkgbtn4\').prop(\'checked\', true);
\t}
}

function Action(action,rl)
{
\t$(\'#resulttext\').val(\'\');
\t$.ajax({
\t\turl: action,
\t\tsuccess: function ( data ) {
\t\t\tvar txt = data.replace(\'<html><body>\',\'\').replace(\'</body></html>\',\'\').replace(/<br>/g,\'\');
\t\t\t$(\'#resulttext\').val(txt);
\t\t\tif(rl !== undefined) {
\t\t\t\tSetLSValue(\'pkg-date\',\'\');
\t\t\t}
\t\t}
\t});
}

function ShowPackages(mode)
{
\t$("#tblpackages").hide();
\tif (mode == \'pkgbtn4\') {
\t\t$("#pkgmore").show();
\t\tif(noupload)
\t\t\treturn;
\t\t$(\'#tmpfiles\').empty();
\t\t$.ajax({
\t\t\turl: \'/ipkg?command=tmp\',
\t\t\tdataType: \'json\',
\t\t\tsuccess: function (data) {
\t\t\t\tvar files = \'\';
\t\t\t\t$.each( data.ipkfiles, function( key, val ) {
\t\t\t\t\tfiles+=\'<li>\' + val[\'name\'] + \'</li>\'
\t\t\t\t});
\t\t\t\t$(\'#tmpfiles\').html(files);
\t\t\t\t$(\'#tmpfiles > li\').click( function () {
\t\t\t\t\task($(this),true);
\t\t\t\t});
\t\t\t}
\t\t});
\t\treturn;
\t}

\t$("#pkgmore").hide();
\t$("#tblpackages").show();

\tvar date = new Date();
\tdate = date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate()+date.getHours();

\tvar cache = GetLSValue(\'pkg-date\',\'\')
\tif(cache === date) {
\t\tcache = GetLSValue(\'pkg-data\',null);
\t\tif(cache != null) {
\t\t\tvar pkgs = JSON.parse(cache);
\t\t\tFillPackages(pkgs,mode);
\t\t\treturn;
\t\t}
\t}

\t$.ajax({
\t\turl: \'/ipkg?command=listall\' + reqfilter,
\t\tdataType: \'json\',
\t\tsuccess: function ( data ) {
\t\t\tvar sdata = JSON.stringify(data);
\t\t\tSetLSValue(\'pkg-date\',date);
\t\t\tSetLSValue(\'pkg-data\',sdata);
\t\t\tFillPackages(data,mode);
\t\t}
\t});
}

function load_scontent(url) {
\t$("#scontent").html(\'\');
\t$("#osettings").hide();
\t$("#packages").hide();
\t$("#bookmarks").hide();
\tif(url==\'bookmarks\')
\t{
\t\t$("#bookmarks").show();
\t\treturn;
\t}
\tif(url==\'owsettings\')
\t{
\t\t$("#osettings").show();
\t\t$("#selectheme").change(function() {
\t\t\t$.ajax({
\t\t\t\turl: "api/setwebconfig?theme=" + $(this).val(),
\t\t\t\tsuccess: function() {
\t\t\t\t\twindow.location.hash = \'#settings\';
\t\t\t\t\twindow.location.reload(true);
\t\t\t\t}
\t\t\t});
\t\t});
\t\t$("#selectmoviedb").change(function() {
\t\t\t$.ajax({
\t\t\t\turl: "api/setwebconfig?moviedb=" + $(this).val(),
\t\t\t});
\t\t});
\t\t$("#selectsmallremote").change(function() {
\t\t\t$.ajax({
\t\t\t\turl: "api/setwebconfig?smallremote=" + $(this).val(),
\t\t\t\tsuccess: function() {
\t\t\t\t\twindow.location.hash = \'\';
\t\t\t\t\twindow.location.reload(true);
\t\t\t\t}
\t\t\t});
\t\t});
\t\treturn;
\t}
\tif(url==\'packages\')
\t{
\t\t$("#packages").show();
\t\tShowPackages(\'pkgbtn1\');
\t\treturn;
\t}
\t$("#scontent").load(url , function () {
\t\t$("#scontent").find("#content_main").attr("id","content_main1");
\t});
\treturn false;
}

$(function() {
\t$( "#slist" ).selectable({
\t\tselected: function( event, ui ) {
\t\t\tvar ids = $(\'#slist .ui-selected\').map(function() {
\t\t\t\tif($(this).data(\'id\') !== undefined) {
\t\t\t\t\tload_scontent($(this).data(\'id\'));
\t\t\t\t}
\t\t\t});
\t\t},
\t\tclasses: {
\t\t\t"ui-selected": getActiveCls()
\t\t}
\t});
\tload_scontent(\'owsettings\');

\t$(".spinner input[type=\'radio\']").checkboxradio({ icon: false });
\t$(".spinner fieldset").controlgroup();
\tvar spin = GetLSValue(\'spinner\',\'fa-spinner\');
\t$(\'#\'+spin).attr(\'checked\', true).checkboxradio("refresh");
\t$(".spinner input:radio").change(function() {
\t\tSetLSValue(\'spinner\',$(this).attr(\'id\'));
\t\tSetSpinner();
\t});

\t$(".pl input[type=\'radio\']").checkboxradio({ icon: false });
\t$(".pl fieldset").controlgroup();
\tvar pl = GetLSValue(\'pl\',\'m3u\');
\t$(\'#\'+pl).attr(\'checked\', true).checkboxradio("refresh");
\t$(".pl input:radio").change(function() {
\t\tSetLSValue(\'pl\',$(this).attr(\'id\'));
\t});

\tsetHover(\'#slist li\');
\t$(\'#fsspinner > label\').css(\'padding-left\',\'10px\');
\t$(\'#fsspinner > label\').css(\'padding-right\',\'10px\');
\t$("#themesbtn").addClass(getActiveCls());

\t$("input[name=zapstream]").click(function(evt) {
\t\tvar ch = evt.currentTarget.checked;
\t\t$(\'input[name=zapstream]\').attr(\'checked\', ch);
\t\twebapi_execute("/api/setwebconfig?zapstream=" + ch);
\t});

\t$("input[name=showpicons]").click(function(evt) {
\t\tvar ch = evt.currentTarget.checked;
\t\t$(\'input[name=showpicons]\').attr(\'checked\', ch);
\t\twebapi_execute("/api/setwebconfig?showpicons=" + ch);
\t});

\t$("input[name=showchanneldetails]").click(function(evt) {
\t\tvar ch = evt.currentTarget.checked;
\t\t$(\'input[name=showchanneldetails]\').attr(\'checked\', ch);
\t\twebapi_execute("/api/setwebconfig?showchanneldetails=" + ch);
\t});

\t$("input[name=showiptvchannelsinselection]").click(function(evt) {
\t\tvar ch = evt.currentTarget.checked;
\t\t$(\'input[name=showiptvchannelsinselection]\').attr(\'checked\', ch);
\t\twebapi_execute("/api/setwebconfig?showiptvchannelsinselection=" + ch);
\t});
\t
\t$("input[name=screenshotchannelname]").click(function(evt) {
\t\tvar ch = evt.currentTarget.checked;
\t\t$(\'input[name=screenshotchannelname]\').attr(\'checked\', ch);
\t\twebapi_execute("/api/setwebconfig?screenshotchannelname=" + ch);
\t});

\t$("input[name=showallpackages]").click(function(evt) {
\t\tvar ch = evt.currentTarget.checked;
\t\t$(\'input[name=showallpackages]\').attr(\'checked\', ch);
\t\twebapi_execute("/api/setwebconfig?showallpackages=" + ch);
\t});

\t$("input[name=responsivedesign]").click(function(evt) {
\t\tvar ch = evt.currentTarget.checked;
\t\t$(\'input[name=responsivedesign]\').attr(\'checked\', ch);
\t\t$.ajax({
\t\t\turl: "api/setwebconfig?responsivedesign=" + ch,
\t\t\tsuccess: function() {
\t\t\t\twindow.location.hash = \'\';
\t\t\t\twindow.location.reload(true);
\t\t\t}
\t\t});
\t});
\t
\t$("input[name=showdetails]").click(function(evt) {
\t\tShowFilterPackages();
\t});

\t$(\'#tb2\').buttonset();
\t$(\'#tb3\').buttonset();
\t$(\'.pkgbtn\').click(function () { ShowPackages($(this).attr(\'id\')); });
\t$(\'#selectfile\').click(function () {$("#rfile").trigger(\'click\'); });
\t$(\'#rfile\').change(prepareUpload);
\t$(\'#updatefeed\').click(function () {Action(\'/ipkg?command=update\',true); });
\t$(\'#upgrade\').click(function () {Action(\'/ipkg?command=upgrade\',\'true\'); });
\t
\t$(\'#searchpk\').focus(function () { 
\t\tif ($(this).val() === \'...\') {
\t\t\t$(this).val(\'\');
\t\t}
\t}).keyup(function (){
\t\tif ($(this).data(\'val\') !== this.value) {
\t\t\tfilterval=this.value;
\t\t\tShowFilterPackages();
\t\t}
\t\t$(this).data(\'val\', this.value);
\t}); /*.blur(function (){
\t\tfilterval=\'\';
\t\t$(this).data(\'val\', \'\');
\t\tif ($(this).val() === \'\') {
\t\t\t$(this).val(\'...\');
\t\t}
\t});
\t*/
});
''')
        if VFFSL(SL,"allowipkupload",True): # generated from line 638, col 1
            write(u'''var noupload=true;
''')
        else: # generated from line 640, col 1
            write(u'''$(function() {
\t$("#pkgupload").remove();
});
var noupload=false;
''')
        write(u'''</script>
''')
        
        ########################################
        ## 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_settings= 'respond'

## END CLASS DEFINITION

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


# 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=settings()).run()


