]> git.mjollnir.org Git - moodle.git/commitdiff
core MDL-19799 Added set_url calls and replaced deprecated functions
authorsamhemelryk <samhemelryk>
Thu, 15 Oct 2009 03:43:28 +0000 (03:43 +0000)
committersamhemelryk <samhemelryk>
Thu, 15 Oct 2009 03:43:28 +0000 (03:43 +0000)
help.php
index.php
lib/javascript-static.js
user/index.php
user/view.php
userpix/index.php
userpix/upgrade.php

index 8bca3cec706a152a6a4046d56ac38a1a385ccf3b..9ab61c08dc8abee67a7d93fc2d5d51c9cb29617d 100644 (file)
--- a/help.php
+++ b/help.php
@@ -23,6 +23,27 @@ $fortooltip = optional_param('fortooltip', 0, PARAM_INT);
 
 $PAGE->set_course($COURSE);
 
+$url = new moodle_url($CFG->wwwroot.'/help.php');
+if ($file !== '')  {
+    $url->param('file', $file);
+}
+if ($text !== 'No text to display')  {
+    $url->param('text', $text);
+}
+if ($module !== 'moodle')  {
+    $url->param('module', $module);
+}
+if ($forcelang !== '')  {
+    $url->param('forcelang', $forcelang);
+}
+if ($skiplocal !== 0)  {
+    $url->param('skiplocal', $skiplocal);
+}
+if ($fortooltip !== 0)  {
+    $url->param('fortooltip', $fortooltip);
+}
+$PAGE->set_url($url);
+
 // We look for the help to display in lots of different places, and
 // only display an error at the end if we can't find the help file
 // anywhere. This variable tracks that.
@@ -93,6 +114,7 @@ if(preg_match('~(##emoticons_html##)~', $output, $matches)) {
 }
 
 // Do the main output.
+$PAGE->set_generaltype('popup');
 $PAGE->set_title($title);
 echo $OUTPUT->header();
 echo $OUTPUT->box_start();
index 6a3c0f5fb50c3beab937dd296fcd635f4f1a1856..1caf8bef33dd26418c98921e10974aac740f3380 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,4 +1,4 @@
-<?php  // $Id$
+<?php
        // index.php - the front page.
 
 ///////////////////////////////////////////////////////////////////////////
         }
     }
 
-    if (isloggedin() and !isguest() and isset($CFG->frontpageloggedin)) {
+    if (isloggedin() and !isguestuser() and isset($CFG->frontpageloggedin)) {
         $frontpagelayout = $CFG->frontpageloggedin;
     } else {
         $frontpagelayout = $CFG->frontpage;
 
             case FRONTPAGECOURSELIST:
 
-                if (isloggedin() and !has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM)) and !isguest() and empty($CFG->disablemycourses)) {
+                if (isloggedin() and !has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM)) and !isguestuser() and empty($CFG->disablemycourses)) {
                     echo $OUTPUT->heading(get_string('mycourses'), 2, 'headingblock header');
                     print_my_moodle();
-                } else if ((!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM)) and !isguest()) or ($DB->count_records('course') <= FRONTPAGECOURSELIMIT)) {
+                } else if ((!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM)) and !isguestuser()) or ($DB->count_records('course') <= FRONTPAGECOURSELIMIT)) {
                     // admin should not see list of courses when there are too many of them
                     echo $OUTPUT->heading(get_string('availablecourses'), 2, 'headingblock header');
                     print_courses(0);
index a6de9fbffde8375efeb0e6740568794f060bcf5b..596104370d91d1e5aaf9335006a1b48a05d0d5c6 100644 (file)
@@ -830,7 +830,7 @@ function openpopup(event, args) {
     if (!windowobj) {
         return true;
     }
-    if (fullscreen) {
+    if (args.fullscreen) {
         windowobj.moveTo(0,0);
         windowobj.resizeTo(screen.availWidth,screen.availHeight);
     }
index ef82d707350575acbc629a0b2c539117db1253bf..8a24aa7abe808b11de73d25fff4a31915bb452b2 100644 (file)
                     if (!empty($user->role)) {
                         $row->cells[1]->text .= get_string('role') .': '. $user->role .'<br />';
                     }
-                    if ($user->maildisplay == 1 or ($user->maildisplay == 2 and ($course->id != SITEID) and !isguest()) or
+                    if ($user->maildisplay == 1 or ($user->maildisplay == 2 and ($course->id != SITEID) and !isguestuser()) or
                                 has_capability('moodle/course:viewhiddenuserfields', $context)) {
                         $link = new html_link();
                         $link->url = "mailto:$user->email";
index 6f31b2d8ebb0af2eb3a82a557b3fb510a8594d68..3b70fb19bfad6e45a4612b75da43516d2a21d186 100644 (file)
@@ -289,7 +289,7 @@ if (has_capability('moodle/user:viewhiddendetails', $coursecontext)) {
 }
 
 if ($user->maildisplay == 1 or
-   ($user->maildisplay == 2 and ($course->id != SITEID) and !isguest()) or
+   ($user->maildisplay == 2 and ($course->id != SITEID) and !isguestuser()) or
    has_capability('moodle/course:useremail', $coursecontext)) {
 
     $emailswitch = '';
@@ -536,7 +536,7 @@ if (!$user->deleted and $USER->id != $user->id  && !session_is_loggedinas() && h
     echo '</form>';
 }
 
-if (!$user->deleted and !empty($CFG->messaging) and !isguest() and has_capability('moodle/site:sendmessage', $systemcontext)) {
+if (!$user->deleted and !empty($CFG->messaging) and !isguestuser() and has_capability('moodle/site:sendmessage', $systemcontext)) {
     if (!empty($USER->id) and ($USER->id == $user->id)) {
         if ($countmessages = $DB->count_records('message', array('useridto'=>$user->id))) {
             $messagebuttonname = get_string("messages", "message")."($countmessages)";
index 24454189abc076cf3d93597230c115175dd36613..50ac819ed112696b39580c7fce2541ce139905ca 100644 (file)
@@ -1,4 +1,4 @@
-<?php // $Id$
+<?php
       // This simple script displays all the users with pictures on one page.
       // By default it is not linked anywhere on the site.  If you want to
       // make it available you should link it in yourself from somewhere.
@@ -8,6 +8,8 @@
 
     include('../config.php');
 
+    $PAGE->set_url(new moodle_url($CFG->wwwroot.'/userpix/index.php'));
+
     require_login();
 
 /// Remove the following three lines if you want everyone to access it
index fe1cd6c85a5d2a35270bc196bf0e1b38901f1f67..b0ba57b8a41fbbe3996354aeeb7fb15a61805a21 100644 (file)
@@ -1,10 +1,12 @@
-<?php // $Id$
+<?php
       // This script updates all users picturesi to remove black border.
 
 
     include('../config.php');
     include('../lib/gdlib.php');
 
+    $PAGE->set_url(new moodle_url($CFG->wwwroot.'/userpix/upgrade.php'));
+
     require_login();
 
     require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));