| 1 |
<?php |
<?php |
| 2 |
|
|
| 3 |
//$Id: click.module,v 1.4 2006/04/13 15:49:30 unconed Exp $ |
//$Id: click.module,v 1.5.2.1 2007/02/08 17:34:44 kbahey Exp $ |
| 4 |
|
|
| 5 |
// Copyright 2005 Khalid Baheyeldin http://2bits.com |
// Copyright 2005 Khalid Baheyeldin http://2bits.com |
| 6 |
|
|
| 60 |
'title' => 'Click Thru tracking', |
'title' => 'Click Thru tracking', |
| 61 |
'description' => t('Settings of the Click Thru tracking module'), |
'description' => t('Settings of the Click Thru tracking module'), |
| 62 |
'callback' => 'drupal_get_form', |
'callback' => 'drupal_get_form', |
| 63 |
'callback arguments' => array('click_settings'), |
'callback arguments' => array('click_admin_settings'), |
| 64 |
'access' => user_access('administer site configuration'), |
'access' => user_access('administer site configuration'), |
| 65 |
); |
); |
| 66 |
|
|
| 76 |
return $items; |
return $items; |
| 77 |
} |
} |
| 78 |
|
|
| 79 |
function click_settings() { |
function click_admin_settings() { |
| 80 |
global $user; |
global $user; |
| 81 |
$group = CLICK_GROUP . $user->uid; |
$click_group = CLICK_GROUP . $user->uid; |
|
|
|
|
$form['click_settings'] = array( |
|
|
'#type' => 'fieldset', |
|
|
'#title' => t('Click settings'), |
|
|
'#tree' => TRUE, |
|
|
); |
|
| 82 |
|
|
| 83 |
$form['click_settings'][$group] = array( |
$form[$click_group] = array( |
| 84 |
'#type' => 'select', |
'#type' => 'select', |
| 85 |
'#title' => t('Active click group'), |
'#title' => t('Active click group'), |
| 86 |
'#default_value' => variable_get($group, 0), |
'#default_value' => variable_get($click_group, 0), |
| 87 |
'#options' => drupal_map_assoc(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)), |
'#options' => drupal_map_assoc(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)), |
| 88 |
'#description' => t('Current active click group for this user'), |
'#description' => t('Current active click group for this user'), |
| 89 |
'#extra' => 0, |
'#extra' => 0, |
| 90 |
'#multiple' => false, |
'#multiple' => FALSE, |
| 91 |
'#required' => true, |
'#required' => TRUE, |
| 92 |
); |
); |
| 93 |
|
|
| 94 |
$form['click_settings'][CLICK_IGNORE_SITE] = array( |
$form[CLICK_IGNORE_SITE] = array( |
| 95 |
'#type' => 'select', |
'#type' => 'select', |
| 96 |
'#title' => t('Ignore clicks from own site'), |
'#title' => t('Ignore clicks from own site'), |
| 97 |
'#default_value' => variable_get(CLICK_IGNORE_SITE, 0), |
'#default_value' => variable_get(CLICK_IGNORE_SITE, 0), |
| 98 |
'#options' => array('No', 'Yes'), |
'#options' => array('No', 'Yes'), |
| 99 |
'#description' => t('Whether to ignore clicks from your own site, or treat them as external ones'), |
'#description' => t('Whether to ignore clicks from your own site, or treat them as external ones'), |
| 100 |
'#extra' => 0, |
'#extra' => 0, |
| 101 |
'#multiple' => false, |
'#multiple' => FALSE, |
| 102 |
'#required' => true, |
'#required' => TRUE, |
| 103 |
); |
); |
| 104 |
|
|
| 105 |
return system_settings_form($form); |
return system_settings_form($form); |