? openads.admin.inc
Index: openads.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/openads/openads.module,v
retrieving revision 1.7.2.4.2.1
diff -U3 -r1.7.2.4.2.1 openads.module
--- openads.module 14 Apr 2008 12:01:16 -0000 1.7.2.4.2.1
+++ openads.module 14 May 2008 17:12:11 -0000
@@ -1,4 +1,4 @@
- 'OpenX (Openads) adserver configuration',
- 'description' => 'Configure OpenX (Openads) AdServer integration behavior and appearance.',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('openads_admin_settings'),
- 'access callback' => 'user_access',
- 'access arguments' => array('administer site configuration'),
- 'type' => MENU_NORMAL_ITEM, // optional
- );
-
- return $items;
-}
-
-/**
- * Implemenation of hook_settings().
- */
-function openads_admin_settings() {
- $form = array();
-
- $form['adserver'] = array(
- '#type' => 'fieldset',
- '#title' => t('Adserver settings'),
- '#description' => t('Select which delivery method to use - Javascript, Remote, Local or XML-RPC. Note Javascript will be used if caching is enabled and the current user is not logged in.'),
- '#collapsible' => TRUE,
- );
-
- if (variable_get('openads_delivery_method', 'js') == 'xmlrpc') {
- $PEAR_missing = $openads_xmlrpc_missing = FALSE;
- if (!@include('XML/RPC.php')) {
- $PEAR_missing = TRUE;
- }
- if (!@include('openads-xmlrpc.inc.php')) {
- $openads_xmlrpc_missing = TRUE;
- }
- }
-
- $form['adserver']['openads_delivery_method'] = array(
- '#type' => 'radios',
- '#title' => t('Delivery Method'),
- '#description' => t('Select the delivery method to use.
Note: To use the Local method OpenX and your banners must be stored on the same machine with the same top level domain.
Note: To use XML-RPC method you must have the PEAR XML-RPC package installed and the OpenX openads-xmlrpc.inc.php file must be in your PHP include path. '. ($PEAR_missing ? '
PEAR XML-RPC appears to not be installed! You must install the PEAR XML-RPC package.' : '') . ($openads_xmlrpc_missing ? '
opeands-xmlrpc.inc.php file appears to not be installed! You must put the file openads-xmlrpc.inc.php from the OpenX installation files into your PHP path.' : ''), array('@link' => 'http://pear.php.net/package/XML_RPC')),
- '#options' => array('js' => 'Javascript', 'remote' => 'Remote', 'local' => 'Local', 'xmlrpc' => 'XML-RPC'),
- '#default_value' => variable_get('openads_delivery_method', 'js'),
- );
-
- $form['adserver']['openads_use_text_below_image'] = array(
- '#type' => 'checkbox',
- '#title' => t('Enable OpenX "Text below Image"'),
- '#description' => t('OpenX is able to show a user defined text below each banner. Click this checkbox to enable this feature. Only availble on Javascript, Local and XML-RPC delivery methods.'),
- '#default_value' => variable_get('openads_use_text_below_image', 0),
- );
- $form['adserver']['server_access_paths'] = array(
- '#type' => 'fieldset',
- '#title' => t('OpenX Server Access Paths'),
- '#description' => t('This group of settings defines access paths to specific elements of your OpenX server. These settings are located on your OpenX server at Settings -> Main Settings -> Delivery Settings'),
- );
- $form['adserver']['server_access_paths']['openads_delivery_url'] = array(
- '#type' => 'textfield',
- '#default_value' => variable_get('openads_delivery_url', ''),
- '#title' => t('The OpenX delivery url'),
- '#description' => t('The OpenX server address, for example "ads.example.org/delivery". "http://" is automatically prefixed.'),
- '#required' => TRUE,
- );
- $form['adserver']['server_access_paths']['openads_delivery_url_https'] = array(
- '#type' => 'textfield',
- '#default_value' => variable_get('openads_delivery_url_https', ''),
- '#title' => t('The OpenX https delivery url'),
- '#description' => t('The OpenX server address, for example "ads.example.org/delivery". "https://" is automatically prefixed.')
- );
-
- $form['adserver']['javascript_options'] = array(
- '#type' => 'fieldset',
- '#title' => t('Javascript options'),
- '#description' => t('The following options affect the Javascript invocation method.'),
- '#collapsible' => TRUE,
- '#collapsed' => TRUE,
- );
- $form['adserver']['javascript_options']['openads_js_delivery_filename'] = array(
- '#type' => 'textfield',
- '#default_value' => variable_get('openads_js_delivery_filename', 'ajs.php'),
- '#title' => t('The OpenX JavaScript delivery filename'),
- '#description' => t('The OpenX JavaScript delivery filename for example "ajs.php"'),
- '#required' => TRUE,
- );
-
- $form['adserver']['remote_options'] = array(
- '#type' => 'fieldset',
- '#title' => t('Remote options'),
- '#description' => t('The following options affect the Remote invocation method.'),
- '#collapsible' => TRUE,
- '#collapsed' => TRUE,
- );
- $form['adserver']['remote_options']['openads_remote_delivery_click_filename'] = array(
- '#type' => 'textfield',
- '#default_value' => variable_get('openads_remote_delivery_click_filename', 'ck.php'),
- '#title' => t('The OpenX Remote delivery click filename'),
- '#description' => t('The OpenX Remote delivery click filename for example "ck.php"')
- );
- $form['adserver']['remote_options']['openads_remote_delivery_view_filename'] = array(
- '#type' => 'textfield',
- '#default_value' => variable_get('openads_remote_delivery_view_filename', 'avw.php'),
- '#title' => t('The OpenX Remote delivery view filename'),
- '#description' => t('The OpenX Remote delivery view filename for example "avw.php"')
- );
-
- $form['adserver']['local_options'] = array(
- '#type' => 'fieldset',
- '#title' => t('Local options'),
- '#description' => t('The following options affect the Local invocation method.'),
- '#collapsible' => TRUE,
- '#collapsed' => TRUE,
- );
- $form['adserver']['local_options']['openads_local_delivery_base_path'] = array(
- '#type' => 'textfield',
- '#default_value' => variable_get('openads_local_delivery_base_path', ''),
- '#title' => t('The OpenX Local delivery base path'),
- '#description' => t('The base path of the OpenX installation for example "/opt/www/openx.example.com"')
- );
- $form['adserver']['local_options']['openads_local_delivery_filename'] = array(
- '#type' => 'textfield',
- '#default_value' => variable_get('openads_local_delivery_filename', 'alocal.php'),
- '#title' => t('The OpenX Local delivery filename'),
- '#description' => t('The OpenX Local delivery filename for example "alocal.php"')
- );
-
- $form['adserver']['xmlrpc_options'] = array(
- '#type' => 'fieldset',
- '#title' => t('XML-RPC options'),
- '#description' => t('The following options affect the XML-RPC invocation method.'),
- '#collapsible' => TRUE,
- '#collapsed' => TRUE,
- );
- $form['adserver']['xmlrpc_options']['openads_xmlrpc_delivery_filename'] = array(
- '#type' => 'textfield',
- '#default_value' => variable_get('openads_xmlrpc_delivery_filename', 'axmlrpc.php'),
- '#title' => t('The OpenX XML-RPC delivery filename'),
- '#description' => t('The OpenX XML-RPC delivery filename for example "axmlrpc.php"')
- );
- $form['adserver']['xmlrpc_options']['openads_xmlrpc_port'] = array(
- '#type' => 'textfield',
- '#title' => t('XML-RPC Port'),
- '#description' => t('If your XML-RPC server is on a non-standard port, specify it here.'),
- '#default_value' => variable_get('openads_xmlrpc_port', 80),
- '#size' => 4,
- );
- $form['adserver']['xmlrpc_options']['openads_xmlrpc_use_ssl'] = array(
- '#type' => 'checkbox',
- '#title' => t('Use SSL'),
- '#description' => t('If you wish to use SSL to connect to your OpenX XML-RPC server, check this option'),
- '#default_value' => variable_get('openads_xmlrpc_use_ssl', ''),
- );
- $form['adserver']['xmlrpc_options']['openads_xmlrpc_timeout'] = array(
- '#type' => 'textfield',
- '#title' => t('Timeout'),
- '#description' => t('Set the timeout in seconds to connect to the OpenX XML-RPC server'),
- '#default_value' => variable_get('openads_xmlrpc_timeout', 2),
- '#size' => 4,
+ 'file' => 'openads.admin.inc',
+ 'title' => 'OpenX (Openads) adserver configuration',
+ 'description' => 'Configure OpenX (Openads) AdServer integration behavior and appearance.',
+ 'page callback' => 'drupal_get_form',
+ 'page arguments' => array('openads_admin_settings'),
+ 'access callback' => 'user_access',
+ 'access arguments' => array('administer site configuration'),
+ 'type' => MENU_NORMAL_ITEM, // optional
);
- $form['publisher'] = array(
- '#type' => 'fieldset',
- '#title' => t('Publisher'),
- '#description' => t('The following settings can be copied from the publisher page of your OpenX adserver.'),
- '#collapsible' => TRUE,
- );
- $form['publisher']['openads_id'] = array(
- '#type' => 'textfield',
- '#default_value' => variable_get('openads_id', ''),
- '#title' => t('Publisher ID'),
- '#description' => t("This is the publisher ID of the publisher you wish to serve ads from."),
- '#required' => TRUE,
- '#size' => 6,
- );
- $form['publisher']['openads_num_zones'] = array(
- '#type' => 'textfield',
- '#default_value' => variable_get('openads_num_zones', '5'),
- '#title' => t('The number of zones defined'),
- '#description' => t('This is the number of zones you can enter below'),
- '#size' => 6,
- );
-
- $form['openads_zones'] = array(
- '#theme' => 'openads_admin_settings_form',
- '#type' => 'fieldset',
- '#title' => t('Zones'),
- '#description' => t('Configure your zones here. '.
- '