You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: includes/config.inc
-39
Original file line number
Diff line number
Diff line change
@@ -71,45 +71,6 @@ function kalatheme_bootstrap_library_form() {
71
71
return$form;
72
72
}
73
73
74
-
/**
75
-
* Form constructor for Bootstrap library selection form
76
-
*
77
-
* @return array
78
-
*/
79
-
functionkalatheme_backend_check_form() {
80
-
$form = array();
81
-
82
-
if (isset($_SERVER['PANTHEON_ENVIRONMENT'])) {
83
-
$form['pantheon_check'] = array(
84
-
'#weight' => -100,
85
-
'#prefix' => '<div class="alert alert-info">',
86
-
'#markup' => t("You are on Pantheon. <strong>You need to set the connection mode to SFTP</strong> to allow for custom Bootstrap libraries and subtheme generation!"),
87
-
'#suffix' => '</div>',
88
-
);
89
-
}
90
-
else {
91
-
if (kalatheme_backend_check()) {
92
-
$form['backend_check'] = array(
93
-
'#weight' => -100,
94
-
'#prefix' => '<div class="alert alert-success">',
95
-
'#markup' => t("Your webserver is correctly configured to allow for custom Bootstrap libraries and subtheme generation!"),
96
-
'#suffix' => '</div>',
97
-
);
98
-
}
99
-
else {
100
-
$form['backend_check'] = array(
101
-
'#weight' => -100,
102
-
'#prefix' => '<div class="alert alert-danger">',
103
-
'#markup' => t("If you want Kalatheme to be able to use custom Bootstrap libraries or generate subthemes automatically please properly configure your webserver."),
TRUE => t('You are on Pantheon. !strong_openYou need to set the connection mode to SFTP!strong_close to allow for custom Bootstrap libraries and subtheme generation!', array('!strong_open' => '<strong>', '!strong_close' => '</strong>')),
360
+
),
361
+
),
362
+
// Verify FTP support
363
+
'ftp' => array(
364
+
'bool' => extension_loaded('ftp'),
365
+
'messages' => array(),
366
+
),
367
+
// Verify SSH support
368
+
'ssh' => array(
369
+
'bool' => extension_loaded('ssh2'),
370
+
'messages' => array(),
371
+
),
372
+
// Verify web server write permissions
373
+
'write_access' => array(
374
+
'bool' => kalatheme_has_write_access(),
375
+
'messages' => array(
376
+
FALSE => t('Your webserver permissions are not configured correctly to facilitate subtheme generation. See !the_wiki for help.', array('!the_wiki' => l('the wiki', 'https://github.com/drupalprojects/kalatheme/wiki/Configuring-Server-for-Automatic-Kalatheme-installation'))),
377
+
),
378
+
),
379
+
// Verify update module is enabled
380
+
'updates_module' => array(
381
+
'bool' => module_exists('update'),
382
+
'messages' => array(
383
+
FALSE => t('The Updates module needs be enabled for subtheme generation. Please visit the !modules_page to enable it.', array('!modules_page' => l('modules page', 'admin/modules'))),
384
+
),
385
+
),
386
+
);
387
+
388
+
// This one is a conglomerate of some of the others.
TRUE => t('Your webserver is correctly configured to allow for custom Bootstrap libraries and subtheme generation!'),
393
+
FALSE => t('Kalatheme need FTP, SSH or write access in order to generate a subtheme.'),
394
+
),
395
+
);
396
+
397
+
return$info;
329
398
}
330
399
400
+
401
+
if (isset($_SERVER['PANTHEON_ENVIRONMENT'])) {
402
+
$form['pantheon_check'] = array(
403
+
'#weight' => -100,
404
+
'#prefix' => '<div class="alert alert-info">',
405
+
'#markup' => t("You are on Pantheon. <strong>You need to set the connection mode to SFTP</strong> to allow for custom Bootstrap libraries and subtheme generation!"),
406
+
'#suffix' => '</div>',
407
+
);
408
+
}
409
+
else {
410
+
if (kalatheme_backend_check()) {
411
+
$form['backend_check'] = array(
412
+
'#weight' => -100,
413
+
'#prefix' => '<div class="alert alert-success">',
414
+
'#markup' => t("Your webserver is correctly configured to allow for custom Bootstrap libraries and subtheme generation!"),
415
+
'#suffix' => '</div>',
416
+
);
417
+
}
418
+
else {
419
+
$form['backend_check'] = array(
420
+
'#weight' => -100,
421
+
'#prefix' => '<div class="alert alert-danger">',
422
+
'#markup' => t("If you want Kalatheme to be able to use custom Bootstrap libraries or generate subthemes automatically please properly configure your webserver."),
423
+
// @todo add link to docs here
424
+
'#suffix' => '</div>',
425
+
);
426
+
}
427
+
}
428
+
429
+
430
+
431
+
432
+
433
+
331
434
/**
332
435
* Check whether Kalatheme has write access to libraries and modules directories.
0 commit comments