Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/theme/formal_white/db/install.php
Go to the documentation of this file.
00001 <?php
00002 
00003 // This file is part of Moodle - http://moodle.org/
00004 //
00005 // Moodle is free software: you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation, either version 3 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // Moodle is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
00017 
00048 defined('MOODLE_INTERNAL') || die();
00049 
00050 function xmldb_theme_formal_white_install() {
00051 
00052     // We need here to check whether or not the theme has been installed.
00053     // If it has been installed then we need to change the name of the settings to the new names.
00054     // If it is not installed it won't have any settings yet and we won't need to worry about this.
00055     $currentsetting = get_config('theme_formal_white');
00056     if (!empty($currentsetting)) {
00057         // Remove the settings that are no longer used by this theme
00058         // Remove regionwidth
00059         unset_config('regionwidth', 'theme_formal_white');
00060         // Remove alwayslangmenu
00061         unset_config('alwayslangmenu', 'theme_formal_white');
00062 
00063         // previous releases of formal_white them were not equipped with version number
00064         // so I can not know if a theme specific variable exists or not.
00065         // This is the reason why I try to use them both.
00066         if (!empty($currentsetting->backgroundcolor)) {
00067             // Create a new config setting called lblockcolumnbgc and give it backgroundcolor's value.
00068             set_config('lblockcolumnbgc', $currentsetting->backgroundcolor, 'theme_formal_white');
00069             // Remove backgroundcolor
00070             unset_config('backgroundcolor', 'theme_formal_white');
00071         } elseif (!empty($currentsetting->blockcolumnbgc)) {
00072             // Create a new config setting called lblockcolumnbgc and give it blockcolumnbgc's value.
00073             set_config('lblockcolumnbgc', $currentsetting->blockcolumnbgc, 'theme_formal_white');
00074             // Remove blockcolumnbgc
00075             unset_config('blockcolumnbgc', 'theme_formal_white');
00076         }
00077     }
00078 
00079     return true;
00080 }
 All Data Structures Namespaces Files Functions Variables Enumerations