diff --git a/unical_client.module b/unical_client.module index d5e7624..05d865e 100644 --- a/unical_client.module +++ b/unical_client.module @@ -53,6 +53,9 @@ function unical_client_init() { $site_url = variable_get('unical_client_settings_site_url'); $site_id = variable_get('unical_client_settings_site_id'); $addthis_id = variable_get('unical_client_settings_addevent_id'); + $unical_path = variable_get('unical_client_settings_unical_path'); + $unical_cron = variable_get('unical_client_settings_unical_cron'); + // JS Variables. $settings = array( @@ -79,7 +82,12 @@ function unical_client_init() { } // Unical API JS. - drupal_add_js($site_url . drupal_get_path('module', 'unical') .'/app/build/unical.js', array('type' => $type, 'weight' => -20, 'scope' => 'footer')); + // Add custom UniCal Js path if is set. + if( variable_get('unical_client_settings_unical_path') ){ + drupal_add_js($unical_path); + }else{ + drupal_add_js($site_url . drupal_get_path('module', 'unical') .'/app/build/unical.js', array('type' => $type, 'weight' => -20, 'scope' => 'footer')); + } // CSS. // Add stock UniCal Styles if boolean is checked. @@ -172,6 +180,25 @@ function unical_client_form($form, &$form_state) { '#description' => t('ID for paid addevent.com plans') ); + // Unical Path. + $form['unical_client_settings']['unical_client_settings_unical_path'] = array( + '#type' => 'textfield', + '#title' => t('Unical Path'), + '#default_value' => variable_get('unical_client_settings_unical_path', ''), + '#size' => 100, + '#maxlength' => 255, + '#description' => t('The path to the unical.js file'), + '#required' => FALSE + ); + + // Make cron run optional + $form['unical_client_settings']['unical_client_settings_unical_cron'] = array( + '#type' => 'checkbox', + '#title' => t('Unical Cron Job'), + '#default_value' => variable_get('unical_client_settings_unical_cron', 1), + '#description' => t('Use cron jobs to remove events that have passed.') + ); + // Style settings. $form['unical_client_style_settings'] = array( '#type' => 'fieldset',