panels_page.install

Go to the documentation of this file.
00001 <?php
00002 // $Id: panels_page.install,v 1.1.2.4 2008/12/28 10:18:44 sdboyer Exp $
00003 
00004 
00005 /**
00006  * Implementation of hook_install()
00007  *
00008  * Note that the panels page tables are largely owned by panels.module
00009  */
00010 function panels_page_install() {
00011   db_query("UPDATE {system} SET weight = 10 WHERE name = 'panels_page'");
00012 }
00013 
00014 function panels_page_update_5000() {
00015   $ret = array();
00016   $ret[] = update_sql("UPDATE {system} SET weight = 10 WHERE name = 'panels_page'");
00017   return $ret;
00018 }
00019 
00020 /**
00021  * Strips out any whitespace in the access string.
00022  *
00023  * Due to developer oversight, the format of access field string changed from
00024  * ', ' to ',' for several months of the -dev version. Ordinarily, we do not
00025  * accommodate changes made in the -dev version in later update functions, as it
00026  * both promotes bad habits on the part of module users and tends to create
00027  * database inconsistencies. However, in this case, the improper delimiter was
00028  * in place for long enough that it merits correction, especially because the
00029  * correction can be made non-destructively and transparently for any site that
00030  * never used the bad -dev.
00031  */
00032 function panels_page_update_5001() {
00033   $result = db_query('SELECT pid, access from {panels_page}');
00034   while ($row = db_fetch_object($result)) {
00035     $access = str_replace(' ', '', $row->access);
00036     $row->access = implode(', ', explode(',', $access));
00037     db_query("UPDATE {panels_page} SET access = '%s' WHERE pid = %d", $row->access, $row->pid);
00038   }
00039   return array();
00040 }

Generated on Sun Sep 5 05:00:14 2010 for Panels 2 by  doxygen 1.5.6