diff options
-rw-r--r-- | Zotlabs/Lib/Libsync.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Thing.php | 35 | ||||
-rw-r--r-- | view/js/main.js | 52 |
3 files changed, 56 insertions, 33 deletions
diff --git a/Zotlabs/Lib/Libsync.php b/Zotlabs/Lib/Libsync.php index a7e33ba6b..c6b149738 100644 --- a/Zotlabs/Lib/Libsync.php +++ b/Zotlabs/Lib/Libsync.php @@ -885,7 +885,7 @@ class Libsync { dbesc($t) ); - q("update hubloc set hubloc_error = 1, hubloc_deleted = 1 where hubloc_url = '%s' and hubloc_sitekey != '%s'", + q("update hubloc set hubloc_error = 1, hubloc_deleted = 1 where hubloc_url = '%s' and hubloc_sitekey != '%s' and hubloc_network = 'zot6'", dbesc($r[0]['hubloc_url']), dbesc($r[0]['hubloc_sitekey']) ); diff --git a/Zotlabs/Module/Thing.php b/Zotlabs/Module/Thing.php index 2038db8c0..a77081741 100644 --- a/Zotlabs/Module/Thing.php +++ b/Zotlabs/Module/Thing.php @@ -50,24 +50,31 @@ class Thing extends \Zotlabs\Web\Controller { $channel = \App::get_channel(); - $term_hash = (($_REQUEST['term_hash']) ? $_REQUEST['term_hash'] : ''); + $term_hash = (($_POST['term_hash']) ? $_POST['term_hash'] : ''); - $name = escape_tags($_REQUEST['term']); - $verb = escape_tags($_REQUEST['verb']); - $activity = intval($_REQUEST['activity']); - $profile_guid = escape_tags($_REQUEST['profile_assign']); - $url = $_REQUEST['url']; - $photo = $_REQUEST['img']; + $name = escape_tags($_POST['term']); + $verb = escape_tags($_POST['verb']); + $activity = intval($_POST['activity']); + $url = $_POST['url']; + $photo = $_POST['img']; + + $profile_guid = isset($_POST['profile_assign']) + ? escape_tags($_POST['profile_assign']) + : null; $hash = new_uuid(); $verbs = obj_verbs(); - /** - * verbs: [0] = first person singular, e.g. "I want", [1] = 3rd person singular, e.g. "Bill wants" - * We use the first person form when creating an activity, but the third person for use in activities - * @FIXME There is no accounting for verb gender for languages where this is significant. We may eventually - * require obj_verbs() to provide full conjugations and specify which form to use in the $_REQUEST params to this module. + /* + * verbs: [0] = first person singular, e.g. "I want", [1] = 3rd person + * singular, e.g. "Bill wants" We use the first person form when + * creating an activity, but the third person for use in activities + * + * @FIXME There is no accounting for verb gender for languages where + * this is significant. We may eventually require obj_verbs() to + * provide full conjugations and specify which form to use in the + * $_POST params to this module. */ $translated_verb = $verbs[$verb][1]; @@ -100,7 +107,7 @@ class Thing extends \Zotlabs\Web\Controller { return; $acl = new \Zotlabs\Access\AccessList($channel); - $acl->set_from_array($_REQUEST); + $acl->set_from_array($_POST); $x = $acl->get(); @@ -394,7 +401,7 @@ class Thing extends \Zotlabs\Web\Controller { '$profile_lbl' => t('Select a profile'), '$profile_select' => contact_profile_assign(''), '$verb_lbl' => $channel['channel_name'], - '$activity' => array('activity',t('Post an activity'),((array_key_exists('activity',$_REQUEST)) ? $_REQUEST['activity'] : true),t('Only sends to viewers of the applicable profile')), + '$activity' => array('activity',t('Post an activity'),((array_key_exists('activity',$_GET)) ? $_GET['activity'] : true),t('Only sends to viewers of the applicable profile')), '$verb_select' => obj_verb_selector(), '$thing_lbl' => t('Name of thing e.g. something'), '$url_lbl' => t('URL of thing (optional)'), diff --git a/view/js/main.js b/view/js/main.js index 87025a1c8..c1b0d410c 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1178,20 +1178,27 @@ function justifyPhotosAjax(id) { } function dolike(ident, verb) { - $('#like-rotator-' + ident.toString()).show(); + $('#like-rotator-' + ident).show(); - if(typeof conv_mode == typeof undefined) + if (typeof conv_mode == typeof undefined) { conv_mode = ''; + } - if(typeof page_mode == typeof undefined) + if (typeof page_mode == typeof undefined) { page_mode = ''; + } + + let reload = 0; - var reload = ''; - if(module == 'photos') + if (module == 'photos') { reload = 1; + } + - $.get('like/' + ident.toString() + '?verb=' + verb + '&conv_mode=' + conv_mode + '&page_mode=' + page_mode + '&reload=' + reload, function (data) { - if(data.success) { + $.get('like/' + ident + '?verb=' + verb + '&conv_mode=' + conv_mode + '&page_mode=' + page_mode + '&reload=' + reload, function (data) { + if (data.success) { + + close_modal(); // mod photos if (data.reload) { @@ -1213,10 +1220,9 @@ function dolike(ident, verb) { $('#wall-item-ago-' + data.id + ' .autotime').timeago(); collapseHeight(); liking = 0; - // remove modal backdrop in case the update was triggered from a modal - $('.modal-backdrop').remove(); } }); + liking = 1; } @@ -1332,26 +1338,28 @@ function dropItem(url, object, b64mid) { } function dosubthread(ident) { - $('#like-rotator-' + ident.toString()).show(); - $.get('subthread/sub/' + ident.toString(), updateInit ); + $('#like-rotator-' + ident).show(); + $.get('subthread/sub/' + ident, updateInit ); liking = 1; } function dounsubthread(ident) { - $('#like-rotator-' + ident.toString()).show(); - $.get('subthread/unsub/' + ident.toString(), updateInit ); + $('#like-rotator-' + ident).show(); + $.get('subthread/unsub/' + ident, updateInit ); liking = 1; } -function moderate_approve(ident) { - $('#like-rotator-' + ident.toString()).show(); - $.get('moderate/' + ident.toString() + '/approve', updateInit ); +function moderate_approve(ident, verb) { + $('#like-rotator-' + ident).show(); + close_modal(); + $.get('moderate/' + ident + '/approve', updateInit ); liking = 1; } function moderate_drop(ident) { - $('#like-rotator-' + ident.toString()).show(); - $.get('moderate/' + ident.toString() + '/drop', $('#thread-wrapper-' + ident.toString()).fadeOut(function() { this.remove(); })); + $('#like-rotator-' + ident).show(); + close_modal(); + $.get('moderate/' + ident + '/drop', $('#thread-wrapper-' + ident).fadeOut(function() { this.remove(); })); liking = 1; } @@ -1723,3 +1731,11 @@ function toast(string, severity) { toastInstance.show(); } + +function close_modal() { + let modal = bootstrap.Modal.getInstance(document.querySelector('.modal.show')); + + if (modal) { + modal.hide(); + } +} |