[MKDoc-commit] Patches from Bruno for the external links env var:

chris at mkdoc.demon.co.uk chris at mkdoc.demon.co.uk
Mon Aug 8 11:23:32 BST 2005


Log Message:
-----------
Patches from Bruno for the external links env var:
https://lists.webarch.co.uk/pipermail/mkdoc-dev/2005-July/000289.html
https://lists.webarch.co.uk/pipermail/mkdoc-dev/2005-July/000290.html

Tags:
----
mkdoc-1-6

Modified Files:
--------------
    mkd/flo:
        Editor.pm
    mkd/MKDoc:
        Config.pm
    mkd/MKDoc/Site/ConfigWriter:
        Httpd_Conf.pm

-------------- next part --------------
Index: Editor.pm
===================================================================
RCS file: /var/spool/cvs/mkd/flo/Editor.pm,v
retrieving revision 1.12.2.44
retrieving revision 1.12.2.45
diff -Lflo/Editor.pm -Lflo/Editor.pm -u -r1.12.2.44 -r1.12.2.45
--- flo/Editor.pm
+++ flo/Editor.pm
@@ -33,7 +33,9 @@
 
 # Set this to true and external links (as determined by
 # MKDoc::Util::LinkParser) will open in a new window.
-our $EXTERNAL_LINKS_OPEN_IN_NEW_WINDOW = 0;
+#our $EXTERNAL_LINKS_OPEN_IN_NEW_WINDOW = 0;
+our $EXTERNAL_LINKS_OPEN_IN_NEW_WINDOW = MKDoc::Config->EXTERNAL_LINKS_OPEN_IN_NEW_WINDOW();
+
 
 use constant BLOCK => 'edit_block';
 our $QBLOCK = quotemeta (BLOCK) . "_";   
Index: Config.pm
===================================================================
RCS file: /var/spool/cvs/mkd/MKDoc/Config.pm,v
retrieving revision 1.8.2.46
retrieving revision 1.8.2.47
diff -LMKDoc/Config.pm -LMKDoc/Config.pm -u -r1.8.2.46 -r1.8.2.47
--- MKDoc/Config.pm
+++ MKDoc/Config.pm
@@ -253,6 +253,11 @@
 sub FILE_HTTP_PATH     { get_env ('MKD__GLOBAL_FILE_HTTP_PATH')         || '/.static/files'                           }
 sub IMAGE_HTTP_PATH    { get_env ('MKD__GLOBAL_IMAGE_HTTP_PATH')        || '/.static/images'                          }
 
+sub EXTERNAL_LINKS_OPEN_IN_NEW_WINDOW
+{
+    my $class = shift;
+    return get_env ('MKD__EXTERNAL_LINKS_OPEN_IN_NEW_WINDOW') || 0;
+}
 
 ##
 # $class->new ($prefix);
Index: Httpd_Conf.pm
===================================================================
RCS file: /var/spool/cvs/mkd/MKDoc/Site/ConfigWriter/Httpd_Conf.pm,v
retrieving revision 1.1.2.37
retrieving revision 1.1.2.38
diff -LMKDoc/Site/ConfigWriter/Httpd_Conf.pm -LMKDoc/Site/ConfigWriter/Httpd_Conf.pm -u -r1.1.2.37 -r1.1.2.38
--- MKDoc/Site/ConfigWriter/Httpd_Conf.pm
+++ MKDoc/Site/ConfigWriter/Httpd_Conf.pm
@@ -220,6 +220,9 @@
 # Uncomment if you want some default text for the users home page.
 # SetEnv MKD__ACCOUNT_HOMEPAGE_CONTENT  $MKDOC_DIR/conf/homepage.txt
 
+# Uncomment this and set the value to 1 if you want external links to open in new windows.
+# SetEnv MKD__EXTERNAL_LINKS_OPEN_IN_NEW_WINDOW 0
+
 EOF
 
     open FP, ">$SITE_DIR/httpd/httpd-env.conf" || die "Cannot write-open $SITE_DIR/httpd/httpd-env.conf. Reason: $@";


More information about the MKDoc-commit mailing list