| 1 |
<?php |
<?php |
| 2 |
// $Id$ |
// $Id: adsense_injector.admin.inc,v 1.1.2.3 2008/12/16 09:25:58 hswong3i Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 11 |
*/ |
*/ |
| 12 |
function adsense_injector_admin_settings() { |
function adsense_injector_admin_settings() { |
| 13 |
$form = array(); |
$form = array(); |
|
_adsense_injector_get_banner($form); |
|
| 14 |
|
|
| 15 |
$form['node_ad_body_insertion'] = array( |
$form['node_ad_body_insertion'] = array( |
| 16 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 77 |
$form['injection_control'] = array( |
$form['injection_control'] = array( |
| 78 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 79 |
'#collapsible' => TRUE, |
'#collapsible' => TRUE, |
| 80 |
'#collapsed' => TRUE, |
'#collapsed' => FALSE, |
| 81 |
'#title' => t('Select Node Types for Insertion'), |
'#title' => t('Select Node Types for Insertion'), |
| 82 |
'#description' => t('Nodes types to display inline ads - ads are inserted <strong>only</strong> in the selected node types.'), |
'#description' => t('Nodes types to display inline ads - ads are inserted <strong>only</strong> in the selected node types.'), |
| 83 |
); |
); |
| 84 |
|
|
| 85 |
/** |
/** |
| 86 |
* Enumerate node types, and set up form fields for each |
* Enumerate node types, and set up form fields for each. |
| 87 |
*/ |
*/ |
| 88 |
$enabled_count = 0; |
$enabled_count = 0; |
| 89 |
$nodetypes = array(); |
$nodetypes = array(); |
| 91 |
$nodetypes[$type] = $obj->name; |
$nodetypes[$type] = $obj->name; |
| 92 |
$enabled = variable_get(ADSENSE_INJECTOR_INSERT_AD_NODETYPE . $type, FALSE); |
$enabled = variable_get(ADSENSE_INJECTOR_INSERT_AD_NODETYPE . $type, FALSE); |
| 93 |
if ($enabled) $enabled_count++; |
if ($enabled) $enabled_count++; |
| 94 |
$form['injection_control']['node_types'][ADSENSE_INJECTOR_INSERT_AD_NODETYPE . $type] = array('#type' => 'checkbox', |
$form['injection_control']['node_types'][ADSENSE_INJECTOR_INSERT_AD_NODETYPE . $type] = array( |
| 95 |
|
'#type' => 'checkbox', |
| 96 |
'#title' => $obj->name, |
'#title' => $obj->name, |
| 97 |
'#default_value' => $enabled, |
'#default_value' => $enabled, |
| 98 |
'#description' => t('Display inline ads on %nodetype nodes', array('%nodetype' => $obj->name)), |
'#description' => t('Display inline ads on %nodetype nodes', array('%nodetype' => $obj->name)), |
| 114 |
|
|
| 115 |
return system_settings_form($form); |
return system_settings_form($form); |
| 116 |
} |
} |
|
|
|
|
/** |
|
|
* Get settings 'banner'. |
|
|
*/ |
|
|
function _adsense_injector_get_banner(&$form) { |
|
|
$name = 'adsense_injector-d5'; |
|
|
$banner = '<a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=exodus.paypal%40gmail.com&item_name='. $name .'&item_number= '. $name .'-donation&page_style=PayPal&no_shipping=1&return=http%3A%2F%2Fexodusdev.com%2Fproducts&cancel_return=http%3A%2F%2Fexodusdev.com%2Fproducts&no_note=1&tax=0¤cy_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8"><img src="http://www.paypal.com/en_US/i/btn/x-click-but7.gif" alt="Your donations support ongoing development" title="Your donations support ongoing development"></a>'; |
|
|
|
|
|
$form['module_banner'] = array( |
|
|
'#type' => 'markup', |
|
|
'#value' => '<div style="border: solid 1px #eee; margin: .5em; padding: .5em;"><div style="float:right;">'. $banner .'</div><strong>Module development sponsored by <a href="http://exodusdev.com">Exodus Development</a></strong><br/>', |
|
|
); |
|
|
$form['module_id'] = array( |
|
|
'#type' => 'markup', |
|
|
'#value' => ADSENSE_INJECTOR_MODULE_VERSION .'<br/></div>', |
|
|
); |
|
|
} |
|