[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/filter/mediaplugin/db/ -> upgrade.php (source)

   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   * Manual authentication plugin upgrade code
  19   *
  20   * @package    filter
  21   * @subpackage mediaplugin
  22   * @copyright  2011 Petr Skoda (http://skodak.org)
  23   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  24   */
  25  
  26  /**
  27   * @param int $oldversion the version we are upgrading from
  28   * @return bool result
  29   */
  30  function xmldb_filter_mediaplugin_upgrade($oldversion) {
  31      global $CFG, $DB;
  32  
  33      $dbman = $DB->get_manager();
  34  
  35  
  36      if ($oldversion < 2011121200) {
  37          // Move all the media enable setttings that are now handled by core media renderer.
  38          foreach (array('html5video', 'html5audio', 'mp3', 'flv', 'wmp', 'qt', 'rm',
  39                  'youtube', 'vimeo', 'swf') as $type) {
  40              $existingkey = 'filter_mediaplugin_enable_' . $type;
  41              if (array_key_exists($existingkey, $CFG)) {
  42                  set_config('core_media_enable_' . $type, $CFG->{$existingkey});
  43                  unset_config($existingkey);
  44              }
  45          }
  46  
  47          // Override setting for html5 to turn it on (previous default was off; because
  48          // of changes in the way fallbacks are handled, this is now unlikely to cause
  49          // a problem, and is required for mobile a/v support on non-Flash devices, so
  50          // this change is basically needed in order to maintain existing behaviour).
  51          set_config('core_media_enable_html5video', 1);
  52          set_config('core_media_enable_html5audio', 1);
  53  
  54          upgrade_plugin_savepoint(true, 2011121200, 'filter', 'mediaplugin');
  55      }
  56  
  57      // Moodle v2.3.0 release upgrade line
  58      // Put any upgrade step following this
  59  
  60  
  61      // Moodle v2.4.0 release upgrade line
  62      // Put any upgrade step following this
  63  
  64  
  65      // Moodle v2.5.0 release upgrade line.
  66      // Put any upgrade step following this.
  67  
  68  
  69      // Moodle v2.6.0 release upgrade line.
  70      // Put any upgrade step following this.
  71  
  72      // Moodle v2.7.0 release upgrade line.
  73      // Put any upgrade step following this.
  74  
  75      // Moodle v2.8.0 release upgrade line.
  76      // Put any upgrade step following this.
  77  
  78      return true;
  79  }


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1