From d1ec9f5f4216280aecbf0a69922f048441c7469b Mon Sep 17 00:00:00 2001 From: Grant Black Date: Wed, 16 May 2018 16:37:37 -0400 Subject: [PATCH 1/2] change unical js --- unical_client.module | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/unical_client.module b/unical_client.module index d5e7624..b9a87ed 100644 --- a/unical_client.module +++ b/unical_client.module @@ -53,6 +53,8 @@ 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'); + // JS Variables. $settings = array( @@ -79,7 +81,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 +179,27 @@ 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 + ); + + // // addevent.com ID + // $form['unical_client_settings']['unical_client_settings_addevent_id'] = array( + // '#type' => 'textfield', + // '#title' => t('addevent.com ID'), + // '#default_value' => variable_get('unical_client_settings_addevent_id', ''), + // '#size' => 50, + // '#maxlength' => 100, + // '#description' => t('ID for paid addevent.com plans') + // ); + // Style settings. $form['unical_client_style_settings'] = array( '#type' => 'fieldset', From 6a1aa96c3e4a2b37cc5d1712da74b2de089704ba Mon Sep 17 00:00:00 2001 From: Grant Black Date: Mon, 21 May 2018 10:50:43 -0400 Subject: [PATCH 2/2] Make cron optional --- unical_client.module | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/unical_client.module b/unical_client.module index b9a87ed..05d865e 100644 --- a/unical_client.module +++ b/unical_client.module @@ -54,6 +54,7 @@ function unical_client_init() { $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. @@ -190,15 +191,13 @@ function unical_client_form($form, &$form_state) { '#required' => FALSE ); - // // addevent.com ID - // $form['unical_client_settings']['unical_client_settings_addevent_id'] = array( - // '#type' => 'textfield', - // '#title' => t('addevent.com ID'), - // '#default_value' => variable_get('unical_client_settings_addevent_id', ''), - // '#size' => 50, - // '#maxlength' => 100, - // '#description' => t('ID for paid addevent.com plans') - // ); + // 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(