From: mark-nielsen
Date: Sat, 9 Sep 2006 21:39:11 +0000 (+0000)
Subject: Lesson buttons should now work with javascript disabled
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=259990d2c654aad551afd1aae09aee69b074f159;p=moodle.git
Lesson buttons should now work with javascript disabled
Also improved the layout of action/continue.html
---
diff --git a/mod/lesson/action/continue.html b/mod/lesson/action/continue.html
index e1743b3a2e..83cdb2655f 100644
--- a/mod/lesson/action/continue.html
+++ b/mod/lesson/action/continue.html
@@ -7,12 +7,15 @@
**/
?>
+
+
-
\ No newline at end of file
+
+
+
+
+timed and !has_capability('mod/lesson:manage', $context)) { // Display for timed lessons and for students only ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+timed) { ?>
+
+
+
+
\ No newline at end of file
diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php
index ec589c4ad1..3828595454 100644
--- a/mod/lesson/locallib.php
+++ b/mod/lesson/locallib.php
@@ -335,6 +335,40 @@ function lesson_print_messages() {
return true;
}
+/**
+ * Prints a lesson link that submits a form.
+ *
+ * If Javascript is disabled, then a regular submit button is printed
+ *
+ * @return mixed boolean/html
+ **/
+function lesson_print_submit_link($name, $form, $align = 'center', $class='standardbutton', $title = '', $id = '', $return = false) {
+ if (!empty($id)) {
+ $id = " id=\"$id\"";
+ }
+ if (empty($title)) {
+ $title = $name;
+ }
+
+ $output = "
\n";
+ $output .= "
+ \n";
+ $output .= "
\n";
+
+ if ($return) {
+ return $output;
+ } else {
+ echo $output;
+ return true;
+ }
+}
+
/**
* Given some question info and some data about the the answers
* this function parses, organises and saves the question
diff --git a/mod/lesson/styles.php b/mod/lesson/styles.php
index 54c5718fe2..e1606583ab 100644
--- a/mod/lesson/styles.php
+++ b/mod/lesson/styles.php
@@ -6,6 +6,19 @@
text-align: left;
}
+/***
+ *** Style for view.php
+ ***/
+
+#mod-lesson-view .password-form {
+ text-align: center;
+ margin-top: 20px;
+}
+
+#mod-lesson-view .password-form .submitbutton {
+ display: inline;
+}
+
/***
*** Style for essay.php
***/
diff --git a/mod/lesson/view.php b/mod/lesson/view.php
index 02267043e4..e89a532596 100644
--- a/mod/lesson/view.php
+++ b/mod/lesson/view.php
@@ -141,6 +141,7 @@
}
if (!$correctpass) {
+ echo "