| 1 |
<?php |
<?php |
| 2 |
// $Id: asterisk.install,v 1.4 2007/02/16 05:18:04 thehunmonkgroup Exp $ |
// $Id: asterisk.install,v 1.5 2007/11/09 22:10:44 thehunmonkgroup Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Implementation of hook_install() |
* Implementation of hook_install() |
| 15 |
* need to be removed. |
* need to be removed. |
| 16 |
*/ |
*/ |
| 17 |
function asterisk_install() { |
function asterisk_install() { |
| 18 |
drupal_install_schema('asterisk'); |
$ret = drupal_install_schema('asterisk'); |
| 19 |
//if ($q1 && $q2) { |
|
| 20 |
|
$failed = array(); |
| 21 |
|
foreach ($ret as $query) { |
| 22 |
|
if (!$query['success']) { |
| 23 |
|
$failed[] = $query['query']; |
| 24 |
|
} |
| 25 |
|
} |
| 26 |
|
if (empty($failed)) { |
| 27 |
drupal_set_message(t('Asterisk module installed successfully.')); |
drupal_set_message(t('Asterisk module installed successfully.')); |
| 28 |
//} |
} |
| 29 |
//else { |
else { |
| 30 |
//drupal_set_message(t('Table installation for the Asterisk module was unsuccessful. The tables may need to be installed by hand. See the asterisk.install file for a list of the installation queries.'), 'error'); |
drupal_set_message(t('Table installation for the Asterisk module was unsuccessful. The following queries failed: !queries', array('!queries' => theme('item_list', $failed))), 'error'); |
| 31 |
//} |
} |
| 32 |
} |
} |
| 33 |
|
|
| 34 |
/** |
/** |