Re: Prewikka: no frame, no menu

"Ju" <[email protected]>
Newsgroups gmane.comp.security.ids.prelude.devel
Message-ID <001c01c8675f$32f8a850$5801a8c0@juskordi>
> Thank you for your contribution!
Thank you for your response

> As you modified GPL code you can send the patch here, as long 
> as your code is GPL.
Of course my change is GPL ;o)

You'll find in attachment the patch for the prewikka version 0.9.13. I made
this patch with "diff -ur". I hope it would be usefull for someones else.

Regards,

JV

_______________________________________________
Prelude-devel site list
[email protected]
http://www.prelude-ids.org/mailman/listinfo/prelude-devel
noframe.diff (application/octet-stream, 20.6 KB)
diff -ur ../prewikka.origin/Core.py ./Core.py
--- ../prewikka.origin/Core.py	2008-01-31 23:27:56.000000000 +0100
+++ ./Core.py	2008-01-31 23:25:31.000000000 +0100
@@ -49,6 +49,9 @@
     dataset["prewikka.software"] = interface.getOptionValue("software", "&nbsp;")
     dataset["prewikka.place"] = interface.getOptionValue("place", "&nbsp;")
     dataset["prewikka.date"] = localization.getDate()
+    ###JV
+    dataset["prewikka.noframes"] = interface.getOptionValue("noframes", "&nbsp;")
+    ###endJV
 
     val = config.general.getOptionValue("external_link_new_window", "true")
     if (not val and config.general.has_key("external_link_new_window")) or (val == None or val.lower() in ["true", "yes"]):
Seulement dans ../prewikka.origin/modules/auth: sslcert
Seulement dans .: noframe.diff
Seulement dans .: noframe.diffu
Seulement dans ../prewikka.origin: siteconfig.py
Seulement dans ../prewikka.origin/templates: About.tmpl
Seulement dans ../prewikka.origin/templates: AlertListing.tmpl
diff -ur ../prewikka.origin/templates/ClassicLayout.py ./templates/ClassicLayout.py
--- ../prewikka.origin/templates/ClassicLayout.py	2008-01-31 23:27:56.000000000 +0100
+++ ./templates/ClassicLayout.py	2008-01-31 23:25:31.000000000 +0100
@@ -197,93 +197,99 @@
         else:
             _filter = self._CHEETAH__currentFilter = \
 			self._CHEETAH__filters[filterName] = getattr(self._CHEETAH__filtersLib, filterName)(self).filter
-        write('\n<div id="topmenu">\n')
-        for name, link in VFFSL(SL,"interface.tabs",True): # generated from line 11, col 3
-            if VFFSL(SL,"name",True) == VFFSL(SL,"interface.active_tab",True): # generated from line 12, col 5
-                class_ = 'topmenu_item_active'
-            else: # generated from line 14, col 5
-                class_ = 'topmenu_item_inactive'
-            write('    <div class="')
-            _v = VFFSL(SL,"class_",True) # '$class_' on line 17, col 17
-            if _v is not None: write(_filter(_v, rawExpr='$class_')) # from line 17, col 17.
-            write('"><p><a href="')
-            _v = VFFSL(SL,"link",True) # '$link' on line 17, col 38
-            if _v is not None: write(_filter(_v, rawExpr='$link')) # from line 17, col 38.
-            write('">')
-            if False:
-                _(VFFSL(SL,"name",True))
-            _v = VFFSL(SL,"_",False)(VFFSL(SL,"name",True)) # '$_($name)' on line 17, col 45
-            if _v is not None: write(_filter(_v, rawExpr='$_($name)')) # from line 17, col 45.
-            write('</a></p></div>\n')
-        write('\n  <div class="topmenu_item_special">\n')
-        if VFFSL(SL,"prewikka.logout_link",True): # generated from line 21, col 3
-            write('    <p><a href="')
-            _v = VFFSL(SL,"prewikka.logout_link",True) # '$prewikka.logout_link' on line 22, col 17
-            if _v is not None: write(_filter(_v, rawExpr='$prewikka.logout_link')) # from line 22, col 17.
-            write('">')
-            if False:
-                _("logout")
-            _v = VFFSL(SL,"_",False)("logout") # '$_("logout")' on line 22, col 40
-            if _v is not None: write(_filter(_v, rawExpr='$_("logout")')) # from line 22, col 40.
-            write('</a></p>\n')
-        write('''  </div>
+	###JV
+	if VFFSL(SL,"prewikka.noframes",True) is not None:
+		write('\n<div id="topmenu">\n')
+		for name, link in VFFSL(SL,"interface.tabs",True): # generated from line 11, col 3
+		    if VFFSL(SL,"name",True) == VFFSL(SL,"interface.active_tab",True): # generated from line 12, col 5
+			class_ = 'topmenu_item_active'
+		    else: # generated from line 14, col 5
+			class_ = 'topmenu_item_inactive'
+		    write('    <div class="')
+		    _v = VFFSL(SL,"class_",True) # '$class_' on line 17, col 17
+		    if _v is not None: write(_filter(_v, rawExpr='$class_')) # from line 17, col 17.
+		    write('"><p><a href="')
+		    _v = VFFSL(SL,"link",True) # '$link' on line 17, col 38
+		    if _v is not None: write(_filter(_v, rawExpr='$link')) # from line 17, col 38.
+		    write('">')
+		    if False:
+			_(VFFSL(SL,"name",True))
+		    _v = VFFSL(SL,"_",False)(VFFSL(SL,"name",True)) # '$_($name)' on line 17, col 45
+		    if _v is not None: write(_filter(_v, rawExpr='$_($name)')) # from line 17, col 45.
+		    write('</a></p></div>\n')
+		write('\n  <div class="topmenu_item_special">\n')
+		if VFFSL(SL,"prewikka.logout_link",True): # generated from line 21, col 3
+		    write('    <p><a href="')
+		    _v = VFFSL(SL,"prewikka.logout_link",True) # '$prewikka.logout_link' on line 22, col 17
+		    if _v is not None: write(_filter(_v, rawExpr='$prewikka.logout_link')) # from line 22, col 17.
+		    write('">')
+		    if False:
+			_("logout")
+		    _v = VFFSL(SL,"_",False)("logout") # '$_("logout")' on line 22, col 40
+		    if _v is not None: write(_filter(_v, rawExpr='$_("logout")')) # from line 22, col 40.
+		    write('</a></p>\n')
+		write('''  </div>
 
   <div class="topmenu_item_info">
 ''')
-        _filter = _orig_filter_49699874
-        write('    <p>')
-        if False:
-            _("%(username)s on %(date)s")
-        _v = VFFSL(SL,"str",False)(VFFSL(SL,"_",False)("%(username)s on %(date)s") % { "username": VFFSL(SL,"prewikka.userlink",True), "date": VFFSL(SL,"prewikka.date",True) }) # '$str($_("%(username)s on %(date)s") % { "username": $prewikka.userlink, "date": $prewikka.date })' on line 28, col 8
-        if _v is not None: write(_filter(_v, rawExpr='$str($_("%(username)s on %(date)s") % { "username": $prewikka.userlink, "date": $prewikka.date })')) # from line 28, col 8.
-        write('</p>\n')
-        _orig_filter_90637961 = _filter
-        filterName = 'CleanOutput'
-        if self._CHEETAH__filters.has_key("CleanOutput"):
-            _filter = self._CHEETAH__currentFilter = self._CHEETAH__filters[filterName]
-        else:
-            _filter = self._CHEETAH__currentFilter = \
+		_filter = _orig_filter_49699874
+		write('    <p>')
+		if False:
+		    _("%(username)s on %(date)s")
+		_v = VFFSL(SL,"str",False)(VFFSL(SL,"_",False)("%(username)s on %(date)s") % { "username": VFFSL(SL,"prewikka.userlink",True), "date": VFFSL(SL,"prewikka.date",True) }) # '$str($_("%(username)s on %(date)s") % { "username": $prewikka.userlink, "date": $prewikka.date })' on line 28, col 8
+		if _v is not None: write(_filter(_v, rawExpr='$str($_("%(username)s on %(date)s") % { "username": $prewikka.userlink, "date": $prewikka.date })')) # from line 28, col 8.
+		write('</p>\n')
+	###endJV
+	_orig_filter_90637961 = _filter
+	filterName = 'CleanOutput'
+	if self._CHEETAH__filters.has_key("CleanOutput"):
+	    _filter = self._CHEETAH__currentFilter = self._CHEETAH__filters[filterName]
+	else:
+	    _filter = self._CHEETAH__currentFilter = \
 			self._CHEETAH__filters[filterName] = getattr(self._CHEETAH__filtersLib, filterName)(self).filter
-        write('  </div>\n</div>\n')
-        _filter = _orig_filter_90637961
-        _orig_filter_24074823 = _filter
-        filterName = 'Filter'
-        if self._CHEETAH__filters.has_key("Filter"):
-            _filter = self._CHEETAH__currentFilter = self._CHEETAH__filters[filterName]
-        else:
-            _filter = self._CHEETAH__currentFilter = \
+	write('  </div>\n</div>\n')
+	_filter = _orig_filter_90637961
+	_orig_filter_24074823 = _filter
+	filterName = 'Filter'
+	if self._CHEETAH__filters.has_key("Filter"):
+	    _filter = self._CHEETAH__currentFilter = self._CHEETAH__filters[filterName]
+	else:
+	    _filter = self._CHEETAH__currentFilter = \
 			self._CHEETAH__filters[filterName] = getattr(self._CHEETAH__filtersLib, filterName)(self).filter
-        write('\n')
-        _v = VFFSL(SL,"layout_start_hook",True) # '$layout_start_hook' on line 37, col 1
-        if _v is not None: write(_filter(_v, rawExpr='$layout_start_hook')) # from line 37, col 1.
-        write('\n\n')
-        _filter = _orig_filter_24074823
-        _orig_filter_18197256 = _filter
-        filterName = 'CleanOutput'
-        if self._CHEETAH__filters.has_key("CleanOutput"):
-            _filter = self._CHEETAH__currentFilter = self._CHEETAH__filters[filterName]
-        else:
-            _filter = self._CHEETAH__currentFilter = \
+	write('\n')
+	_v = VFFSL(SL,"layout_start_hook",True) # '$layout_start_hook' on line 37, col 1
+	if _v is not None: write(_filter(_v, rawExpr='$layout_start_hook')) # from line 37, col 1.
+	write('\n\n')
+	_filter = _orig_filter_24074823
+	_orig_filter_18197256 = _filter
+	filterName = 'CleanOutput'
+	if self._CHEETAH__filters.has_key("CleanOutput"):
+	    _filter = self._CHEETAH__currentFilter = self._CHEETAH__filters[filterName]
+	else:
+	    _filter = self._CHEETAH__currentFilter = \
 			self._CHEETAH__filters[filterName] = getattr(self._CHEETAH__filtersLib, filterName)(self).filter
-        write('<div id="menu">\n')
-        for name, link in VFFSL(SL,"interface.sections",True): # generated from line 42, col 3
-            if VFFSL(SL,"name",True) == VFFSL(SL,"interface.active_section",True): # generated from line 43, col 5
-                class_ = 'menu_item_active'
-            else: # generated from line 45, col 5
-                class_ = 'menu_item_inactive'
-            write('    <a class="')
-            _v = VFFSL(SL,"class_",True) # '$class_' on line 48, col 15
-            if _v is not None: write(_filter(_v, rawExpr='$class_')) # from line 48, col 15.
-            write('" href="')
-            _v = VFFSL(SL,"link",True) # '$link' on line 48, col 30
-            if _v is not None: write(_filter(_v, rawExpr='$link')) # from line 48, col 30.
-            write('">')
-            if False:
-                _(VFFSL(SL,"name",True))
-            _v = VFFSL(SL,"_",False)(VFFSL(SL,"name",True)) # '$_($name)' on line 48, col 37
-            if _v is not None: write(_filter(_v, rawExpr='$_($name)')) # from line 48, col 37.
-            write('</a>\n')
-        write('\n')
+	###JV
+	if VFFSL(SL,"prewikka.noframes",True) is not None:
+		write('<div id="menu">\n')
+		for name, link in VFFSL(SL,"interface.sections",True): # generated from line 42, col 3
+		    if VFFSL(SL,"name",True) == VFFSL(SL,"interface.active_section",True): # generated from line 43, col 5
+			class_ = 'menu_item_active'
+		    else: # generated from line 45, col 5
+			class_ = 'menu_item_inactive'
+		    write('    <a class="')
+		    _v = VFFSL(SL,"class_",True) # '$class_' on line 48, col 15
+		    if _v is not None: write(_filter(_v, rawExpr='$class_')) # from line 48, col 15.
+		    write('" href="')
+		    _v = VFFSL(SL,"link",True) # '$link' on line 48, col 30
+		    if _v is not None: write(_filter(_v, rawExpr='$link')) # from line 48, col 30.
+		    write('">')
+		    if False:
+			_(VFFSL(SL,"name",True))
+		    _v = VFFSL(SL,"_",False)(VFFSL(SL,"name",True)) # '$_($name)' on line 48, col 37
+		    if _v is not None: write(_filter(_v, rawExpr='$_($name)')) # from line 48, col 37.
+		    write('</a>\n')
+		write('\n')
+	###endJV
         _filter = _orig_filter_18197256
         _orig_filter_57421047 = _filter
         filterName = 'Filter'
@@ -292,13 +298,50 @@
         else:
             _filter = self._CHEETAH__currentFilter = \
 			self._CHEETAH__filters[filterName] = getattr(self._CHEETAH__filtersLib, filterName)(self).filter
-        write('  ')
-        _v = VFFSL(SL,"menu_extra_content",True) # '$menu_extra_content' on line 55, col 3
-        if _v is not None: write(_filter(_v, rawExpr='$menu_extra_content')) # from line 55, col 3.
-        write('''
-</div>
+	###JV
+	if VFFSL(SL,"prewikka.noframes",True) is not None:
+		write('  ')
+		_v = VFFSL(SL,"menu_extra_content",True) # '$menu_extra_content' on line 55, col 3
+		if _v is not None: write(_filter(_v, rawExpr='$menu_extra_content')) # from line 55, col 3.
+		write('''
+</div><div id="main" style="margin-top: 80px; padding-left: 170px;">''')
+	else:
+		try:
+			write('<input type=hidden name=filter value="')
+			_v = VFFSL(SL,"current_filter",False)
+			if _v is not None: write(_filter(_v, rawExpr='$current_filter'))
+			write('">')
+
+			write('<input type=hidden name=timeline_value value="')
+			_v = VFFSL(SL,"timeline.value",True)
+			if _v is not None: write(_filter(_v, rawExpr='$timeline.value'))
+			write('">')
+
+			write('<input type=hidden name=timeline_unit value="')
+			if VFFSL(SL,"timeline.min_selected",True) != "": write('min')
+			if VFFSL(SL,"timeline.hour_selected",True) != "": write('hour')
+			if VFFSL(SL,"timeline.day_selected",True) != "": write('day')
+			if VFFSL(SL,"timeline.month_selected",True) != "": write('month')
+			if VFFSL(SL,"timeline.year_selected",True) != "": write('year')
+			if VFFSL(SL,"timeline.unlimited_selected",True) != "": write('unlimited')
+			write('">')
+
+			write('<input type=hidden name=timezone value="')
+			if VFFSL(SL,"timeline.frontend_localtime_selected",True) != "": write('frontend_localtime')
+			if VFFSL(SL,"timeline.sensor_localtime_selected",True) != "": write('sensor_localtime')
+			if VFFSL(SL,"timeline.utc_selected",True) != "": write('utc')
+			write('">')
+
+			write('<input type=hidden name=limit value="')
+			_v = VFFSL(SL,"limit",True)
+			if _v is not None: write(_filter(_v, rawExpr='$limit'))
+			write('">')
+				
+		except:
+			pass
 
-<div id="main">''')
+		write('<div id="main">')
+	###endJV
         _v = VFFSL(SL,"main_content",True) # '$main_content' on line 58, col 16
         if _v is not None: write(_filter(_v, rawExpr='$main_content')) # from line 58, col 16.
         write('</div>\n\n')
Seulement dans ../prewikka.origin/templates: ClassicLayout.tmpl
Seulement dans ../prewikka.origin/templates: Command.tmpl
Seulement dans ../prewikka.origin/templates: ErrorTemplate.tmpl
Seulement dans ../prewikka.origin/templates: FilterEdition.tmpl
Seulement dans ../prewikka.origin/templates: HeartbeatAnalyze.tmpl
Seulement dans ../prewikka.origin/templates: HeartbeatListing.tmpl
Seulement dans ../prewikka.origin/templates: HTMLDocument.tmpl
Seulement dans ../prewikka.origin/templates: LoginPasswordForm.tmpl
Seulement dans ../prewikka.origin/templates: MessageDetails.tmpl
diff -ur ../prewikka.origin/templates/MessageListing.py ./templates/MessageListing.py
--- ../prewikka.origin/templates/MessageListing.py	2008-01-31 23:27:56.000000000 +0100
+++ ./templates/MessageListing.py	2008-01-31 23:25:31.000000000 +0100
@@ -764,28 +764,33 @@
         ########################################
         ## START - generated method body
         
-        write('<body class="')
-        _v = VFFSL(SL,"body_class",True) # '$body_class' on line 345, col 14
-        if _v is not None: write(_filter(_v, rawExpr='$body_class')) # from line 345, col 14.
-        write('''" onload="beginAutoApply()">
-        <div id="top_view">
-                <div id="top_view_header">
-                        <div id="top_view_header_software">''')
-        _v = VFFSL(SL,"prewikka.software",True) # '$prewikka.software' on line 348, col 60
-        if _v is not None: write(_filter(_v, rawExpr='$prewikka.software')) # from line 348, col 60.
-        write('</div>\n                        <div id="top_view_header_place">')
-        _v = VFFSL(SL,"prewikka.place",True) # '$prewikka.place' on line 349, col 57
-        if _v is not None: write(_filter(_v, rawExpr='$prewikka.place')) # from line 349, col 57.
-        write('</div>\n                        <div id="top_view_header_title">')
-        _v = VFFSL(SL,"prewikka.title",True) # '$prewikka.title' on line 350, col 57
-        if _v is not None: write(_filter(_v, rawExpr='$prewikka.title')) # from line 350, col 57.
-        write('</div>\n                </div>\n                ')
-        _v = VFFSL(SL,"toplayout_content",True) # '$toplayout_content' on line 352, col 17
-        if _v is not None: write(_filter(_v, rawExpr='$toplayout_content')) # from line 352, col 17.
-        write('''
-        </div>
-</body>
-''')
+	###JV
+        if VFFSL(SL,"prewikka.noframes",True) is not None:
+		write('<body class="')
+		_v = VFFSL(SL,"body_class",True) # '$body_class' on line 345, col 14
+		if _v is not None: write(_filter(_v, rawExpr='$body_class')) # from line 345, col 14.
+		write('''" onload="beginAutoApply()">
+		<div id="top_view">
+			<div id="top_view_header">
+				<div id="top_view_header_software">''')
+		_v = VFFSL(SL,"prewikka.software",True) # '$prewikka.software' on line 348, col 60
+		if _v is not None: write(_filter(_v, rawExpr='$prewikka.software')) # from line 348, col 60.
+		write('</div>\n                        <div id="top_view_header_place">')
+		_v = VFFSL(SL,"prewikka.place",True) # '$prewikka.place' on line 349, col 57
+		if _v is not None: write(_filter(_v, rawExpr='$prewikka.place')) # from line 349, col 57.
+		write('</div>\n                        <div id="top_view_header_title">')
+		_v = VFFSL(SL,"prewikka.title",True) # '$prewikka.title' on line 350, col 57
+		if _v is not None: write(_filter(_v, rawExpr='$prewikka.title')) # from line 350, col 57.
+		write('</div>\n                </div>\n                ')
+	###endJV
+	_v = VFFSL(SL,"toplayout_content",True) # '$toplayout_content' on line 352, col 17
+	if _v is not None: write(_filter(_v, rawExpr='$toplayout_content')) # from line 352, col 17.
+
+	###JV
+        if VFFSL(SL,"prewikka.noframes",True) is not None:
+		write('''</div></body>''')
+	###endJV
+
         
         ########################################
         ## END - generated method body
Seulement dans ../prewikka.origin/templates: MessageListing.tmpl
Seulement dans ../prewikka.origin/templates: MessageSummary.tmpl
Seulement dans ../prewikka.origin/templates: PropertiesChangeForm.tmpl
Seulement dans ../prewikka.origin/templates: SensorAlertListing.tmpl
Seulement dans ../prewikka.origin/templates: SensorHeartbeatListing.tmpl
Seulement dans ../prewikka.origin/templates: SensorListing.tmpl
diff -ur ../prewikka.origin/templates/TopLayout.py ./templates/TopLayout.py
--- ../prewikka.origin/templates/TopLayout.py	2008-01-31 23:27:56.000000000 +0100
+++ ./templates/TopLayout.py	2008-01-31 23:25:31.000000000 +0100
@@ -111,28 +111,31 @@
         ########################################
         ## START - generated method body
         
-        write('<body class="')
-        _v = VFFSL(SL,"body_class",True) # '$body_class' on line 7, col 14
-        if _v is not None: write(_filter(_v, rawExpr='$body_class')) # from line 7, col 14.
-        write('''">
-	<div id="top_view">
-		<div id="top_view_header">
-			<div id="top_view_header_software">''')
-        _v = VFFSL(SL,"prewikka.software",True) # '$prewikka.software' on line 10, col 39
-        if _v is not None: write(_filter(_v, rawExpr='$prewikka.software')) # from line 10, col 39.
-        write('</div>\n\t\t\t<div id="top_view_header_place">')
-        _v = VFFSL(SL,"prewikka.place",True) # '$prewikka.place' on line 11, col 36
-        if _v is not None: write(_filter(_v, rawExpr='$prewikka.place')) # from line 11, col 36.
-        write('</div>\n\t\t\t<div id="top_view_header_title">')
-        _v = VFFSL(SL,"prewikka.title",True) # '$prewikka.title' on line 12, col 36
-        if _v is not None: write(_filter(_v, rawExpr='$prewikka.title')) # from line 12, col 36.
-        write('</div>\n\t\t</div>\n\t\t')
-        _v = VFFSL(SL,"toplayout_content",True) # '$toplayout_content' on line 14, col 3
+	###JV
+        if VFFSL(SL,"prewikka.noframes",True) is not None:
+		write('<body class="')
+		_v = VFFSL(SL,"body_class",True) # '$body_class' on line 7, col 14
+		if _v is not None: write(_filter(_v, rawExpr='$body_class')) # from line 7, col 14.
+		write('''">
+		<div id="top_view">
+			<div id="top_view_header">
+				<div id="top_view_header_software">''')
+		_v = VFFSL(SL,"prewikka.software",True) # '$prewikka.software' on line 10, col 39
+		if _v is not None: write(_filter(_v, rawExpr='$prewikka.software')) # from line 10, col 39.
+		write('</div>\n\t\t\t<div id="top_view_header_place">')
+		_v = VFFSL(SL,"prewikka.place",True) # '$prewikka.place' on line 11, col 36
+		if _v is not None: write(_filter(_v, rawExpr='$prewikka.place')) # from line 11, col 36.
+		write('</div>\n\t\t\t<div id="top_view_header_title">')
+		_v = VFFSL(SL,"prewikka.title",True) # '$prewikka.title' on line 12, col 36
+		if _v is not None: write(_filter(_v, rawExpr='$prewikka.title')) # from line 12, col 36.
+		write('</div>\n\t\t</div>\n\t\t')
+	###endJV
+	_v = VFFSL(SL,"toplayout_content",True) # '$toplayout_content' on line 14, col 3
         if _v is not None: write(_filter(_v, rawExpr='$toplayout_content')) # from line 14, col 3.
-        write('''
-	</div>
-</body>
-''')
+	###JV
+        if VFFSL(SL,"prewikka.noframes",True) is not None:
+  	      write('''</div></body>''')
+	###endJV
         
         ########################################
         ## END - generated method body
Seulement dans ../prewikka.origin/templates: TopLayout.tmpl
Seulement dans ../prewikka.origin/templates: UserListing.tmpl
Seulement dans ../prewikka.origin/templates: UserSettings.tmpl
Seulement dans ../prewikka.origin/templates: utils.tmpl
smime.p7s (application/x-pkcs7-signature, 3.4 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.