[MKDoc-commit] [1.6] New doc always defaulted to parent document template

bruno at mkdoc.demon.co.uk bruno at mkdoc.demon.co.uk
Thu Sep 8 15:55:38 BST 2005


Log Message:
-----------
[1.6] New doc always defaulted to parent document template

Tags:
----
mkdoc-1-6

Modified Files:
--------------
    mkd/flo/plugin/Admin:
        New.pm

-------------- next part --------------
Index: New.pm
===================================================================
RCS file: /var/spool/cvs/mkd/flo/plugin/Admin/New.pm,v
retrieving revision 1.1.2.11
retrieving revision 1.1.2.12
diff -Lflo/plugin/Admin/New.pm -Lflo/plugin/Admin/New.pm -u -r1.1.2.11 -r1.1.2.12
--- flo/plugin/Admin/New.pm
+++ flo/plugin/Admin/New.pm
@@ -64,6 +64,22 @@
 
 
 ##
+# $class->templates;
+# ------------------
+# Returns a structure which can be used within a template to choose
+# a document template from a select box.
+#
+# See MKDoc::Util::TemplateFinder::list_structure()
+##
+sub templates
+{
+    my $self    = shift;
+    my $default = $self->form_input ('template') || $self->parent->popular_children_template || shift || 'default';
+    return MKDoc::Util::TemplateFinder::list_structure ('document', $default);
+}
+
+
+##
 # $self->http_post;
 # -----------------
 #   Reflect the changes on the database and redirects to


More information about the MKDoc-commit mailing list