Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change unical js #4

Open
wants to merge 2 commits into
base: 7.x-1.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion unical_client.module
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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.
Expand Down Expand Up @@ -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',
Expand Down