[ Index ] |
PHP Cross Reference of Unnamed Project |
[Summary view] [Print] [Text view]
1 <?php 2 3 // This file is part of Moodle - http://moodle.org/ 4 // 5 // Moodle is free software: you can redistribute it and/or modify 6 // it under the terms of the GNU General Public License as published by 7 // the Free Software Foundation, either version 3 of the License, or 8 // (at your option) any later version. 9 // 10 // Moodle is distributed in the hope that it will be useful, 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 // GNU General Public License for more details. 14 // 15 // You should have received a copy of the GNU General Public License 16 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 17 18 /** 19 * This script displays one thumbnail of the image in current user's dropbox. 20 * If {@link repository_dropbox::send_thumbnail()} can not display image 21 * the default 64x64 filetype icon is returned 22 * 23 * @package repository_dropbox 24 * @copyright 2012 Marina Glancy 25 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 26 */ 27 28 require(__DIR__.'/../../config.php'); 29 require_once (__DIR__.'/lib.php'); 30 31 $repo_id = optional_param('repo_id', 0, PARAM_INT); // Repository ID 32 $contextid = optional_param('ctx_id', SYSCONTEXTID, PARAM_INT); // Context ID 33 $source = optional_param('source', '', PARAM_TEXT); // File path in current user's dropbox 34 35 if (isloggedin() && $repo_id && $source 36 && ($repo = repository::get_repository_by_id($repo_id, $contextid)) 37 && method_exists($repo, 'send_thumbnail')) { 38 // try requesting thumbnail and outputting it. This function exits if thumbnail was retrieved 39 $repo->send_thumbnail($source); 40 } 41 42 // send default icon for the file type 43 $fileicon = file_extension_icon($source, 64); 44 send_file($CFG->dirroot.'/pix/'.$fileicon.'.png', basename($fileicon).'.png');
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Thu Aug 11 10:00:09 2016 | Cross-referenced by PHPXref 0.7.1 |