Skip to content

Commit

Permalink
fix dev env connection
Browse files Browse the repository at this point in the history
fix tests
  • Loading branch information
Cloud Edwards authored and Cloud Edwards committed Jun 20, 2018
1 parent d0ff67d commit 6c2431a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docker/bin/configure-wordpress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ wp post create --post_type=page --post_title='Shortcode Event List Table Less' -
wp post create --post_type=page --post_title='Shortcode Event List Table by Category' --post_status=publish --post_content="[rs_programs table show_title show_date category='plant-medicine']"

# Set default posts to host content to Events and Teachers
wp option update rs_remote_settings --format=json '{"rs_domain":"tests", "page": {"programs": 3, "teachers": 4}}'
wp option update rs_remote_settings --format=json '{"rs_domain":"tests", "page": {"programs": 4, "teachers": 5}}'
2 changes: 1 addition & 1 deletion programs-remote-listings/rs-connect-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static function get_base_url()
$http = 'http://';
}

$sub_domain = ! empty($options['rs_domain']) ? $options['rs_domain'] : 'demo';
$sub_domain = ! empty($options['rs_domain']) ? $options['rs_domain'] : 'demo.qa0';

return $http.$sub_domain.'.'.$base_domain;
}
Expand Down
22 changes: 17 additions & 5 deletions programs-remote-listings/views/admin-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,28 @@
<form action="options.php" method="post"><?php
settings_fields('rs_remote_settings');
do_settings_sections(__FILE__);
$options = get_option('rs_remote_settings'); ?>
$options = get_option('rs_remote_settings');
$rs_domain = (! empty($options['rs_domain']) && $options['rs_domain'] != '') ? $options['rs_domain'] : '';
$base_domain = '.secure.retreat.guru';
$http = 'https://';

if (isset($_SERVER['SERVER_NAME']) && ('rgconnect.test' == $_SERVER['SERVER_NAME'] || 'qa-testing.booking-demo.com' == $_SERVER['SERVER_NAME'])) {
$base_domain = '.rbgapp.com';
$http = 'http://';
}

$site_link = $http.$rs_domain.$base_domain.'/wp-admin';

?>
<table class="form-table">
<tr>
<th scope="row">Subdomain</th>
<td>
<fieldset>
<label><?php $rs_domain = (! empty($options['rs_domain']) && $options['rs_domain'] != '') ? $options['rs_domain'] : ''; ?>
https:// <input name="rs_remote_settings[rs_domain]" type="text" id="rs_domain"
value="<?php echo $rs_domain; ?>"/>
.secure.retreat.guru<br/>
<label><?php ?>
<?php echo $http; ?>
<input name="rs_remote_settings[rs_domain]" type="text" id="rs_domain" value="<?php echo $rs_domain; ?>"/>
<a target="_blank" href="<?php echo $site_link; ?>"> <?php echo $base_domain; ?></a><br/>
</label> <?php if(empty($rs_domain)) { echo "<span style='color:red;'>Required</span>"; } ?>
</fieldset>
</td>
Expand Down

0 comments on commit 6c2431a

Please sign in to comment.