Skip to content

Commit 84ca5af

Browse files
author
Luke Stevens
committed
Fix for v9+
Fix for v9+ which has different value for PAGE constant on new project page.
1 parent 1deaee3 commit 84ca5af

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

HideCreateEmptyProject.php

+5-6
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,17 @@
1313
class HideCreateEmptyProject extends AbstractExternalModule
1414
{
1515
public function redcap_every_page_top($project_id) {
16-
if (PAGE === 'redcap/index.php' || PAGE === 'index.php?action=create') {
16+
if (PAGE === 'index.php' || PAGE === 'redcap/index.php' || PAGE === 'index.php?action=create') {
1717
// For "Create new Project" hide "Empty Project" option and default to template
1818
if (isset($_GET['action']) && $_GET['action']==='create') {
1919
?>
2020
<script type='text/javascript'>
2121
$(document).ready(function() {
2222
$('input[name="project_template_radio"][value="0"]').closest('div').hide();
23-
// $(window).on('load', function() {
24-
setTimeout(function() {
25-
$('input[name="project_template_radio"]').val([1]).change().click();
26-
}, 1000);
27-
// });
23+
$('input[name="project_template_radio"]').val([1]);
24+
setTimeout(function() {
25+
$('input[name="project_template_radio"]').change();
26+
}, 500);
2827
});
2928
</script>
3029
<?php

0 commit comments

Comments
 (0)