panels_page.install in Panels 5.2
Same filename and directory in other branches
File
panels_page/panels_page.installView source
<?php
/**
* Implementation of hook_install()
*
* Note that the panels page tables are largely owned by panels.module
*/
function panels_page_install() {
db_query("UPDATE {system} SET weight = 10 WHERE name = 'panels_page'");
}
function panels_page_update_5000() {
$ret = array();
$ret[] = update_sql("UPDATE {system} SET weight = 10 WHERE name = 'panels_page'");
return $ret;
}
/**
* Strips out any whitespace in the access string.
*
* Due to developer oversight, the format of access field string changed from
* ', ' to ',' for several months of the -dev version. Ordinarily, we do not
* accommodate changes made in the -dev version in later update functions, as it
* both promotes bad habits on the part of module users and tends to create
* database inconsistencies. However, in this case, the improper delimiter was
* in place for long enough that it merits correction, especially because the
* correction can be made non-destructively and transparently for any site that
* never used the bad -dev.
*/
function panels_page_update_5001() {
$result = db_query('SELECT pid, access from {panels_page}');
while ($row = db_fetch_object($result)) {
$access = str_replace(' ', '', $row->access);
$row->access = implode(', ', explode(',', $access));
db_query("UPDATE {panels_page} SET access = '%s' WHERE pid = %d", $row->access, $row->pid);
}
return array();
}
Functions
Name![]() |
Description |
---|---|
panels_page_install | Implementation of hook_install() |
panels_page_update_5000 | |
panels_page_update_5001 | Strips out any whitespace in the access string. |