From a0f563bc8f47cd2d70fe541f3ea752c6a582dfa7 Mon Sep 17 00:00:00 2001
From: Penny Leach <penny@mjollnir.org>
Date: Fri, 7 Aug 2009 09:45:40 +0200
Subject: [PATCH] [UPSTREAM] assignment core: third party subtype support

allow third party subtypes to inject their titles into the mod edit form.
---
 mod/assignment/mod_form.php |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/mod/assignment/mod_form.php b/mod/assignment/mod_form.php
index c3bfe25..da68b81 100644
--- a/mod/assignment/mod_form.php
+++ b/mod/assignment/mod_form.php
@@ -57,7 +57,11 @@ class mod_assignment_mod_form extends moodleform_mod {
         $mform->addElement('select', 'preventlate', get_string('preventlate', 'assignment'), $ynoptions);
         $mform->setDefault('preventlate', 0);
 
-        $mform->addElement('header', 'typedesc', get_string('type'.$type,'assignment'));
+        $typestr = get_string('type'.$type,'assignment');
+        if (strpos($typestr, '[[') === 0) {
+            $typestr = get_string('type'.$type, 'assignment_' . $type);
+        }
+        $mform->addElement('header', 'typedesc', $typestr);
         $assignmentinstance->setup_elements($mform);
 
         $features = new stdClass;
-- 
1.6.3.3

