mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
* src/scm/report/iframe-url.scm: convert to guile module.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4741 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
0835ad73f1
commit
2a7ca35fd9
@ -1,36 +1,37 @@
|
||||
|
||||
(gnc:support "report/iframe-url.scm")
|
||||
;; depends must be outside module scope -- and should eventually go away.
|
||||
(gnc:depend "report-html.scm")
|
||||
|
||||
(let ()
|
||||
(define (options-generator)
|
||||
(let ((options (gnc:new-options)))
|
||||
(gnc:register-option options
|
||||
(gnc:make-string-option
|
||||
(N_ "General")
|
||||
(N_ "URL to frame")
|
||||
"a" (N_ "URL to display in report")
|
||||
"http://www.gnucash.org"))
|
||||
options))
|
||||
|
||||
(define (renderer report-obj)
|
||||
(let ((url (gnc:option-value
|
||||
(gnc:lookup-option
|
||||
(gnc:report-options report-obj)
|
||||
(N_ "General") (N_ "URL to frame"))))
|
||||
(doc (gnc:make-html-document))
|
||||
(txt (gnc:make-html-text)))
|
||||
(gnc:html-text-append!
|
||||
txt
|
||||
(gnc:html-markup/attr
|
||||
"iframe" (format #f "src=\"~A\"" url)
|
||||
"Your browser does not support inline frames, sorry."))
|
||||
(gnc:html-document-add-object! doc txt)
|
||||
doc))
|
||||
(define-module (gnucash report iframe-url))
|
||||
|
||||
(gnc:define-report
|
||||
'version 1
|
||||
'name (N_ "Frame URL")
|
||||
'menu-path (list gnc:menuname-utility)
|
||||
'options-generator options-generator
|
||||
'renderer renderer))
|
||||
(define (options-generator)
|
||||
(let ((options (gnc:new-options)))
|
||||
(gnc:register-option options
|
||||
(gnc:make-string-option
|
||||
(N_ "General")
|
||||
(N_ "URL to frame")
|
||||
"a" (N_ "URL to display in report")
|
||||
"http://www.gnucash.org"))
|
||||
options))
|
||||
|
||||
(define (renderer report-obj)
|
||||
(let ((url (gnc:option-value
|
||||
(gnc:lookup-option
|
||||
(gnc:report-options report-obj)
|
||||
(N_ "General") (N_ "URL to frame"))))
|
||||
(doc (gnc:make-html-document))
|
||||
(txt (gnc:make-html-text)))
|
||||
(gnc:html-text-append!
|
||||
txt
|
||||
(gnc:html-markup/attr
|
||||
"iframe" (format #f "src=\"~A\"" url)
|
||||
"Your browser does not support inline frames, sorry."))
|
||||
(gnc:html-document-add-object! doc txt)
|
||||
doc))
|
||||
|
||||
(gnc:define-report
|
||||
'version 1
|
||||
'name (N_ "Frame URL")
|
||||
'menu-path (list gnc:menuname-utility)
|
||||
'options-generator options-generator
|
||||
'renderer renderer)
|
||||
|
Loading…
Reference in New Issue
Block a user