Narweb: add php session_start (#1169)

* Narweb: add php session_start

Fixes #12135

- remove php3
- remove duplicate code

* libhtml: better pylint score
This commit is contained in:
Serge Noiraud
2021-02-13 17:39:03 +01:00
committed by GitHub
parent 94ddf6a815
commit 66680851f2
5 changed files with 181 additions and 145 deletions

View File

@@ -30,7 +30,6 @@ This module exports the Html class
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# Python modules # Python modules
#------------------------------------------------------------------------ #------------------------------------------------------------------------
import re
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# #
@@ -114,10 +113,10 @@ class Html(list):
""" """
Build and return an XML declaration statement Build and return an XML declaration statement
:type version: decimal number :type version: decimal number
:param version: version of XML to be used. Defaults to 1.0 :param version: version of XML to be used. Defaults to 1.0
:type encoding: string :type encoding: string
:param encoding: encoding method to be used. Defaults to "UTF-8" :param encoding: encoding method to be used. Defaults to "UTF-8"
:type standalone: string :type standalone: string
:param standalone: "yes" or "no". Defaults to "no" :param standalone: "yes" or "no". Defaults to "no"
""" """
@@ -132,16 +131,16 @@ class Html(list):
""" """
Build and return a DOCTYPE statement Build and return a DOCTYPE statement
:type name: string :type name: string
:param name: name of this DOCTYPE. Defaults to "html" :param name: name of this DOCTYPE. Defaults to "html"
:type public: string :type public: string
:param public: class of this DOCTYPE. Defaults to 'PUBLIC :param public: class of this DOCTYPE. Defaults to 'PUBLIC
:type external_id: string :type external_id: string
:param external_id: external identifier of this DOCTYPE. :param external_id: external identifier of this DOCTYPE.
Defaults to XHTML 1.0 STRICT Defaults to XHTML 1.0 STRICT
:type args: object :type args: object
:param args: 0 or more positional parameters to be added to this :param args: 0 or more positional parameters to be added to
DOCTYPE. this DOCTYPE.
""" """
return ( return (
'<!DOCTYPE %s %s %s' % ( '<!DOCTYPE %s %s %s' % (
@@ -152,38 +151,40 @@ class Html(list):
).rstrip() + '>' ).rstrip() + '>'
# #
@staticmethod @staticmethod
def html(xmlns=_XMLNS, lang='en', *args, **keywargs): def html(xmlns=_XMLNS, lang='en', php_session=None, *args, **keywargs):
""" """
Build and return a properly-formated <html> object Build and return a properly-formated <html> object
:type xmlns: string :type xmlns: string
:param xmlns: XML namespace string. Default = 'http://www.w3.org/1999/xhtml' :param xmlns: XML namespace string.
:type lang: string Default = 'http://www.w3.org/1999/xhtml'
:param lang: language to be used. Defaul = 'en' :type lang: string
:rtype: reference to new Html instance :param lang: language to be used. Defaul = 'en'
:returns: reference to the newly-created Html instances for <html> object :rtype: reference to new Html instance
:php_session: If we need to have a php session start
:returns: reference to the newly-created Html instances
for <html> object
""" """
return Html('html', return Html('html', indent=False, xmlns=xmlns,
indent=False, attr='xml:lang="%s" lang="%s"' % ((lang,)*2),
xmlns=xmlns, php=php_session,
attr='xml:lang="%s" lang="%s"' % ((lang,)*2), *args, **keywargs)
*args, **keywargs
)
# #
@staticmethod @staticmethod
def head(title=None, encoding='utf-8', html5=True, *args, **keywargs): def head(title=None, encoding='utf-8', html5=True, *args, **keywargs):
""" """
Build and return a properly-formated <head> object Build and return a properly-formated <head> object
:type title: string or None :type title: string or None
:param title: title for HTML page. Default=None. If None no :param title: title for HTML page. Default=None. If None no
title tag is written title tag is written
:type encoding: string :type encoding: string
:param encoding: encoding to be used. Default = 'utf-8' :param encoding: encoding to be used. Default = 'utf-8'
:param html5: generate html5 syntax. Default = True. Set to False :param html5: generate html5 syntax. Default = True. Set to False
if pre-html5 syntax required if pre-html5 syntax required
:rtype: reference to new Html instance :rtype: reference to new Html instance
:returns: reference to the newly-created Html instances for <head> object :returns: reference to the newly-created Html instances
for <head> object
""" """
head = Html('head', *args, **keywargs) head = Html('head', *args, **keywargs)
@@ -199,39 +200,38 @@ class Html(list):
return head return head
# #
@staticmethod @staticmethod
def page(title=None, encoding='utf-8', lang='en', html5=True, cms=False, *args, **keywargs): def page(title=None, encoding='utf-8', lang='en', html5=True, cms=False,
php_session=None, *args, **keywargs):
""" """
This function prepares a new Html class based page and returns This function prepares a new Html class based page and returns
:type title: string :type title: string
:param title: title for HTML page. Default=None :param title: title for HTML page. Default=None
:type encoding: string :type encoding: string
:param encoding: encoding to be used. Default = 'utf-8' :param encoding: encoding to be used. Default = 'utf-8'
:type lang: string :type lang: string
:param lang: language to be used. Defaul = 'en' :param lang: language to be used. Defaul = 'en'
:param html5: generate html5 syntax. Default = True. Set to False :param html5: generate html5 syntax. Default = True. Set to False
if pre-html5 syntax required if pre-html5 syntax required
:rtype: three object references :rtype: three object references
:returns: references to the newly-created Html instances for :php_session: the note to include before all html code
page, head and body :returns: references to the newly-created Html instances for
page, head and body
""" """
page = Html.html(lang=lang, *args, **keywargs) page = Html.html(lang=lang, php_session=php_session,
*args, **keywargs)
if html5: if html5:
page.addDOCTYPE(external_id=_HTML5) page.addDOCTYPE(external_id=_HTML5)
else: else:
page.addXML(encoding=encoding) page.addXML(encoding=encoding)
page.addDOCTYPE(external_id=_XHTML10_STRICT) page.addDOCTYPE(external_id=_XHTML10_STRICT)
# #
head = Html.head(title=title, head = Html.head(title=title, encoding=encoding, lang=lang,
encoding=encoding, html5=html5, indent=False, *args, **keywargs)
lang=lang,
html5=html5,
indent=False,
*args, **keywargs
)
# #
if cms: if cms:
body = Html('div', class_ = "body", indent=False, *args, **keywargs) body = Html('div', class_="body", indent=False,
*args, **keywargs)
else: else:
body = Html('body', indent=False, *args, **keywargs) body = Html('body', indent=False, *args, **keywargs)
page += (head, body) page += (head, body)
@@ -241,34 +241,37 @@ class Html(list):
""" """
Class Constructor: Returns a new instance of the Html class Class Constructor: Returns a new instance of the Html class
:type tag: string :type tag: string
:param tag: The HTML tag. Default is 'html' :param tag: The HTML tag. Default is 'html'
:type args: optional positional parameters :type args: optional positional parameters
:param args: 0 more positional arguments to be inserted between :param args: 0 more positional arguments to be inserted between
opening and closing HTML tags. opening and closing HTML tags.
:type indent: boolean or None :type indent: boolean or None
:param indent: True ==> indent this object with respect to its parent :param indent: True ==> indent this object with respect to its
False ==> do not indent this object parent
None ==> no indent for this object (use eg for pre tag) False ==> do not indent this object
Defaults to True None ==> no indent for this object
:type inline: boolean (use eg for pre tag)
:param inline: True ==> instructs the write() method to output this Defaults to True
object and any child objects as a single string :type inline: boolean
False ==> output this object and its contents one string :param inline: True ==> instructs the write() method to output
at a time this object and any child objects as a
Defaults to False single string
:type close: boolean or None False ==> output this object and its contents one
:param close: True ==> this tag should be closed normally string at a time
e.g. <tag>...</tag> Defaults to False
False ==> this tag should be automatically closed :type close: boolean or None
e.g. <tag /> :param close: True ==> this tag should be closed normally
None ==> do not provide any closing for this tag e.g. <tag>...</tag>
False ==> this tag should be automatically closed
e.g. <tag />
None ==> do not provide any closing for this tag
:type keywargs: optional keyword parameters :type keywargs: optional keyword parameters
:param keywargs: 0 or more keyword=argument pairs that should be :param keywargs: 0 or more keyword=argument pairs that should be
copied into the opening tag as keyword="argument" copied into the opening tag as keyword="argument"
attributes attributes
:rtype: object reference :rtype: object reference
:returns: reference to the newly-created Html instance :returns: reference to the newly-created Html instance
For full usage of the Html class with examples, please see the wiki For full usage of the Html class with examples, please see the wiki
page at: http://www.gramps-project.org/wiki/index.php?title=Libhtml page at: http://www.gramps-project.org/wiki/index.php?title=Libhtml
@@ -284,16 +287,19 @@ class Html(list):
# Keywords we don't recognize are saved for later # Keywords we don't recognize are saved for later
# addition to the opening tag as attributes. # addition to the opening tag as attributes.
# #
phpnote = None
for keyw, arg in sorted(keywargs.items()): for keyw, arg in sorted(keywargs.items()):
if (keyw in ['indent', 'close', 'inline'] and if (keyw in ['indent', 'close', 'inline'] and
arg in [True, False, None]): arg in [True, False, None]):
setattr(self, keyw, arg) setattr(self, keyw, arg)
elif keyw == 'attr': # pass attributes along elif keyw == 'attr': # pass attributes along
attr += ' ' + arg attr += ' ' + arg
elif keyw[-1] == '_': # avoid Python conflicts elif keyw == 'php': # php init session
attr += ' %s="%s"' % (keyw[:-1], arg) # pass keyword arg along phpnote = arg
elif keyw[-1] == '_': # avoid Python conflicts
attr += ' %s="%s"' % (keyw[:-1], arg) # pass keyword arg along
else: else:
attr += ' %s="%s"' % (keyw, arg) # pass keyword arg along attr += ' %s="%s"' % (keyw, arg) # pass keyword arg along
# #
if tag[0] == '<': # if caller provided preformatted tag? if tag[0] == '<': # if caller provided preformatted tag?
self[0:] = [tag] # add it in self[0:] = [tag] # add it in
@@ -301,7 +307,13 @@ class Html(list):
else: else:
if tag in _START_CLOSE: # if tag in special list if tag in _START_CLOSE: # if tag in special list
self.close = False # it needs no closing tag self.close = False # it needs no closing tag
begin = '<%s%s%s>' % ( # build opening tag with attributes if phpnote:
# We need to insert php code before the html tag
# This is used to initiate a php session.
htmlhead = phpnote + '<%s%s%s>'
else:
htmlhead = '<%s%s%s>'
begin = htmlhead % ( # build opening tag with attributes
tag, tag,
attr, attr,
('' if self.close is not False else ' /') ('' if self.close is not False else ' /')
@@ -310,7 +322,7 @@ class Html(list):
# Use slice syntax since we don't override slicing # Use slice syntax since we don't override slicing
self[0:] = [begin] + list(args) # add beginning tag self[0:] = [begin] + list(args) # add beginning tag
if self.close: # if need closing tab if self.close: # if need closing tab
self[len(self):] = ['</%s>' % tag] # add it on the end self[len(self):] = ['</%s>' % tag] # add it on the end
# #
def __add(self, value): def __add(self, value):
""" """
@@ -320,8 +332,8 @@ class Html(list):
:type value: object :type value: object
:param value: object to be added :param value: object to be added
:rtype: object reference :rtype: object reference
:returns: reference to object with new value added :returns: reference to object with new value added
""" """
if (isinstance(value, Html) or not hasattr(value, '__iter__') or if (isinstance(value, Html) or not hasattr(value, '__iter__') or
isinstance(value, str)): isinstance(value, str)):
@@ -346,11 +358,11 @@ class Html(list):
:type cur_value: object :type cur_value: object
:param cur_value: value of object to be replaced :param cur_value: value of object to be replaced
:type value: object :type value: object
:param value: replacement value :param value: replacement value
:rtype: object reference :rtype: object reference
:returns: reference to object with new value added :returns: reference to object with new value added
""" """
self[self.index(cur_value)] = value self[self.index(cur_value)] = value
# #
@@ -360,8 +372,8 @@ class Html(list):
:type value: object :type value: object
:param value: object to be removed :param value: object to be removed
:rtype: object reference :rtype: object reference
:returns: reference to object with value removed :returns: reference to object with value removed
""" """
del self[self.index(value)] del self[self.index(value)]
return self return self
@@ -372,7 +384,7 @@ class Html(list):
""" """
Returns string representation Returns string representation
:rtype: string :rtype: string
:returns: string representation of object :returns: string representation of object
""" """
return '%s'*len(self) % tuple(self[:]) return '%s'*len(self) % tuple(self[:])
@@ -382,9 +394,9 @@ class Html(list):
Iterator function: returns a generator that performs an Iterator function: returns a generator that performs an
insertion-order tree traversal and yields each item found. insertion-order tree traversal and yields each item found.
""" """
for item in self[:]: # loop through all list elements for item in self[:]: # loop through all list elements
if isinstance(item, Html): # if nested list found if isinstance(item, Html): # if nested list found
for sub_item in item: # recurse for sub_item in item: # recurse
yield sub_item yield sub_item
else: else:
yield item yield item
@@ -393,26 +405,26 @@ class Html(list):
# #
def write(self, method=print, indent='\t', tabs=''): def write(self, method=print, indent='\t', tabs=''):
""" """
Output function: performs an insertion-order tree traversal Output function: performs an insertion-order tree traversal and
and calls supplied method for each item found. calls supplied method for each item found.
:type method: function reference :type method: function reference
:param method: function to call with each item found :param method: function to call with each item found
:type indent: string :type indent: string
:param indenf: string to use for indentation. Default = '\t' (tab) :param indenf: string to use for indentation. Default = '\t' (tab)
:type tabs: string :type tabs: string
:param tabs: starting indentation :param tabs: starting indentation
""" """
if self.indent is None: if self.indent is None:
tabs = '' tabs = ''
elif self.indent: elif self.indent:
tabs += indent tabs += indent
if self.inline: # if inline, write all list and if self.inline: # if inline, write all list and
method(str('%s%s' % (tabs, self))) # nested list elements method(str('%s%s' % (tabs, self))) # nested list elements
# #
else: else:
for item in self[:]: # else write one at a time for item in self[:]: # else write one at a time
if isinstance(item, Html): # recurse if nested Html class if isinstance(item, Html): # recurse if nested Html class
item.write(method=method, indent=indent, tabs=tabs) item.write(method=method, indent=indent, tabs=tabs)
else: else:
method(str('%s%s' % (tabs, item))) # else write the line method(str('%s%s' % (tabs, item))) # else write the line
@@ -421,10 +433,10 @@ class Html(list):
""" """
Add an XML statement to the start of the list for this object Add an XML statement to the start of the list for this object
:type version: decimal number :type version: decimal number
:param version: version of XML to be used. Defaults to 1.0 :param version: version of XML to be used. Defaults to 1.0
:type encoding: string :type encoding: string
:param encoding: encoding method to be used. Defaults to "UTF-8" :param encoding: encoding method to be used. Defaults to "UTF-8"
:type standalone: string :type standalone: string
:param standalone: "yes" or "no". Defaults to "no" :param standalone: "yes" or "no". Defaults to "no"
""" """
@@ -436,30 +448,30 @@ class Html(list):
self[0:0] = [xmldecl] self[0:0] = [xmldecl]
# #
def addDOCTYPE(self, name='html', public='PUBLIC', def addDOCTYPE(self, name='html', public='PUBLIC',
external_id=_HTML5, *args): external_id=_HTML5, *args):
""" """
Add a DOCTYPE statement to the start of the list Add a DOCTYPE statement to the start of the list
:type name: string :type name: string
:param name: name of this DOCTYPE. Defaults to "html" :param name: name of this DOCTYPE. Defaults to "html"
:type external_id: string :type external_id: string
:param external_id: external identifier of this DOCTYPE. :param external_id: external identifier of this DOCTYPE.
Defaults to XHTML 1.0 STRICT Defaults to XHTML 1.0 STRICT
:type args: object :type args: object
:param args: 0 or more positional parameters to be added to this :param args: 0 or more positional parameters to be added
DOCTYPE. to this DOCTYPE.
""" """
doctype = ( doctype = (
'<!DOCTYPE %s %s %s%s' % ( '<!DOCTYPE %s %s %s%s' % (name,
name, ('' if external_id == _HTML5
('' if external_id ==_HTML5 else public), else public),
external_id, external_id,
' %s'*len(args) % args ' %s'*len(args) % args)
)
).rstrip() + '>' ).rstrip() + '>'
# Note: DOCTYPE declaration must follow XML declaration # Note: DOCTYPE declaration must follow XML declaration
if len(self) and self[0][:6] == '<?xml ': #if len(self) and self[0][:6] == '<?xml ':
if self[0][:6] == '<?xml ':
self[1:1] = [doctype] self[1:1] = [doctype]
else: else:
self[0:0] = [doctype] self[0:0] = [doctype]
@@ -468,7 +480,7 @@ class Html(list):
""" """
Returns HTML tag for this object Returns HTML tag for this object
:rtype: string :rtype: string
:returns: HTML tag :returns: HTML tag
""" """
return self[0].split()[0].strip('< >') return self[0].split()[0].strip('< >')
@@ -496,7 +508,7 @@ class Html(list):
""" """
Returns HTML attributes for this object Returns HTML attributes for this object
:rtype: string :rtype: string
:returns: HTML attributes :returns: HTML attributes
""" """
attr = self[0].strip('<!?/>').split(None, 1) attr = self[0].strip('<!?/>').split(None, 1)
@@ -520,20 +532,16 @@ class Html(list):
""" """
Removes HTML attributes for this object Removes HTML attributes for this object
""" """
self[0] = '<' + self.tag + ( self[0] = '<' + self.tag + (# Set correct closing delimiter(s)
' />' if self.close is False else '>')
# Set correct closing delimiter(s)
' />' if self.close is False else '>'
)
# #
attr = property(__getattr, __setattr, __delattr) attr = property(__getattr, __setattr, __delattr)
# #
def __getinside(self): def __getinside(self):
""" """
Returns list of items between opening and closing tags Returns list of items between opening and closing tags
:rtype: list :rtype: list
:returns: list of items between opening and closing HTML tags :returns: list of items between opening and closing HTML tags
""" """
return self[1:-1] return self[1:-1]

View File

@@ -1503,6 +1503,16 @@ class BasePage:
@param: title -- Is the title of the web page @param: title -- Is the title of the web page
@param: cal -- The number of directories to use @param: cal -- The number of directories to use
""" """
# If .php extension and a note selected, add it to the head section.
phpnote = self.report.options['phpnote']
note = None
if phpnote and self.ext == ".php":
# This is used to give the ability to have a php init session.
# This note must not contains formatting
# and should only contains php code. ie:
# <? php session_start (); ?>
note = self.r_db.get_note_from_gramps_id(phpnote).get()
# begin each html page... # begin each html page...
if self.the_lang: if self.the_lang:
xmllang = self.the_lang.replace('_', '-') xmllang = self.the_lang.replace('_', '-')
@@ -1512,11 +1522,11 @@ class BasePage:
(html_escape(self.title_str.strip()), (html_escape(self.title_str.strip()),
html_escape(the_title)), html_escape(the_title)),
self.report.encoding, self.report.encoding,
xmllang, cms=self.usecms) xmllang, cms=self.usecms, php_session=note)
# temporary fix for .php parsing error # temporary fix for .php parsing error
if self.ext in [".php", ".php3", ".cgi"]: if self.ext in [".php", ".cgi"]:
del page[0] del page[0] # remove the "DOCTYPE" directive
# Header constants # Header constants
_meta1 = 'name ="viewport" content="width=device-width, ' _meta1 = 'name ="viewport" content="width=device-width, '

View File

@@ -57,7 +57,7 @@ from gramps.gen.display.name import displayer as _nd
import gramps.plugins.lib.libholiday as libholiday import gramps.plugins.lib.libholiday as libholiday
from gramps.plugins.webreport.basepage import BasePage from gramps.plugins.webreport.basepage import BasePage
from gramps.plugins.webreport.common import do_we_have_holidays from gramps.plugins.webreport.common import (do_we_have_holidays, _WEB_EXT)
from gramps.plugins.lib.libhtml import Html #, xml_lang from gramps.plugins.lib.libhtml import Html #, xml_lang
from gramps.gui.pluginmanager import GuiPluginManager from gramps.gui.pluginmanager import GuiPluginManager
@@ -74,9 +74,6 @@ _LOG = logging.getLogger(".WebPage")
FULLCLEAR = Html("div", class_="fullclear", inline=True) FULLCLEAR = Html("div", class_="fullclear", inline=True)
# Web page filename extensions
_WEB_EXT = ['.html', '.htm', '.shtml', '.php', '.php3', '.cgi']
# Calendar stylesheet names # Calendar stylesheet names
_CALENDARSCREEN = 'calendar-screen.css' _CALENDARSCREEN = 'calendar-screen.css'
_CALENDARPRINT = 'calendar-print.css' _CALENDARPRINT = 'calendar-print.css'

View File

@@ -50,7 +50,7 @@ LOG = logging.getLogger(".NarrativeWeb")
# define clear blank line for proper styling # define clear blank line for proper styling
FULLCLEAR = Html("div", class_="fullclear", inline=True) FULLCLEAR = Html("div", class_="fullclear", inline=True)
# define all possible web page filename extensions # define all possible web page filename extensions
_WEB_EXT = ['.html', '.htm', '.shtml', '.php', '.php3', '.cgi'] _WEB_EXT = ['.html', '.htm', '.shtml', '.php', '.cgi']
# used to select secured web site or not # used to select secured web site or not
HTTP = "http://" HTTP = "http://"
HTTPS = "https://" HTTPS = "https://"

View File

@@ -1906,6 +1906,8 @@ class NavWebOptions(MenuReportOptions):
self.__toggle = None self.__toggle = None
self.__death_anniv = None self.__death_anniv = None
self.__after_year = None self.__after_year = None
self.__ext = None
self.__phpnote = None
db_options = name + ' ' + dbase.get_dbname() db_options = name + ' ' + dbase.get_dbname()
MenuReportOptions.__init__(self, db_options, dbase) MenuReportOptions.__init__(self, db_options, dbase)
@@ -1929,7 +1931,6 @@ class NavWebOptions(MenuReportOptions):
self.__add_translations(menu) self.__add_translations(menu)
self.__add_calendar_options(menu) self.__add_calendar_options(menu)
def __add_report_options(self, menu): def __add_report_options(self, menu):
""" """
Options on the "Report Options" tab. Options on the "Report Options" tab.
@@ -1999,11 +2000,12 @@ class NavWebOptions(MenuReportOptions):
category_name = _("Html options") category_name = _("Html options")
addopt = partial(menu.add_option, category_name) addopt = partial(menu.add_option, category_name)
ext = EnumeratedListOption(_("File extension"), ".html") self.__ext = EnumeratedListOption(_("File extension"), ".html")
for etype in _WEB_EXT: for etype in _WEB_EXT:
ext.add_item(etype, etype) self.__ext.add_item(etype, etype)
ext.set_help(_("The extension to be used for the web files")) self.__ext.set_help(_("The extension to be used for the web files"))
addopt("ext", ext) addopt("ext", self.__ext)
self.__ext.connect("value-changed", self.__ext_changed)
cright = EnumeratedListOption(_('Copyright'), 0) cright = EnumeratedListOption(_('Copyright'), 0)
for index, copt in enumerate(_COPY_OPTIONS): for index, copt in enumerate(_COPY_OPTIONS):
@@ -2197,13 +2199,22 @@ class NavWebOptions(MenuReportOptions):
addopt("contactimg", contactimg) addopt("contactimg", contactimg)
headernote = NoteOption(_('HTML user header')) headernote = NoteOption(_('HTML user header'))
headernote.set_help(_("A note to be used as the page header")) headernote.set_help(_("A note to be used as the page header"
" or a php code to insert."))
addopt("headernote", headernote) addopt("headernote", headernote)
footernote = NoteOption(_('HTML user footer')) footernote = NoteOption(_('HTML user footer'))
footernote.set_help(_("A note to be used as the page footer")) footernote.set_help(_("A note to be used as the page footer"))
addopt("footernote", footernote) addopt("footernote", footernote)
# This option will be available only if you select ".php" in the
# "File extension" from the "Html" tab
self.__phpnote = NoteOption(_('PHP user session'))
self.__phpnote.set_help(_("A note to use for starting the php session."
"\nThis option will be available only if "
"the .php file extension is selected."))
addopt("phpnote", self.__phpnote)
def __add_images_generation_options(self, menu): def __add_images_generation_options(self, menu):
""" """
Options on the "Page Generation" tab. Options on the "Page Generation" tab.
@@ -2602,6 +2613,16 @@ class NavWebOptions(MenuReportOptions):
self.__maxupdates.set_available(False) self.__maxupdates.set_available(False)
self.__maxdays.set_available(False) self.__maxdays.set_available(False)
def __ext_changed(self):
"""
The file extension changed.
If .php selected, we must set the PHP user session available
"""
if self.__ext.get_value()[:4] == ".php":
self.__phpnote.set_available(True)
else:
self.__phpnote.set_available(False)
def __usecms_changed(self): def __usecms_changed(self):
""" """
We need to use cms or not We need to use cms or not