mirror of
https://github.com/moodle/moodle.git
synced 2025-08-02 23:59:41 +02:00
MDL-15800: clean filelib.php, fix https image link into the edit profil page (weblib.php), merged from 19
This commit is contained in:
parent
16baeef69c
commit
f86eb734ee
2 changed files with 13 additions and 8 deletions
|
@ -9,7 +9,7 @@ require_once("$CFG->libdir/file/file_browser.php");
|
|||
require_once("$CFG->libdir/packer/zip_packer.php");
|
||||
|
||||
function get_file_url($path, $options=null, $type='coursefile') {
|
||||
global $CFG;
|
||||
global $CFG, $HTTPSPAGEREQUIRED;
|
||||
|
||||
$path = str_replace('//', '/', $path);
|
||||
$path = trim($path, '/'); // no leading and trailing slashes
|
||||
|
@ -23,7 +23,13 @@ function get_file_url($path, $options=null, $type='coursefile') {
|
|||
$url = $CFG->wwwroot."/rss/file.php";
|
||||
break;
|
||||
case 'user':
|
||||
$url = $CFG->wwwroot."/user/pix.php";
|
||||
if (!empty($HTTPSPAGEREQUIRED)) {
|
||||
$wwwroot = $CFG->httpswwwroot;
|
||||
}
|
||||
else {
|
||||
$wwwroot = $CFG->wwwroot;
|
||||
}
|
||||
$url = $wwwroot."/user/pix.php";
|
||||
break;
|
||||
case 'usergroup':
|
||||
$url = $CFG->wwwroot."/user/pixgroup.php";
|
||||
|
|
|
@ -34,7 +34,11 @@
|
|||
* - datalib.php - functions that access the database.
|
||||
* - moodlelib.php - general-purpose Moodle functions.
|
||||
* @author Martin Dougiamas
|
||||
<<<<<<< weblib.php
|
||||
* @version $Id$
|
||||
=======
|
||||
* @version $Id$
|
||||
>>>>>>> 1.970.2.113
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package moodlecore
|
||||
*/
|
||||
|
@ -4409,7 +4413,7 @@ function print_file_picture($path, $courseid=0, $height='', $width='', $link='',
|
|||
* @todo Finish documenting this function
|
||||
*/
|
||||
function print_user_picture($user, $courseid, $picture=NULL, $size=0, $return=false, $link=true, $target='', $alttext=true) {
|
||||
global $CFG, $HTTPSPAGEREQUIRED, $DB;
|
||||
global $CFG, $DB;
|
||||
|
||||
$needrec = false;
|
||||
// only touch the DB if we are missing data...
|
||||
|
@ -4464,11 +4468,6 @@ function print_user_picture($user, $courseid, $picture=NULL, $size=0, $return=fa
|
|||
$file = 'f2';
|
||||
}
|
||||
$class = "userpicture";
|
||||
if (!empty($HTTPSPAGEREQUIRED)) {
|
||||
$wwwroot = $CFG->httpswwwroot;
|
||||
} else {
|
||||
$wwwroot = $CFG->wwwroot;
|
||||
}
|
||||
|
||||
if (is_null($picture)) {
|
||||
$picture = $user->picture;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue