| 1 |
<?php
|
| 2 |
// $Id: hosting.install,v 1.28 2009/10/29 17:15:04 adrian Exp $
|
| 3 |
|
| 4 |
function hosting_install() {
|
| 5 |
db_query("UPDATE {system} SET weight = 10 WHERE type='module' and name='hosting'");
|
| 6 |
}
|
| 7 |
|
| 8 |
function hosting_update_1() {
|
| 9 |
$ret = array();
|
| 10 |
$ret[] = update_sql("UPDATE {system} SET weight = 10 WHERE type='module' and name='hosting'");
|
| 11 |
return $ret;
|
| 12 |
}
|
| 13 |
|
| 14 |
/**
|
| 15 |
* Update function to remove unused table
|
| 16 |
*/
|
| 17 |
function hosting_update_2() {
|
| 18 |
$ret = array();
|
| 19 |
$ret[] = update_sql("DROP TABLE {hosting_config_template}");
|
| 20 |
return $ret;
|
| 21 |
}
|
| 22 |
|
| 23 |
/**
|
| 24 |
* Hide hostmaster and hostslave profiles
|
| 25 |
*/
|
| 26 |
function hosting_update_3() {
|
| 27 |
$ret = array();
|
| 28 |
$result = db_query("select n.nid from {node} n left join hosting_package p on n.nid = p.nid where short_name in ('hostslave', 'hostmaster')");
|
| 29 |
while ($obj = db_fetch_object($result)) {
|
| 30 |
$in[] = (int) $obj->nid;
|
| 31 |
}
|
| 32 |
$in = implode(", ", $in);
|
| 33 |
$ret[] = update_sql("UPDATE {node} SET status = 0 WHERE nid IN (" .$in. ")", $values);
|
| 34 |
return $ret;
|
| 35 |
}
|
| 36 |
|
| 37 |
/**
|
| 38 |
* Enable the modalframe and jquery_ui modules
|
| 39 |
*/
|
| 40 |
function hosting_update_6000() {
|
| 41 |
$ret = array();
|
| 42 |
module_enable(array('modalframe', 'jquery_ui'));
|
| 43 |
return $ret;
|
| 44 |
}
|
| 45 |
|
| 46 |
/**
|
| 47 |
* Change the default configured blocks to match eldir
|
| 48 |
*/
|
| 49 |
function hosting_update_6001() {
|
| 50 |
$ret = array();
|
| 51 |
install_include(array('block'));
|
| 52 |
|
| 53 |
$theme = 'eldir';
|
| 54 |
install_disable_block('hosting', 'hosting_queues_summary', $theme);
|
| 55 |
install_set_block('user', 0 , $theme, 'right', 0);
|
| 56 |
install_set_block('user', 1 , $theme, 'right', 0);
|
| 57 |
install_set_block('hosting', 'hosting_queues', $theme, 'right', 5);
|
| 58 |
install_set_block('hosting', 'hosting_summary', $theme, 'right', 10);
|
| 59 |
|
| 60 |
return $ret;
|
| 61 |
}
|
| 62 |
|
| 63 |
/**
|
| 64 |
* re-verify at least one platform and all sites
|
| 65 |
*/
|
| 66 |
|
| 67 |
function hosting_update_6002() {
|
| 68 |
include_once(drupal_get_path('module', 'hosting_task') . '/hosting_task.module');
|
| 69 |
|
| 70 |
$ret = array();
|
| 71 |
$result = db_query("SELECT nid FROM {node} WHERE type='platform' AND status=1");
|
| 72 |
if ($platform = db_fetch_object($result)) {
|
| 73 |
hosting_add_task($platform->nid, 'verify');
|
| 74 |
} else {
|
| 75 |
drupal_set_message(t("No platform found"));
|
| 76 |
}
|
| 77 |
|
| 78 |
$result = db_query("SELECT n.nid FROM {node} n INNER JOIN hosting_site s on s.nid = n.nid WHERE n.type='site' AND s.status=1");
|
| 79 |
while ($site = db_fetch_object($result)) {
|
| 80 |
hosting_add_task($site->nid, 'verify');
|
| 81 |
}
|
| 82 |
return $ret;
|
| 83 |
}
|