Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/blocks/navigation/db/upgrade.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 
00055 function xmldb_block_navigation_upgrade($oldversion, $block) {
00056     global $DB;
00057     // Implemented at 2009082800
00058 
00059     if ($oldversion < 2010091400) {
00060 
00061         $sql = "SELECT bp.id FROM {block_instances} bi 
00062                 LEFT JOIN {block_positions} bp ON bp.blockinstanceid=bi.id
00063                 WHERE bi.blockname='navigation' AND bp.visible=0";
00064         $blockpositions = $DB->get_records_sql($sql);
00065         if ($blockpositions) {
00066             foreach ($blockpositions as $bp) {
00067                 $bp->visible = 1;
00068                 $DB->update_record('block_positions', $bp);
00069             }
00070         }
00071 
00072         upgrade_block_savepoint(true, 2010091400, 'navigation');
00073     }
00074 
00075     // Moodle v2.1.0 release upgrade line
00076     // Put any upgrade step following this
00077 
00078     // Moodle v2.2.0 release upgrade line
00079     // Put any upgrade step following this
00080 
00081     return true;
00082 }
 All Data Structures Namespaces Files Functions Variables Enumerations