]> git.mjollnir.org Git - moodle.git/commitdiff
Modified Greg's work to:
authormoodler <moodler>
Wed, 12 Mar 2003 07:36:22 +0000 (07:36 +0000)
committermoodler <moodler>
Wed, 12 Mar 2003 07:36:22 +0000 (07:36 +0000)
  - rename the main_frame variable to framename, because it
       - might have caused some confusion
       - none of the global variables have underscores
  - put the config in the config table, with a default of _top

12 files changed:
admin/auth.php
admin/config.html
lang/en/moodle.php
lib/db/mysql.php
lib/defaults.php
lib/weblib.php
mod/journal/lib.php
mod/resource/view.php
mod/survey/report.php
theme/oceanblue/header.html_logo
theme/poweraid/header.html
version.php

index dd73e0ae1d0b7f58df1e20fa9e305f7ef067d66b..334c6ae5874dcbb71b75c04fd01e8385a5a7ea40 100644 (file)
@@ -91,7 +91,7 @@
                   "<A HREF=\"index.php\">$stradministration</A> -> $strauthenticationoptions", "$focus");
 
     echo "<CENTER><P><B>";
-    echo "<form TARGET=\"{$CFG->main_frame}\" NAME=\"authmenu\" method=\"post\" action=\"auth.php\">";
+    echo "<form TARGET=\"{$CFG->framename}\" NAME=\"authmenu\" method=\"post\" action=\"auth.php\">";
     print_string("chooseauthmethod","auth");
 
        choose_from_menu ($options, "auth", $auth, "","top.location='auth.php?auth='+document.authmenu.auth.options[document.authmenu.auth.selectedIndex].value", "");
index e4fea33852667ff70fb77304be2e70f0fbbc6816..4f65567774a13338569955b9d04cea4fb34cc9c4 100644 (file)
     <? print_string("configdebug") ?>
     </TD>
 </TR>
+<TR VALIGN=TOP>
+       <TD ALIGN=RIGHT><P>framename:</TD>
+       <TD>
+    <? if (empty($config->framename)) {
+           $config->framename = "_top";
+       }
+    ?>
+    <INPUT NAME=framename TYPE=text SIZE=15 VALUE="<?=$config->framename?>">
+    </TD>
+    <TD>
+    <? print_string("configframename") ?>
+    </TD>
+</TR>
 
 
 <TR>
index 4b3540ebabd4d29fcb8b1205403ebb48f3778792..6d3526d6548f069ea2af1131a33d15838acf5b04 100644 (file)
@@ -66,6 +66,7 @@ $string['configlang'] = "Choose a default language for the whole site.  Users ca
 $string['configlangdir'] = "Most languages are printed left-to-right, but some, like Arabic and Hebrew, are printed right-to-left.";
 $string['configlocale'] = "Choose a sitewide locale - this will affect the format and language of dates. You need to have this locale data installed on your operating system.  (eg en_US or es_ES).  If you don't know what to choose leave it blank.";
 $string['configlongtimenosee'] = "If students haven't logged in for a very long time, then they are automatically unsubscribed from courses.  This parameter specifies that time limit.";
+$string['configframename'] = "If you are embedding Moodle within a web frame, then put the name of this frame here.  Otherwise this value should remain as '_top'";
 $string['configmaxeditingtime'] = "This specifies the amount of time people have to re-edit forum postings, journal feedback etc.  Usually 30 minutes is a good value.";
 $string['configproxyhost'] = "If this <B>server</B> needs to use a proxy computer (eg a firewall) to access the Internet, then provide the proxy hostname and port here.  Otherwise leave it blank.";
 $string['configsessiontimeout'] = "If people logged in to this site are idle for a long time (without loading pages) then they are automatically logged out (their session is ended).  This variable specifies how long this time should be.";
index dd10ad0e16df23081a8a7c9f33d5b28f315e1b26..a41aeeaf6bfc37f6c3c2000041884f4095e52ac6 100644 (file)
@@ -88,6 +88,7 @@ function main_upgrade($oldversion=0) {
     }
 
     if ($oldversion < 2002102503) {
+        execute_sql(" ALTER TABLE `course` ADD `modinfo` TEXT NOT NULL AFTER `format` ");
         require_once("$CFG->dirroot/mod/forum/lib.php");
         require_once("$CFG->dirroot/course/lib.php");
 
index 40be0aa1b6d9617bf7736918ed9e0ed07ae6d929..7dee176a108cb7f30dba91c750177f79b7afdbdd 100644 (file)
@@ -26,6 +26,7 @@
        "prefix"           => "",
        "guestloginbutton" =>  1,
        "sessiontimeout"   =>  7200,
+       "framename"       =>  "_top",
        "debug"            =>  7
     );
 
index 5362387a80b568df31d600afd9eaa9a951980611..c193533f077a26c03e38e5182e32d170e8923aa9 100644 (file)
@@ -319,7 +319,7 @@ function popup_form ($common, $options, $formname, $selected="", $nothing="choos
         $nothing = get_string("choose")."...";
     }
 
-    $output = "<FORM TARGET=\"{$CFG->main_frame}\" NAME=$formname>";
+    $output = "<FORM TARGET=\"{$CFG->framename}\" NAME=$formname>";
     $output .= "<SELECT NAME=popup onChange=\"top.location=document.$formname.popup.options[document.$formname.popup.selectedIndex].value\">\n";
 
     if ($nothing != "") {
@@ -636,10 +636,10 @@ function print_footer ($course=NULL) {
             $course = get_site();
             $homepage = true;
         } else {
-            $homelink = "<A TARGET=\"{$CFG->main_frame}\" HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>";
+            $homelink = "<A TARGET=\"{$CFG->framename}\" HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>";
         }
     } else {
-        $homelink = "<A TARGET=\"{$CFG->main_frame}\" HREF=\"$CFG->wwwroot\">".get_string("home")."</A>";
+        $homelink = "<A TARGET=\"{$CFG->framename}\" HREF=\"$CFG->wwwroot\">".get_string("home")."</A>";
         $course = get_site();
     }
 
@@ -673,7 +673,7 @@ function print_navigation ($navigation) {
        if (! $site = get_site()) {
            $site->shortname = get_string("home");;
        }
-       echo "<A TARGET=\"{$CFG->main_frame}\" HREF=\"$CFG->wwwroot/\">$site->shortname</A> -> $navigation";
+       echo "<A TARGET=\"{$CFG->framename}\" HREF=\"$CFG->wwwroot/\">$site->shortname</A> -> $navigation";
    }
 }
 
index 526c13018682b0be03b0959256c5c8ed11354976..3740119a58a05ecd7ac5a3ec8a0521d410fb838f 100644 (file)
@@ -1,8 +1,17 @@
 <?PHP // $Id$
 
-$JOURNAL_RATING = array ("3" => get_string("journalrating3", "journal"),
-                         "2" => get_string("journalrating2", "journal"),
-                         "1" => get_string("journalrating1", "journal") );
+//$JOURNAL_RATING = array ("3" => get_string("journalrating3", "journal"),
+//                         "2" => get_string("journalrating2", "journal"),
+//                         "1" => get_string("journalrating1", "journal") );
+
+// Hack to use 0-x grades
+
+$JOURNAL_MAX = 30;
+
+$JOURNAL_RATING = array();
+for ($journal_i=$JOURNAL_MAX; $journal_i>=0; $journal_i--) {
+    $JOURNAL_RATING["$journal_i"] = "$journal_i";
+}
 
 
 
@@ -155,7 +164,7 @@ function journal_print_recent_activity(&$logs, $isteacher=false) {
 
 function journal_grades($journalid) {
 /// Must return an array of grades, indexed by user, and a max grade.
-    global $JOURNAL_RATING;
+    global $JOURNAL_RATING, $JOURNAL_MAX;
 
     if ($return->grades = get_records_menu("journal_entries", "journal", $journalid, "", "userid,rating")) {
         foreach ($return->grades as $key => $value) {
@@ -165,7 +174,7 @@ function journal_grades($journalid) {
                 $return->grades[$key] = "-";
             }
         }
-        $return->maxgrade = "";
+        $return->maxgrade = $JOURNAL_MAX;
     }
     return $return;
 }
@@ -312,7 +321,7 @@ function journal_delete_instance($id) {
 
 
 function journal_print_feedback($course, $entry) {
-    global $CFG, $THEME, $JOURNAL_RATING;
+    global $CFG, $THEME, $JOURNAL_RATING, $JOURNAL_MAX;
 
     if (! $teacher = get_record("user", "id", $entry->teacher)) {
         error("Weird journal error");
@@ -335,6 +344,7 @@ function journal_print_feedback($course, $entry) {
     if ($JOURNAL_RATING[$entry->rating]) {
         echo get_string("overallrating", "journal").": ";
         echo $JOURNAL_RATING[$entry->rating];
+        echo " / $JOURNAL_MAX";
     } else {
         print_string("noratinggiven", "journal");
     }
index e008e78353113b787f6f373bddcbaca91aedb8e6..c945e3487f171e900ee5154145761b9d9cf49a1d 100644 (file)
 
     if ($course->category) {
         require_login($course->id);
-        $navigation = "<A TARGET=\"{$CFG->main_frame}\" HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->
-                       <A TARGET=\"{$CFG->main_frame}\" HREF=\"index.php?id=$course->id\">$strresources</A> ->";
+        $navigation = "<A TARGET=\"{$CFG->framename}\" HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->
+                       <A TARGET=\"{$CFG->framename}\" HREF=\"index.php?id=$course->id\">$strresources</A> ->";
     } else {
-        $navigation = "<A TARGET=\"{$CFG->main_frame}\" HREF=\"index.php?id=$course->id\">$strresources</A> ->";
+        $navigation = "<A TARGET=\"{$CFG->framename}\" HREF=\"index.php?id=$course->id\">$strresources</A> ->";
     }
 
 
@@ -54,7 +54,7 @@
         case WEBPAGE:
             if (!empty($frameset)) {
                 print_header("$course->shortname: $resource->name", "$course->fullname", 
-                "$navigation <A TARGET=\"{$CFG->main_frame}\" HREF=\"$resource->reference\" TITLE=\"$resource->reference\">$resource->name</A>",
+                "$navigation <A TARGET=\"{$CFG->framename}\" HREF=\"$resource->reference\" TITLE=\"$resource->reference\">$resource->name</A>",
                 "", "", true, update_module_button($cm->id, $course->id, $strresource), navmenu($course, $cm));
                 echo "<CENTER><FONT SIZE=-1>".text_to_html($resource->summary, true, false)."</FONT></CENTER>";
 
index 0ff965cfc093cc9430759fc21bcaf7f45c62a15c..6cd5dc77c3355b85487dafc6b1e872e404dea248 100644 (file)
     switch ($action) {
       case "top":
         if ($course->category) {
-            $navigation = "<A TARGET=\"{$CFG->main_frame}\" HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->
-                           <A TARGET=\"{$CFG->main_frame}\" HREF=\"index.php?id=$course->id\">$strsurveys</A> ->
-                           <A TARGET=\"{$CFG->main_frame}\" HREF=\"view.php?id=$cm->id\">$survey->name</A> -> ";
+            $navigation = "<A TARGET=\"{$CFG->framename}\" HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->
+                           <A TARGET=\"{$CFG->framename}\" HREF=\"index.php?id=$course->id\">$strsurveys</A> ->
+                           <A TARGET=\"{$CFG->framename}\" HREF=\"view.php?id=$cm->id\">$survey->name</A> -> ";
         } else {
-            $navigation = "<A TARGET=\"{$CFG->main_frame}\" HREF=\"index.php?id=$course->id\">$strsurveys</A> ->
-                           <A TARGET=\"{$CFG->main_frame}\" HREF=\"view.php?id=$cm->id\">$survey->name</A> -> ";
+            $navigation = "<A TARGET=\"{$CFG->framename}\" HREF=\"index.php?id=$course->id\">$strsurveys</A> ->
+                           <A TARGET=\"{$CFG->framename}\" HREF=\"view.php?id=$cm->id\">$survey->name</A> -> ";
         }
         print_header("$course->shortname: $survey->name", "$course->fullname", "$navigation $strreport");
         break;
index d45b1d323bed32fe8ffcd96b3b6f0008828227bf..86b40dcae23298e1b2f5f67f1b95de1453948509 100644 (file)
@@ -14,7 +14,7 @@
 \r
      <TABLE WIDTH=100% CELLPADDING=10 CELLSPACING=0 BORDER=0>\r
        <TR>\r
-         <TD VALIGN=TOP><A HREF="<?=$CFG->wwwroot?>" TARGET="<?=$CFG->main_frame?>"><IMG SRC="<?=$CFG->wwwroot?>/theme/oceanblue/logo.jpg" ALT="Moodle" BORDER="0"></A></TD>\r
+         <TD VALIGN=TOP><A HREF="<?=$CFG->wwwroot?>" TARGET="<?=$CFG->framename?>"><IMG SRC="<?=$CFG->wwwroot?>/theme/oceanblue/logo.jpg" ALT="Moodle" BORDER="0"></A></TD>\r
          <TD ALIGN=RIGHT VALIGN=TOP><?=$menu ?></TD>\r
        </TR>\r
      </TABLE>\r
index f28c100caa67110ad81c56777efa4e9c3c952244..13898b924ec5d613217311fbeb4cb2fc07636ac6 100644 (file)
@@ -58,7 +58,7 @@
 </tr>
 <tr>
 <td width="6" bgcolor="<? echo $THEME->body?>"><img src="<?=$CFG->wwwroot?>/theme/<?=$CFG->theme ?>/images/side_left.gif" width="2" height="100%" /></td>
-<td align="left" valign="top"><A TARGET=\"{$CFG->main_frame}\" HREF="<? echo $CFG->wwwroot?>"><img src="<? echo "$CFG->wwwroot/theme/$CFG->theme/$THEME->frontlogo" ?>" border="0" /></A></td>
+<td align="left" valign="top"><A TARGET=\"{$CFG->framename}\" HREF="<? echo $CFG->wwwroot?>"><img src="<? echo "$CFG->wwwroot/theme/$CFG->theme/$THEME->frontlogo" ?>" border="0" /></A></td>
 <td width="6" bgcolor="<? echo $THEME->body?>"><img src="<?=$CFG->wwwroot?>/theme/<?=$CFG->theme ?>/images/left_sidebar.jpg" width="6" height="100%" /></td>
 </tr>
 </table><table border="0" cellspacing="0" cellpadding="0" width="<? echo $THEME->themewidth?>">
@@ -99,7 +99,7 @@
 </tr>
 <tr>
 <td width="6" bgcolor="<? echo $THEME->body?>"><img src="<?=$CFG->wwwroot?>/theme/<?=$CFG->theme ?>/images/side_left.gif" width="2" height="100%" /></td>
-<td align="left" valign="top"><A TARGET="<?=$CFG->main_frame?>" HREF="<? echo $CFG->wwwroot ?>"><img src="<? echo "$CFG->wwwroot/theme/$CFG->theme/$THEME->smalllogo" ?>" border="0" /></A></td>
+<td align="left" valign="top"><A TARGET="<?=$CFG->framename?>" HREF="<? echo $CFG->wwwroot ?>"><img src="<? echo "$CFG->wwwroot/theme/$CFG->theme/$THEME->smalllogo" ?>" border="0" /></A></td>
 <td width="6" background="<?=$CFG->wwwroot?>/theme/<?=$CFG->theme ?>/images/left_sidebar.jpg"><img src="<?=$CFG->wwwroot?>/theme/<?=$CFG->theme ?>/images/left_sidebar.jpg" width="6" height="100%" /></td>
 </tr>
 </table><table border="0" cellspacing="0" cellpadding="0" width="<? echo $THEME->themewidth?>">
index 192e76bae69a91e85e4754288d65bf92cad54d0c..3acebac22f187329dc0c62377eedbb890c6e41de 100644 (file)
@@ -5,7 +5,7 @@
 // database to determine whether upgrades should
 // be performed (see lib/db/*.php)
 
-$version = 2003032600;   // The current version is a date (YYYYMMDDXX)
+$version = 2003032601;   // The current version is a date (YYYYMMDDXX)
 
 $release = "1.0.9 development";  // User-friendly version number