]> git.mjollnir.org Git - moodle.git/commitdiff
New configuration screen for the resources module
authormoodler <moodler>
Mon, 18 Aug 2003 17:46:51 +0000 (17:46 +0000)
committermoodler <moodler>
Mon, 18 Aug 2003 17:46:51 +0000 (17:46 +0000)
lang/en/resource.php
mod/resource/config.html [new file with mode: 0644]
mod/resource/lib.php
mod/resource/view.php

index 9250791a0e027ff8885a187fc7464667c62e9a7f..4b0567e93d877c462b69a599766b22195651cad1 100644 (file)
@@ -6,6 +6,7 @@ $string['modulenameplural'] = "Resources";
 #------------------------------------------------------------
 
 $string['addresource'] = "Add resource";
+$string['configframesize'] = "When a web page or an uploaded file is displayed within a frame, this value is the size (in pixels) of the top frame (which contains the navigation).";
 $string['editingaresource'] = "Editing a resource";
 $string['example'] = "Example";
 $string['examplereference'] = "Tobin, K. & Tippins, D (1993) Constructivism as a Referent for Teaching and Learning. In: K. Tobin (Ed) The Practice of Constructivism in Science Education, pp 3-21, Lawrence-Erlbaum, Hillsdale, NJ.";
diff --git a/mod/resource/config.html b/mod/resource/config.html
new file mode 100644 (file)
index 0000000..dc6480e
--- /dev/null
@@ -0,0 +1,19 @@
+<form method="post" action="module.php" name="form">
+
+<table cellpadding=9 cellspacing=0 >
+<tr valign=top>
+       <td align=right><p>resource_framesize:</td>
+       <td>
+    <input name=resource_framesize type=text size=5 value="<?php p($CFG->resource_framesize) ?>">
+    </td>
+    <td>
+    <?php print_string("configframesize", "resource") ?>
+    </td>
+</tr>
+<tr>
+    <td colspan=3 align=center>
+       <input type="submit" value="<?php print_string("savechanges") ?>"></td>
+</tr>
+</table>
+
+</form>
index 680cbcddd4c8da93bbb6f32b916d04669f259da1..f86f332e4cb4b57982109fa73383ca1d4c0727c4 100644 (file)
@@ -18,7 +18,9 @@ $RESOURCE_TYPE = array (REFERENCE    => get_string("resourcetype1", "resource"),
                         PROGRAM      => get_string("resourcetype7", "resource"),
                         WIKITEXT     => get_string("resourcetype8", "resource") );
 
-$RESOURCE_FRAME_SIZE = 130;
+if (!isset($CFG->resource_framesize)) {
+    set_config("resource_framesize", 130);
+} 
 
 $RESOURCE_WINDOW_OPTIONS = array("resizable", "scrollbars", "directories", "location", 
                                  "menubar", "toolbar", "status", "height", "width");
index 5a7879ddc1dfef9fbbf75c9ebf874d96eb72d0c6..ae339f968190451884e6809f5c83ee3855422755 100644 (file)
@@ -70,7 +70,7 @@
             } else {
                 add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", "$resource->id");
                 echo "<head><title>$course->shortname: $resource->name</title></head>\n";
-                echo "<frameset rows=$RESOURCE_FRAME_SIZE,*>";
+                echo "<frameset rows=$CFG->resource_framesize,*>";
                 echo "<frame src=\"view.php?id=$cm->id&frameset=top\">";
                 echo "<frame src=\"$resource->reference\">";
                 echo "</frameset>";
                 
             } else {               // Display resource in a frame of it's own.
                 echo "<head><title>$course->shortname: $resource->name</title></head>\n";
-                echo "<frameset rows=$RESOURCE_FRAME_SIZE,*>";
+                echo "<frameset rows=$CFG->resource_framesize,*>";
                 echo "<frame src=\"view.php?id=$cm->id&frameset=top\">";
                 echo "<frame src=\"$fullurl\">";
                 echo "</frameset>";