aboutsummaryrefslogtreecommitdiff
path: root/ellinika/cgi.scm4
diff options
context:
space:
mode:
Diffstat (limited to 'ellinika/cgi.scm4')
-rw-r--r--ellinika/cgi.scm436
1 files changed, 13 insertions, 23 deletions
diff --git a/ellinika/cgi.scm4 b/ellinika/cgi.scm4
index 661bd4c..9a7dc11 100644
--- a/ellinika/cgi.scm4
+++ b/ellinika/cgi.scm4
@@ -15,7 +15,12 @@
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;;;
-(define-module (ellinika cgi))
+(define-module (ellinika cgi)
+ #:use-module (ellinika config)
+ #:re-export (base-dir html-dir sysconf-dir locale-path
+ sql-iface sql-host sql-port sql-database
+ sql-username sql-password
+ config-file-name ))
(use-modules ifelse(IFACE,[CGI],(www cgi),(guile-user))
(gamma gettext)
@@ -60,13 +65,6 @@ ifelse(IFACE,[CGI],,dnl
;;; User-definable variables
-(define-public base-dir "PREFIX")
-(define-public html-dir "HTMLDIR")
-(define-public sysconf-dir "SYSCONFDIR")
-(define-public locale-path "LOCALEDIR:/usr/share/locale:/usr/local/share/locale")
-(define-public ref-loc #f)
-
-(define-public config-file-name "ellinika.conf")
(define-public dict-template-file-name "dict.html")
(define-public nea-template-file-name "nea.html")
(define-public monima-nea-template-file-name "monima.html")
@@ -74,16 +72,10 @@ ifelse(IFACE,[CGI],,dnl
(define-public word-forms-reference '())
-(define-public sql-iface "mysql") ;; SQL interface ("mysql" or "postgres")
-(define-public sql-host "localhost") ;; SQL server hostname or a path to the UNIX
- ;; socket
-(define-public sql-port 3306) ;; SQL port number (0 for sockaddr_un
- ;; connection)
-(define-public sql-database "ellinika") ;; Name of the database
-(define-public sql-username "gray") ;; Database user name
-(define-public sql-password "") ;; Password for that user name
+(define-public ref-loc #f)
-(define-public match-list-columns 4) ;; Number of colums in fuzzy search output
+;; Number of colums in fuzzy search output
+(define-public match-list-columns 4)
;;; End of user-definable variables
(define-public (language-code lang)
@@ -162,17 +154,15 @@ THUNK.
(define-public (ellinika-cgi-init template-file-name)
;;; Load the site defaults
- (let ((rc-file (string-append sysconf-dir "/" config-file-name)))
- (if (file-exists? rc-file)
- (load rc-file)))
-
-;;; Load the language-specific defaults
+ (ellinika-config-setup)
+
+ ;;; Load the language-specific defaults
(cond
((cgi:value "LANG") =>
(lambda (x)
(if (file-exists? (template-file x template-file-name))
(set! target-language x)))))
-;;; Initialize i18n
+ ;;; Initialize i18n
(let ((x (locale-setup target-language "PACKAGE" locale-path)))
(if x
(set! target-language x))))

Return to:

Send suggestions and report system problems to the System administrator.