[ Index ] |
PHP Cross Reference of moodle-2.8 |
[Summary view] [Print] [Text view]
1 <?php 2 // This file is part of Moodle - http://moodle.org/ 3 // 4 // Moodle is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // Moodle is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU General Public License for more details. 13 // 14 // You should have received a copy of the GNU General Public License 15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 16 17 /** 18 * Upgrade. 19 * 20 * @package repository_boxnet 21 * @copyright 2013 Frédéric Massart 22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 */ 24 25 defined('MOODLE_INTERNAL') || die(); 26 27 /** 28 * Upgrade function. 29 * 30 * @param int $oldversion the version we are upgrading from. 31 * @return bool result 32 */ 33 function xmldb_repository_boxnet_upgrade($oldversion) { 34 global $CFG, $DB; 35 36 $dbman = $DB->get_manager(); 37 38 if ($oldversion < 2013110503) { 39 // Delete old user preferences containing auth tokens. 40 $DB->delete_records('user_preferences', array('name' => 'boxnet__auth_token')); 41 upgrade_plugin_savepoint(true, 2013110503, 'repository', 'boxnet'); 42 } 43 44 if ($oldversion < 2013110700) { 45 require_once($CFG->dirroot . '/repository/lib.php'); 46 require_once($CFG->dirroot . '/repository/boxnet/db/upgradelib.php'); 47 48 $clientid = get_config('boxnet', 'clientid'); 49 $clientsecret = get_config('boxnet', 'clientsecret'); 50 51 // Only proceed if the repository hasn't been set for APIv2 yet. 52 if ($clientid === false && $clientsecret === false) { 53 $params = array(); 54 $params['context'] = array(); 55 $params['onlyvisible'] = false; 56 $params['type'] = 'boxnet'; 57 $instances = repository::get_instances($params); 58 59 // Notify the admin about the migration process if they are using the repo. 60 if (!empty($instances)) { 61 repository_boxnet_admin_upgrade_notification(); 62 } 63 64 // Hide the repository. 65 $repositorytype = repository::get_type_by_typename('boxnet'); 66 if (!empty($repositorytype)) { 67 $repositorytype->update_visibility(false); 68 } 69 } 70 71 upgrade_plugin_savepoint(true, 2013110700, 'repository', 'boxnet'); 72 } 73 74 // Moodle v2.6.0 release upgrade line. 75 // Put any upgrade step following this. 76 77 // Moodle v2.7.0 release upgrade line. 78 // Put any upgrade step following this. 79 80 // Moodle v2.8.0 release upgrade line. 81 // Put any upgrade step following this. 82 83 return true; 84 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:29:05 2014 | Cross-referenced by PHPXref 0.7.1 |