]> git.mjollnir.org Git - moodle.git/commitdiff
Added CFG->frametarget (defined by frametarget()) MDL-8050
authormoodler <moodler>
Thu, 4 Jan 2007 04:57:50 +0000 (04:57 +0000)
committermoodler <moodler>
Thu, 4 Jan 2007 04:57:50 +0000 (04:57 +0000)
lib/setup.php
lib/weblib.php

index 6739b2fa037e5a11d93ab52d12639e2dcdd23c59..01de893e7c3c9cbbfbdf3f43a46757a738c9e0b2 100644 (file)
@@ -301,6 +301,9 @@ global $HTTPSPAGEREQUIRED;
     }
     $CFG->os = PHP_OS;
 
+/// Set up default frame target string, based on $CFG->framename
+    $CFG->frametarget = frametarget();
+
 /// Setup cache dir for Smarty and others
     if (!file_exists($CFG->dataroot .'/cache')) {
         make_upload_directory('cache');
index 099b14a6021ac863870ef042ceaf5cfed7352d9b..dc0054a1cd82bf83dcf46292ddfc1bf16a702e59 100644 (file)
@@ -5632,5 +5632,19 @@ function disable_debugging() {
     $CFG->debug = $CFG->debug | 0x80000000; // switch the sign bit in integer number ;-)
 }
 
+
+/** 
+ *  Returns string to add a frame attribute, if required
+ */
+function frametarget() {
+    global $CFG;
+
+    if (empty($CFG->framename) or ($CFG->framename == '_top')) {
+        return '';
+    } else {
+        return ' target="'.$CFG->framename.'" ';
+    }
+}
+
 // vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
 ?>