| 1 |
<?php |
<?php |
| 2 |
// $Id: contact_forms.module,v 1.10 2008/09/14 09:50:50 gpdinoz Exp $ |
// $Id: contact_forms.module,v 1.11 2008/09/25 04:20:15 gpdinoz Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 6 |
* Creates a unique Site Wide Contact form with out drop down menu for each of the Contact Categories. |
* Creates a unique Site Wide Contact form with out drop down menu for each of the Contact Categories. |
| 7 |
*/ |
*/ |
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
* Implementation of hook_menu() |
|
|
*/ |
|
|
function contact_forms_menu() { |
|
|
// instead of hijacking the path 'contact' we create a path for each contact category |
|
|
$result = db_query('SELECT category FROM {contact}'); |
|
|
$num = db_result(db_query("SELECT COUNT(*) FROM {contact}")); |
|
|
if ($num) { |
|
|
foreach (db_fetch_object($result) as $contact) { |
|
|
$name = str_replace(' ', '_' ,$contact->category); |
|
|
|
|
|
$items['contact/%name'] = array( |
|
|
'page arguments' => array('$name'), |
|
|
'access arguments' => array(1), // ?????????????? |
|
|
'type' => MENU_CALLBACK, |
|
|
|
|
|
); |
|
|
} |
|
|
} |
|
|
return $items; |
|
|
} |
|
|
|
|
| 9 |
/** |
/** |
| 10 |
* Implementation of hook_form_alter() |
* Implementation of hook_form_alter() |
| 11 |
*/ |
*/ |