Commit 1920ad7b authored by Dave Lane's avatar Dave Lane
Browse files

removed unnecessary debugging and tweaked messaging in admin js

parent efdee867
...@@ -155,7 +155,7 @@ class BFFForm extends BFFCourse { ...@@ -155,7 +155,7 @@ class BFFForm extends BFFCourse {
} }
} }
if (count($found)) { if (count($found)) {
$this->log('BFF-equipped sites: '.print_r($found, true)); //$this->log('BFF-equipped sites: '.print_r($found, true));
foreach($found as $sid) { foreach($found as $sid) {
if ($sid != 1) { if ($sid != 1) {
// we have to make sure we're in the right site context! // we have to make sure we're in the right site context!
...@@ -176,9 +176,9 @@ class BFFForm extends BFFCourse { ...@@ -176,9 +176,9 @@ class BFFForm extends BFFCourse {
$msg = sprintf(__(' Deleted unnecessary BFF pages with the following ids: $s', 'oeru-bff'), $list); $msg = sprintf(__(' Deleted unnecessary BFF pages with the following ids: $s', 'oeru-bff'), $list);
} }
} }
if (count($not_found)) { /*if (count($not_found)) {
$this->log('Sites without a BFF page: '.print_r($not_found, true)); $this->log('Sites without a BFF page: '.print_r($not_found, true));
} }*/
} }
...@@ -387,14 +387,14 @@ class BFFForm extends BFFCourse { ...@@ -387,14 +387,14 @@ class BFFForm extends BFFCourse {
// get thet settings for a specific blog, defaulting to the main/default one, of '1' // get thet settings for a specific blog, defaulting to the main/default one, of '1'
protected function get_settings($sid = 1) { protected function get_settings($sid = 1) {
$this->log('default settings: '. print_r($this->default_settings, true)); //$this->log('default settings: '. print_r($this->default_settings, true));
$settings = array(); $settings = array();
$default_settings = array(); $default_settings = array();
if ($sid == 1) { if ($sid == 1) {
$this->log('sid = 1, so using default_settings.'); //$this->log('sid = 1, so using default_settings.');
$default_settings = $this->default_settings; $default_settings = $this->default_settings;
} else { } else {
$this->log('site != 1, so using multisite settings as default_settings'); //$this->log('site != 1, so using multisite settings as default_settings');
$default_settings = $this->get_settings(); $default_settings = $this->get_settings();
} }
foreach ($default_settings as $setting => $default) { foreach ($default_settings as $setting => $default) {
......
...@@ -118,16 +118,14 @@ jQuery(document).ready(function() { ...@@ -118,16 +118,14 @@ jQuery(document).ready(function() {
LOG('Success: data: ', data); LOG('Success: data: ', data);
if (data.hasOwnProperty('success')) { if (data.hasOwnProperty('success')) {
// strip links out // strip links out
msg = data.message.replace(/<a[^>]*>[^<]*<\/a>/g, ''); LOG('Success msg', msg);
console.log('Success msg', msg);
$('#bff-status').html(msg);
// disable the form until further changes are made // disable the form until further changes are made
$('#bff-submit').attr('disabled', true); $('#bff-submit').attr('disabled', true);
} else if (data.hasOwnProperty('error')) { } else if (data.hasOwnProperty('error')) {
msg = data.message;
LOG('message:', msg); LOG('message:', msg);
$('#bff-status').html(msg);
} }
msg = data.message.replace(/<a[^>]*>[^<]*<\/a>/g, '');
$('#bff-status').html(msg);
return true; return true;
}, },
failure: function() { failure: function() {
...@@ -138,10 +136,10 @@ jQuery(document).ready(function() { ...@@ -138,10 +136,10 @@ jQuery(document).ready(function() {
// if nothing else returns this first, there was a problem... // if nothing else returns this first, there was a problem...
return false; return false;
}); });
$('#bff-cleanup').on('click', function() { $('#bff-cleanup').on('click', function() {
LOG('in cleanup function'); LOG('in cleanup function');
checked = false; $('#bff-status').html('Cleaning up...');
$('#bff-status').html('Processing...');
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
...@@ -154,17 +152,13 @@ jQuery(document).ready(function() { ...@@ -154,17 +152,13 @@ jQuery(document).ready(function() {
var msg = ''; var msg = '';
LOG('Success: data: ', data); LOG('Success: data: ', data);
if (data.hasOwnProperty('success')) { if (data.hasOwnProperty('success')) {
// strip links out LOG('Success msg', msg);
msg = data.message.replace(/<a[^>]*>[^<]*<\/a>/g, '');
console.log('Success msg', msg);
$('#bff-status').html(msg);
// disable the form until further changes are made
$('#bff-submit').attr('disabled', true);
} else if (data.hasOwnProperty('error')) { } else if (data.hasOwnProperty('error')) {
msg = data.message;
LOG('message:', msg); LOG('message:', msg);
$('#bff-status').html(msg);
} }
// strip links out
msg = data.message.replace(/<a[^>]*>[^<]*<\/a>/g, '');
$('#bff-status').html(msg);
return true; return true;
}, },
failure: function() { failure: function() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment