mirror of
https://github.com/moodle/moodle.git
synced 2025-08-03 16:13:28 +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");
|
require_once("$CFG->libdir/packer/zip_packer.php");
|
||||||
|
|
||||||
function get_file_url($path, $options=null, $type='coursefile') {
|
function get_file_url($path, $options=null, $type='coursefile') {
|
||||||
global $CFG;
|
global $CFG, $HTTPSPAGEREQUIRED;
|
||||||
|
|
||||||
$path = str_replace('//', '/', $path);
|
$path = str_replace('//', '/', $path);
|
||||||
$path = trim($path, '/'); // no leading and trailing slashes
|
$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";
|
$url = $CFG->wwwroot."/rss/file.php";
|
||||||
break;
|
break;
|
||||||
case 'user':
|
case 'user':
|
||||||
$url = $CFG->wwwroot."/user/pix.php";
|
if (!empty($HTTPSPAGEREQUIRED)) {
|
||||||
|
$wwwroot = $CFG->httpswwwroot;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$wwwroot = $CFG->wwwroot;
|
||||||
|
}
|
||||||
|
$url = $wwwroot."/user/pix.php";
|
||||||
break;
|
break;
|
||||||
case 'usergroup':
|
case 'usergroup':
|
||||||
$url = $CFG->wwwroot."/user/pixgroup.php";
|
$url = $CFG->wwwroot."/user/pixgroup.php";
|
||||||
|
|
|
@ -34,7 +34,11 @@
|
||||||
* - datalib.php - functions that access the database.
|
* - datalib.php - functions that access the database.
|
||||||
* - moodlelib.php - general-purpose Moodle functions.
|
* - moodlelib.php - general-purpose Moodle functions.
|
||||||
* @author Martin Dougiamas
|
* @author Martin Dougiamas
|
||||||
|
<<<<<<< weblib.php
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
|
=======
|
||||||
|
* @version $Id$
|
||||||
|
>>>>>>> 1.970.2.113
|
||||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||||
* @package moodlecore
|
* @package moodlecore
|
||||||
*/
|
*/
|
||||||
|
@ -4409,7 +4413,7 @@ function print_file_picture($path, $courseid=0, $height='', $width='', $link='',
|
||||||
* @todo Finish documenting this function
|
* @todo Finish documenting this function
|
||||||
*/
|
*/
|
||||||
function print_user_picture($user, $courseid, $picture=NULL, $size=0, $return=false, $link=true, $target='', $alttext=true) {
|
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;
|
$needrec = false;
|
||||||
// only touch the DB if we are missing data...
|
// 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';
|
$file = 'f2';
|
||||||
}
|
}
|
||||||
$class = "userpicture";
|
$class = "userpicture";
|
||||||
if (!empty($HTTPSPAGEREQUIRED)) {
|
|
||||||
$wwwroot = $CFG->httpswwwroot;
|
|
||||||
} else {
|
|
||||||
$wwwroot = $CFG->wwwroot;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_null($picture)) {
|
if (is_null($picture)) {
|
||||||
$picture = $user->picture;
|
$picture = $user->picture;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue