Skip to content
Closed
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions includes/utils.inc
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ function kalatheme_has_write_access() {
function kalatheme_lib_dir() {
if (!is_dir('sites/all/libraries')) {
mkdir(DRUPAL_ROOT . '/sites/all/libraries');
chmod(DRUPAL_ROOT . '/sites/all/libraries', 0755);
} else {
chmod(DRUPAL_ROOT . '/sites/all/libraries', 0755);
}
return is_dir('sites/all/libraries') ? 'sites/all/libraries' : 'sites/all';
}
Expand Down
12 changes: 7 additions & 5 deletions kalatheme.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ function drush_kalatheme($name = NULL) {
// Write the custom bootstrap library if applicable
$current_dir = getcwd();
chdir($dtemp);
if (($theme_settings['bootstrap_library'] == 'custom') && ($filepath = drush_download_file($custom))) {
if (($theme_settings['bootstrap_library'] == 'custom')) {
$filepath = drush_download_file($custom);
if (empty($filepath)) {
drush_print(dt('Could not download custom library.'));
return;
}
$filename = basename($filepath);
$dirname = basename($filepath, '.zip');
$library_name = $machine_name . '_bootstrap';
Expand All @@ -140,10 +145,7 @@ function drush_kalatheme($name = NULL) {
drush_op('kalatheme_custom_bootstrap_library_integrate', $files, $machine_name, $dtemp, $lib_tmp_directory, $sub_tmp_directory, !$no_magic);
drush_move_dir($lib_tmp_directory, $library_path, FILE_EXISTS_OVERWRITE);
}
else {
drush_print(dt('Could not download custom library.'));
return;
}

// Return
chdir($current_dir);
// Move the subtheme into the right directory
Expand Down
2 changes: 1 addition & 1 deletion template.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function kalatheme_process_page(&$variables) {
// Use the CDN if not using libraries
if (!kalatheme_use_libraries()) {
$library = theme_get_setting('bootstrap_library');
if ($library !== 'none') {
if ($library !== 'none' && !empty($library)) {
// Add the JS
drupal_add_js($base['scheme'] . ":" . KALATHEME_BOOTSTRAP_JS, 'external');
// Add the CSS
Expand Down