Skip to content

Commit

Permalink
#123: more work
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Walker committed May 11, 2016
1 parent d5c4020 commit 22f56cd
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions includes/utils.inc
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,13 @@ function kalatheme_backend_check() {
$messages = drupal_get_messages(NULL, FALSE);

// Output messages for each of the checks.
foreach ($info as $check) {
foreach ($info as $type => $check) {
if (isset($check['messages']) && !empty($check['messages'])) {
$bool = $check['bool'];
if (isset($check['messages'][$bool])) {
$message = $check['messages'][$bool];
$status = $check['bool'] ? 'status' : 'error';
$status = $type == 'pantheon' ? 'warning' : $status;

// Make sure we don't set a message twice.
$already_set = FALSE;
Expand All @@ -345,7 +346,7 @@ function kalatheme_backend_check() {
}
}

return ($info['install_permissions'] && $info['updates_module']);
return ($info['install_permissions']['bool'] && $info['updates_module']['bool']);
}

/**
Expand Down Expand Up @@ -387,22 +388,25 @@ function kalatheme_backend_check_info(){
),
);

// This one is a conglomerate of some of the others.
$info['install_permissions'] = array(
'bool' => $info['ftp']['bool'] || $info['ssh']['bool'] || $info['write_access']['bool'],
'messages' => array(
TRUE => t('Your webserver is correctly configured to allow for custom Bootstrap libraries and subtheme generation!'),
FALSE => t('Kalatheme need FTP, SSH or write access in order to generate a subtheme.'),
),
);
$info['install_permissions'] = array('bool' => TRUE);
if (!isset($_SERVER['PANTHEON_ENVIRONMENT'])) {
// This one is a conglomerate of some of the others.
$info['install_permissions'] = array(
'bool' => $info['ftp']['bool'] || $info['ssh']['bool'] || $info['write_access']['bool'],
'messages' => array(
TRUE => t('Your webserver is correctly configured to allow for custom Bootstrap libraries and subtheme generation!'),
FALSE => t('Kalatheme needs FTP, SSH or write access in order to generate a subtheme.'),
),
);
}

return $info;
}

/**
* Check whether Kalatheme has write access to libraries and modules directories.
*
* This check indicates whether we have enough access to be able to use
* This check indicates whether we have enough access to be able to use
* authorize.php and the updater.
*
* @return boolean
Expand Down

0 comments on commit 22f56cd

Please sign in to comment.