94 lines
2.7 KiB
Perl
94 lines
2.7 KiB
Perl
# Woman's Voice
|
|
# Config.pm: The web site configuration.
|
|
|
|
# Copyright (c) 2003-2020 imacat.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
# Author: imacat <imacat@mail.imacat.idv.tw>
|
|
# First written: 2003-04-06
|
|
|
|
package Selima::wov::Config;
|
|
use 5.008;
|
|
use utf8;
|
|
use strict;
|
|
use warnings;
|
|
use base qw(Exporter);
|
|
use vars qw(@EXPORT @EXPORT_OK);
|
|
BEGIN {
|
|
@EXPORT = qw(siteconf page_replacements);
|
|
@EXPORT_OK = @EXPORT;
|
|
# Prototype declaration
|
|
sub siteconf();
|
|
sub page_replacements();
|
|
}
|
|
|
|
# Get into the public variable space and initialize them
|
|
use lib $ENV{"DOCUMENT_ROOT"} . qw(/../../lib/perl5);
|
|
use Selima::CopyYear;
|
|
use Selima::DataVars qw(:all);
|
|
use Selima::ShortCut;
|
|
|
|
use Selima::wov::DataVars qw(:all);
|
|
|
|
# siteconf: Subroutine to initialize site configuration
|
|
sub siteconf() {
|
|
local ($_, %_);
|
|
|
|
# The package name and the package title
|
|
$PACKAGE = "wov";
|
|
$SITENAME_ABBR = "WOV";
|
|
# The author and the copyright
|
|
$AUTHOR = "小招, 依瑪貓";
|
|
$COPYRIGHT = "© <!--selima:copyyear--> 《女聲》電子報。《女聲》電子報保有所有權利。";
|
|
# Document root, the library and the l10n directories
|
|
$DOC_ROOT = $ENV{"DOCUMENT_ROOT"};
|
|
$SITE_LIBDIR = $DOC_ROOT . "/magicat/lib/perl5";
|
|
$LOCALEDIR = $DOC_ROOT . "/magicat/locale";
|
|
|
|
# Tables to lock when rebuilding pages
|
|
@REBUILD_TABLES = qw(linkcat links linkcatz);
|
|
# The local rebuild type labels
|
|
%REBUILD_LABELS = (
|
|
"newslets" => N_("Newsletter"),
|
|
);
|
|
|
|
# The languages
|
|
$DEFAULT_LANG = "zh-tw";
|
|
@ALL_LINGUAS = qw(zh-tw);
|
|
|
|
# The site data variables
|
|
$SCRIPTS{FORM_NEWSLETS()} = "/magicat/cgi-bin/newslets.cgi",
|
|
$SCRIPTS{FORM_NLARTS()} = "/magicat/cgi-bin/nlarts.cgi",
|
|
|
|
return;
|
|
}
|
|
|
|
# page_replacements: Dynamic page elements to be replaced,
|
|
# but not part of the content. Used by xfupdate_template().
|
|
sub page_replacements() {
|
|
return {
|
|
"copyyear" => {
|
|
"pattern" => "1999(?:-\\d{4})?",
|
|
"content" => copyyear(1999),
|
|
},
|
|
"generator" => {
|
|
"pattern" => "Selima \\d+\\.\\d+",
|
|
"content" => "Selima $Selima::VERSION",
|
|
},
|
|
};
|
|
}
|
|
|
|
no utf8;
|
|
return 1;
|